@things-factory/warehouse-base 4.3.667 → 4.3.671

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 (191) hide show
  1. package/package.json +10 -10
  2. package/dist-server/constants/adjustment-code.js +0 -13
  3. package/dist-server/constants/adjustment-code.js.map +0 -1
  4. package/dist-server/constants/index.js +0 -23
  5. package/dist-server/constants/index.js.map +0 -1
  6. package/dist-server/constants/inventory.js +0 -74
  7. package/dist-server/constants/inventory.js.map +0 -1
  8. package/dist-server/constants/location.js +0 -19
  9. package/dist-server/constants/location.js.map +0 -1
  10. package/dist-server/constants/pallet.js +0 -13
  11. package/dist-server/constants/pallet.js.map +0 -1
  12. package/dist-server/constants/rule-type.js +0 -8
  13. package/dist-server/constants/rule-type.js.map +0 -1
  14. package/dist-server/constants/tote.js +0 -9
  15. package/dist-server/constants/tote.js.map +0 -1
  16. package/dist-server/controllers/ecommerce/ecommerce-controller.js +0 -125
  17. package/dist-server/controllers/ecommerce/ecommerce-controller.js.map +0 -1
  18. package/dist-server/controllers/ecommerce/index.js +0 -22
  19. package/dist-server/controllers/ecommerce/index.js.map +0 -1
  20. package/dist-server/controllers/ecommerce/pos-controller.js +0 -65
  21. package/dist-server/controllers/ecommerce/pos-controller.js.map +0 -1
  22. package/dist-server/controllers/ecommerce/powrup-controller.js +0 -87
  23. package/dist-server/controllers/ecommerce/powrup-controller.js.map +0 -1
  24. package/dist-server/controllers/ecommerce/sellercraft-controller.js +0 -85
  25. package/dist-server/controllers/ecommerce/sellercraft-controller.js.map +0 -1
  26. package/dist-server/controllers/ecommerce/webspert-controller.js +0 -131
  27. package/dist-server/controllers/ecommerce/webspert-controller.js.map +0 -1
  28. package/dist-server/controllers/index.js +0 -19
  29. package/dist-server/controllers/index.js.map +0 -1
  30. package/dist-server/controllers/warehouse-controller.js +0 -143
  31. package/dist-server/controllers/warehouse-controller.js.map +0 -1
  32. package/dist-server/index.js +0 -35
  33. package/dist-server/index.js.map +0 -1
  34. package/dist-server/middlewares/index.js +0 -1
  35. package/dist-server/middlewares/index.js.map +0 -1
  36. package/dist-server/migrations/index.js +0 -12
  37. package/dist-server/migrations/index.js.map +0 -1
  38. package/dist-server/service/index.js +0 -96
  39. package/dist-server/service/index.js.map +0 -1
  40. package/dist-server/service/inventory/index.js +0 -9
  41. package/dist-server/service/inventory/index.js.map +0 -1
  42. package/dist-server/service/inventory/inventory-mutation.js +0 -414
  43. package/dist-server/service/inventory/inventory-mutation.js.map +0 -1
  44. package/dist-server/service/inventory/inventory-query.js +0 -1211
  45. package/dist-server/service/inventory/inventory-query.js.map +0 -1
  46. package/dist-server/service/inventory/inventory-types.js +0 -478
  47. package/dist-server/service/inventory/inventory-types.js.map +0 -1
  48. package/dist-server/service/inventory/inventory.js +0 -569
  49. package/dist-server/service/inventory/inventory.js.map +0 -1
  50. package/dist-server/service/inventory-change/index.js +0 -9
  51. package/dist-server/service/inventory-change/index.js.map +0 -1
  52. package/dist-server/service/inventory-change/inventory-change-mutation.js +0 -1188
  53. package/dist-server/service/inventory-change/inventory-change-mutation.js.map +0 -1
  54. package/dist-server/service/inventory-change/inventory-change-query.js +0 -150
  55. package/dist-server/service/inventory-change/inventory-change-query.js.map +0 -1
  56. package/dist-server/service/inventory-change/inventory-change-types.js +0 -73
  57. package/dist-server/service/inventory-change/inventory-change-types.js.map +0 -1
  58. package/dist-server/service/inventory-change/inventory-change.js +0 -225
  59. package/dist-server/service/inventory-change/inventory-change.js.map +0 -1
  60. package/dist-server/service/inventory-history/index.js +0 -9
  61. package/dist-server/service/inventory-history/index.js.map +0 -1
  62. package/dist-server/service/inventory-history/inventory-history-mutation.js +0 -121
  63. package/dist-server/service/inventory-history/inventory-history-mutation.js.map +0 -1
  64. package/dist-server/service/inventory-history/inventory-history-query.js +0 -1694
  65. package/dist-server/service/inventory-history/inventory-history-query.js.map +0 -1
  66. package/dist-server/service/inventory-history/inventory-history-types.js +0 -626
  67. package/dist-server/service/inventory-history/inventory-history-types.js.map +0 -1
  68. package/dist-server/service/inventory-history/inventory-history.js +0 -238
  69. package/dist-server/service/inventory-history/inventory-history.js.map +0 -1
  70. package/dist-server/service/inventory-item/index.js +0 -9
  71. package/dist-server/service/inventory-item/index.js.map +0 -1
  72. package/dist-server/service/inventory-item/inventory-item-mutation.js +0 -274
  73. package/dist-server/service/inventory-item/inventory-item-mutation.js.map +0 -1
  74. package/dist-server/service/inventory-item/inventory-item-query.js +0 -265
  75. package/dist-server/service/inventory-item/inventory-item-query.js.map +0 -1
  76. package/dist-server/service/inventory-item/inventory-item-type.js +0 -127
  77. package/dist-server/service/inventory-item/inventory-item-type.js.map +0 -1
  78. package/dist-server/service/inventory-item/inventory-item.js +0 -146
  79. package/dist-server/service/inventory-item/inventory-item.js.map +0 -1
  80. package/dist-server/service/inventory-item-change/index.js +0 -9
  81. package/dist-server/service/inventory-item-change/index.js.map +0 -1
  82. package/dist-server/service/inventory-item-change/inventory-item-change-mutation.js +0 -121
  83. package/dist-server/service/inventory-item-change/inventory-item-change-mutation.js.map +0 -1
  84. package/dist-server/service/inventory-item-change/inventory-item-change-query.js +0 -87
  85. package/dist-server/service/inventory-item-change/inventory-item-change-query.js.map +0 -1
  86. package/dist-server/service/inventory-item-change/inventory-item-change-type.js +0 -107
  87. package/dist-server/service/inventory-item-change/inventory-item-change-type.js.map +0 -1
  88. package/dist-server/service/inventory-item-change/inventory-item-change.js +0 -110
  89. package/dist-server/service/inventory-item-change/inventory-item-change.js.map +0 -1
  90. package/dist-server/service/inventory-product/index.js +0 -9
  91. package/dist-server/service/inventory-product/index.js.map +0 -1
  92. package/dist-server/service/inventory-product/inventory-product-mutation.js +0 -120
  93. package/dist-server/service/inventory-product/inventory-product-mutation.js.map +0 -1
  94. package/dist-server/service/inventory-product/inventory-product-query.js +0 -87
  95. package/dist-server/service/inventory-product/inventory-product-query.js.map +0 -1
  96. package/dist-server/service/inventory-product/inventory-product-type.js +0 -95
  97. package/dist-server/service/inventory-product/inventory-product-type.js.map +0 -1
  98. package/dist-server/service/inventory-product/inventory-product.js +0 -112
  99. package/dist-server/service/inventory-product/inventory-product.js.map +0 -1
  100. package/dist-server/service/location/index.js +0 -9
  101. package/dist-server/service/location/index.js.map +0 -1
  102. package/dist-server/service/location/location-mutation.js +0 -279
  103. package/dist-server/service/location/location-mutation.js.map +0 -1
  104. package/dist-server/service/location/location-query.js +0 -321
  105. package/dist-server/service/location/location-query.js.map +0 -1
  106. package/dist-server/service/location/location-types.js +0 -296
  107. package/dist-server/service/location/location-types.js.map +0 -1
  108. package/dist-server/service/location/location.js +0 -146
  109. package/dist-server/service/location/location.js.map +0 -1
  110. package/dist-server/service/movement/index.js +0 -9
  111. package/dist-server/service/movement/index.js.map +0 -1
  112. package/dist-server/service/movement/movement-mutation.js +0 -80
  113. package/dist-server/service/movement/movement-mutation.js.map +0 -1
  114. package/dist-server/service/movement/movement-query.js +0 -286
  115. package/dist-server/service/movement/movement-query.js.map +0 -1
  116. package/dist-server/service/movement/movement-types.js +0 -117
  117. package/dist-server/service/movement/movement-types.js.map +0 -1
  118. package/dist-server/service/movement/movement.js +0 -101
  119. package/dist-server/service/movement/movement.js.map +0 -1
  120. package/dist-server/service/pallet/index.js +0 -9
  121. package/dist-server/service/pallet/index.js.map +0 -1
  122. package/dist-server/service/pallet/pallet-mutation.js +0 -194
  123. package/dist-server/service/pallet/pallet-mutation.js.map +0 -1
  124. package/dist-server/service/pallet/pallet-query.js +0 -164
  125. package/dist-server/service/pallet/pallet-query.js.map +0 -1
  126. package/dist-server/service/pallet/pallet-types.js +0 -109
  127. package/dist-server/service/pallet/pallet-types.js.map +0 -1
  128. package/dist-server/service/pallet/pallet.js +0 -112
  129. package/dist-server/service/pallet/pallet.js.map +0 -1
  130. package/dist-server/service/pallet-count/index.js +0 -9
  131. package/dist-server/service/pallet-count/index.js.map +0 -1
  132. package/dist-server/service/pallet-count/pallet-count-mutation.js +0 -153
  133. package/dist-server/service/pallet-count/pallet-count-mutation.js.map +0 -1
  134. package/dist-server/service/pallet-count/pallet-count-query.js +0 -86
  135. package/dist-server/service/pallet-count/pallet-count-query.js.map +0 -1
  136. package/dist-server/service/pallet-count/pallet-count-types.js +0 -65
  137. package/dist-server/service/pallet-count/pallet-count-types.js.map +0 -1
  138. package/dist-server/service/pallet-count/pallet-count.js +0 -89
  139. package/dist-server/service/pallet-count/pallet-count.js.map +0 -1
  140. package/dist-server/service/pallet-history/index.js +0 -9
  141. package/dist-server/service/pallet-history/index.js.map +0 -1
  142. package/dist-server/service/pallet-history/pallet-history-mutation.js +0 -120
  143. package/dist-server/service/pallet-history/pallet-history-mutation.js.map +0 -1
  144. package/dist-server/service/pallet-history/pallet-history-query.js +0 -87
  145. package/dist-server/service/pallet-history/pallet-history-query.js.map +0 -1
  146. package/dist-server/service/pallet-history/pallet-history-types.js +0 -65
  147. package/dist-server/service/pallet-history/pallet-history-types.js.map +0 -1
  148. package/dist-server/service/pallet-history/pallet-history.js +0 -107
  149. package/dist-server/service/pallet-history/pallet-history.js.map +0 -1
  150. package/dist-server/service/product-detail-stock/index.js +0 -9
  151. package/dist-server/service/product-detail-stock/index.js.map +0 -1
  152. package/dist-server/service/product-detail-stock/product-detail-stock-mutation.js +0 -120
  153. package/dist-server/service/product-detail-stock/product-detail-stock-mutation.js.map +0 -1
  154. package/dist-server/service/product-detail-stock/product-detail-stock-query.js +0 -66
  155. package/dist-server/service/product-detail-stock/product-detail-stock-query.js.map +0 -1
  156. package/dist-server/service/product-detail-stock/product-detail-stock-types.js +0 -57
  157. package/dist-server/service/product-detail-stock/product-detail-stock-types.js.map +0 -1
  158. package/dist-server/service/product-detail-stock/product-detail-stock.js +0 -90
  159. package/dist-server/service/product-detail-stock/product-detail-stock.js.map +0 -1
  160. package/dist-server/service/reduced-inventory-history/index.js +0 -6
  161. package/dist-server/service/reduced-inventory-history/index.js.map +0 -1
  162. package/dist-server/service/reduced-inventory-history/reduced-inventory-history.js +0 -133
  163. package/dist-server/service/reduced-inventory-history/reduced-inventory-history.js.map +0 -1
  164. package/dist-server/service/tote/index.js +0 -9
  165. package/dist-server/service/tote/index.js.map +0 -1
  166. package/dist-server/service/tote/tote-mutation.js +0 -192
  167. package/dist-server/service/tote/tote-mutation.js.map +0 -1
  168. package/dist-server/service/tote/tote-query.js +0 -162
  169. package/dist-server/service/tote/tote-query.js.map +0 -1
  170. package/dist-server/service/tote/tote-types.js +0 -75
  171. package/dist-server/service/tote/tote-types.js.map +0 -1
  172. package/dist-server/service/tote/tote.js +0 -98
  173. package/dist-server/service/tote/tote.js.map +0 -1
  174. package/dist-server/service/warehouse/index.js +0 -9
  175. package/dist-server/service/warehouse/index.js.map +0 -1
  176. package/dist-server/service/warehouse/warehouse-mutation.js +0 -148
  177. package/dist-server/service/warehouse/warehouse-mutation.js.map +0 -1
  178. package/dist-server/service/warehouse/warehouse-query.js +0 -91
  179. package/dist-server/service/warehouse/warehouse-query.js.map +0 -1
  180. package/dist-server/service/warehouse/warehouse-types.js +0 -82
  181. package/dist-server/service/warehouse/warehouse-types.js.map +0 -1
  182. package/dist-server/service/warehouse/warehouse.js +0 -114
  183. package/dist-server/service/warehouse/warehouse.js.map +0 -1
  184. package/dist-server/utils/datetime-util.js +0 -61
  185. package/dist-server/utils/datetime-util.js.map +0 -1
  186. package/dist-server/utils/index.js +0 -20
  187. package/dist-server/utils/index.js.map +0 -1
  188. package/dist-server/utils/inventory-no-generator.js +0 -17
  189. package/dist-server/utils/inventory-no-generator.js.map +0 -1
  190. package/dist-server/utils/inventory-util.js +0 -413
  191. package/dist-server/utils/inventory-util.js.map +0 -1
@@ -1,87 +0,0 @@
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
- var _a;
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.InventoryProductQuery = void 0;
17
- const type_graphql_1 = require("type-graphql");
18
- const typeorm_1 = require("typeorm");
19
- const shell_1 = require("@things-factory/shell");
20
- const auth_base_1 = require("@things-factory/auth-base");
21
- const inventory_product_1 = require("./inventory-product");
22
- const inventory_product_type_1 = require("./inventory-product-type");
23
- let InventoryProductQuery = class InventoryProductQuery {
24
- async inventoryProduct(id, context) {
25
- const { domain } = context.state;
26
- return await (0, typeorm_1.getRepository)(inventory_product_1.InventoryProduct).findOne({
27
- where: { domain, id }
28
- });
29
- }
30
- async inventoryProducts(params, context) {
31
- const { domain } = context.state;
32
- const convertedParams = (0, shell_1.convertListParams)(params, domain.id);
33
- const [items, total] = await (0, typeorm_1.getRepository)(inventory_product_1.InventoryProduct).findAndCount(convertedParams);
34
- return { items, total };
35
- }
36
- async domain(inventoryProduct) {
37
- return await (0, typeorm_1.getRepository)(shell_1.Domain).findOne(inventoryProduct.domainId);
38
- }
39
- async updater(inventoryProduct) {
40
- return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(inventoryProduct.updaterId);
41
- }
42
- async creator(inventoryProduct) {
43
- return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(inventoryProduct.creatorId);
44
- }
45
- };
46
- __decorate([
47
- (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)
53
- ], InventoryProductQuery.prototype, "inventoryProduct", null);
54
- __decorate([
55
- (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)
61
- ], InventoryProductQuery.prototype, "inventoryProducts", null);
62
- __decorate([
63
- (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)
68
- ], InventoryProductQuery.prototype, "domain", null);
69
- __decorate([
70
- (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)
75
- ], InventoryProductQuery.prototype, "updater", null);
76
- __decorate([
77
- (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)
82
- ], InventoryProductQuery.prototype, "creator", null);
83
- InventoryProductQuery = __decorate([
84
- (0, type_graphql_1.Resolver)(inventory_product_1.InventoryProduct)
85
- ], InventoryProductQuery);
86
- exports.InventoryProductQuery = InventoryProductQuery;
87
- //# sourceMappingURL=inventory-product-query.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inventory-product-query.js","sourceRoot":"","sources":["../../../server/service/inventory-product/inventory-product-query.ts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AAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAA;IACtE,CAAC;CACF,CAAA;AAhCO;IADL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,oCAAgB,EAAE,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;IAC3D,WAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;6DAMnD;AAGK;IADL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,6CAAoB,EAAE,EAAE,WAAW,EAAE,qCAAqC,EAAE,CAAC;IACtE,WAAA,IAAA,mBAAI,GAAE,CAAA;IAAqB,WAAA,IAAA,kBAAG,GAAE,CAAA;;yDAAjB,iBAAS,oBAAT,iBAAS;;8DAOhD;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAmB,oCAAgB;;mDAEtD;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAmB,oCAAgB;;oDAEvD;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAmB,oCAAgB;;oDAEvD;AAjCU,qBAAqB;IADjC,IAAA,uBAAQ,EAAC,oCAAgB,CAAC;GACd,qBAAqB,CAkCjC;AAlCY,sDAAqB"}
@@ -1,95 +0,0 @@
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 _a;
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.InventoryProductList = exports.InventoryProductPatch = exports.NewInventoryProduct = void 0;
14
- const type_graphql_1 = require("type-graphql");
15
- const shell_1 = require("@things-factory/shell");
16
- const inventory_product_1 = require("./inventory-product");
17
- let NewInventoryProduct = class NewInventoryProduct {
18
- };
19
- __decorate([
20
- (0, type_graphql_1.Field)(),
21
- __metadata("design:type", String)
22
- ], NewInventoryProduct.prototype, "name", void 0);
23
- __decorate([
24
- (0, type_graphql_1.Field)({ nullable: true }),
25
- __metadata("design:type", String)
26
- ], NewInventoryProduct.prototype, "serialNumber", void 0);
27
- __decorate([
28
- (0, type_graphql_1.Field)({ nullable: true }),
29
- __metadata("design:type", String)
30
- ], NewInventoryProduct.prototype, "status", void 0);
31
- __decorate([
32
- (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)
34
- ], NewInventoryProduct.prototype, "product", void 0);
35
- __decorate([
36
- (0, type_graphql_1.Field)({ nullable: true }),
37
- __metadata("design:type", String)
38
- ], NewInventoryProduct.prototype, "arrivalNoticeId", void 0);
39
- __decorate([
40
- (0, type_graphql_1.Field)({ nullable: true }),
41
- __metadata("design:type", String)
42
- ], NewInventoryProduct.prototype, "releaseGoodId", void 0);
43
- NewInventoryProduct = __decorate([
44
- (0, type_graphql_1.InputType)()
45
- ], NewInventoryProduct);
46
- exports.NewInventoryProduct = NewInventoryProduct;
47
- let InventoryProductPatch = class InventoryProductPatch {
48
- };
49
- __decorate([
50
- (0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
51
- __metadata("design:type", String)
52
- ], InventoryProductPatch.prototype, "id", void 0);
53
- __decorate([
54
- (0, type_graphql_1.Field)({ nullable: true }),
55
- __metadata("design:type", String)
56
- ], InventoryProductPatch.prototype, "name", void 0);
57
- __decorate([
58
- (0, type_graphql_1.Field)({ nullable: true }),
59
- __metadata("design:type", String)
60
- ], InventoryProductPatch.prototype, "serialNumber", void 0);
61
- __decorate([
62
- (0, type_graphql_1.Field)({ nullable: true }),
63
- __metadata("design:type", String)
64
- ], InventoryProductPatch.prototype, "status", void 0);
65
- __decorate([
66
- (0, type_graphql_1.Field)({ nullable: true }),
67
- __metadata("design:type", String)
68
- ], InventoryProductPatch.prototype, "arrivalNoticeId", void 0);
69
- __decorate([
70
- (0, type_graphql_1.Field)({ nullable: true }),
71
- __metadata("design:type", String)
72
- ], InventoryProductPatch.prototype, "releaseGoodId", void 0);
73
- __decorate([
74
- (0, type_graphql_1.Field)(),
75
- __metadata("design:type", String)
76
- ], InventoryProductPatch.prototype, "cuFlag", void 0);
77
- InventoryProductPatch = __decorate([
78
- (0, type_graphql_1.InputType)()
79
- ], InventoryProductPatch);
80
- exports.InventoryProductPatch = InventoryProductPatch;
81
- let InventoryProductList = class InventoryProductList {
82
- };
83
- __decorate([
84
- (0, type_graphql_1.Field)(type => [inventory_product_1.InventoryProduct]),
85
- __metadata("design:type", Array)
86
- ], InventoryProductList.prototype, "items", void 0);
87
- __decorate([
88
- (0, type_graphql_1.Field)(type => type_graphql_1.Int),
89
- __metadata("design:type", Number)
90
- ], InventoryProductList.prototype, "total", void 0);
91
- InventoryProductList = __decorate([
92
- (0, type_graphql_1.ObjectType)()
93
- ], InventoryProductList);
94
- exports.InventoryProductList = InventoryProductList;
95
- //# sourceMappingURL=inventory-product-type.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inventory-product-type.js","sourceRoot":"","sources":["../../../server/service/inventory-product/inventory-product-type.ts"],"names":[],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,CAAC;;4DACJ;AAEtB;IAAC,IAAA,oBAAK,GAAE;;qDACM;AApBH,qBAAqB;IADjC,IAAA,wBAAS,GAAE;GACC,qBAAqB,CAqBjC;AArBY,sDAAqB;AAwB3B,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;CAMhC,CAAA;AALC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,oCAAgB,CAAC,CAAC;;mDACT;AAEzB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;mDACN;AALF,oBAAoB;IADhC,IAAA,yBAAU,GAAE;GACA,oBAAoB,CAMhC;AANY,oDAAoB"}
@@ -1,112 +0,0 @@
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 _a, _b, _c, _d, _e;
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.InventoryProduct = void 0;
14
- const type_graphql_1 = require("type-graphql");
15
- const typeorm_1 = require("typeorm");
16
- const auth_base_1 = require("@things-factory/auth-base");
17
- const product_base_1 = require("@things-factory/product-base");
18
- const shell_1 = require("@things-factory/shell");
19
- let InventoryProduct = class InventoryProduct {
20
- };
21
- __decorate([
22
- (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
23
- (0, type_graphql_1.Field)(type => type_graphql_1.ID),
24
- __metadata("design:type", String)
25
- ], InventoryProduct.prototype, "id", void 0);
26
- __decorate([
27
- (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
28
- (0, type_graphql_1.Field)({ nullable: true }),
29
- __metadata("design:type", typeof (_a = typeof shell_1.Domain !== "undefined" && shell_1.Domain) === "function" ? _a : Object)
30
- ], InventoryProduct.prototype, "domain", void 0);
31
- __decorate([
32
- (0, typeorm_1.RelationId)((inventoryProduct) => inventoryProduct.domain),
33
- __metadata("design:type", String)
34
- ], InventoryProduct.prototype, "domainId", void 0);
35
- __decorate([
36
- (0, typeorm_1.Column)(),
37
- (0, type_graphql_1.Field)(),
38
- __metadata("design:type", String)
39
- ], InventoryProduct.prototype, "name", void 0);
40
- __decorate([
41
- (0, typeorm_1.Column)({ nullable: true }),
42
- (0, type_graphql_1.Field)({ nullable: true }),
43
- __metadata("design:type", String)
44
- ], InventoryProduct.prototype, "serialNumber", void 0);
45
- __decorate([
46
- (0, typeorm_1.Column)({ nullable: true }),
47
- (0, type_graphql_1.Field)({ nullable: true }),
48
- __metadata("design:type", String)
49
- ], InventoryProduct.prototype, "status", void 0);
50
- __decorate([
51
- (0, typeorm_1.Column)({ nullable: true }),
52
- (0, type_graphql_1.Field)({ nullable: true }),
53
- __metadata("design:type", String)
54
- ], InventoryProduct.prototype, "arrivalNoticeId", void 0);
55
- __decorate([
56
- (0, typeorm_1.Column)({ nullable: true }),
57
- (0, type_graphql_1.Field)({ nullable: true }),
58
- __metadata("design:type", String)
59
- ], InventoryProduct.prototype, "releaseGoodId", void 0);
60
- __decorate([
61
- (0, typeorm_1.ManyToOne)(type => product_base_1.Product),
62
- (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)
64
- ], InventoryProduct.prototype, "product", void 0);
65
- __decorate([
66
- (0, typeorm_1.RelationId)((inventoryProduct) => inventoryProduct.product),
67
- __metadata("design:type", String)
68
- ], InventoryProduct.prototype, "productId", void 0);
69
- __decorate([
70
- (0, typeorm_1.ManyToOne)(type => product_base_1.ProductDetail, { nullable: true }),
71
- (0, type_graphql_1.Field)({ nullable: true }),
72
- __metadata("design:type", typeof (_c = typeof product_base_1.ProductDetail !== "undefined" && product_base_1.ProductDetail) === "function" ? _c : Object)
73
- ], InventoryProduct.prototype, "productDetail", void 0);
74
- __decorate([
75
- (0, typeorm_1.CreateDateColumn)(),
76
- (0, type_graphql_1.Field)({ nullable: true }),
77
- __metadata("design:type", Date)
78
- ], InventoryProduct.prototype, "createdAt", void 0);
79
- __decorate([
80
- (0, typeorm_1.UpdateDateColumn)(),
81
- (0, type_graphql_1.Field)({ nullable: true }),
82
- __metadata("design:type", Date)
83
- ], InventoryProduct.prototype, "updatedAt", void 0);
84
- __decorate([
85
- (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
86
- nullable: true
87
- }),
88
- (0, type_graphql_1.Field)({ nullable: true }),
89
- __metadata("design:type", typeof (_d = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _d : Object)
90
- ], InventoryProduct.prototype, "creator", void 0);
91
- __decorate([
92
- (0, typeorm_1.RelationId)((inventoryProduct) => inventoryProduct.creator),
93
- __metadata("design:type", String)
94
- ], InventoryProduct.prototype, "creatorId", void 0);
95
- __decorate([
96
- (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
97
- nullable: true
98
- }),
99
- (0, type_graphql_1.Field)({ nullable: true }),
100
- __metadata("design:type", typeof (_e = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _e : Object)
101
- ], InventoryProduct.prototype, "updater", void 0);
102
- __decorate([
103
- (0, typeorm_1.RelationId)((inventoryProduct) => inventoryProduct.updater),
104
- __metadata("design:type", String)
105
- ], InventoryProduct.prototype, "updaterId", void 0);
106
- InventoryProduct = __decorate([
107
- (0, typeorm_1.Entity)(),
108
- (0, typeorm_1.Index)('ix_inventory_product_0', (inventoryProduct) => [inventoryProduct.domain, inventoryProduct.name], { unique: true }),
109
- (0, type_graphql_1.ObjectType)({ description: 'Entity for InventoryProduct' })
110
- ], InventoryProduct);
111
- exports.InventoryProduct = InventoryProduct;
112
- //# sourceMappingURL=inventory-product.js.map
@@ -1 +0,0 @@
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,+DAAqE;AACrE,iDAA8C;AASvC,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAoE5B,CAAA;AAnEC;IAAC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;4CACC;AAEnB;IAAC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;kDACjB,cAAM,oBAAN,cAAM;gDAAA;AAEf;IAAC,IAAA,oBAAU,EAAC,CAAC,gBAAkC,EAAE,EAAE,CAAC,gBAAgB,CAAC,MAAM,CAAC;;kDAC3D;AAEjB;IAAC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,GAAE;;8CACI;AAEZ;IAAC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC1B,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDACL;AAErB;IAAC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC1B,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACX;AAEf;IAAC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC1B,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yDACH;AAEv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IAAI;KACf,CAAC;IACD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;kDAChB,gBAAI,oBAAJ,gBAAI;iDAAA;AAEd;IAAC,IAAA,oBAAU,EAAC,CAAC,gBAAkC,EAAE,EAAE,CAAC,gBAAgB,CAAC,OAAO,CAAC;;mDAC3D;AAnEP,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,CAoE5B;AApEY,4CAAgB"}
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.resolvers = exports.entities = void 0;
4
- const location_1 = require("./location");
5
- const location_mutation_1 = require("./location-mutation");
6
- const location_query_1 = require("./location-query");
7
- exports.entities = [location_1.Location];
8
- exports.resolvers = [location_query_1.LocationQuery, location_mutation_1.LocationMutation];
9
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
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,279 +0,0 @@
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
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.deleteLocations = exports.deleteLocation = exports.updateLocation = exports.createLocation = exports.LocationMutation = void 0;
16
- const type_graphql_1 = require("type-graphql");
17
- const location_1 = require("../location/location");
18
- const warehouse_1 = require("../warehouse/warehouse");
19
- const location_types_1 = require("./location-types");
20
- const typeorm_1 = require("typeorm");
21
- let LocationMutation = class LocationMutation {
22
- async createLocation(location, context) {
23
- return await createLocation(location, context);
24
- }
25
- async createMultipleLocation(patches, context) {
26
- let results = [];
27
- const _createRecords = patches
28
- .filter((patch) => patch.cuFlag === '+')
29
- .map(x => {
30
- delete x.id;
31
- return Object.assign({}, x);
32
- });
33
- if (_createRecords.length > 0) {
34
- for (let i = 0; i < _createRecords.length; i++) {
35
- const patch = _createRecords[i];
36
- const result = await createLocation(patch, context);
37
- results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
38
- }
39
- }
40
- return results;
41
- }
42
- async updateLocation(id, patch, context) {
43
- return await updateLocation(id, patch, context.state.user);
44
- }
45
- async updateMultipleLocation(patches, context) {
46
- let results = [];
47
- const _createRecords = patches.filter((patch) => patch.cuFlag === '+');
48
- const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
49
- if (_createRecords.length > 0) {
50
- for (let i = 0; i < _createRecords.length; i++) {
51
- const patch = _createRecords[i];
52
- const result = await createLocation(patch, context);
53
- results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
54
- }
55
- }
56
- if (_updateRecords.length > 0) {
57
- for (let i = 0; i < _updateRecords.length; i++) {
58
- const patch = _updateRecords[i];
59
- const result = await updateLocation(patch.id, patch, context);
60
- results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
61
- }
62
- }
63
- return results;
64
- }
65
- async deleteLocation(id, context) {
66
- return await deleteLocation(id, context);
67
- }
68
- async deleteLocations(ids, context) {
69
- return await deleteLocations(ids, context);
70
- }
71
- async deleteAllLocations(warehouseId, context) {
72
- const { tx } = context.state;
73
- const warehouse = await tx.getRepository(warehouse_1.Warehouse).findOne(warehouseId);
74
- try {
75
- await tx.getRepository(location_1.Location).delete({ warehouse });
76
- return true;
77
- }
78
- catch (err) {
79
- if (err instanceof typeorm_1.QueryFailedError) {
80
- if (err.code === '23503') {
81
- throw new Error("Some locations are still connected to inventory records. Please contact our support to delete.");
82
- }
83
- }
84
- // For any other unknown errors
85
- console.error('Failed to delete all locations:', err);
86
- throw new Error('Failed to delete locations. Please try again or contact support.');
87
- }
88
- }
89
- };
90
- __decorate([
91
- (0, type_graphql_1.Directive)('@privilege(category: "warehouse", privilege: "mutation")'),
92
- (0, type_graphql_1.Directive)('@transaction'),
93
- (0, type_graphql_1.Mutation)(returns => location_1.Location),
94
- __param(0, (0, type_graphql_1.Arg)('location')),
95
- __param(1, (0, type_graphql_1.Ctx)()),
96
- __metadata("design:type", Function),
97
- __metadata("design:paramtypes", [location_types_1.NewLocation, Object]),
98
- __metadata("design:returntype", Promise)
99
- ], LocationMutation.prototype, "createLocation", null);
100
- __decorate([
101
- (0, type_graphql_1.Directive)('@privilege(category: "warehouse", privilege: "mutation")'),
102
- (0, type_graphql_1.Directive)('@transaction'),
103
- (0, type_graphql_1.Mutation)(returns => [location_1.Location]),
104
- __param(0, (0, type_graphql_1.Arg)('patches', type => [location_types_1.LocationPatch])),
105
- __param(1, (0, type_graphql_1.Ctx)()),
106
- __metadata("design:type", Function),
107
- __metadata("design:paramtypes", [Array, Object]),
108
- __metadata("design:returntype", Promise)
109
- ], LocationMutation.prototype, "createMultipleLocation", null);
110
- __decorate([
111
- (0, type_graphql_1.Directive)('@privilege(category: "warehouse", privilege: "mutation")'),
112
- (0, type_graphql_1.Directive)('@transaction'),
113
- (0, type_graphql_1.Mutation)(returns => location_1.Location),
114
- __param(0, (0, type_graphql_1.Arg)('id')),
115
- __param(1, (0, type_graphql_1.Arg)('patch')),
116
- __param(2, (0, type_graphql_1.Ctx)()),
117
- __metadata("design:type", Function),
118
- __metadata("design:paramtypes", [String, location_types_1.LocationPatch, Object]),
119
- __metadata("design:returntype", Promise)
120
- ], LocationMutation.prototype, "updateLocation", null);
121
- __decorate([
122
- (0, type_graphql_1.Directive)('@privilege(category: "warehouse", privilege: "mutation")'),
123
- (0, type_graphql_1.Directive)('@transaction'),
124
- (0, type_graphql_1.Mutation)(returns => [location_1.Location]),
125
- __param(0, (0, type_graphql_1.Arg)('patches', type => [location_types_1.LocationPatch])),
126
- __param(1, (0, type_graphql_1.Ctx)()),
127
- __metadata("design:type", Function),
128
- __metadata("design:paramtypes", [Array, Object]),
129
- __metadata("design:returntype", Promise)
130
- ], LocationMutation.prototype, "updateMultipleLocation", null);
131
- __decorate([
132
- (0, type_graphql_1.Directive)('@privilege(category: "warehouse", privilege: "mutation")'),
133
- (0, type_graphql_1.Directive)('@transaction'),
134
- (0, type_graphql_1.Mutation)(returns => Boolean),
135
- __param(0, (0, type_graphql_1.Arg)('id')),
136
- __param(1, (0, type_graphql_1.Ctx)()),
137
- __metadata("design:type", Function),
138
- __metadata("design:paramtypes", [String, Object]),
139
- __metadata("design:returntype", Promise)
140
- ], LocationMutation.prototype, "deleteLocation", null);
141
- __decorate([
142
- (0, type_graphql_1.Directive)('@privilege(category: "warehouse", privilege: "mutation")'),
143
- (0, type_graphql_1.Directive)('@transaction'),
144
- (0, type_graphql_1.Mutation)(returns => Boolean),
145
- __param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
146
- __param(1, (0, type_graphql_1.Ctx)()),
147
- __metadata("design:type", Function),
148
- __metadata("design:paramtypes", [Array, Object]),
149
- __metadata("design:returntype", Promise)
150
- ], LocationMutation.prototype, "deleteLocations", null);
151
- __decorate([
152
- (0, type_graphql_1.Directive)('@privilege(category: "warehouse", privilege: "mutation")'),
153
- (0, type_graphql_1.Directive)('@transaction'),
154
- (0, type_graphql_1.Mutation)(returns => Boolean),
155
- __param(0, (0, type_graphql_1.Arg)('warehouseId')),
156
- __param(1, (0, type_graphql_1.Ctx)()),
157
- __metadata("design:type", Function),
158
- __metadata("design:paramtypes", [String, Object]),
159
- __metadata("design:returntype", Promise)
160
- ], LocationMutation.prototype, "deleteAllLocations", null);
161
- LocationMutation = __decorate([
162
- (0, type_graphql_1.Resolver)(location_1.Location)
163
- ], LocationMutation);
164
- exports.LocationMutation = LocationMutation;
165
- async function createLocation(location, context) {
166
- const { domain, user, tx } = context.state;
167
- const locationRepository = tx.getRepository(location_1.Location);
168
- const warehouseRepository = tx.getRepository(warehouse_1.Warehouse);
169
- const foundLocation = await locationRepository.findOne({
170
- where: [
171
- {
172
- domain,
173
- name: location.name,
174
- row: location.row,
175
- zone: location.zone,
176
- column: location.column,
177
- shelf: location.shelf
178
- },
179
- {
180
- domain,
181
- row: location.row,
182
- zone: location.zone,
183
- column: location.column,
184
- shelf: location.shelf
185
- },
186
- {
187
- domain,
188
- name: location.name
189
- }
190
- ]
191
- });
192
- //name found in db is the same as the one passed by the user
193
- if (foundLocation && (foundLocation === null || foundLocation === void 0 ? void 0 : foundLocation.id) && (foundLocation === null || foundLocation === void 0 ? void 0 : foundLocation.name) === (location === null || location === void 0 ? void 0 : location.name)) {
194
- throw new Error(`Duplicates name found: ${foundLocation.name}`);
195
- }
196
- if (foundLocation) {
197
- throw new Error(`Existing location found: ${foundLocation.name}`);
198
- }
199
- return await locationRepository.save(Object.assign(Object.assign({}, location), { warehouse: await warehouseRepository.findOne(location.warehouse.id), domain, creator: user, updater: user }));
200
- }
201
- exports.createLocation = createLocation;
202
- async function updateLocation(id, patch, context) {
203
- var _a, _b, _c, _d;
204
- const { user, domain, tx } = context.state;
205
- const locationRepository = tx.getRepository(location_1.Location);
206
- const warehouseRepository = tx.getRepository(warehouse_1.Warehouse);
207
- const location = await locationRepository.findOne(id);
208
- if (patch.warehouse && patch.warehouse.id) {
209
- patch.warehouse = await warehouseRepository.findOne(patch.warehouse.id);
210
- }
211
- const propertiesValidation = {
212
- keys: ['zone', 'shelf', 'row', 'column'],
213
- changeName: false,
214
- changeZone: false
215
- };
216
- Object.keys(patch).forEach(prop => {
217
- if (propertiesValidation.keys.includes(prop)) {
218
- location[prop] = patch[prop];
219
- propertiesValidation.changeZone = true;
220
- }
221
- if (['name'].includes(prop)) {
222
- location[prop] = patch[prop];
223
- propertiesValidation.changeName = true;
224
- }
225
- });
226
- let queryConditions = '';
227
- //if got changes to name but no changes to the zone,row,column and shelf
228
- if (propertiesValidation.changeName) {
229
- queryConditions += `or (name = $2)`;
230
- }
231
- //if name no changes, but have changes to zone,row,column and shelf
232
- if (propertiesValidation.changeZone) {
233
- queryConditions += `or (zone = $3 AND "row" = $4 AND "column" = $5 AND shelf = $6)`;
234
- }
235
- //validation if no changes to name,zone,row,column,shelf but have changes to type,status
236
- if (queryConditions !== '') {
237
- const foundLocation = await tx.query(`Select * from locations
238
- where domain_id = $1
239
- and ((name = $2 AND zone = $3 AND "row" = $4 AND "column" = $5 AND shelf = $6) ${queryConditions})
240
- limit 1
241
- `, [domain.id, location.name, location.zone, location.row, location.column, location.shelf]);
242
- if ((foundLocation === null || foundLocation === void 0 ? void 0 : foundLocation.length) > 0 && ((_a = foundLocation[0]) === null || _a === void 0 ? void 0 : _a.name) === (patch === null || patch === void 0 ? void 0 : patch.name) && ((_b = foundLocation[0]) === null || _b === void 0 ? void 0 : _b.id) !== id) {
243
- throw new Error(`Duplicates name found: ${(_c = foundLocation[0]) === null || _c === void 0 ? void 0 : _c.name}`);
244
- }
245
- if ((foundLocation === null || foundLocation === void 0 ? void 0 : foundLocation.length) > 0) {
246
- throw new Error(`Existing location found: ${(_d = foundLocation[0]) === null || _d === void 0 ? void 0 : _d.name}`);
247
- }
248
- }
249
- return await locationRepository.save(Object.assign(Object.assign(Object.assign({}, location), patch), { updater: user }));
250
- }
251
- exports.updateLocation = updateLocation;
252
- async function deleteLocation(id, context) {
253
- const { tx } = context.state;
254
- const repository = tx.getRepository(location_1.Location);
255
- await repository.delete(id);
256
- return true;
257
- }
258
- exports.deleteLocation = deleteLocation;
259
- async function deleteLocations(ids, context) {
260
- const { tx } = context.state;
261
- const repository = tx.getRepository(location_1.Location);
262
- try {
263
- await repository.delete(ids);
264
- return true;
265
- }
266
- catch (err) {
267
- if (err instanceof typeorm_1.QueryFailedError) {
268
- // Check if it's a foreign key constraint violation
269
- if (err.code === '23503') {
270
- throw new Error(`The location is associated with inventory records. Please contact our support to delete.`);
271
- }
272
- }
273
- // For all other errors, throw a generic message
274
- console.error('Failed to delete location: ', err);
275
- throw new Error('Failed to delete location. Please try again or contact support.');
276
- }
277
- }
278
- exports.deleteLocations = deleteLocations;
279
- //# sourceMappingURL=location-mutation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"location-mutation.js","sourceRoot":"","sources":["../../../server/service/location/location-mutation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAAsE;AAMtE,mDAA+C;AAC/C,sDAAkD;AAClD,qDAA6D;AAC7D,qCAA0C;AAGnC,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAIrB,AAAN,KAAK,CAAC,cAAc,CAAkB,QAAqB,EAAS,OAAY;QAC9E,OAAO,MAAM,cAAc,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;IAChD,CAAC;IAKK,AAAN,KAAK,CAAC,sBAAsB,CACe,OAAwB,EAC1D,OAAY;QAEnB,IAAI,OAAO,GAAG,EAAE,CAAA;QAChB,MAAM,cAAc,GAAG,OAAO;aAC3B,MAAM,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC,M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