@things-factory/warehouse-base 4.1.29 → 4.1.34

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 (40) hide show
  1. package/dist-server/constants/inventory.js +8 -2
  2. package/dist-server/constants/inventory.js.map +1 -1
  3. package/dist-server/service/index.js +5 -0
  4. package/dist-server/service/index.js.map +1 -1
  5. package/dist-server/service/inventory-item/index.js +9 -0
  6. package/dist-server/service/inventory-item/index.js.map +1 -0
  7. package/dist-server/service/inventory-item/inventory-item-mutation.js +207 -0
  8. package/dist-server/service/inventory-item/inventory-item-mutation.js.map +1 -0
  9. package/dist-server/service/inventory-item/inventory-item-query.js +150 -0
  10. package/dist-server/service/inventory-item/inventory-item-query.js.map +1 -0
  11. package/dist-server/service/inventory-item/inventory-item-type.js +115 -0
  12. package/dist-server/service/inventory-item/inventory-item-type.js.map +1 -0
  13. package/dist-server/service/inventory-item/inventory-item.js +124 -0
  14. package/dist-server/service/inventory-item/inventory-item.js.map +1 -0
  15. package/dist-server/service/inventory-product/index.js +9 -0
  16. package/dist-server/service/inventory-product/index.js.map +1 -0
  17. package/dist-server/service/inventory-product/inventory-product-mutation.js +120 -0
  18. package/dist-server/service/inventory-product/inventory-product-mutation.js.map +1 -0
  19. package/dist-server/service/inventory-product/inventory-product-query.js +87 -0
  20. package/dist-server/service/inventory-product/inventory-product-query.js.map +1 -0
  21. package/dist-server/service/inventory-product/inventory-product-type.js +95 -0
  22. package/dist-server/service/inventory-product/inventory-product-type.js.map +1 -0
  23. package/dist-server/service/inventory-product/inventory-product.js +107 -0
  24. package/dist-server/service/inventory-product/inventory-product.js.map +1 -0
  25. package/dist-server/utils/inventory-no-generator.js +3 -0
  26. package/dist-server/utils/inventory-no-generator.js.map +1 -1
  27. package/package.json +5 -5
  28. package/server/constants/inventory.ts +8 -1
  29. package/server/service/index.ts +5 -0
  30. package/server/service/inventory-item/index.ts +6 -0
  31. package/server/service/inventory-item/inventory-item-mutation.ts +210 -0
  32. package/server/service/inventory-item/inventory-item-query.ts +118 -0
  33. package/server/service/inventory-item/inventory-item-type.ts +74 -0
  34. package/server/service/inventory-item/inventory-item.ts +99 -0
  35. package/server/service/inventory-product/index.ts +6 -0
  36. package/server/service/inventory-product/inventory-product-mutation.ts +112 -0
  37. package/server/service/inventory-product/inventory-product-query.ts +43 -0
  38. package/server/service/inventory-product/inventory-product-type.ts +59 -0
  39. package/server/service/inventory-product/inventory-product.ts +88 -0
  40. package/server/utils/inventory-no-generator.ts +4 -0
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.INVENTORY_TRANSACTION_TYPE = exports.INVENTORY_TYPES = exports.INVENTORY_STATUS = void 0;
3
+ exports.INVENTORY_ITEM_SOURCE = exports.INVENTORY_TRANSACTION_TYPE = exports.INVENTORY_TYPES = exports.INVENTORY_STATUS = void 0;
4
4
  exports.INVENTORY_STATUS = {
5
5
  UNLOADED: 'UNLOADED',
6
6
  PARTIALLY_UNLOADED: 'PARTIALLY_UNLOADED',
@@ -12,7 +12,8 @@ exports.INVENTORY_STATUS = {
12
12
  TRANSFERED: 'TRANSFERED',
13
13
  DELETED: 'DELETED',
14
14
  CHECKED: 'CHECKED',
15
- PICKED: 'PICKED'
15
+ PICKED: 'PICKED',
16
+ PICKING: 'PICKING'
16
17
  };
17
18
  exports.INVENTORY_TYPES = {
18
19
  BUFFER: 'BUFFER',
@@ -50,4 +51,9 @@ exports.INVENTORY_TRANSACTION_TYPE = {
50
51
  UNDO_REVERSE_KITTING: 'UNDO_REVERSE_KITTING',
51
52
  DIRECT_DEDUCTION: 'DIRECT_DEDUCTION'
52
53
  };
54
+ exports.INVENTORY_ITEM_SOURCE = {
55
+ INBOUND: 'INBOUND',
56
+ OUTBOUND: 'OUTBOUND',
57
+ ADJUSTMENT: 'ADJUSTMENT'
58
+ };
53
59
  //# sourceMappingURL=inventory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"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AU;IACpB,eAAe,EAAE,iBAAiB;IAClC,oBAAoB,EAAE,sBAAsB;IAC5C,gBAAgB,EAAE,kBAAkB;CACrC,CAAA;AAEY,QAAA,qBAAqB,GAAG;IACnC,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,UAAU;IACpB,UAAU,EAAE,YAAY;CACzB,CAAA"}
@@ -14,6 +14,7 @@ exports.schema = exports.entities = void 0;
14
14
  const inventory_1 = require("./inventory");
15
15
  const inventory_change_1 = require("./inventory-change");
16
16
  const inventory_history_1 = require("./inventory-history");
17
+ const inventory_item_1 = require("./inventory-item");
17
18
  const location_1 = require("./location");
18
19
  const movement_1 = require("./movement");
19
20
  const pallet_1 = require("./pallet");
@@ -22,6 +23,7 @@ const pallet_history_1 = require("./pallet-history");
22
23
  const reduced_inventory_history_1 = require("./reduced-inventory-history");
23
24
  const warehouse_1 = require("./warehouse");
24
25
  /* EXPORT ENTITY TYPES */
26
+ __exportStar(require("./inventory-item/inventory-item"), exports);
25
27
  __exportStar(require("./inventory/inventory"), exports);
26
28
  __exportStar(require("./inventory-change/inventory-change"), exports);
27
29
  __exportStar(require("./inventory-history/inventory-history"), exports);
@@ -35,6 +37,7 @@ __exportStar(require("./reduced-inventory-history/reduced-inventory-history"), e
35
37
  /* EXPORT TYPES */
36
38
  __exportStar(require("./inventory/inventory-types"), exports);
37
39
  __exportStar(require("./inventory/inventory-types"), exports);
40
+ __exportStar(require("./inventory-item/inventory-item"), exports);
38
41
  __exportStar(require("./inventory-change/inventory-change-types"), exports);
39
42
  __exportStar(require("./inventory-history/inventory-history-types"), exports);
40
43
  __exportStar(require("./location/location-types"), exports);
@@ -47,6 +50,7 @@ exports.entities = [
47
50
  ...inventory_1.entities,
48
51
  ...inventory_change_1.entities,
49
52
  ...inventory_history_1.entities,
53
+ ...inventory_item_1.entities,
50
54
  ...location_1.entities,
51
55
  ...movement_1.entities,
52
56
  ...pallet_1.entities,
@@ -60,6 +64,7 @@ exports.schema = {
60
64
  ...inventory_1.resolvers,
61
65
  ...inventory_change_1.resolvers,
62
66
  ...inventory_history_1.resolvers,
67
+ ...inventory_item_1.resolvers,
63
68
  ...location_1.resolvers,
64
69
  ...movement_1.resolvers,
65
70
  ...pallet_1.resolvers,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAA4F;AAC5F,yDAA+G;AAC/G,2DAAkH;AAClH,yCAAyF;AACzF,yCAAyF;AACzF,qCAAmF;AACnF,iDAAmG;AACnG,qDAAyG;AACzG,2EAAyF;AACzF,2CAA4F;AAE5F,yBAAyB;AACzB,wDAAqC;AACrC,sEAAmD;AACnD,wEAAqD;AACrD,sDAAmC;AACnC,sDAAmC;AACnC,kDAA+B;AAC/B,8DAA2C;AAC3C,kEAA+C;AAC/C,wDAAqC;AACrC,wFAAqE;AAErE,kBAAkB;AAClB,8DAA2C;AAC3C,8DAA2C;AAC3C,4EAAyD;AACzD,8EAA2D;AAC3D,4DAAyC;AACzC,4DAAyC;AACzC,wDAAqC;AACrC,oEAAiD;AACjD,wEAAqD;AACrD,8DAA2C;AAE9B,QAAA,QAAQ,GAAG;IACtB,GAAG,oBAAiB;IACpB,GAAG,2BAAuB;IAC1B,GAAG,4BAAwB;IAC3B,GAAG,mBAAgB;IACnB,GAAG,mBAAgB;IACnB,GAAG,iBAAc;IACjB,GAAG,uBAAmB;IACtB,GAAG,yBAAqB;IACxB,GAAG,oBAAiB;IACpB,GAAG,oCAA+B;CACnC,CAAA;AAEY,QAAA,MAAM,GAAG;IACpB,eAAe,EAAE;QACf,GAAG,qBAAkB;QACrB,GAAG,4BAAwB;QAC3B,GAAG,6BAAyB;QAC5B,GAAG,oBAAiB;QACpB,GAAG,oBAAiB;QACpB,GAAG,kBAAe;QAClB,GAAG,wBAAoB;QACvB,GAAG,0BAAsB;QACzB,GAAG,qBAAkB;KACtB;CACF,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAA4F;AAC5F,yDAA+G;AAC/G,2DAAkH;AAClH,qDAAyG;AACzG,yCAAyF;AACzF,yCAAyF;AACzF,qCAAmF;AACnF,iDAAmG;AACnG,qDAAyG;AACzG,2EAAyF;AACzF,2CAA4F;AAE5F,yBAAyB;AACzB,kEAA+C;AAC/C,wDAAqC;AACrC,sEAAmD;AACnD,wEAAqD;AACrD,sDAAmC;AACnC,sDAAmC;AACnC,kDAA+B;AAC/B,8DAA2C;AAC3C,kEAA+C;AAC/C,wDAAqC;AACrC,wFAAqE;AAErE,kBAAkB;AAClB,8DAA2C;AAC3C,8DAA2C;AAC3C,kEAA+C;AAC/C,4EAAyD;AACzD,8EAA2D;AAC3D,4DAAyC;AACzC,4DAAyC;AACzC,wDAAqC;AACrC,oEAAiD;AACjD,wEAAqD;AACrD,8DAA2C;AAE9B,QAAA,QAAQ,GAAG;IACtB,GAAG,oBAAiB;IACpB,GAAG,2BAAuB;IAC1B,GAAG,4BAAwB;IAC3B,GAAG,yBAAqB;IACxB,GAAG,mBAAgB;IACnB,GAAG,mBAAgB;IACnB,GAAG,iBAAc;IACjB,GAAG,uBAAmB;IACtB,GAAG,yBAAqB;IACxB,GAAG,oBAAiB;IACpB,GAAG,oCAA+B;CACnC,CAAA;AAEY,QAAA,MAAM,GAAG;IACpB,eAAe,EAAE;QACf,GAAG,qBAAkB;QACrB,GAAG,4BAAwB;QAC3B,GAAG,6BAAyB;QAC5B,GAAG,0BAAsB;QACzB,GAAG,oBAAiB;QACpB,GAAG,oBAAiB;QACpB,GAAG,kBAAe;QAClB,GAAG,wBAAoB;QACvB,GAAG,0BAAsB;QACzB,GAAG,qBAAkB;KACtB;CACF,CAAA"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolvers = exports.entities = void 0;
4
+ const inventory_item_1 = require("./inventory-item");
5
+ const inventory_item_mutation_1 = require("./inventory-item-mutation");
6
+ const inventory_item_query_1 = require("./inventory-item-query");
7
+ exports.entities = [inventory_item_1.InventoryItem];
8
+ exports.resolvers = [inventory_item_query_1.InventoryItemQuery, inventory_item_mutation_1.InventoryItemMutation];
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/inventory-item/index.ts"],"names":[],"mappings":";;;AAAA,qDAAgD;AAChD,uEAAiE;AACjE,iEAA2D;AAE9C,QAAA,QAAQ,GAAG,CAAC,8BAAa,CAAC,CAAA;AAC1B,QAAA,SAAS,GAAG,CAAC,yCAAkB,EAAE,+CAAqB,CAAC,CAAA"}
@@ -0,0 +1,207 @@
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.InventoryItemMutation = void 0;
16
+ const type_graphql_1 = require("type-graphql");
17
+ const typeorm_1 = require("typeorm");
18
+ const constants_1 = require("../../constants");
19
+ const utils_1 = require("../../utils");
20
+ const inventory_item_1 = require("./inventory-item");
21
+ const inventory_item_type_1 = require("./inventory-item-type");
22
+ let InventoryItemMutation = class InventoryItemMutation {
23
+ async createInventoryItem(inventoryItem, context) {
24
+ const { domain, user, tx } = context.state;
25
+ return await tx.getRepository(inventory_item_1.InventoryItem).save(Object.assign(Object.assign({}, inventoryItem), { domain, creator: user, updater: user }));
26
+ }
27
+ async updateInventoryItem(id, patch, context) {
28
+ const { domain, user, tx } = context.state;
29
+ const repository = tx.getRepository(inventory_item_1.InventoryItem);
30
+ const inventoryItem = await repository.findOne({
31
+ where: { domain, id }
32
+ });
33
+ return await repository.save(Object.assign(Object.assign(Object.assign({}, inventoryItem), patch), { updater: user }));
34
+ }
35
+ async updateInventoryItemSerialNumber(id, serialNumber, context) {
36
+ try {
37
+ const { domain, user, tx } = context.state;
38
+ const repository = tx.getRepository(inventory_item_1.InventoryItem);
39
+ const inventoryItem = await repository.findOne({
40
+ where: { domain, id },
41
+ relations: ['product']
42
+ });
43
+ const product = inventoryItem.product;
44
+ const duplicatedSerialNumberCnt = await repository.count({
45
+ domain,
46
+ product,
47
+ serialNumber
48
+ });
49
+ if (duplicatedSerialNumberCnt)
50
+ throw new Error(`Serial Number ${serialNumber} is duplicated`);
51
+ await repository.update({ id }, { serialNumber, updater: user });
52
+ return true;
53
+ }
54
+ catch (error) {
55
+ throw error;
56
+ }
57
+ }
58
+ async updateMultipleInventoryItem(patches, context) {
59
+ const { domain, user, tx } = context.state;
60
+ let results = [];
61
+ const _createRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === '+');
62
+ const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
63
+ const inventoryItemRepo = tx.getRepository(inventory_item_1.InventoryItem);
64
+ if (_createRecords.length > 0) {
65
+ for (let i = 0; i < _createRecords.length; i++) {
66
+ const newRecord = _createRecords[i];
67
+ const result = await inventoryItemRepo.save(Object.assign(Object.assign({}, newRecord), { domain, creator: user, updater: user }));
68
+ results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
69
+ }
70
+ }
71
+ if (_updateRecords.length > 0) {
72
+ for (let i = 0; i < _updateRecords.length; i++) {
73
+ const newRecord = _updateRecords[i];
74
+ const inventoryItem = await inventoryItemRepo.findOne(newRecord.id);
75
+ const result = await inventoryItemRepo.save(Object.assign(Object.assign(Object.assign({}, inventoryItem), newRecord), { updater: user }));
76
+ results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
77
+ }
78
+ }
79
+ return results;
80
+ }
81
+ async deleteInventoryItem(id, context) {
82
+ const { domain, tx } = context.state;
83
+ await tx.getRepository(inventory_item_1.InventoryItem).delete({ domain, id });
84
+ return true;
85
+ }
86
+ async deleteInventoryItems(ids, context) {
87
+ const { domain, tx } = context.state;
88
+ await tx.getRepository(inventory_item_1.InventoryItem).delete({
89
+ domain,
90
+ id: (0, typeorm_1.In)(ids)
91
+ });
92
+ return true;
93
+ }
94
+ async replacePickedInventoryItem(selectedSerialNumber, newSerialNumber, context) {
95
+ var _a, _b;
96
+ const { domain, user, tx } = context.state;
97
+ const repository = tx.getRepository(inventory_item_1.InventoryItem);
98
+ const foundSerialNumber = await repository.findOne({
99
+ where: { domain, serialNumber: newSerialNumber }
100
+ });
101
+ await repository.update({
102
+ domain,
103
+ id: selectedSerialNumber.id
104
+ }, {
105
+ status: constants_1.INVENTORY_STATUS.STORED,
106
+ outboundOrderId: null,
107
+ updater: user
108
+ });
109
+ if (foundSerialNumber) {
110
+ if (foundSerialNumber.productId !== ((_a = selectedSerialNumber.product) === null || _a === void 0 ? void 0 : _a.id)) {
111
+ throw new Error('Invalid Serial Number');
112
+ }
113
+ if (foundSerialNumber.inventoryId !== ((_b = selectedSerialNumber.inventory) === null || _b === void 0 ? void 0 : _b.id)) {
114
+ throw new Error('Serial Number Registered Under Different Inventory');
115
+ }
116
+ if (foundSerialNumber.status !== constants_1.INVENTORY_STATUS.STORED) {
117
+ throw new Error('Inventory Item is not available');
118
+ }
119
+ foundSerialNumber.status = constants_1.INVENTORY_STATUS.PICKED;
120
+ foundSerialNumber.updater = user;
121
+ foundSerialNumber.outboundOrderId = selectedSerialNumber.outboundOrderId;
122
+ return await repository.save(foundSerialNumber);
123
+ }
124
+ else {
125
+ let inventoryItem = new inventory_item_1.InventoryItem();
126
+ inventoryItem.name = utils_1.InventoryNoGenerator.inventoryItemName();
127
+ inventoryItem.serialNumber = newSerialNumber;
128
+ inventoryItem.status = constants_1.INVENTORY_STATUS.PICKED;
129
+ inventoryItem.outboundOrderId = selectedSerialNumber.outboundOrderId;
130
+ inventoryItem.product = selectedSerialNumber.product;
131
+ inventoryItem.inventory = selectedSerialNumber.inventory;
132
+ inventoryItem.domain = domain;
133
+ return await repository.save(inventoryItem);
134
+ }
135
+ }
136
+ };
137
+ __decorate([
138
+ (0, type_graphql_1.Directive)('@transaction'),
139
+ (0, type_graphql_1.Mutation)(returns => inventory_item_1.InventoryItem, { description: 'To create new InventoryItem' }),
140
+ __param(0, (0, type_graphql_1.Arg)('inventoryItem')),
141
+ __param(1, (0, type_graphql_1.Ctx)()),
142
+ __metadata("design:type", Function),
143
+ __metadata("design:paramtypes", [inventory_item_type_1.NewInventoryItem, Object]),
144
+ __metadata("design:returntype", Promise)
145
+ ], InventoryItemMutation.prototype, "createInventoryItem", null);
146
+ __decorate([
147
+ (0, type_graphql_1.Directive)('@transaction'),
148
+ (0, type_graphql_1.Mutation)(returns => inventory_item_1.InventoryItem, { description: 'To modify InventoryItem information' }),
149
+ __param(0, (0, type_graphql_1.Arg)('id')),
150
+ __param(1, (0, type_graphql_1.Arg)('patch')),
151
+ __param(2, (0, type_graphql_1.Ctx)()),
152
+ __metadata("design:type", Function),
153
+ __metadata("design:paramtypes", [String, inventory_item_type_1.InventoryItemPatch, Object]),
154
+ __metadata("design:returntype", Promise)
155
+ ], InventoryItemMutation.prototype, "updateInventoryItem", null);
156
+ __decorate([
157
+ (0, type_graphql_1.Directive)('@transaction'),
158
+ (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To modify InventoryItem serial number' }),
159
+ __param(0, (0, type_graphql_1.Arg)('id')),
160
+ __param(1, (0, type_graphql_1.Arg)('serialNumber')),
161
+ __param(2, (0, type_graphql_1.Ctx)()),
162
+ __metadata("design:type", Function),
163
+ __metadata("design:paramtypes", [String, String, Object]),
164
+ __metadata("design:returntype", Promise)
165
+ ], InventoryItemMutation.prototype, "updateInventoryItemSerialNumber", null);
166
+ __decorate([
167
+ (0, type_graphql_1.Directive)('@transaction'),
168
+ (0, type_graphql_1.Mutation)(returns => [inventory_item_1.InventoryItem], { description: "To modify multiple InventoryItems' information" }),
169
+ __param(0, (0, type_graphql_1.Arg)('patches', type => [inventory_item_type_1.InventoryItemPatch])),
170
+ __param(1, (0, type_graphql_1.Ctx)()),
171
+ __metadata("design:type", Function),
172
+ __metadata("design:paramtypes", [Array, Object]),
173
+ __metadata("design:returntype", Promise)
174
+ ], InventoryItemMutation.prototype, "updateMultipleInventoryItem", null);
175
+ __decorate([
176
+ (0, type_graphql_1.Directive)('@transaction'),
177
+ (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete InventoryItem' }),
178
+ __param(0, (0, type_graphql_1.Arg)('id')),
179
+ __param(1, (0, type_graphql_1.Ctx)()),
180
+ __metadata("design:type", Function),
181
+ __metadata("design:paramtypes", [String, Object]),
182
+ __metadata("design:returntype", Promise)
183
+ ], InventoryItemMutation.prototype, "deleteInventoryItem", null);
184
+ __decorate([
185
+ (0, type_graphql_1.Directive)('@transaction'),
186
+ (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple inventoryItems' }),
187
+ __param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
188
+ __param(1, (0, type_graphql_1.Ctx)()),
189
+ __metadata("design:type", Function),
190
+ __metadata("design:paramtypes", [Array, Object]),
191
+ __metadata("design:returntype", Promise)
192
+ ], InventoryItemMutation.prototype, "deleteInventoryItems", null);
193
+ __decorate([
194
+ (0, type_graphql_1.Directive)('@transaction'),
195
+ (0, type_graphql_1.Mutation)(returns => inventory_item_1.InventoryItem, { description: 'To update picked InventoryItem with new IventoryItem' }),
196
+ __param(0, (0, type_graphql_1.Arg)('selectedSerialNumber')),
197
+ __param(1, (0, type_graphql_1.Arg)('newSerialNumber')),
198
+ __param(2, (0, type_graphql_1.Ctx)()),
199
+ __metadata("design:type", Function),
200
+ __metadata("design:paramtypes", [inventory_item_type_1.InventoryItemPatch, String, Object]),
201
+ __metadata("design:returntype", Promise)
202
+ ], InventoryItemMutation.prototype, "replacePickedInventoryItem", null);
203
+ InventoryItemMutation = __decorate([
204
+ (0, type_graphql_1.Resolver)(inventory_item_1.InventoryItem)
205
+ ], InventoryItemMutation);
206
+ exports.InventoryItemMutation = InventoryItemMutation;
207
+ //# sourceMappingURL=inventory-item-mutation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inventory-item-mutation.js","sourceRoot":"","sources":["../../../server/service/inventory-item/inventory-item-mutation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAAsE;AACtE,qCAA4B;AAI5B,+CAAkD;AAClD,uCAAkD;AAClD,qDAAgD;AAChD,+DAA4E;AAG5E,IAAa,qBAAqB,GAAlC,MAAa,qBAAqB;IAGhC,KAAK,CAAC,mBAAmB,CACD,aAA+B,EAC9C,OAAY;QAEnB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,OAAO,MAAM,EAAE,CAAC,aAAa,CAAC,8BAAa,CAAC,CAAC,IAAI,iCAC5C,aAAa,KAChB,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;IACJ,CAAC;IAID,KAAK,CAAC,mBAAmB,CACZ,EAAU,EACP,KAAyB,EAChC,OAAY;QAEnB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,UAAU,GAAG,EAAE,CAAC,aAAa,CAAC,8BAAa,CAAC,CAAA;QAClD,MAAM,aAAa,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC;YAC7C,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AAA,IAAA,kBAAG,GAAE,CAAA;;;;gEAMtD;AAID;IAFC,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,mCAAmC,EAAE,CAAC;IACvD,WAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAAiB,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;iEAS7E;AAID;IAFC,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,8BAAa,EAAE,EAAE,WAAW,EAAE,sDAAsD,EAAE,CAAC;IAEzG,WAAA,IAAA,kBAAG,EAAC,sBAAsB,CAAC,CAAA;IAC3B,WAAA,IAAA,kBAAG,EAAC,iBAAiB,CAAC,CAAA;IACtB,WAAA,IAAA,kBAAG,GAAE,CAAA;;qCAF6C,wCAAkB;;uEAqDtE;AArMU,qBAAqB;IADjC,IAAA,uBAAQ,EAAC,8BAAa,CAAC;GACX,qBAAqB,CAsMjC;AAtMY,sDAAqB"}
@@ -0,0 +1,150 @@
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, _b;
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.InventoryItemQuery = 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 constants_1 = require("../../constants");
22
+ const inventory_1 = require("../inventory/inventory");
23
+ const inventory_item_1 = require("./inventory-item");
24
+ const inventory_item_type_1 = require("./inventory-item-type");
25
+ let InventoryItemQuery = class InventoryItemQuery {
26
+ async inventoryItem(id, context) {
27
+ const { domain } = context.state;
28
+ return await (0, typeorm_1.getRepository)(inventory_item_1.InventoryItem).findOne({
29
+ where: { domain, id }
30
+ });
31
+ }
32
+ async inventoryItems(params, context) {
33
+ const { domain } = context.state;
34
+ const convertedParams = (0, shell_1.convertListParams)(params, domain.id);
35
+ const [items, total] = await (0, typeorm_1.getRepository)(inventory_item_1.InventoryItem).findAndCount(convertedParams);
36
+ return { items, total };
37
+ }
38
+ async inventoryItemsByInventory(params, context) {
39
+ const { domain } = context.state;
40
+ const page = params.pagination.page;
41
+ const limit = params.pagination.limit;
42
+ const sortings = params.sortings;
43
+ let inventoryInfoFilter = params.filters.find(filter => filter.name == 'inventory_info');
44
+ let orderTypeFilter = params.filters.find(filter => filter.name == 'orderType');
45
+ let orderIdFilter = params.filters.find(filter => filter.name == 'orderId');
46
+ let productIdFilter = params.filters.find(filter => filter.name == 'productId');
47
+ let qb = (0, typeorm_1.getRepository)(inventory_item_1.InventoryItem).createQueryBuilder('ivi');
48
+ qb.leftJoinAndSelect('ivi.product', 'product').leftJoinAndSelect('ivi.inventory', 'inventory');
49
+ qb.where('ivi.product_id=:productId', { productId: productIdFilter.value });
50
+ qb.andWhere('inventory.status!=:inventoryStatus', { inventoryStatus: constants_1.INVENTORY_STATUS.PARTIALLY_UNLOADED });
51
+ if (orderTypeFilter.value == 'inbound') {
52
+ qb.andWhere('ivi.inbound_order_id=:orderId', { orderId: orderIdFilter.value });
53
+ }
54
+ else {
55
+ qb.andWhere('ivi.outbound_order_id=:orderId', { orderId: orderIdFilter.value });
56
+ }
57
+ if (inventoryInfoFilter) {
58
+ qb.andWhere(qb => {
59
+ const subQuery = qb
60
+ .subQuery()
61
+ .select()
62
+ .from(inventory_1.Inventory, `inventories`)
63
+ .where(`inventories.id = ivi.inventory_id`)
64
+ .andWhere(new typeorm_1.Brackets(qb => {
65
+ qb.where('Lower(inventories.pallet_id) LIKE :inventoryInfo', {
66
+ inventoryInfo: '%' + inventoryInfoFilter.value.toLowerCase() + '%'
67
+ })
68
+ .orWhere('Lower(inventories.carton_id) LIKE :inventoryInfo', {
69
+ inventoryInfo: '%' + inventoryInfoFilter.value.toLowerCase() + '%'
70
+ })
71
+ .orWhere('Lower(ivi.serial_number) LIKE :inventoryInfo', {
72
+ inventoryInfo: '%' + inventoryInfoFilter.value.toLowerCase() + '%'
73
+ });
74
+ }))
75
+ .getQuery();
76
+ return `EXISTS ${subQuery}`;
77
+ });
78
+ }
79
+ if ((sortings === null || sortings === void 0 ? void 0 : sortings.length) !== 0) {
80
+ const arrChildSortData = ['serial_number'];
81
+ const sort = (sortings || []).reduce((acc, sort) => (Object.assign(Object.assign({}, acc), { [arrChildSortData.indexOf(sort.name) >= 0 ? sort.name + '.name' : 'ivi.' + sort.name]: sort.desc
82
+ ? 'DESC'
83
+ : 'ASC' })), {});
84
+ qb.orderBy(sort);
85
+ }
86
+ qb.limit(limit);
87
+ qb.offset(limit * (page - 1));
88
+ let [items, total] = await qb.getManyAndCount();
89
+ return { items, total };
90
+ }
91
+ async domain(inventoryItem) {
92
+ return await (0, typeorm_1.getRepository)(shell_1.Domain).findOne(inventoryItem.domainId);
93
+ }
94
+ async updater(inventoryItem) {
95
+ return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(inventoryItem.updaterId);
96
+ }
97
+ async creator(inventoryItem) {
98
+ return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(inventoryItem.creatorId);
99
+ }
100
+ };
101
+ __decorate([
102
+ (0, type_graphql_1.Query)(returns => inventory_item_1.InventoryItem, { description: 'To fetch a InventoryItem' }),
103
+ __param(0, (0, type_graphql_1.Arg)('id')),
104
+ __param(1, (0, type_graphql_1.Ctx)()),
105
+ __metadata("design:type", Function),
106
+ __metadata("design:paramtypes", [String, Object]),
107
+ __metadata("design:returntype", Promise)
108
+ ], InventoryItemQuery.prototype, "inventoryItem", null);
109
+ __decorate([
110
+ (0, type_graphql_1.Query)(returns => inventory_item_type_1.InventoryItemList, { description: 'To fetch multiple InventoryItems' }),
111
+ __param(0, (0, type_graphql_1.Args)()),
112
+ __param(1, (0, type_graphql_1.Ctx)()),
113
+ __metadata("design:type", Function),
114
+ __metadata("design:paramtypes", [typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object, Object]),
115
+ __metadata("design:returntype", Promise)
116
+ ], InventoryItemQuery.prototype, "inventoryItems", null);
117
+ __decorate([
118
+ (0, type_graphql_1.Query)(returns => inventory_item_type_1.InventoryItemList, { description: 'To fetch multiple InventoryItems by inventory' }),
119
+ __param(0, (0, type_graphql_1.Args)()),
120
+ __param(1, (0, type_graphql_1.Ctx)()),
121
+ __metadata("design:type", Function),
122
+ __metadata("design:paramtypes", [typeof (_b = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _b : Object, Object]),
123
+ __metadata("design:returntype", Promise)
124
+ ], InventoryItemQuery.prototype, "inventoryItemsByInventory", null);
125
+ __decorate([
126
+ (0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
127
+ __param(0, (0, type_graphql_1.Root)()),
128
+ __metadata("design:type", Function),
129
+ __metadata("design:paramtypes", [inventory_item_1.InventoryItem]),
130
+ __metadata("design:returntype", Promise)
131
+ ], InventoryItemQuery.prototype, "domain", null);
132
+ __decorate([
133
+ (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
134
+ __param(0, (0, type_graphql_1.Root)()),
135
+ __metadata("design:type", Function),
136
+ __metadata("design:paramtypes", [inventory_item_1.InventoryItem]),
137
+ __metadata("design:returntype", Promise)
138
+ ], InventoryItemQuery.prototype, "updater", null);
139
+ __decorate([
140
+ (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
141
+ __param(0, (0, type_graphql_1.Root)()),
142
+ __metadata("design:type", Function),
143
+ __metadata("design:paramtypes", [inventory_item_1.InventoryItem]),
144
+ __metadata("design:returntype", Promise)
145
+ ], InventoryItemQuery.prototype, "creator", null);
146
+ InventoryItemQuery = __decorate([
147
+ (0, type_graphql_1.Resolver)(inventory_item_1.InventoryItem)
148
+ ], InventoryItemQuery);
149
+ exports.InventoryItemQuery = InventoryItemQuery;
150
+ //# sourceMappingURL=inventory-item-query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inventory-item-query.js","sourceRoot":"","sources":["../../../server/service/inventory-item/inventory-item-query.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAAmF;AACnF,qCAAqE;AAErE,yDAAgD;AAChD,iDAA4E;AAE5E,+CAAkD;AAClD,sDAAkD;AAClD,qDAAgD;AAChD,+DAAyD;AAGzD,IAAa,kBAAkB,GAA/B,MAAa,kBAAkB;IAE7B,KAAK,CAAC,aAAa,CAAY,EAAU,EAAS,OAAY;QAC5D,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,uBAAa,EAAC,8BAAa,CAAC,CAAC,OAAO,CAAC;YAChD,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;SACtB,CAAC,CAAA;IACJ,CAAC;IAGD,KAAK,CAAC,cAAc,CAAS,MAAiB,EAAS,OAAY;QACjE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,eAAe,GAAG,IAAA,yBAAiB,EAAC,MAAM,EAAE,MAAM,CAAC,EAAE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,gDAAkB"}
@@ -0,0 +1,115 @@
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.InventoryItemList = exports.InventoryItemPatch = exports.NewInventoryItem = void 0;
14
+ const type_graphql_1 = require("type-graphql");
15
+ const shell_1 = require("@things-factory/shell");
16
+ const inventory_item_1 = require("./inventory-item");
17
+ let NewInventoryItem = class NewInventoryItem {
18
+ };
19
+ __decorate([
20
+ (0, type_graphql_1.Field)(),
21
+ __metadata("design:type", String)
22
+ ], NewInventoryItem.prototype, "name", void 0);
23
+ __decorate([
24
+ (0, type_graphql_1.Field)({ nullable: true }),
25
+ __metadata("design:type", String)
26
+ ], NewInventoryItem.prototype, "serialNumber", void 0);
27
+ __decorate([
28
+ (0, type_graphql_1.Field)({ nullable: true }),
29
+ __metadata("design:type", String)
30
+ ], NewInventoryItem.prototype, "status", void 0);
31
+ __decorate([
32
+ (0, type_graphql_1.Field)({ nullable: true }),
33
+ __metadata("design:type", String)
34
+ ], NewInventoryItem.prototype, "source", void 0);
35
+ __decorate([
36
+ (0, type_graphql_1.Field)(type => shell_1.ObjectRef, { nullable: true }),
37
+ __metadata("design:type", typeof (_a = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _a : Object)
38
+ ], NewInventoryItem.prototype, "product", void 0);
39
+ __decorate([
40
+ (0, type_graphql_1.Field)(type => shell_1.ObjectRef, { nullable: true }),
41
+ __metadata("design:type", typeof (_b = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _b : Object)
42
+ ], NewInventoryItem.prototype, "inventory", void 0);
43
+ __decorate([
44
+ (0, type_graphql_1.Field)({ nullable: true }),
45
+ __metadata("design:type", String)
46
+ ], NewInventoryItem.prototype, "inboundOrderId", void 0);
47
+ __decorate([
48
+ (0, type_graphql_1.Field)({ nullable: true }),
49
+ __metadata("design:type", String)
50
+ ], NewInventoryItem.prototype, "outboundOrderId", void 0);
51
+ NewInventoryItem = __decorate([
52
+ (0, type_graphql_1.InputType)()
53
+ ], NewInventoryItem);
54
+ exports.NewInventoryItem = NewInventoryItem;
55
+ let InventoryItemPatch = class InventoryItemPatch {
56
+ };
57
+ __decorate([
58
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
59
+ __metadata("design:type", String)
60
+ ], InventoryItemPatch.prototype, "id", void 0);
61
+ __decorate([
62
+ (0, type_graphql_1.Field)({ nullable: true }),
63
+ __metadata("design:type", String)
64
+ ], InventoryItemPatch.prototype, "name", void 0);
65
+ __decorate([
66
+ (0, type_graphql_1.Field)({ nullable: true }),
67
+ __metadata("design:type", String)
68
+ ], InventoryItemPatch.prototype, "serialNumber", void 0);
69
+ __decorate([
70
+ (0, type_graphql_1.Field)({ nullable: true }),
71
+ __metadata("design:type", String)
72
+ ], InventoryItemPatch.prototype, "status", void 0);
73
+ __decorate([
74
+ (0, type_graphql_1.Field)({ nullable: true }),
75
+ __metadata("design:type", String)
76
+ ], InventoryItemPatch.prototype, "source", void 0);
77
+ __decorate([
78
+ (0, type_graphql_1.Field)(type => shell_1.ObjectRef, { nullable: true }),
79
+ __metadata("design:type", typeof (_c = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _c : Object)
80
+ ], InventoryItemPatch.prototype, "product", void 0);
81
+ __decorate([
82
+ (0, type_graphql_1.Field)(type => shell_1.ObjectRef, { nullable: true }),
83
+ __metadata("design:type", typeof (_d = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _d : Object)
84
+ ], InventoryItemPatch.prototype, "inventory", void 0);
85
+ __decorate([
86
+ (0, type_graphql_1.Field)({ nullable: true }),
87
+ __metadata("design:type", String)
88
+ ], InventoryItemPatch.prototype, "inboundOrderId", void 0);
89
+ __decorate([
90
+ (0, type_graphql_1.Field)({ nullable: true }),
91
+ __metadata("design:type", String)
92
+ ], InventoryItemPatch.prototype, "outboundOrderId", void 0);
93
+ __decorate([
94
+ (0, type_graphql_1.Field)({ nullable: true }),
95
+ __metadata("design:type", String)
96
+ ], InventoryItemPatch.prototype, "cuFlag", void 0);
97
+ InventoryItemPatch = __decorate([
98
+ (0, type_graphql_1.InputType)()
99
+ ], InventoryItemPatch);
100
+ exports.InventoryItemPatch = InventoryItemPatch;
101
+ let InventoryItemList = class InventoryItemList {
102
+ };
103
+ __decorate([
104
+ (0, type_graphql_1.Field)(type => [inventory_item_1.InventoryItem]),
105
+ __metadata("design:type", Array)
106
+ ], InventoryItemList.prototype, "items", void 0);
107
+ __decorate([
108
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int),
109
+ __metadata("design:type", Number)
110
+ ], InventoryItemList.prototype, "total", void 0);
111
+ InventoryItemList = __decorate([
112
+ (0, type_graphql_1.ObjectType)()
113
+ ], InventoryItemList);
114
+ exports.InventoryItemList = InventoryItemList;
115
+ //# sourceMappingURL=inventory-item-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inventory-item-type.js","sourceRoot":"","sources":["../../../server/service/inventory-item/inventory-item-type.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,+CAAoE;AAEpE,iDAAiD;AAEjD,qDAAgD;AAGhD,IAAa,gBAAgB,GAA7B,MAAa,gBAAgB;CAwB5B,CAAA;AAtBC;IADC,IAAA,o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