@things-factory/warehouse-base 5.0.2 → 5.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/dist-server/constants/index.js +6 -19
  2. package/dist-server/constants/index.js.map +1 -1
  3. package/dist-server/constants/inventory.js.map +1 -1
  4. package/dist-server/constants/location.js.map +1 -1
  5. package/dist-server/constants/pallet.js.map +1 -1
  6. package/dist-server/constants/rule-type.js.map +1 -1
  7. package/dist-server/constants/tote.js.map +1 -1
  8. package/dist-server/controllers/ecommerce/ecommerce-controller.js.map +1 -1
  9. package/dist-server/controllers/ecommerce/index.js +3 -16
  10. package/dist-server/controllers/ecommerce/index.js.map +1 -1
  11. package/dist-server/controllers/ecommerce/sellercraft-controller.js.map +1 -1
  12. package/dist-server/controllers/index.js +3 -16
  13. package/dist-server/controllers/index.js.map +1 -1
  14. package/dist-server/controllers/warehouse-controller.js.map +1 -1
  15. package/dist-server/index.js +6 -19
  16. package/dist-server/index.js.map +1 -1
  17. package/dist-server/middlewares/index.js.map +1 -1
  18. package/dist-server/migrations/index.js.map +1 -1
  19. package/dist-server/service/index.js +28 -41
  20. package/dist-server/service/index.js.map +1 -1
  21. package/dist-server/service/inventory/index.js.map +1 -1
  22. package/dist-server/service/inventory/inventory-mutation.js +50 -61
  23. package/dist-server/service/inventory/inventory-mutation.js.map +1 -1
  24. package/dist-server/service/inventory/inventory-query.js +125 -136
  25. package/dist-server/service/inventory/inventory-query.js.map +1 -1
  26. package/dist-server/service/inventory/inventory-types.js +198 -206
  27. package/dist-server/service/inventory/inventory-types.js.map +1 -1
  28. package/dist-server/service/inventory/inventory.js +133 -141
  29. package/dist-server/service/inventory/inventory.js.map +1 -1
  30. package/dist-server/service/inventory-change/index.js.map +1 -1
  31. package/dist-server/service/inventory-change/inventory-change-mutation.js +51 -62
  32. package/dist-server/service/inventory-change/inventory-change-mutation.js.map +1 -1
  33. package/dist-server/service/inventory-change/inventory-change-query.js +29 -40
  34. package/dist-server/service/inventory-change/inventory-change-query.js.map +1 -1
  35. package/dist-server/service/inventory-change/inventory-change-types.js +20 -28
  36. package/dist-server/service/inventory-change/inventory-change-types.js.map +1 -1
  37. package/dist-server/service/inventory-change/inventory-change.js +68 -76
  38. package/dist-server/service/inventory-change/inventory-change.js.map +1 -1
  39. package/dist-server/service/inventory-history/index.js.map +1 -1
  40. package/dist-server/service/inventory-history/inventory-history-mutation.js +33 -44
  41. package/dist-server/service/inventory-history/inventory-history-mutation.js.map +1 -1
  42. package/dist-server/service/inventory-history/inventory-history-query.js +105 -116
  43. package/dist-server/service/inventory-history/inventory-history-query.js.map +1 -1
  44. package/dist-server/service/inventory-history/inventory-history-types.js +282 -290
  45. package/dist-server/service/inventory-history/inventory-history-types.js.map +1 -1
  46. package/dist-server/service/inventory-history/inventory-history.js +82 -90
  47. package/dist-server/service/inventory-history/inventory-history.js.map +1 -1
  48. package/dist-server/service/inventory-item/index.js.map +1 -1
  49. package/dist-server/service/inventory-item/inventory-item-mutation.js +47 -58
  50. package/dist-server/service/inventory-item/inventory-item-mutation.js.map +1 -1
  51. package/dist-server/service/inventory-item/inventory-item-query.js +41 -52
  52. package/dist-server/service/inventory-item/inventory-item-query.js.map +1 -1
  53. package/dist-server/service/inventory-item/inventory-item-type.js +44 -52
  54. package/dist-server/service/inventory-item/inventory-item-type.js.map +1 -1
  55. package/dist-server/service/inventory-item/inventory-item.js +44 -52
  56. package/dist-server/service/inventory-item/inventory-item.js.map +1 -1
  57. package/dist-server/service/inventory-item-change/index.js.map +1 -1
  58. package/dist-server/service/inventory-item-change/inventory-item-change-mutation.js +33 -44
  59. package/dist-server/service/inventory-item-change/inventory-item-change-mutation.js.map +1 -1
  60. package/dist-server/service/inventory-item-change/inventory-item-change-query.js +29 -40
  61. package/dist-server/service/inventory-item-change/inventory-item-change-query.js.map +1 -1
  62. package/dist-server/service/inventory-item-change/inventory-item-change-type.js +40 -48
  63. package/dist-server/service/inventory-item-change/inventory-item-change-type.js.map +1 -1
  64. package/dist-server/service/inventory-item-change/inventory-item-change.js +34 -42
  65. package/dist-server/service/inventory-item-change/inventory-item-change.js.map +1 -1
  66. package/dist-server/service/inventory-product/index.js.map +1 -1
  67. package/dist-server/service/inventory-product/inventory-product-mutation.js +33 -44
  68. package/dist-server/service/inventory-product/inventory-product-mutation.js.map +1 -1
  69. package/dist-server/service/inventory-product/inventory-product-query.js +29 -40
  70. package/dist-server/service/inventory-product/inventory-product-query.js.map +1 -1
  71. package/dist-server/service/inventory-product/inventory-product-type.js +34 -42
  72. package/dist-server/service/inventory-product/inventory-product-type.js.map +1 -1
  73. package/dist-server/service/inventory-product/inventory-product.js +34 -42
  74. package/dist-server/service/inventory-product/inventory-product.js.map +1 -1
  75. package/dist-server/service/location/index.js.map +1 -1
  76. package/dist-server/service/location/location-mutation.js +39 -50
  77. package/dist-server/service/location/location-mutation.js.map +1 -1
  78. package/dist-server/service/location/location-query.js +65 -76
  79. package/dist-server/service/location/location-query.js.map +1 -1
  80. package/dist-server/service/location/location-types.js +105 -113
  81. package/dist-server/service/location/location-types.js.map +1 -1
  82. package/dist-server/service/location/location.js +41 -49
  83. package/dist-server/service/location/location.js.map +1 -1
  84. package/dist-server/service/movement/index.js.map +1 -1
  85. package/dist-server/service/movement/movement-mutation.js +21 -32
  86. package/dist-server/service/movement/movement-mutation.js.map +1 -1
  87. package/dist-server/service/movement/movement-query.js +51 -65
  88. package/dist-server/service/movement/movement-query.js.map +1 -1
  89. package/dist-server/service/movement/movement-types.js +43 -51
  90. package/dist-server/service/movement/movement-types.js.map +1 -1
  91. package/dist-server/service/movement/movement.js +30 -38
  92. package/dist-server/service/movement/movement.js.map +1 -1
  93. package/dist-server/service/pallet/index.js.map +1 -1
  94. package/dist-server/service/pallet/pallet-mutation.js +39 -50
  95. package/dist-server/service/pallet/pallet-mutation.js.map +1 -1
  96. package/dist-server/service/pallet/pallet-query.js +48 -59
  97. package/dist-server/service/pallet/pallet-query.js.map +1 -1
  98. package/dist-server/service/pallet/pallet-types.js +39 -47
  99. package/dist-server/service/pallet/pallet-types.js.map +1 -1
  100. package/dist-server/service/pallet/pallet.js +34 -42
  101. package/dist-server/service/pallet/pallet.js.map +1 -1
  102. package/dist-server/service/pallet-count/index.js.map +1 -1
  103. package/dist-server/service/pallet-count/pallet-count-mutation.js +39 -50
  104. package/dist-server/service/pallet-count/pallet-count-mutation.js.map +1 -1
  105. package/dist-server/service/pallet-count/pallet-count-query.js +28 -39
  106. package/dist-server/service/pallet-count/pallet-count-query.js.map +1 -1
  107. package/dist-server/service/pallet-count/pallet-count-types.js +20 -28
  108. package/dist-server/service/pallet-count/pallet-count-types.js.map +1 -1
  109. package/dist-server/service/pallet-count/pallet-count.js +26 -34
  110. package/dist-server/service/pallet-count/pallet-count.js.map +1 -1
  111. package/dist-server/service/pallet-history/index.js.map +1 -1
  112. package/dist-server/service/pallet-history/pallet-history-mutation.js +33 -44
  113. package/dist-server/service/pallet-history/pallet-history-mutation.js.map +1 -1
  114. package/dist-server/service/pallet-history/pallet-history-query.js +29 -40
  115. package/dist-server/service/pallet-history/pallet-history-query.js.map +1 -1
  116. package/dist-server/service/pallet-history/pallet-history-types.js +20 -28
  117. package/dist-server/service/pallet-history/pallet-history-types.js.map +1 -1
  118. package/dist-server/service/pallet-history/pallet-history.js +34 -42
  119. package/dist-server/service/pallet-history/pallet-history.js.map +1 -1
  120. package/dist-server/service/reduced-inventory-history/index.js.map +1 -1
  121. package/dist-server/service/reduced-inventory-history/reduced-inventory-history.js +52 -60
  122. package/dist-server/service/reduced-inventory-history/reduced-inventory-history.js.map +1 -1
  123. package/dist-server/service/tote/index.js.map +1 -1
  124. package/dist-server/service/tote/tote-mutation.js +46 -57
  125. package/dist-server/service/tote/tote-mutation.js.map +1 -1
  126. package/dist-server/service/tote/tote-query.js +44 -55
  127. package/dist-server/service/tote/tote-query.js.map +1 -1
  128. package/dist-server/service/tote/tote-types.js +24 -32
  129. package/dist-server/service/tote/tote-types.js.map +1 -1
  130. package/dist-server/service/tote/tote.js +30 -38
  131. package/dist-server/service/tote/tote.js.map +1 -1
  132. package/dist-server/service/warehouse/index.js.map +1 -1
  133. package/dist-server/service/warehouse/warehouse-mutation.js +33 -44
  134. package/dist-server/service/warehouse/warehouse-mutation.js.map +1 -1
  135. package/dist-server/service/warehouse/warehouse-query.js +29 -40
  136. package/dist-server/service/warehouse/warehouse-query.js.map +1 -1
  137. package/dist-server/service/warehouse/warehouse-types.js +28 -36
  138. package/dist-server/service/warehouse/warehouse-types.js.map +1 -1
  139. package/dist-server/service/warehouse/warehouse.js +31 -39
  140. package/dist-server/service/warehouse/warehouse.js.map +1 -1
  141. package/dist-server/tsconfig.tsbuildinfo +1 -0
  142. package/dist-server/utils/datetime-util.js.map +1 -1
  143. package/dist-server/utils/index.js +4 -17
  144. package/dist-server/utils/index.js.map +1 -1
  145. package/dist-server/utils/inventory-no-generator.js.map +1 -1
  146. package/dist-server/utils/inventory-util.js.map +1 -1
  147. package/package.json +8 -8
  148. package/server/service/inventory/inventory-mutation.ts +2 -2
  149. package/server/service/inventory/inventory-query.ts +48 -16
  150. package/server/service/inventory/inventory.ts +6 -5
  151. package/server/service/inventory-change/inventory-change-mutation.ts +1 -1
  152. package/server/service/inventory-change/inventory-change-query.ts +2 -2
  153. package/server/service/inventory-history/inventory-history-query.ts +29 -28
  154. package/server/service/inventory-history/inventory-history.ts +39 -39
  155. package/server/service/inventory-item/inventory-item-mutation.ts +3 -3
  156. package/server/service/movement/movement-query.ts +3 -6
@@ -1,18 +1,7 @@
1
1
  "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- var __param = (this && this.__param) || function (paramIndex, decorator) {
12
- return function (target, key) { decorator(target, key, paramIndex); }
13
- };
14
2
  Object.defineProperty(exports, "__esModule", { value: true });
15
3
  exports.InventoryProductMutation = void 0;
4
+ const tslib_1 = require("tslib");
16
5
  const type_graphql_1 = require("type-graphql");
17
6
  const typeorm_1 = require("typeorm");
18
7
  const inventory_product_1 = require("./inventory-product");
@@ -67,53 +56,53 @@ let InventoryProductMutation = class InventoryProductMutation {
67
56
  return true;
68
57
  }
69
58
  };
70
- __decorate([
59
+ tslib_1.__decorate([
71
60
  (0, type_graphql_1.Directive)('@transaction'),
72
61
  (0, type_graphql_1.Mutation)(returns => inventory_product_1.InventoryProduct, { description: 'To create new InventoryProduct' }),
73
- __param(0, (0, type_graphql_1.Arg)('inventoryProduct')),
74
- __param(1, (0, type_graphql_1.Ctx)()),
75
- __metadata("design:type", Function),
76
- __metadata("design:paramtypes", [inventory_product_type_1.NewInventoryProduct, Object]),
77
- __metadata("design:returntype", Promise)
62
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('inventoryProduct')),
63
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
64
+ tslib_1.__metadata("design:type", Function),
65
+ tslib_1.__metadata("design:paramtypes", [inventory_product_type_1.NewInventoryProduct, Object]),
66
+ tslib_1.__metadata("design:returntype", Promise)
78
67
  ], InventoryProductMutation.prototype, "createInventoryProduct", null);
79
- __decorate([
68
+ tslib_1.__decorate([
80
69
  (0, type_graphql_1.Directive)('@transaction'),
81
70
  (0, type_graphql_1.Mutation)(returns => inventory_product_1.InventoryProduct, { description: 'To modify InventoryProduct information' }),
82
- __param(0, (0, type_graphql_1.Arg)('id')),
83
- __param(1, (0, type_graphql_1.Arg)('patch')),
84
- __param(2, (0, type_graphql_1.Ctx)()),
85
- __metadata("design:type", Function),
86
- __metadata("design:paramtypes", [String, inventory_product_type_1.InventoryProductPatch, Object]),
87
- __metadata("design:returntype", Promise)
71
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
72
+ tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
73
+ tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
74
+ tslib_1.__metadata("design:type", Function),
75
+ tslib_1.__metadata("design:paramtypes", [String, inventory_product_type_1.InventoryProductPatch, Object]),
76
+ tslib_1.__metadata("design:returntype", Promise)
88
77
  ], InventoryProductMutation.prototype, "updateInventoryProduct", null);
89
- __decorate([
78
+ tslib_1.__decorate([
90
79
  (0, type_graphql_1.Directive)('@transaction'),
91
80
  (0, type_graphql_1.Mutation)(returns => [inventory_product_1.InventoryProduct], { description: "To modify multiple InventoryProducts' information" }),
92
- __param(0, (0, type_graphql_1.Arg)('patches', type => [inventory_product_type_1.InventoryProductPatch])),
93
- __param(1, (0, type_graphql_1.Ctx)()),
94
- __metadata("design:type", Function),
95
- __metadata("design:paramtypes", [Array, Object]),
96
- __metadata("design:returntype", Promise)
81
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [inventory_product_type_1.InventoryProductPatch])),
82
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
83
+ tslib_1.__metadata("design:type", Function),
84
+ tslib_1.__metadata("design:paramtypes", [Array, Object]),
85
+ tslib_1.__metadata("design:returntype", Promise)
97
86
  ], InventoryProductMutation.prototype, "updateMultipleInventoryProduct", null);
98
- __decorate([
87
+ tslib_1.__decorate([
99
88
  (0, type_graphql_1.Directive)('@transaction'),
100
89
  (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete InventoryProduct' }),
101
- __param(0, (0, type_graphql_1.Arg)('id')),
102
- __param(1, (0, type_graphql_1.Ctx)()),
103
- __metadata("design:type", Function),
104
- __metadata("design:paramtypes", [String, Object]),
105
- __metadata("design:returntype", Promise)
90
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
91
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
92
+ tslib_1.__metadata("design:type", Function),
93
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
94
+ tslib_1.__metadata("design:returntype", Promise)
106
95
  ], InventoryProductMutation.prototype, "deleteInventoryProduct", null);
107
- __decorate([
96
+ tslib_1.__decorate([
108
97
  (0, type_graphql_1.Directive)('@transaction'),
109
98
  (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple inventoryProducts' }),
110
- __param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
111
- __param(1, (0, type_graphql_1.Ctx)()),
112
- __metadata("design:type", Function),
113
- __metadata("design:paramtypes", [Array, Object]),
114
- __metadata("design:returntype", Promise)
99
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
100
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
101
+ tslib_1.__metadata("design:type", Function),
102
+ tslib_1.__metadata("design:paramtypes", [Array, Object]),
103
+ tslib_1.__metadata("design:returntype", Promise)
115
104
  ], InventoryProductMutation.prototype, "deleteInventoryProducts", null);
116
- InventoryProductMutation = __decorate([
105
+ InventoryProductMutation = tslib_1.__decorate([
117
106
  (0, type_graphql_1.Resolver)(inventory_product_1.InventoryProduct)
118
107
  ], InventoryProductMutation);
119
108
  exports.InventoryProductMutation = InventoryProductMutation;
@@ -1 +1 @@
1
- {"version":3,"file":"inventory-product-mutation.js","sourceRoot":"","sources":["../../../server/service/inventory-product/inventory-product-mutation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAAsE;AACtE,qCAA2C;AAC3C,2DAAsD;AACtD,qEAAqF;AAGrF,IAAa,wBAAwB,GAArC,MAAa,wBAAwB;IAGnC,KAAK,CAAC,sBAAsB,CAA0B,gBAAqC,EAAS,OAAY;QAC9G,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,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AAE,4BAA4B,EAAE,CAAC;IAC9C,WAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;sEAKzD;AAID;IAFC,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,sCAAsC,EAAE,CAAC;IAEnF,WAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAC5B,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;uEAUP;AAxGU,wBAAwB;IADpC,IAAA,uBAAQ,EAAC,oCAAgB,CAAC;GACd,wBAAwB,CAyGpC;AAzGY,4DAAwB"}
1
+ {"version":3,"file":"inventory-product-mutation.js","sourceRoot":"","sources":["../../../server/service/inventory-product/inventory-product-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA2C;AAC3C,2DAAsD;AACtD,qEAAqF;AAGrF,IAAa,wBAAwB,GAArC,MAAa,wBAAwB;IAGnC,KAAK,CAAC,sBAAsB,CAA0B,gBAAqC,EAAS,OAAY;QAC9G,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,OAAO,MAAM,EAAE,CAAC,aAAa,CAAC,oCAAgB,CAAC,CAAC,IAAI,iCAC/C,gBAAgB,KACnB,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;IACJ,CAAC;IAID,KAAK,CAAC,sBAAsB,CACf,EAAU,EACP,KAA4B,EACnC,OAAY;QAEnB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,UAAU,GAAG,EAAE,CAAC,aAAa,CAAC,oCAAgB,CAAC,CAAA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,GAAE,CAAA;;;;uEAUP;AAxGU,wBAAwB;IADpC,IAAA,uBAAQ,EAAC,oCAAgB,CAAC;GACd,wBAAwB,CAyGpC;AAzGY,4DAAwB","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { getRepository, In } from 'typeorm'\nimport { InventoryProduct } from './inventory-product'\nimport { NewInventoryProduct, InventoryProductPatch } from './inventory-product-type'\n\n@Resolver(InventoryProduct)\nexport class InventoryProductMutation {\n @Directive('@transaction')\n @Mutation(returns => InventoryProduct, { description: 'To create new InventoryProduct' })\n async createInventoryProduct(@Arg('inventoryProduct') inventoryProduct: NewInventoryProduct, @Ctx() context: any): Promise<InventoryProduct> {\n const { domain, user, tx } = context.state\n\n return await tx.getRepository(InventoryProduct).save({\n ...inventoryProduct,\n domain,\n creator: user,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => InventoryProduct, { description: 'To modify InventoryProduct information' })\n async updateInventoryProduct(\n @Arg('id') id: string,\n @Arg('patch') patch: InventoryProductPatch,\n @Ctx() context: any\n ): Promise<InventoryProduct> {\n const { domain, user, tx } = context.state\n\n const repository = tx.getRepository(InventoryProduct)\n const inventoryProduct = await repository.findOne({\n where: { domain, id }\n })\n\n return await repository.save({\n ...inventoryProduct,\n ...patch,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => [InventoryProduct], { description: \"To modify multiple InventoryProducts' information\" })\n async updateMultipleInventoryProduct(\n @Arg('patches', type => [InventoryProductPatch]) patches: InventoryProductPatch[],\n @Ctx() context: any\n ): Promise<InventoryProduct[]> {\n const { domain, user, tx } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const inventoryProductRepo = tx.getRepository(InventoryProduct)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await inventoryProductRepo.save({\n ...newRecord,\n domain,\n creator: user,\n updater: user\n })\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const newRecord = _updateRecords[i]\n const inventoryProduct = await inventoryProductRepo.findOne(newRecord.id)\n\n const result = await inventoryProductRepo.save({\n ...inventoryProduct,\n ...newRecord,\n updater: user\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete InventoryProduct' })\n async deleteInventoryProduct(@Arg('id') id: string, @Ctx() context: any): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(InventoryProduct).delete({ domain, id })\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple inventoryProducts' })\n async deleteInventoryProducts(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: any\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(InventoryProduct).delete({\n domain,\n id: In(ids)\n })\n\n return true\n }\n}\n"]}
@@ -1,19 +1,8 @@
1
1
  "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- var __param = (this && this.__param) || function (paramIndex, decorator) {
12
- return function (target, key) { decorator(target, key, paramIndex); }
13
- };
14
2
  var _a;
15
3
  Object.defineProperty(exports, "__esModule", { value: true });
16
4
  exports.InventoryProductQuery = void 0;
5
+ const tslib_1 = require("tslib");
17
6
  const type_graphql_1 = require("type-graphql");
18
7
  const typeorm_1 = require("typeorm");
19
8
  const auth_base_1 = require("@things-factory/auth-base");
@@ -43,44 +32,44 @@ let InventoryProductQuery = class InventoryProductQuery {
43
32
  return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(inventoryProduct.creatorId);
44
33
  }
45
34
  };
46
- __decorate([
35
+ tslib_1.__decorate([
47
36
  (0, type_graphql_1.Query)(returns => inventory_product_1.InventoryProduct, { description: 'To fetch a InventoryProduct' }),
48
- __param(0, (0, type_graphql_1.Arg)('id')),
49
- __param(1, (0, type_graphql_1.Ctx)()),
50
- __metadata("design:type", Function),
51
- __metadata("design:paramtypes", [String, Object]),
52
- __metadata("design:returntype", Promise)
37
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
38
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
39
+ tslib_1.__metadata("design:type", Function),
40
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
41
+ tslib_1.__metadata("design:returntype", Promise)
53
42
  ], InventoryProductQuery.prototype, "inventoryProduct", null);
54
- __decorate([
43
+ tslib_1.__decorate([
55
44
  (0, type_graphql_1.Query)(returns => inventory_product_type_1.InventoryProductList, { description: 'To fetch multiple InventoryProducts' }),
56
- __param(0, (0, type_graphql_1.Args)()),
57
- __param(1, (0, type_graphql_1.Ctx)()),
58
- __metadata("design:type", Function),
59
- __metadata("design:paramtypes", [typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object, Object]),
60
- __metadata("design:returntype", Promise)
45
+ tslib_1.__param(0, (0, type_graphql_1.Args)()),
46
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
47
+ tslib_1.__metadata("design:type", Function),
48
+ tslib_1.__metadata("design:paramtypes", [typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object, Object]),
49
+ tslib_1.__metadata("design:returntype", Promise)
61
50
  ], InventoryProductQuery.prototype, "inventoryProducts", null);
62
- __decorate([
51
+ tslib_1.__decorate([
63
52
  (0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
64
- __param(0, (0, type_graphql_1.Root)()),
65
- __metadata("design:type", Function),
66
- __metadata("design:paramtypes", [inventory_product_1.InventoryProduct]),
67
- __metadata("design:returntype", Promise)
53
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
54
+ tslib_1.__metadata("design:type", Function),
55
+ tslib_1.__metadata("design:paramtypes", [inventory_product_1.InventoryProduct]),
56
+ tslib_1.__metadata("design:returntype", Promise)
68
57
  ], InventoryProductQuery.prototype, "domain", null);
69
- __decorate([
58
+ tslib_1.__decorate([
70
59
  (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
71
- __param(0, (0, type_graphql_1.Root)()),
72
- __metadata("design:type", Function),
73
- __metadata("design:paramtypes", [inventory_product_1.InventoryProduct]),
74
- __metadata("design:returntype", Promise)
60
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
61
+ tslib_1.__metadata("design:type", Function),
62
+ tslib_1.__metadata("design:paramtypes", [inventory_product_1.InventoryProduct]),
63
+ tslib_1.__metadata("design:returntype", Promise)
75
64
  ], InventoryProductQuery.prototype, "updater", null);
76
- __decorate([
65
+ tslib_1.__decorate([
77
66
  (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
78
- __param(0, (0, type_graphql_1.Root)()),
79
- __metadata("design:type", Function),
80
- __metadata("design:paramtypes", [inventory_product_1.InventoryProduct]),
81
- __metadata("design:returntype", Promise)
67
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
68
+ tslib_1.__metadata("design:type", Function),
69
+ tslib_1.__metadata("design:paramtypes", [inventory_product_1.InventoryProduct]),
70
+ tslib_1.__metadata("design:returntype", Promise)
82
71
  ], InventoryProductQuery.prototype, "creator", null);
83
- InventoryProductQuery = __decorate([
72
+ InventoryProductQuery = tslib_1.__decorate([
84
73
  (0, type_graphql_1.Resolver)(inventory_product_1.InventoryProduct)
85
74
  ], InventoryProductQuery);
86
75
  exports.InventoryProductQuery = InventoryProductQuery;
@@ -1 +1 @@
1
- {"version":3,"file":"inventory-product-query.js","sourceRoot":"","sources":["../../../server/service/inventory-product/inventory-product-query.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAAmF;AACnF,qCAAuC;AAEvC,yDAAgD;AAChD,iDAA4E;AAE5E,2DAAsD;AACtD,qEAA+D;AAG/D,IAAa,qBAAqB,GAAlC,MAAa,qBAAqB;IAEhC,KAAK,CAAC,gBAAgB,CAAY,EAAU,EAAS,OAAY;QAC/D,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,uBAAa,EAAC,oCAAgB,CAAC,CAAC,OAAO,CAAC;YACnD,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;SACtB,CAAC,CAAA;IACJ,CAAC;IAGD,KAAK,CAAC,iBAAiB,CAAS,MAAiB,EAAS,OAAY;QACpE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,eAAe,GAAG,IAAA,yBAAiB,EAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAA;QAC7D,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,IAAA,uBAAa,EAAC,oCAAgB,CAAC,CAAC,YAAY,CAAC,eAAe,CAAC,CAAA;QAE1F,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;IAGD,KAAK,CAAC,MAAM,CAAS,gBAAkC;QACrD,OAAO,MAAM,IAAA,uBAAa,EAAC,cAAM,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAA;IACvE,CAAC;IAGD,KAAK,CAAC,OAAO,CAAS,gBAAkC;QACtD,OAAO,M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AC,gBAAgB,CAAC,SAAS,CAAC,CAAA;IACtE,CAAC;CACF,CAAA;AAhCC;IADC,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,oCAAgB,EAAE,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;IAC3D,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;6DAMnD;AAGD;IADC,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,6CAAoB,EAAE,EAAE,WAAW,EAAE,qCAAqC,EAAE,CAAC;IACtE,mBAAA,IAAA,mBAAI,GAAE,CAAA;IAAqB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;iEAAjB,iBAAS,oBAAT,iBAAS;;8DAOhD;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAmB,oCAAgB;;mDAEtD;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAmB,oCAAgB;;oDAEvD;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAmB,oCAAgB;;oDAEvD;AAjCU,qBAAqB;IADjC,IAAA,uBAAQ,EAAC,oCAAgB,CAAC;GACd,qBAAqB,CAkCjC;AAlCY,sDAAqB","sourcesContent":["import { Arg, Args, Ctx, FieldResolver, Query, Resolver, Root } from 'type-graphql'\nimport { getRepository } from 'typeorm'\n\nimport { User } from '@things-factory/auth-base'\nimport { convertListParams, Domain, ListParam } from '@things-factory/shell'\n\nimport { InventoryProduct } from './inventory-product'\nimport { InventoryProductList } from './inventory-product-type'\n\n@Resolver(InventoryProduct)\nexport class InventoryProductQuery {\n @Query(returns => InventoryProduct, { description: 'To fetch a InventoryProduct' })\n async inventoryProduct(@Arg('id') id: string, @Ctx() context: any): Promise<InventoryProduct> {\n const { domain } = context.state\n\n return await getRepository(InventoryProduct).findOne({\n where: { domain, id }\n })\n }\n\n @Query(returns => InventoryProductList, { description: 'To fetch multiple InventoryProducts' })\n async inventoryProducts(@Args() params: ListParam, @Ctx() context: any): Promise<InventoryProductList> {\n const { domain } = context.state\n\n const convertedParams = convertListParams(params, { domain })\n const [items, total] = await getRepository(InventoryProduct).findAndCount(convertedParams)\n\n return { items, total }\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() inventoryProduct: InventoryProduct): Promise<Domain> {\n return await getRepository(Domain).findOne(inventoryProduct.domainId)\n }\n\n @FieldResolver(type => User)\n async updater(@Root() inventoryProduct: InventoryProduct): Promise<User> {\n return await getRepository(User).findOne(inventoryProduct.updaterId)\n }\n\n @FieldResolver(type => User)\n async creator(@Root() inventoryProduct: InventoryProduct): Promise<User> {\n return await getRepository(User).findOne(inventoryProduct.creatorId)\n }\n}\n"]}
@@ -1,94 +1,86 @@
1
1
  "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
2
  var _a;
12
3
  Object.defineProperty(exports, "__esModule", { value: true });
13
4
  exports.InventoryProductList = exports.InventoryProductPatch = exports.NewInventoryProduct = void 0;
5
+ const tslib_1 = require("tslib");
14
6
  const type_graphql_1 = require("type-graphql");
15
7
  const shell_1 = require("@things-factory/shell");
16
8
  const inventory_product_1 = require("./inventory-product");
17
9
  let NewInventoryProduct = class NewInventoryProduct {
18
10
  };
19
- __decorate([
11
+ tslib_1.__decorate([
20
12
  (0, type_graphql_1.Field)(),
21
- __metadata("design:type", String)
13
+ tslib_1.__metadata("design:type", String)
22
14
  ], NewInventoryProduct.prototype, "name", void 0);
23
- __decorate([
15
+ tslib_1.__decorate([
24
16
  (0, type_graphql_1.Field)({ nullable: true }),
25
- __metadata("design:type", String)
17
+ tslib_1.__metadata("design:type", String)
26
18
  ], NewInventoryProduct.prototype, "serialNumber", void 0);
27
- __decorate([
19
+ tslib_1.__decorate([
28
20
  (0, type_graphql_1.Field)({ nullable: true }),
29
- __metadata("design:type", String)
21
+ tslib_1.__metadata("design:type", String)
30
22
  ], NewInventoryProduct.prototype, "status", void 0);
31
- __decorate([
23
+ tslib_1.__decorate([
32
24
  (0, type_graphql_1.Field)(type => shell_1.ObjectRef, { nullable: true }),
33
- __metadata("design:type", typeof (_a = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _a : Object)
25
+ tslib_1.__metadata("design:type", typeof (_a = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _a : Object)
34
26
  ], NewInventoryProduct.prototype, "product", void 0);
35
- __decorate([
27
+ tslib_1.__decorate([
36
28
  (0, type_graphql_1.Field)({ nullable: true }),
37
- __metadata("design:type", String)
29
+ tslib_1.__metadata("design:type", String)
38
30
  ], NewInventoryProduct.prototype, "arrivalNoticeId", void 0);
39
- __decorate([
31
+ tslib_1.__decorate([
40
32
  (0, type_graphql_1.Field)({ nullable: true }),
41
- __metadata("design:type", String)
33
+ tslib_1.__metadata("design:type", String)
42
34
  ], NewInventoryProduct.prototype, "releaseGoodId", void 0);
43
- NewInventoryProduct = __decorate([
35
+ NewInventoryProduct = tslib_1.__decorate([
44
36
  (0, type_graphql_1.InputType)()
45
37
  ], NewInventoryProduct);
46
38
  exports.NewInventoryProduct = NewInventoryProduct;
47
39
  let InventoryProductPatch = class InventoryProductPatch {
48
40
  };
49
- __decorate([
41
+ tslib_1.__decorate([
50
42
  (0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
51
- __metadata("design:type", String)
43
+ tslib_1.__metadata("design:type", String)
52
44
  ], InventoryProductPatch.prototype, "id", void 0);
53
- __decorate([
45
+ tslib_1.__decorate([
54
46
  (0, type_graphql_1.Field)({ nullable: true }),
55
- __metadata("design:type", String)
47
+ tslib_1.__metadata("design:type", String)
56
48
  ], InventoryProductPatch.prototype, "name", void 0);
57
- __decorate([
49
+ tslib_1.__decorate([
58
50
  (0, type_graphql_1.Field)({ nullable: true }),
59
- __metadata("design:type", String)
51
+ tslib_1.__metadata("design:type", String)
60
52
  ], InventoryProductPatch.prototype, "serialNumber", void 0);
61
- __decorate([
53
+ tslib_1.__decorate([
62
54
  (0, type_graphql_1.Field)({ nullable: true }),
63
- __metadata("design:type", String)
55
+ tslib_1.__metadata("design:type", String)
64
56
  ], InventoryProductPatch.prototype, "status", void 0);
65
- __decorate([
57
+ tslib_1.__decorate([
66
58
  (0, type_graphql_1.Field)({ nullable: true }),
67
- __metadata("design:type", String)
59
+ tslib_1.__metadata("design:type", String)
68
60
  ], InventoryProductPatch.prototype, "arrivalNoticeId", void 0);
69
- __decorate([
61
+ tslib_1.__decorate([
70
62
  (0, type_graphql_1.Field)({ nullable: true }),
71
- __metadata("design:type", String)
63
+ tslib_1.__metadata("design:type", String)
72
64
  ], InventoryProductPatch.prototype, "releaseGoodId", void 0);
73
- __decorate([
65
+ tslib_1.__decorate([
74
66
  (0, type_graphql_1.Field)(),
75
- __metadata("design:type", String)
67
+ tslib_1.__metadata("design:type", String)
76
68
  ], InventoryProductPatch.prototype, "cuFlag", void 0);
77
- InventoryProductPatch = __decorate([
69
+ InventoryProductPatch = tslib_1.__decorate([
78
70
  (0, type_graphql_1.InputType)()
79
71
  ], InventoryProductPatch);
80
72
  exports.InventoryProductPatch = InventoryProductPatch;
81
73
  let InventoryProductList = class InventoryProductList {
82
74
  };
83
- __decorate([
75
+ tslib_1.__decorate([
84
76
  (0, type_graphql_1.Field)(type => [inventory_product_1.InventoryProduct]),
85
- __metadata("design:type", Array)
77
+ tslib_1.__metadata("design:type", Array)
86
78
  ], InventoryProductList.prototype, "items", void 0);
87
- __decorate([
79
+ tslib_1.__decorate([
88
80
  (0, type_graphql_1.Field)(type => type_graphql_1.Int),
89
- __metadata("design:type", Number)
81
+ tslib_1.__metadata("design:type", Number)
90
82
  ], InventoryProductList.prototype, "total", void 0);
91
- InventoryProductList = __decorate([
83
+ InventoryProductList = tslib_1.__decorate([
92
84
  (0, type_graphql_1.ObjectType)()
93
85
  ], InventoryProductList);
94
86
  exports.InventoryProductList = InventoryProductList;
@@ -1 +1 @@
1
- {"version":3,"file":"inventory-product-type.js","sourceRoot":"","sources":["../../../server/service/inventory-product/inventory-product-type.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,+CAAoE;AAEpE,iDAAiD;AAEjD,2DAAsD;AAGtD,IAAa,mBAAmB,GAAhC,MAAa,mBAAmB;CAkB/B,CAAA;AAhBC;IADC,IAAA,oBAAK,GAAE;;iDACI;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yDACL;AAGrB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACX;AAGf;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;kDACnC,iBAAS,oBAAT,iBAAS;oDAAA;AAGnB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4DACF;AAGxB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0DACJ;AAjBX,mBAAmB;IAD/B,IAAA,wBAAS,GAAE;GACC,mBAAmB,CAkB/B;AAlBY,kDAAmB;AAqBhC,IAAa,qBAAqB,GAAlC,MAAa,qBAAqB;CAqBjC,CAAA;AAnBC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDAC3B;AAGX;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACb;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2DACL;AAGrB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDACX;AAGf;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8DACF;AAGxB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4DACJ;AAGtB;IADC,IAAA,oBAAK,GAAE;;qDACM;AApBH,qBAAqB;IADjC,IAAA,wBAAS,GAAE;GACC,qBAAqB,CAqBjC;AArBY,sDAAqB;AAwBlC,IAAa,oBAAoB,GAAjC,MAAa,oBAAoB;CAMhC,CAAA;AAJC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,oCAAgB,CAAC,CAAC;;mDACT;AAGzB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;mDACN;AALF,oBAAoB;IADhC,IAAA,yBAAU,GAAE;GACA,oBAAoB,CAMhC;AANY,oDAAoB"}
1
+ {"version":3,"file":"inventory-product-type.js","sourceRoot":"","sources":["../../../server/service/inventory-product/inventory-product-type.ts"],"names":[],"mappings":";;;;;AAAA,+CAAoE;AAEpE,iDAAiD;AAEjD,2DAAsD;AAGtD,IAAa,mBAAmB,GAAhC,MAAa,mBAAmB;CAkB/B,CAAA;AAhB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IAAa,oBAAoB,GAAjC,MAAa,oBAAoB;CAMhC,CAAA;AAJC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,oCAAgB,CAAC,CAAC;;mDACT;AAGzB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;mDACN;AALF,oBAAoB;IADhC,IAAA,yBAAU,GAAE;GACA,oBAAoB,CAMhC;AANY,oDAAoB","sourcesContent":["import { Field, ID, InputType, Int, ObjectType } from 'type-graphql'\n\nimport { ObjectRef } from '@things-factory/shell'\n\nimport { InventoryProduct } from './inventory-product'\n\n@InputType()\nexport class NewInventoryProduct {\n @Field()\n name: string\n\n @Field({ nullable: true })\n serialNumber?: string\n\n @Field({ nullable: true })\n status?: string\n\n @Field(type => ObjectRef, { nullable: true })\n product?: ObjectRef\n\n @Field({ nullable: true })\n arrivalNoticeId?: string\n\n @Field({ nullable: true })\n releaseGoodId?: string\n}\n\n@InputType()\nexport class InventoryProductPatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n serialNumber?: string\n\n @Field({ nullable: true })\n status?: string\n\n @Field({ nullable: true })\n arrivalNoticeId?: string\n\n @Field({ nullable: true })\n releaseGoodId?: string\n\n @Field()\n cuFlag: string\n}\n\n@ObjectType()\nexport class InventoryProductList {\n @Field(type => [InventoryProduct])\n items: InventoryProduct[]\n\n @Field(type => Int)\n total: number\n}\n"]}
@@ -1,16 +1,8 @@
1
1
  "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
2
  var _a, _b, _c, _d;
12
3
  Object.defineProperty(exports, "__esModule", { value: true });
13
4
  exports.InventoryProduct = void 0;
5
+ const tslib_1 = require("tslib");
14
6
  const type_graphql_1 = require("type-graphql");
15
7
  const typeorm_1 = require("typeorm");
16
8
  const auth_base_1 = require("@things-factory/auth-base");
@@ -18,87 +10,87 @@ const product_base_1 = require("@things-factory/product-base");
18
10
  const shell_1 = require("@things-factory/shell");
19
11
  let InventoryProduct = class InventoryProduct {
20
12
  };
21
- __decorate([
13
+ tslib_1.__decorate([
22
14
  (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
23
15
  (0, type_graphql_1.Field)(type => type_graphql_1.ID),
24
- __metadata("design:type", String)
16
+ tslib_1.__metadata("design:type", String)
25
17
  ], InventoryProduct.prototype, "id", void 0);
26
- __decorate([
18
+ tslib_1.__decorate([
27
19
  (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
28
20
  (0, type_graphql_1.Field)({ nullable: true }),
29
- __metadata("design:type", typeof (_a = typeof shell_1.Domain !== "undefined" && shell_1.Domain) === "function" ? _a : Object)
21
+ tslib_1.__metadata("design:type", typeof (_a = typeof shell_1.Domain !== "undefined" && shell_1.Domain) === "function" ? _a : Object)
30
22
  ], InventoryProduct.prototype, "domain", void 0);
31
- __decorate([
23
+ tslib_1.__decorate([
32
24
  (0, typeorm_1.RelationId)((inventoryProduct) => inventoryProduct.domain),
33
- __metadata("design:type", String)
25
+ tslib_1.__metadata("design:type", String)
34
26
  ], InventoryProduct.prototype, "domainId", void 0);
35
- __decorate([
27
+ tslib_1.__decorate([
36
28
  (0, typeorm_1.Column)(),
37
29
  (0, type_graphql_1.Field)(),
38
- __metadata("design:type", String)
30
+ tslib_1.__metadata("design:type", String)
39
31
  ], InventoryProduct.prototype, "name", void 0);
40
- __decorate([
32
+ tslib_1.__decorate([
41
33
  (0, typeorm_1.Column)({ nullable: true }),
42
34
  (0, type_graphql_1.Field)({ nullable: true }),
43
- __metadata("design:type", String)
35
+ tslib_1.__metadata("design:type", String)
44
36
  ], InventoryProduct.prototype, "serialNumber", void 0);
45
- __decorate([
37
+ tslib_1.__decorate([
46
38
  (0, typeorm_1.Column)({ nullable: true }),
47
39
  (0, type_graphql_1.Field)({ nullable: true }),
48
- __metadata("design:type", String)
40
+ tslib_1.__metadata("design:type", String)
49
41
  ], InventoryProduct.prototype, "status", void 0);
50
- __decorate([
42
+ tslib_1.__decorate([
51
43
  (0, typeorm_1.Column)({ nullable: true }),
52
44
  (0, type_graphql_1.Field)({ nullable: true }),
53
- __metadata("design:type", String)
45
+ tslib_1.__metadata("design:type", String)
54
46
  ], InventoryProduct.prototype, "arrivalNoticeId", void 0);
55
- __decorate([
47
+ tslib_1.__decorate([
56
48
  (0, typeorm_1.Column)({ nullable: true }),
57
49
  (0, type_graphql_1.Field)({ nullable: true }),
58
- __metadata("design:type", String)
50
+ tslib_1.__metadata("design:type", String)
59
51
  ], InventoryProduct.prototype, "releaseGoodId", void 0);
60
- __decorate([
52
+ tslib_1.__decorate([
61
53
  (0, typeorm_1.ManyToOne)(type => product_base_1.Product),
62
54
  (0, type_graphql_1.Field)({ nullable: true }),
63
- __metadata("design:type", typeof (_b = typeof product_base_1.Product !== "undefined" && product_base_1.Product) === "function" ? _b : Object)
55
+ tslib_1.__metadata("design:type", typeof (_b = typeof product_base_1.Product !== "undefined" && product_base_1.Product) === "function" ? _b : Object)
64
56
  ], InventoryProduct.prototype, "product", void 0);
65
- __decorate([
57
+ tslib_1.__decorate([
66
58
  (0, typeorm_1.RelationId)((inventoryProduct) => inventoryProduct.product),
67
- __metadata("design:type", String)
59
+ tslib_1.__metadata("design:type", String)
68
60
  ], InventoryProduct.prototype, "productId", void 0);
69
- __decorate([
61
+ tslib_1.__decorate([
70
62
  (0, typeorm_1.CreateDateColumn)(),
71
63
  (0, type_graphql_1.Field)({ nullable: true }),
72
- __metadata("design:type", Date)
64
+ tslib_1.__metadata("design:type", Date)
73
65
  ], InventoryProduct.prototype, "createdAt", void 0);
74
- __decorate([
66
+ tslib_1.__decorate([
75
67
  (0, typeorm_1.UpdateDateColumn)(),
76
68
  (0, type_graphql_1.Field)({ nullable: true }),
77
- __metadata("design:type", Date)
69
+ tslib_1.__metadata("design:type", Date)
78
70
  ], InventoryProduct.prototype, "updatedAt", void 0);
79
- __decorate([
71
+ tslib_1.__decorate([
80
72
  (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
81
73
  nullable: true
82
74
  }),
83
75
  (0, type_graphql_1.Field)({ nullable: true }),
84
- __metadata("design:type", typeof (_c = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _c : Object)
76
+ tslib_1.__metadata("design:type", typeof (_c = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _c : Object)
85
77
  ], InventoryProduct.prototype, "creator", void 0);
86
- __decorate([
78
+ tslib_1.__decorate([
87
79
  (0, typeorm_1.RelationId)((inventoryProduct) => inventoryProduct.creator),
88
- __metadata("design:type", String)
80
+ tslib_1.__metadata("design:type", String)
89
81
  ], InventoryProduct.prototype, "creatorId", void 0);
90
- __decorate([
82
+ tslib_1.__decorate([
91
83
  (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
92
84
  nullable: true
93
85
  }),
94
86
  (0, type_graphql_1.Field)({ nullable: true }),
95
- __metadata("design:type", typeof (_d = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _d : Object)
87
+ tslib_1.__metadata("design:type", typeof (_d = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _d : Object)
96
88
  ], InventoryProduct.prototype, "updater", void 0);
97
- __decorate([
89
+ tslib_1.__decorate([
98
90
  (0, typeorm_1.RelationId)((inventoryProduct) => inventoryProduct.creator),
99
- __metadata("design:type", String)
91
+ tslib_1.__metadata("design:type", String)
100
92
  ], InventoryProduct.prototype, "updaterId", void 0);
101
- InventoryProduct = __decorate([
93
+ InventoryProduct = tslib_1.__decorate([
102
94
  (0, typeorm_1.Entity)(),
103
95
  (0, typeorm_1.Index)('ix_inventory_product_0', (inventoryProduct) => [inventoryProduct.domain, inventoryProduct.name], { unique: true }),
104
96
  (0, type_graphql_1.ObjectType)({ description: 'Entity for InventoryProduct' })
@@ -1 +1 @@
1
- {"version":3,"file":"inventory-product.js","sourceRoot":"","sources":["../../../server/service/inventory-product/inventory-product.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,+CAAoD;AACpD,qCASgB;AAEhB,yDAAgD;AAChD,+DAAsD;AACtD,iDAA8C;AAS9C,IAAa,gBAAgB,GAA7B,MAAa,gBAAgB;CAgE5B,CAAA;AA7DC;IAFC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;4CACC;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;kDACjB,cAAM,oBAAN,cAAM;gDAAA;AAGf;IADC,IAAA,oBAAU,EAAC,CAAC,gBAAkC,EAAE,EAAE,CAAC,gBAAgB,CAAC,MAAM,CAAC;;kDAC3D;AAIjB;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,GAAE;;8CACI;AAIZ;IAFC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC1B,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDACL;AAIrB;IAFC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC1B,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACX;AAIf;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,EAAE,CAAC;kDAChB,gBAAI,oBAAJ,gBAAI;iDAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,gBAAkC,EAAE,EAAE,CAAC,gBAAgB,CAAC,OAAO,CAAC;;mDAC3D;AA/DP,gBAAgB;IAP5B,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EACJ,wBAAwB,EACxB,CAAC,gBAAkC,EAAE,EAAE,CAAC,CAAC,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,CAAC,IAAI,CAAC,EACxF,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;IACA,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;GAC9C,gBAAgB,CAgE5B;AAhEY,4CAAgB"}
1
+ {"version":3,"file":"inventory-product.js","sourceRoot":"","sources":["../../../server/service/inventory-product/inventory-product.ts"],"names":[],"mappings":";;;;;AAAA,+CAAoD;AACpD,qCASgB;AAEhB,yDAAgD;AAChD,+DAAsD;AACtD,iDAA8C;AAS9C,IAAa,gBAAgB,GAA7B,MAAa,gBAAgB;CAgE5B,CAAA;AA7DC;IAFC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;4CACC;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;0DACjB,cAAM,oBAAN,cAAM;gDAAA;AAGf;IADC,IAAA,oBAAU,EAAC,CAAC,gBAAkC,EAAE,EAAE,CAAC,gBAAgB,CAAC,MAAM,CAAC;;kDAC3D;AAIjB;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,GAAE;;8CACI;AAIZ;IAFC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC1B,IAAA,oBAAK,EAAC,EAAE,QA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,CAAC,OAAO,CAAC;;mDAC3D;AAMlB;IAJC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE;QACvB,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;0DAChB,gBAAI,oBAAJ,gBAAI;iDAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,gBAAkC,EAAE,EAAE,CAAC,gBAAgB,CAAC,OAAO,CAAC;;mDAC3D;AA/DP,gBAAgB;IAP5B,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EACJ,wBAAwB,EACxB,CAAC,gBAAkC,EAAE,EAAE,CAAC,CAAC,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,CAAC,IAAI,CAAC,EACxF,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;IACA,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;GAC9C,gBAAgB,CAgE5B;AAhEY,4CAAgB","sourcesContent":["import { Field, ID, ObjectType } from 'type-graphql'\nimport {\n Column,\n CreateDateColumn,\n Entity,\n Index,\n ManyToOne,\n PrimaryGeneratedColumn,\n RelationId,\n UpdateDateColumn\n} from 'typeorm'\n\nimport { User } from '@things-factory/auth-base'\nimport { Product } from '@things-factory/product-base'\nimport { Domain } from '@things-factory/shell'\n\n@Entity()\n@Index(\n 'ix_inventory_product_0',\n (inventoryProduct: InventoryProduct) => [inventoryProduct.domain, inventoryProduct.name],\n { unique: true }\n)\n@ObjectType({ description: 'Entity for InventoryProduct' })\nexport class InventoryProduct {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true })\n domain?: Domain\n\n @RelationId((inventoryProduct: InventoryProduct) => inventoryProduct.domain)\n domainId?: string\n\n @Column()\n @Field()\n name: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n serialNumber?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n status?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n arrivalNoticeId: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n releaseGoodId: string\n\n @ManyToOne(type => Product)\n @Field({ nullable: true })\n product?: Product\n\n @RelationId((inventoryProduct: InventoryProduct) => inventoryProduct.product)\n productId?: string\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @ManyToOne(type => User, {\n nullable: true\n })\n @Field({ nullable: true })\n creator?: User\n\n @RelationId((inventoryProduct: InventoryProduct) => inventoryProduct.creator)\n creatorId?: string\n\n @ManyToOne(type => User, {\n nullable: true\n })\n @Field({ nullable: true })\n updater?: User\n\n @RelationId((inventoryProduct: InventoryProduct) => inventoryProduct.creator)\n updaterId?: string\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/location/index.ts"],"names":[],"mappings":";;;AAAA,yCAAqC;AACrC,2DAAsD;AACtD,qDAAgD;AAEnC,QAAA,QAAQ,GAAG,CAAC,mBAAQ,CAAC,CAAA;AACrB,QAAA,SAAS,GAAG,CAAC,8BAAa,EAAE,oCAAgB,CAAC,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/location/index.ts"],"names":[],"mappings":";;;AAAA,yCAAqC;AACrC,2DAAsD;AACtD,qDAAgD;AAEnC,QAAA,QAAQ,GAAG,CAAC,mBAAQ,CAAC,CAAA;AACrB,QAAA,SAAS,GAAG,CAAC,8BAAa,EAAE,oCAAgB,CAAC,CAAA","sourcesContent":["import { Location } from './location'\nimport { LocationMutation } from './location-mutation'\nimport { LocationQuery } from './location-query'\n\nexport const entities = [Location]\nexport const resolvers = [LocationQuery, LocationMutation]\n"]}