@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,148 +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 __importDefault = (this && this.__importDefault) || function (mod) {
15
- return (mod && mod.__esModule) ? mod : { "default": mod };
16
- };
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.deleteWarehouses = exports.deleteWarehouse = exports.updateWarehouse = exports.createWarehouse = exports.WarehouseMutation = void 0;
19
- const type_graphql_1 = require("type-graphql");
20
- const warehouse_1 = require("./warehouse");
21
- const warehouse_types_1 = require("./warehouse-types");
22
- const i18next_1 = __importDefault(require("i18next"));
23
- let WarehouseMutation = class WarehouseMutation {
24
- async createWarehouse(warehouse, context) {
25
- return await createWarehouse(warehouse, context);
26
- }
27
- async updateWarehouse(id, patch, context) {
28
- return await updateWarehouse(id, patch, context);
29
- }
30
- async updateMultipleWarehouse(patches, context) {
31
- const { tx, domain, user } = context.state;
32
- for (let patch of patches) {
33
- let foundWarehouse;
34
- foundWarehouse = await tx.getRepository(warehouse_1.Warehouse).findOne({
35
- domain,
36
- id: patch.id
37
- });
38
- if (!foundWarehouse) {
39
- await tx.getRepository(warehouse_1.Warehouse).save(Object.assign(Object.assign({}, patch), { domain, creator: user, updater: user }));
40
- }
41
- else {
42
- if (patch.cuFlag === '+') {
43
- throw new Error(i18next_1.default.t('error.warehouse (x) already exists', { x: patch.name }));
44
- }
45
- if ((!patch.name || !foundWarehouse.name) && (!patch.type || !foundWarehouse.type)) {
46
- throw new Error(i18next_1.default.t('text.empty_value_in_list'));
47
- }
48
- if ((patch.name) && (patch.type === '')) {
49
- throw new Error(i18next_1.default.t('text.empty_value_in_list'));
50
- }
51
- const updatedName = patch.name || foundWarehouse.name;
52
- const updatedType = patch.type || foundWarehouse.type;
53
- delete patch.cuFlag;
54
- await tx.getRepository(warehouse_1.Warehouse).update({ id: foundWarehouse.id }, Object.assign(Object.assign({}, patch), { name: updatedName, type: updatedType, updater: user }));
55
- }
56
- }
57
- return true;
58
- }
59
- async deleteWarehouse(id, context) {
60
- return await deleteWarehouse(id, context);
61
- }
62
- async deleteWarehouses(ids, context) {
63
- return await deleteWarehouses(ids, context);
64
- }
65
- };
66
- __decorate([
67
- (0, type_graphql_1.Directive)('@privilege(category: "warehouse", privilege: "mutation")'),
68
- (0, type_graphql_1.Directive)('@transaction'),
69
- (0, type_graphql_1.Mutation)(returns => warehouse_1.Warehouse),
70
- __param(0, (0, type_graphql_1.Arg)('warehouse')),
71
- __param(1, (0, type_graphql_1.Ctx)()),
72
- __metadata("design:type", Function),
73
- __metadata("design:paramtypes", [warehouse_types_1.NewWarehouse, Object]),
74
- __metadata("design:returntype", Promise)
75
- ], WarehouseMutation.prototype, "createWarehouse", null);
76
- __decorate([
77
- (0, type_graphql_1.Directive)('@privilege(category: "warehouse", privilege: "mutation")'),
78
- (0, type_graphql_1.Directive)('@transaction'),
79
- (0, type_graphql_1.Mutation)(returns => warehouse_1.Warehouse),
80
- __param(0, (0, type_graphql_1.Arg)('id')),
81
- __param(1, (0, type_graphql_1.Arg)('patch')),
82
- __param(2, (0, type_graphql_1.Ctx)()),
83
- __metadata("design:type", Function),
84
- __metadata("design:paramtypes", [String, warehouse_types_1.WarehousePatch, Object]),
85
- __metadata("design:returntype", Promise)
86
- ], WarehouseMutation.prototype, "updateWarehouse", null);
87
- __decorate([
88
- (0, type_graphql_1.Directive)('@privilege(category: "warehouse", privilege: "mutation")'),
89
- (0, type_graphql_1.Directive)('@transaction'),
90
- (0, type_graphql_1.Mutation)(returns => Boolean),
91
- __param(0, (0, type_graphql_1.Arg)('patches', type => [warehouse_types_1.WarehousePatch])),
92
- __param(1, (0, type_graphql_1.Ctx)()),
93
- __metadata("design:type", Function),
94
- __metadata("design:paramtypes", [Array, Object]),
95
- __metadata("design:returntype", Promise)
96
- ], WarehouseMutation.prototype, "updateMultipleWarehouse", null);
97
- __decorate([
98
- (0, type_graphql_1.Directive)('@privilege(category: "warehouse", privilege: "mutation")'),
99
- (0, type_graphql_1.Directive)('@transaction'),
100
- (0, type_graphql_1.Mutation)(returns => Boolean),
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)
106
- ], WarehouseMutation.prototype, "deleteWarehouse", null);
107
- __decorate([
108
- (0, type_graphql_1.Directive)('@privilege(category: "warehouse", privilege: "mutation")'),
109
- (0, type_graphql_1.Directive)('@transaction'),
110
- (0, type_graphql_1.Mutation)(returns => Boolean),
111
- __param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
112
- __param(1, (0, type_graphql_1.Ctx)()),
113
- __metadata("design:type", Function),
114
- __metadata("design:paramtypes", [Array, Object]),
115
- __metadata("design:returntype", Promise)
116
- ], WarehouseMutation.prototype, "deleteWarehouses", null);
117
- WarehouseMutation = __decorate([
118
- (0, type_graphql_1.Resolver)(warehouse_1.Warehouse)
119
- ], WarehouseMutation);
120
- exports.WarehouseMutation = WarehouseMutation;
121
- async function createWarehouse(warehouse, context) {
122
- const { domain, user, tx } = context.state;
123
- const repository = tx.getRepository(warehouse_1.Warehouse);
124
- return await repository.save(Object.assign(Object.assign({}, warehouse), { domain, creator: user, updater: user }));
125
- }
126
- exports.createWarehouse = createWarehouse;
127
- async function updateWarehouse(id, patch, context) {
128
- const { domain, user, tx } = context.state;
129
- const repository = tx.getRepository(warehouse_1.Warehouse);
130
- const warehouse = await repository.findOne(id);
131
- return await repository.save(Object.assign(Object.assign(Object.assign({}, warehouse), patch), { updater: user }));
132
- }
133
- exports.updateWarehouse = updateWarehouse;
134
- async function deleteWarehouse(id, context) {
135
- const { tx } = context.state;
136
- const repository = tx.getRepository(warehouse_1.Warehouse);
137
- await repository.delete(id);
138
- return true;
139
- }
140
- exports.deleteWarehouse = deleteWarehouse;
141
- async function deleteWarehouses(ids, context) {
142
- const { tx } = context.state;
143
- const repository = tx.getRepository(warehouse_1.Warehouse);
144
- await repository.delete(ids);
145
- return true;
146
- }
147
- exports.deleteWarehouses = deleteWarehouses;
148
- //# sourceMappingURL=warehouse-mutation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"warehouse-mutation.js","sourceRoot":"","sources":["../../../server/service/warehouse/warehouse-mutation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,+CAAsE;AAMtE,2CAAuC;AACvC,uDAAgE;AAEhE,sDAA6B;AAGtB,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAItB,AAAN,KAAK,CAAC,eAAe,CAAmB,SAAuB,EAAS,OAAY;QAClF,OAAO,MAAM,eAAe,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;IAClD,CAAC;IAKK,AAAN,KAAK,CAAC,eAAe,CACR,EAAU,EACP,KAAqB,EAC5B,OAAY;QAEnB,OAAO,MAAM,eAAe,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,CAAA;IAClD,CAAC;IAKK,AAAN,KAAK,CAAC,uBAAuB,CACe,OAAyB,EAC5D,OAAY;QAEnB,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,GAAsD,OAAO,CAAC,KAAK,CAAA;QAE7F,KAAK,IAAI,KAAK,IAAI,OAAO,EAAE;YACzB,IAAI,cAAyB,CAAA;YAE7B,cAAc,GAAG,MAAM,EAAE,CAAC,aAAa,CAAC,qBAAS,CAAC,CAAC,OAAO,CAAC;gBACzD,MAAM;gBACN,EAAE,EAAE,KAAK,CAAC,EAAE;aACb,CAAC,CAAA;YAEF,IAAI,CAAC,cAAc,EAAE;gBACnB,MAAM,EAAE,CAAC,aAAa,CAAC,qBAAS,CAAC,CAAC,IAAI,iCAAM,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AAC,EAAU,EAAE,OAAO;IACvD,MAAM,EAAE,EAAE,EAAE,GAA0B,OAAO,CAAC,KAAK,CAAA;IAEnD,MAAM,UAAU,GAA0B,EAAE,CAAC,aAAa,CAAC,qBAAS,CAAC,CAAA;IACrE,MAAM,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;IAC3B,OAAO,IAAI,CAAA;AACb,CAAC;AAND,0CAMC;AAEM,KAAK,UAAU,gBAAgB,CAAC,GAAa,EAAE,OAAY;IAChE,MAAM,EAAE,EAAE,EAAE,GAA0B,OAAO,CAAC,KAAK,CAAA;IAEnD,MAAM,UAAU,GAA0B,EAAE,CAAC,aAAa,CAAC,qBAAS,CAAC,CAAA;IACrE,MAAM,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IAC5B,OAAO,IAAI,CAAA;AACb,CAAC;AAND,4CAMC"}
@@ -1,91 +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.WarehouseQuery = void 0;
17
- const type_graphql_1 = require("type-graphql");
18
- const typeorm_1 = require("typeorm");
19
- const auth_base_1 = require("@things-factory/auth-base");
20
- const shell_1 = require("@things-factory/shell");
21
- const warehouse_1 = require("./warehouse");
22
- const warehouse_types_1 = require("./warehouse-types");
23
- let WarehouseQuery = class WarehouseQuery {
24
- async warehouse(id, context) {
25
- const { domain } = context.state;
26
- return await (0, typeorm_1.getRepository)(warehouse_1.Warehouse).findOne({
27
- where: {
28
- domain: domain,
29
- name
30
- },
31
- relations: ['domain', 'locations', 'creator', 'updater']
32
- });
33
- }
34
- async warehouses(params, context) {
35
- const { domain } = context.state;
36
- const convertedParams = (0, shell_1.convertListParams)(params, domain.id);
37
- const [items, total] = await (0, typeorm_1.getRepository)(warehouse_1.Warehouse).findAndCount(Object.assign(Object.assign({}, convertedParams), { relations: ['domain', 'creator', 'updater'] }));
38
- return { items, total };
39
- }
40
- async domain(warehouse) {
41
- return await (0, typeorm_1.getRepository)(shell_1.Domain).findOne(warehouse.domainId);
42
- }
43
- async updater(warehouse) {
44
- return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(warehouse.updaterId);
45
- }
46
- async creator(warehouse) {
47
- return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(warehouse.creatorId);
48
- }
49
- };
50
- __decorate([
51
- (0, type_graphql_1.Query)(returns => warehouse_1.Warehouse),
52
- __param(0, (0, type_graphql_1.Arg)('id')),
53
- __param(1, (0, type_graphql_1.Ctx)()),
54
- __metadata("design:type", Function),
55
- __metadata("design:paramtypes", [String, Object]),
56
- __metadata("design:returntype", Promise)
57
- ], WarehouseQuery.prototype, "warehouse", null);
58
- __decorate([
59
- (0, type_graphql_1.Query)(returns => warehouse_types_1.WarehouseList),
60
- __param(0, (0, type_graphql_1.Args)()),
61
- __param(1, (0, type_graphql_1.Ctx)()),
62
- __metadata("design:type", Function),
63
- __metadata("design:paramtypes", [typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object, Object]),
64
- __metadata("design:returntype", Promise)
65
- ], WarehouseQuery.prototype, "warehouses", null);
66
- __decorate([
67
- (0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
68
- __param(0, (0, type_graphql_1.Root)()),
69
- __metadata("design:type", Function),
70
- __metadata("design:paramtypes", [warehouse_1.Warehouse]),
71
- __metadata("design:returntype", Promise)
72
- ], WarehouseQuery.prototype, "domain", null);
73
- __decorate([
74
- (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
75
- __param(0, (0, type_graphql_1.Root)()),
76
- __metadata("design:type", Function),
77
- __metadata("design:paramtypes", [warehouse_1.Warehouse]),
78
- __metadata("design:returntype", Promise)
79
- ], WarehouseQuery.prototype, "updater", null);
80
- __decorate([
81
- (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
82
- __param(0, (0, type_graphql_1.Root)()),
83
- __metadata("design:type", Function),
84
- __metadata("design:paramtypes", [warehouse_1.Warehouse]),
85
- __metadata("design:returntype", Promise)
86
- ], WarehouseQuery.prototype, "creator", null);
87
- WarehouseQuery = __decorate([
88
- (0, type_graphql_1.Resolver)(warehouse_1.Warehouse)
89
- ], WarehouseQuery);
90
- exports.WarehouseQuery = WarehouseQuery;
91
- //# sourceMappingURL=warehouse-query.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"warehouse-query.js","sourceRoot":"","sources":["../../../server/service/warehouse/warehouse-query.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAAmF;AACnF,qCAAuC;AAEvC,yDAAgD;AAChD,iDAA4E;AAE5E,2CAAuC;AACvC,uDAAiD;AAG1C,IAAM,cAAc,GAApB,MAAM,cAAc;IAEnB,AAAN,KAAK,CAAC,SAAS,CAAY,EAAU,EAAS,OAAY;QACxD,MAAM,EAAE,MAAM,EAAE,GAAuB,OAAO,CAAC,KAAK,CAAA;QAEpD,OAAO,MAAM,IAAA,uBAAa,EAAC,qBAAS,CAAC,CAAC,OAAO,CAAC;YAC5C,KAAK,EAAE;gBACL,MAAM,EAAE,MAAM;gBACd,IAAI;aACL;YACD,SAAS,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,CAA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AAqB,WAAA,IAAA,kBAAG,GAAE,CAAA;;yDAAjB,iBAAS,oBAAT,iBAAS;;gDASzC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAY,qBAAS;;4CAExC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAY,qBAAS;;6CAEzC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAY,qBAAS;;6CAEzC;AAvCU,cAAc;IAD1B,IAAA,uBAAQ,EAAC,qBAAS,CAAC;GACP,cAAc,CAwC1B;AAxCY,wCAAc"}
@@ -1,82 +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
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.WarehousePatch = exports.WarehouseList = exports.NewWarehouse = void 0;
13
- const type_graphql_1 = require("type-graphql");
14
- const shell_1 = require("@things-factory/shell");
15
- const warehouse_1 = require("./warehouse");
16
- let NewWarehouse = class NewWarehouse {
17
- };
18
- __decorate([
19
- (0, type_graphql_1.Field)({ nullable: true }),
20
- __metadata("design:type", String)
21
- ], NewWarehouse.prototype, "id", void 0);
22
- __decorate([
23
- (0, type_graphql_1.Field)(),
24
- __metadata("design:type", String)
25
- ], NewWarehouse.prototype, "name", void 0);
26
- __decorate([
27
- (0, type_graphql_1.Field)(type => [shell_1.ObjectRef], { nullable: true }),
28
- __metadata("design:type", Array)
29
- ], NewWarehouse.prototype, "locations", void 0);
30
- __decorate([
31
- (0, type_graphql_1.Field)({ nullable: true }),
32
- __metadata("design:type", String)
33
- ], NewWarehouse.prototype, "description", void 0);
34
- NewWarehouse = __decorate([
35
- (0, type_graphql_1.InputType)()
36
- ], NewWarehouse);
37
- exports.NewWarehouse = NewWarehouse;
38
- let WarehouseList = class WarehouseList {
39
- };
40
- __decorate([
41
- (0, type_graphql_1.Field)(type => [warehouse_1.Warehouse], { nullable: true }),
42
- __metadata("design:type", Array)
43
- ], WarehouseList.prototype, "items", void 0);
44
- __decorate([
45
- (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
46
- __metadata("design:type", Number)
47
- ], WarehouseList.prototype, "total", void 0);
48
- WarehouseList = __decorate([
49
- (0, type_graphql_1.ObjectType)()
50
- ], WarehouseList);
51
- exports.WarehouseList = WarehouseList;
52
- let WarehousePatch = class WarehousePatch {
53
- };
54
- __decorate([
55
- (0, type_graphql_1.Field)({ nullable: true }),
56
- __metadata("design:type", String)
57
- ], WarehousePatch.prototype, "id", void 0);
58
- __decorate([
59
- (0, type_graphql_1.Field)({ nullable: true }),
60
- __metadata("design:type", String)
61
- ], WarehousePatch.prototype, "name", void 0);
62
- __decorate([
63
- (0, type_graphql_1.Field)({ nullable: true }),
64
- __metadata("design:type", String)
65
- ], WarehousePatch.prototype, "type", void 0);
66
- __decorate([
67
- (0, type_graphql_1.Field)(type => [shell_1.ObjectRef], { nullable: true }),
68
- __metadata("design:type", Array)
69
- ], WarehousePatch.prototype, "locations", void 0);
70
- __decorate([
71
- (0, type_graphql_1.Field)({ nullable: true }),
72
- __metadata("design:type", String)
73
- ], WarehousePatch.prototype, "description", void 0);
74
- __decorate([
75
- (0, type_graphql_1.Field)({ nullable: true }),
76
- __metadata("design:type", String)
77
- ], WarehousePatch.prototype, "cuFlag", void 0);
78
- WarehousePatch = __decorate([
79
- (0, type_graphql_1.InputType)()
80
- ], WarehousePatch);
81
- exports.WarehousePatch = WarehousePatch;
82
- //# sourceMappingURL=warehouse-types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"warehouse-types.js","sourceRoot":"","sources":["../../../server/service/warehouse/warehouse-types.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAAgE;AAEhE,iDAAiD;AAEjD,2CAAuC;AAGhC,IAAM,YAAY,GAAlB,MAAM,YAAY;CAYxB,CAAA;AAXC;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wCACf;AAEX;IAAC,IAAA,oBAAK,GAAE;;0CACI;AAEZ;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,iBAAS,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACxB;AAEvB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACN;AAXT,YAAY;IADxB,IAAA,wBAAS,GAAE;GACC,YAAY,CAYxB;AAZY,oCAAY;AAelB,IAAM,aAAa,GAAnB,MAAM,aAAa;CAMzB,CAAA;AALC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,qBAAS,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CAC5B;AAEnB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACzB;AALH,aAAa;IADzB,IAAA,yBAAU,GAAE;GACA,aAAa,CAMzB;AANY,sCAAa;AASnB,IAAM,cAAc,GAApB,MAAM,cAAc;CAkB1B,CAAA;AAjBC;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CACf;AAEX;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACb;AAEb;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACb;AAEb;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,iBAAS,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACxB;AAEvB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACN;AAEpB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACX;AAjBJ,cAAc;IAD1B,IAAA,wBAAS,GAAE;GACC,cAAc,CAkB1B;AAlBY,wCAAc"}
@@ -1,114 +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;
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.Warehouse = 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 biz_base_1 = require("@things-factory/biz-base");
18
- const shell_1 = require("@things-factory/shell");
19
- const location_1 = require("../location/location");
20
- let Warehouse = class Warehouse {
21
- constructor(obj) {
22
- if (obj) {
23
- this.id = obj.warehouse_id;
24
- this.name = obj.warehouse_name;
25
- this.locations = obj.warehouse_locations;
26
- this.type = obj.warehouse_type;
27
- this.description = obj.warehouse_description;
28
- this.createdAt = obj.warehouse_created_at;
29
- this.updatedAt = obj.warehouse_updated_at;
30
- }
31
- }
32
- };
33
- __decorate([
34
- (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
35
- (0, type_graphql_1.Field)(type => type_graphql_1.ID),
36
- __metadata("design:type", String)
37
- ], Warehouse.prototype, "id", void 0);
38
- __decorate([
39
- (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
40
- (0, type_graphql_1.Field)(),
41
- __metadata("design:type", typeof (_a = typeof shell_1.Domain !== "undefined" && shell_1.Domain) === "function" ? _a : Object)
42
- ], Warehouse.prototype, "domain", void 0);
43
- __decorate([
44
- (0, typeorm_1.RelationId)((warehouse) => warehouse.domain),
45
- __metadata("design:type", String)
46
- ], Warehouse.prototype, "domainId", void 0);
47
- __decorate([
48
- (0, typeorm_1.ManyToOne)(type => biz_base_1.Bizplace),
49
- (0, type_graphql_1.Field)(),
50
- __metadata("design:type", typeof (_b = typeof biz_base_1.Bizplace !== "undefined" && biz_base_1.Bizplace) === "function" ? _b : Object)
51
- ], Warehouse.prototype, "bizplace", void 0);
52
- __decorate([
53
- (0, typeorm_1.Column)(),
54
- (0, type_graphql_1.Field)(),
55
- __metadata("design:type", String)
56
- ], Warehouse.prototype, "name", void 0);
57
- __decorate([
58
- (0, typeorm_1.OneToMany)(type => location_1.Location, location => location.warehouse),
59
- (0, type_graphql_1.Field)(type => [location_1.Location]),
60
- __metadata("design:type", Array)
61
- ], Warehouse.prototype, "locations", void 0);
62
- __decorate([
63
- (0, typeorm_1.Column)(),
64
- (0, type_graphql_1.Field)(),
65
- __metadata("design:type", String)
66
- ], Warehouse.prototype, "type", void 0);
67
- __decorate([
68
- (0, typeorm_1.Column)({
69
- nullable: true
70
- }),
71
- (0, type_graphql_1.Field)({ nullable: true }),
72
- __metadata("design:type", String)
73
- ], Warehouse.prototype, "description", void 0);
74
- __decorate([
75
- (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
76
- nullable: true
77
- }),
78
- (0, type_graphql_1.Field)({ nullable: true }),
79
- __metadata("design:type", typeof (_c = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _c : Object)
80
- ], Warehouse.prototype, "creator", void 0);
81
- __decorate([
82
- (0, typeorm_1.RelationId)((warehouse) => warehouse.creator),
83
- __metadata("design:type", String)
84
- ], Warehouse.prototype, "creatorId", void 0);
85
- __decorate([
86
- (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
87
- nullable: true
88
- }),
89
- (0, type_graphql_1.Field)({ nullable: true }),
90
- __metadata("design:type", typeof (_d = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _d : Object)
91
- ], Warehouse.prototype, "updater", void 0);
92
- __decorate([
93
- (0, typeorm_1.RelationId)((warehouse) => warehouse.updater),
94
- __metadata("design:type", String)
95
- ], Warehouse.prototype, "updaterId", void 0);
96
- __decorate([
97
- (0, typeorm_1.CreateDateColumn)(),
98
- (0, type_graphql_1.Field)({ nullable: true }),
99
- __metadata("design:type", Date)
100
- ], Warehouse.prototype, "createdAt", void 0);
101
- __decorate([
102
- (0, typeorm_1.UpdateDateColumn)(),
103
- (0, type_graphql_1.Field)({ nullable: true }),
104
- __metadata("design:type", Date)
105
- ], Warehouse.prototype, "updatedAt", void 0);
106
- Warehouse = __decorate([
107
- (0, typeorm_1.Entity)(),
108
- (0, typeorm_1.Index)('ix_warehouse_0', (warehouse) => [warehouse.domain, warehouse.name], { unique: true }),
109
- (0, typeorm_1.Index)('ix_warehouse_1', (warehouse) => [warehouse.domain, warehouse.id], { unique: true }),
110
- (0, type_graphql_1.ObjectType)(),
111
- __metadata("design:paramtypes", [Object])
112
- ], Warehouse);
113
- exports.Warehouse = Warehouse;
114
- //# sourceMappingURL=warehouse.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"warehouse.js","sourceRoot":"","sources":["../../../server/service/warehouse/warehouse.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,+CAAoD;AACpD,qCAUgB;AAEhB,yDAAgD;AAChD,uDAAmD;AACnD,iDAA8C;AAE9C,mDAA+C;AAMxC,IAAM,SAAS,GAAf,MAAM,SAAS;IA4DpB,YAAY,GAAI;QACd,IAAI,GAAG,EAAE;YACP,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC,YAAY,CAAA;YAC1B,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,cAAc,CAAA;YAC9B,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC,mBAAmB,CAAA;YACxC,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,cAAc,CAAA;YAC9B,IAAI,CAAC,WAAW,GAAG,GAAG,CAAC,qBAAqB,CAAA;YAC5C,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC,oBAAoB,CAAA;YACzC,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC,oBAAoB,CAAA;SAC1C;IACH,CAAC;CACF,CAAA;AAtEC;IAAC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;qCACR;AAEV;IAAC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,GAAE;kDACA,cAAM,oBAAN,cAAM;yCAAA;AAEd;IAAC,IAAA,oBAAU,EAAC,CAAC,SAAoB,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC;;2CACvC;AAEhB;IAAC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,mBAAQ,CAAC;IAC3B,IAAA,oBAAK,GAAE;kDACE,mBAAQ,oBAAR,mBAAQ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AA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACf,IAAI;4CAAA;AA1DJ,SAAS;IAJrB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,gBAAgB,EAAE,CAAC,SAAoB,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvG,IAAA,eAAK,EAAC,gBAAgB,EAAE,CAAC,SAAoB,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACrG,IAAA,yBAAU,GAAE;;GACA,SAAS,CAuErB;AAvEY,8BAAS"}
@@ -1,61 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DateTimeDifference = exports.DateTimeConverter = exports.DateGenerator = void 0;
4
- class DateGenerator {
5
- static generateDate() {
6
- const today = new Date();
7
- const year = today.getFullYear();
8
- const month = today.getMonth();
9
- const day = today.getDate();
10
- const yy = String(year).substr(String(year).length - 2);
11
- const mm = String(month + 1).padStart(2, '0');
12
- const dd = String(day).padStart(2, '0');
13
- return yy + mm + dd;
14
- }
15
- }
16
- exports.DateGenerator = DateGenerator;
17
- class DateTimeConverter {
18
- static date(dateTime) {
19
- let unloadDate = '';
20
- if (dateTime) {
21
- const unloadDateTime = new Date(dateTime);
22
- var year = unloadDateTime.getFullYear();
23
- var month = (1 + unloadDateTime.getMonth()).toString();
24
- month = month.length > 1 ? month : '0' + month;
25
- var day = unloadDateTime.getDate().toString();
26
- day = day.length > 1 ? day : '0' + day;
27
- unloadDate = day + '-' + month + '-' + year;
28
- }
29
- return unloadDate;
30
- }
31
- static datetime(dateTime, timezone) {
32
- let unloadDate = '';
33
- if (dateTime) {
34
- const datetime = Number(dateTime);
35
- const timezoneOffset = timezone * 60000;
36
- const newUnloadDate = new Date(datetime - timezoneOffset).toISOString().slice(0, -1);
37
- var dateTimeParts = newUnloadDate.split('T');
38
- //handle date parts
39
- var dateParts = dateTimeParts[0].split('-');
40
- var newDate = DateTimeConverter.date(dateParts);
41
- //handle time part
42
- var timeParts = dateTimeParts[1].slice(0, -7);
43
- unloadDate = newDate + ' ' + timeParts;
44
- }
45
- return unloadDate;
46
- }
47
- }
48
- exports.DateTimeConverter = DateTimeConverter;
49
- class DateTimeDifference {
50
- static timeDifferenceInSeconds(prevDateTime, curDateTime) {
51
- let diffInSeconds = '';
52
- if (prevDateTime && curDateTime) {
53
- let dateA = new Date(prevDateTime);
54
- let dateB = new Date(curDateTime);
55
- diffInSeconds = (dateB.getTime() - dateA.getTime()) / 1000;
56
- }
57
- return diffInSeconds;
58
- }
59
- }
60
- exports.DateTimeDifference = DateTimeDifference;
61
- //# sourceMappingURL=datetime-util.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"datetime-util.js","sourceRoot":"","sources":["../../server/utils/datetime-util.ts"],"names":[],"mappings":";;;AAAA,MAAa,aAAa;IACxB,MAAM,CAAC,YAAY;QACjB,MAAM,KAAK,GAAG,IAAI,IAAI,EAAE,CAAA;QACxB,MAAM,IAAI,GAAG,KAAK,CAAC,WAAW,EAAE,CAAA;QAChC,MAAM,KAAK,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAA;QAC9B,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,EAAE,CAAA;QAE3B,MAAM,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;QACvD,MAAM,EAAE,GAAG,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;QAC7C,MAAM,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,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Aa,GAAQ,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;YAEjD,mBAAmB;YACnB,IAAI,SAAS,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;YAC3C,IAAI,OAAO,GAAG,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;YAE/C,kBAAkB;YAClB,IAAI,SAAS,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;YAE7C,UAAU,GAAG,OAAO,GAAG,GAAG,GAAG,SAAS,CAAA;SACvC;QACD,OAAO,UAAU,CAAA;IACnB,CAAC;CACF;AAtCD,8CAsCC;AAED,MAAa,kBAAkB;IAC7B,MAAM,CAAC,uBAAuB,CAAC,YAAY,EAAE,WAAW;QACtD,IAAI,aAAa,GAAQ,EAAE,CAAA;QAC3B,IAAI,YAAY,IAAI,WAAW,EAAE;YAC/B,IAAI,KAAK,GAAQ,IAAI,IAAI,CAAC,YAAY,CAAC,CAAA;YACvC,IAAI,KAAK,GAAQ,IAAI,IAAI,CAAC,WAAW,CAAC,CAAA;YAEtC,aAAa,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,KAAK,CAAC,OAAO,EAAE,CAAC,GAAG,IAAI,CAAA;SAC3D;QAED,OAAO,aAAa,CAAA;IACtB,CAAC;CACF;AAZD,gDAYC"}
@@ -1,20 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./inventory-no-generator"), exports);
18
- __exportStar(require("./inventory-util"), exports);
19
- __exportStar(require("./datetime-util"), exports);
20
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAwC;AACxC,mDAAgC;AAChC,kDAA+B"}
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.InventoryNoGenerator = void 0;
4
- const uuid_1 = require("uuid");
5
- class InventoryNoGenerator {
6
- static inventoryName() {
7
- return (0, uuid_1.v4)();
8
- }
9
- static inventoryHistoryName() {
10
- return (0, uuid_1.v4)();
11
- }
12
- static inventoryItemName() {
13
- return (0, uuid_1.v4)();
14
- }
15
- }
16
- exports.InventoryNoGenerator = InventoryNoGenerator;
17
- //# sourceMappingURL=inventory-no-generator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inventory-no-generator.js","sourceRoot":"","sources":["../../server/utils/inventory-no-generator.ts"],"names":[],"mappings":";;;AAAA,+BAAmC;AAEnC,MAAa,oBAAoB;IAC/B,MAAM,CAAC,aAAa;QAClB,OAAO,IAAA,SAAM,GAAE,CAAA;IACjB,CAAC;IAED,MAAM,CAAC,oBAAoB;QACzB,OAAO,IAAA,SAAM,GAAE,CAAA;IACjB,CAAC;IAED,MAAM,CAAC,iBAAiB;QACtB,OAAO,IAAA,SAAM,GAAE,CAAA;IACjB,CAAC;CACF;AAZD,oDAYC"}