@things-factory/warehouse-base 4.1.33 → 4.1.36

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 +212 -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 +214 -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
@@ -0,0 +1,124 @@
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.InventoryItem = 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
+ const inventory_1 = require("../inventory/inventory");
20
+ let InventoryItem = class InventoryItem {
21
+ };
22
+ __decorate([
23
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
24
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID),
25
+ __metadata("design:type", String)
26
+ ], InventoryItem.prototype, "id", void 0);
27
+ __decorate([
28
+ (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
29
+ (0, type_graphql_1.Field)({ nullable: true }),
30
+ __metadata("design:type", typeof (_a = typeof shell_1.Domain !== "undefined" && shell_1.Domain) === "function" ? _a : Object)
31
+ ], InventoryItem.prototype, "domain", void 0);
32
+ __decorate([
33
+ (0, typeorm_1.RelationId)((inventoryItem) => inventoryItem.domain),
34
+ __metadata("design:type", String)
35
+ ], InventoryItem.prototype, "domainId", void 0);
36
+ __decorate([
37
+ (0, typeorm_1.Column)(),
38
+ (0, type_graphql_1.Field)(),
39
+ __metadata("design:type", String)
40
+ ], InventoryItem.prototype, "name", void 0);
41
+ __decorate([
42
+ (0, typeorm_1.Column)({ nullable: true }),
43
+ (0, type_graphql_1.Field)({ nullable: true }),
44
+ __metadata("design:type", String)
45
+ ], InventoryItem.prototype, "serialNumber", void 0);
46
+ __decorate([
47
+ (0, typeorm_1.Column)({ nullable: true }),
48
+ (0, type_graphql_1.Field)({ nullable: true }),
49
+ __metadata("design:type", String)
50
+ ], InventoryItem.prototype, "status", void 0);
51
+ __decorate([
52
+ (0, typeorm_1.Column)({ nullable: true }),
53
+ (0, type_graphql_1.Field)({ nullable: true }),
54
+ __metadata("design:type", String)
55
+ ], InventoryItem.prototype, "source", void 0);
56
+ __decorate([
57
+ (0, typeorm_1.Column)({ nullable: true }),
58
+ (0, type_graphql_1.Field)({ nullable: true }),
59
+ __metadata("design:type", String)
60
+ ], InventoryItem.prototype, "inboundOrderId", void 0);
61
+ __decorate([
62
+ (0, typeorm_1.Column)({ nullable: true }),
63
+ (0, type_graphql_1.Field)({ nullable: true }),
64
+ __metadata("design:type", String)
65
+ ], InventoryItem.prototype, "outboundOrderId", void 0);
66
+ __decorate([
67
+ (0, typeorm_1.ManyToOne)(type => product_base_1.Product),
68
+ (0, type_graphql_1.Field)(type => product_base_1.Product, { nullable: true }),
69
+ __metadata("design:type", typeof (_b = typeof product_base_1.Product !== "undefined" && product_base_1.Product) === "function" ? _b : Object)
70
+ ], InventoryItem.prototype, "product", void 0);
71
+ __decorate([
72
+ (0, typeorm_1.RelationId)((inventoryItem) => inventoryItem.product),
73
+ __metadata("design:type", String)
74
+ ], InventoryItem.prototype, "productId", void 0);
75
+ __decorate([
76
+ (0, typeorm_1.ManyToOne)(type => inventory_1.Inventory),
77
+ (0, type_graphql_1.Field)(type => inventory_1.Inventory),
78
+ __metadata("design:type", inventory_1.Inventory)
79
+ ], InventoryItem.prototype, "inventory", void 0);
80
+ __decorate([
81
+ (0, typeorm_1.RelationId)((inventoryItem) => inventoryItem.inventory),
82
+ __metadata("design:type", String)
83
+ ], InventoryItem.prototype, "inventoryId", void 0);
84
+ __decorate([
85
+ (0, typeorm_1.CreateDateColumn)(),
86
+ (0, type_graphql_1.Field)({ nullable: true }),
87
+ __metadata("design:type", Date)
88
+ ], InventoryItem.prototype, "createdAt", void 0);
89
+ __decorate([
90
+ (0, typeorm_1.UpdateDateColumn)(),
91
+ (0, type_graphql_1.Field)({ nullable: true }),
92
+ __metadata("design:type", Date)
93
+ ], InventoryItem.prototype, "updatedAt", void 0);
94
+ __decorate([
95
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
96
+ nullable: true
97
+ }),
98
+ (0, type_graphql_1.Field)({ nullable: true }),
99
+ __metadata("design:type", typeof (_c = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _c : Object)
100
+ ], InventoryItem.prototype, "creator", void 0);
101
+ __decorate([
102
+ (0, typeorm_1.RelationId)((inventoryItem) => inventoryItem.creator),
103
+ __metadata("design:type", String)
104
+ ], InventoryItem.prototype, "creatorId", void 0);
105
+ __decorate([
106
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
107
+ nullable: true
108
+ }),
109
+ (0, type_graphql_1.Field)({ nullable: true }),
110
+ __metadata("design:type", typeof (_d = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _d : Object)
111
+ ], InventoryItem.prototype, "updater", void 0);
112
+ __decorate([
113
+ (0, typeorm_1.RelationId)((inventoryItem) => inventoryItem.creator),
114
+ __metadata("design:type", String)
115
+ ], InventoryItem.prototype, "updaterId", void 0);
116
+ InventoryItem = __decorate([
117
+ (0, typeorm_1.Entity)(),
118
+ (0, typeorm_1.Index)('ix_inventory_item_0', (inventoryItem) => [inventoryItem.domain, inventoryItem.name], {
119
+ unique: true
120
+ }),
121
+ (0, type_graphql_1.ObjectType)({ description: 'Entity for InventoryItem' })
122
+ ], InventoryItem);
123
+ exports.InventoryItem = InventoryItem;
124
+ //# sourceMappingURL=inventory-item.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inventory-item.js","sourceRoot":"","sources":["../../../server/service/inventory-item/inventory-item.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,+CAAoD;AACpD,qCASgB;AAEhB,yDAAgD;AAChD,+DAAsD;AACtD,iDAA8C;AAE9C,sDAAkD;AAOlD,IAAa,aAAa,GAA1B,MAAa,aAAa;CA2EzB,CAAA;AAxEC;IAFC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;yCACC;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;kDACjB,cAAM,oBAAN,cAAM;6CAAA;AAGf;IADC,IAAA,oBAAU,EAAC,CAAC,aAA4B,EAAE,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC;;+CAClD;AAIjB;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,GAAE;;2CACI;AAIZ;IAFC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC1B,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACL;AAIrB;IAFC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI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AE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACd,IAAI;gDAAA;AAMhB;IAJC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE;QACvB,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;kDAChB,gBAAI,oBAAJ,gBAAI;8CAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,aAA4B,EAAE,EAAE,CAAC,aAAa,CAAC,OAAO,CAAC;;gDAClD;AAMlB;IAJC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE;QACvB,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;kDAChB,gBAAI,oBAAJ,gBAAI;8CAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,aAA4B,EAAE,EAAE,CAAC,aAAa,CAAC,OAAO,CAAC;;gDAClD;AA1EP,aAAa;IALzB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,qBAAqB,EAAE,CAAC,aAA4B,EAAE,EAAE,CAAC,CAAC,aAAa,CAAC,MAAM,EAAE,aAAa,CAAC,IAAI,CAAC,EAAE;QAC1G,MAAM,EAAE,IAAI;KACb,CAAC;IACD,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,0BAA0B,EAAE,CAAC;GAC3C,aAAa,CA2EzB;AA3EY,sCAAa"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolvers = exports.entities = void 0;
4
+ const inventory_product_1 = require("./inventory-product");
5
+ const inventory_product_query_1 = require("./inventory-product-query");
6
+ const inventory_product_mutation_1 = require("./inventory-product-mutation");
7
+ exports.entities = [inventory_product_1.InventoryProduct];
8
+ exports.resolvers = [inventory_product_query_1.InventoryProductQuery, inventory_product_mutation_1.InventoryProductMutation];
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/inventory-product/index.ts"],"names":[],"mappings":";;;AAAA,2DAAsD;AACtD,uEAAiE;AACjE,6EAAuE;AAE1D,QAAA,QAAQ,GAAG,CAAC,oCAAgB,CAAC,CAAA;AAC7B,QAAA,SAAS,GAAG,CAAC,+CAAqB,EAAE,qDAAwB,CAAC,CAAA"}
@@ -0,0 +1,120 @@
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.InventoryProductMutation = void 0;
16
+ const type_graphql_1 = require("type-graphql");
17
+ const typeorm_1 = require("typeorm");
18
+ const inventory_product_1 = require("./inventory-product");
19
+ const inventory_product_type_1 = require("./inventory-product-type");
20
+ let InventoryProductMutation = class InventoryProductMutation {
21
+ async createInventoryProduct(inventoryProduct, context) {
22
+ const { domain, user, tx } = context.state;
23
+ return await tx.getRepository(inventory_product_1.InventoryProduct).save(Object.assign(Object.assign({}, inventoryProduct), { domain, creator: user, updater: user }));
24
+ }
25
+ async updateInventoryProduct(id, patch, context) {
26
+ const { domain, user, tx } = context.state;
27
+ const repository = tx.getRepository(inventory_product_1.InventoryProduct);
28
+ const inventoryProduct = await repository.findOne({
29
+ where: { domain, id }
30
+ });
31
+ return await repository.save(Object.assign(Object.assign(Object.assign({}, inventoryProduct), patch), { updater: user }));
32
+ }
33
+ async updateMultipleInventoryProduct(patches, context) {
34
+ const { domain, user, tx } = context.state;
35
+ let results = [];
36
+ const _createRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === '+');
37
+ const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
38
+ const inventoryProductRepo = tx.getRepository(inventory_product_1.InventoryProduct);
39
+ if (_createRecords.length > 0) {
40
+ for (let i = 0; i < _createRecords.length; i++) {
41
+ const newRecord = _createRecords[i];
42
+ const result = await inventoryProductRepo.save(Object.assign(Object.assign({}, newRecord), { domain, creator: user, updater: user }));
43
+ results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
44
+ }
45
+ }
46
+ if (_updateRecords.length > 0) {
47
+ for (let i = 0; i < _updateRecords.length; i++) {
48
+ const newRecord = _updateRecords[i];
49
+ const inventoryProduct = await inventoryProductRepo.findOne(newRecord.id);
50
+ const result = await inventoryProductRepo.save(Object.assign(Object.assign(Object.assign({}, inventoryProduct), newRecord), { updater: user }));
51
+ results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
52
+ }
53
+ }
54
+ return results;
55
+ }
56
+ async deleteInventoryProduct(id, context) {
57
+ const { domain, tx } = context.state;
58
+ await tx.getRepository(inventory_product_1.InventoryProduct).delete({ domain, id });
59
+ return true;
60
+ }
61
+ async deleteInventoryProducts(ids, context) {
62
+ const { domain, tx } = context.state;
63
+ await tx.getRepository(inventory_product_1.InventoryProduct).delete({
64
+ domain,
65
+ id: (0, typeorm_1.In)(ids)
66
+ });
67
+ return true;
68
+ }
69
+ };
70
+ __decorate([
71
+ (0, type_graphql_1.Directive)('@transaction'),
72
+ (0, type_graphql_1.Mutation)(returns => inventory_product_1.InventoryProduct, { description: 'To create new InventoryProduct' }),
73
+ __param(0, (0, type_graphql_1.Arg)('inventoryProduct')),
74
+ __param(1, (0, type_graphql_1.Ctx)()),
75
+ __metadata("design:type", Function),
76
+ __metadata("design:paramtypes", [inventory_product_type_1.NewInventoryProduct, Object]),
77
+ __metadata("design:returntype", Promise)
78
+ ], InventoryProductMutation.prototype, "createInventoryProduct", null);
79
+ __decorate([
80
+ (0, type_graphql_1.Directive)('@transaction'),
81
+ (0, type_graphql_1.Mutation)(returns => inventory_product_1.InventoryProduct, { description: 'To modify InventoryProduct information' }),
82
+ __param(0, (0, type_graphql_1.Arg)('id')),
83
+ __param(1, (0, type_graphql_1.Arg)('patch')),
84
+ __param(2, (0, type_graphql_1.Ctx)()),
85
+ __metadata("design:type", Function),
86
+ __metadata("design:paramtypes", [String, inventory_product_type_1.InventoryProductPatch, Object]),
87
+ __metadata("design:returntype", Promise)
88
+ ], InventoryProductMutation.prototype, "updateInventoryProduct", null);
89
+ __decorate([
90
+ (0, type_graphql_1.Directive)('@transaction'),
91
+ (0, type_graphql_1.Mutation)(returns => [inventory_product_1.InventoryProduct], { description: "To modify multiple InventoryProducts' information" }),
92
+ __param(0, (0, type_graphql_1.Arg)('patches', type => [inventory_product_type_1.InventoryProductPatch])),
93
+ __param(1, (0, type_graphql_1.Ctx)()),
94
+ __metadata("design:type", Function),
95
+ __metadata("design:paramtypes", [Array, Object]),
96
+ __metadata("design:returntype", Promise)
97
+ ], InventoryProductMutation.prototype, "updateMultipleInventoryProduct", null);
98
+ __decorate([
99
+ (0, type_graphql_1.Directive)('@transaction'),
100
+ (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete InventoryProduct' }),
101
+ __param(0, (0, type_graphql_1.Arg)('id')),
102
+ __param(1, (0, type_graphql_1.Ctx)()),
103
+ __metadata("design:type", Function),
104
+ __metadata("design:paramtypes", [String, Object]),
105
+ __metadata("design:returntype", Promise)
106
+ ], InventoryProductMutation.prototype, "deleteInventoryProduct", null);
107
+ __decorate([
108
+ (0, type_graphql_1.Directive)('@transaction'),
109
+ (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple inventoryProducts' }),
110
+ __param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
111
+ __param(1, (0, type_graphql_1.Ctx)()),
112
+ __metadata("design:type", Function),
113
+ __metadata("design:paramtypes", [Array, Object]),
114
+ __metadata("design:returntype", Promise)
115
+ ], InventoryProductMutation.prototype, "deleteInventoryProducts", null);
116
+ InventoryProductMutation = __decorate([
117
+ (0, type_graphql_1.Resolver)(inventory_product_1.InventoryProduct)
118
+ ], InventoryProductMutation);
119
+ exports.InventoryProductMutation = InventoryProductMutation;
120
+ //# sourceMappingURL=inventory-product-mutation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inventory-product-mutation.js","sourceRoot":"","sources":["../../../server/service/inventory-product/inventory-product-mutation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAAsE;AACtE,qCAA2C;AAC3C,2DAAsD;AACtD,qEAAqF;AAGrF,IAAa,wBAAwB,GAArC,MAAa,wBAAwB;IAGnC,KAAK,CAAC,sBAAsB,CAA0B,gBAAqC,EAAS,OAAY;QAC9G,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,OAAO,MAAM,EAAE,CAAC,aAAa,CAAC,oCAAgB,CAAC,CAAC,IAAI,iCAC/C,gBAAgB,KACnB,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;IACJ,CAAC;IAID,KAAK,CAAC,sBAAsB,CACf,EAAU,EACP,KAA4B,EACnC,OAAY;QAEnB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,UAAU,GAAG,EAAE,CAAC,aAAa,CAAC,oCAAgB,CAAC,CAAA;QACrD,MAAM,gBAAgB,GAAG,MAAM,UA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A,uBAAQ,EAAC,oCAAgB,CAAC;GACd,wBAAwB,CAyGpC;AAzGY,4DAAwB"}
@@ -0,0 +1,87 @@
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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inventory-product-query.js","sourceRoot":"","sources":["../../../server/service/inventory-product/inventory-product-query.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA8F;AAC9F,qCAAuC;AACvC,iDAA4E;AAC5E,yDAAgD;AAChD,2DAAsD;AACtD,qEAA+D;AAG/D,IAAa,qBAAqB,GAAlC,MAAa,qBAAqB;IAEhC,KAAK,CAAC,gBAAgB,CAAY,EAAU,EAAS,OAAY;QAC/D,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,uBAAa,EAAC,oCAAgB,CAAC,CAAC,OAAO,CAAC;YACnD,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;SACtB,CAAC,CAAA;IACJ,CAAC;IAGD,KAAK,CAAC,iBAAiB,CAAS,MAAiB,EAAS,OAAY;QACpE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,eAAe,GAAG,IAAA,yBAAiB,EAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,CAAA;QAC5D,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,IAAA,uBAAa,EAAC,oCAAgB,CAAC,CAAC,YAAY,CAAC,eAAe,CAAC,CAAA;QAE1F,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,C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BAAI,CAAC;IACb,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAmB,oCAAgB;;oDAEvD;AAjCU,qBAAqB;IADjC,IAAA,uBAAQ,EAAC,oCAAgB,CAAC;GACd,qBAAqB,CAkCjC;AAlCY,sDAAqB"}
@@ -0,0 +1,95 @@
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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inventory-product-type.js","sourceRoot":"","sources":["../../../server/service/inventory-product/inventory-product-type.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,+CAAoE;AAEpE,iDAAiD;AAEjD,2DAAsD;AAGtD,IAAa,mBAAmB,GAAhC,MAAa,mBAAmB;CAkB/B,CAAA;AAhBC;IADC,IAAA,oBAAK,GAAE;;iDACI;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yDACL;AAGrB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACX;AAGf;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;kDACnC,iBAAS,oBAAT,iBAAS;oDAAA;AAGnB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4DACF;AAGxB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0DACJ;AAjBX,mBAAmB;IAD/B,IAAA,wBAAS,GAAE;GACC,mBAAmB,CAkB/B;AAlBY,kDAAmB;AAqBhC,IAAa,qBAAqB,GAAlC,MAAa,qBAAqB;CAqBjC,CAAA;AAnBC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDAC3B;AAGX;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACb;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2DACL;AAGrB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDACX;AAGf;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8DACF;AAGxB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4DACJ;AAGtB;IADC,IAAA,oBAAK,GAAE;;qDACM;AApBH,qBAAqB;IADjC,IAAA,wBAAS,GAAE;GACC,qBAAqB,CAqBjC;AArBY,sDAAqB;AAwBlC,IAAa,oBAAoB,GAAjC,MAAa,oBAAoB;CAMhC,CAAA;AAJC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,oCAAgB,CAAC,CAAC;;mDACT;AAGzB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;mDACN;AALF,oBAAoB;IADhC,IAAA,yBAAU,GAAE;GACA,oBAAoB,CAMhC;AANY,oDAAoB"}
@@ -0,0 +1,107 @@
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.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.CreateDateColumn)(),
71
+ (0, type_graphql_1.Field)({ nullable: true }),
72
+ __metadata("design:type", Date)
73
+ ], InventoryProduct.prototype, "createdAt", void 0);
74
+ __decorate([
75
+ (0, typeorm_1.UpdateDateColumn)(),
76
+ (0, type_graphql_1.Field)({ nullable: true }),
77
+ __metadata("design:type", Date)
78
+ ], InventoryProduct.prototype, "updatedAt", void 0);
79
+ __decorate([
80
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
81
+ nullable: true
82
+ }),
83
+ (0, type_graphql_1.Field)({ nullable: true }),
84
+ __metadata("design:type", typeof (_c = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _c : Object)
85
+ ], InventoryProduct.prototype, "creator", void 0);
86
+ __decorate([
87
+ (0, typeorm_1.RelationId)((inventoryProduct) => inventoryProduct.creator),
88
+ __metadata("design:type", String)
89
+ ], InventoryProduct.prototype, "creatorId", void 0);
90
+ __decorate([
91
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
92
+ nullable: true
93
+ }),
94
+ (0, type_graphql_1.Field)({ nullable: true }),
95
+ __metadata("design:type", typeof (_d = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _d : Object)
96
+ ], InventoryProduct.prototype, "updater", void 0);
97
+ __decorate([
98
+ (0, typeorm_1.RelationId)((inventoryProduct) => inventoryProduct.creator),
99
+ __metadata("design:type", String)
100
+ ], InventoryProduct.prototype, "updaterId", void 0);
101
+ InventoryProduct = __decorate([
102
+ (0, typeorm_1.Entity)(),
103
+ (0, typeorm_1.Index)('ix_inventory_product_0', (inventoryProduct) => [inventoryProduct.domain, inventoryProduct.name], { unique: true }),
104
+ (0, type_graphql_1.ObjectType)({ description: 'Entity for InventoryProduct' })
105
+ ], InventoryProduct);
106
+ exports.InventoryProduct = InventoryProduct;
107
+ //# sourceMappingURL=inventory-product.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inventory-product.js","sourceRoot":"","sources":["../../../server/service/inventory-product/inventory-product.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,+CAAoD;AACpD,qCASgB;AAEhB,yDAAgD;AAChD,+DAAsD;AACtD,iDAA8C;AAS9C,IAAa,gBAAgB,GAA7B,MAAa,gBAAgB;CAgE5B,CAAA;AA7DC;IAFC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;4CACC;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;kDACjB,cAAM,oBAAN,cAAM;gDAAA;AAGf;IADC,IAAA,oBAAU,EAAC,CAAC,gBAAkC,EAAE,EAAE,CAAC,gBAAgB,CAAC,MAAM,CAAC;;kDAC3D;AAIjB;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,GAAE;;8CACI;AAI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,gBAAI,oBAAJ,gBAAI;iDAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,gBAAkC,EAAE,EAAE,CAAC,gBAAgB,CAAC,OAAO,CAAC;;mDAC3D;AAMlB;IAJC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE;QACvB,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;kDAChB,gBAAI,oBAAJ,gBAAI;iDAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,gBAAkC,EAAE,EAAE,CAAC,gBAAgB,CAAC,OAAO,CAAC;;mDAC3D;AA/DP,gBAAgB;IAP5B,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EACJ,wBAAwB,EACxB,CAAC,gBAAkC,EAAE,EAAE,CAAC,CAAC,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,CAAC,IAAI,CAAC,EACxF,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;IACA,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;GAC9C,gBAAgB,CAgE5B;AAhEY,4CAAgB"}
@@ -12,6 +12,9 @@ class InventoryNoGenerator {
12
12
  static inventoryHistoryName() {
13
13
  return (0, v4_1.default)();
14
14
  }
15
+ static inventoryItemName() {
16
+ return (0, v4_1.default)();
17
+ }
15
18
  }
16
19
  exports.InventoryNoGenerator = InventoryNoGenerator;
17
20
  //# sourceMappingURL=inventory-no-generator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"inventory-no-generator.js","sourceRoot":"","sources":["../../server/utils/inventory-no-generator.ts"],"names":[],"mappings":";;;;;;AAAA,iDAA0B;AAE1B,MAAa,oBAAoB;IAC/B,MAAM,CAAC,aAAa;QAClB,OAAO,IAAA,YAAI,GAAE,CAAA;IACf,CAAC;IAED,MAAM,CAAC,oBAAoB;QACzB,OAAO,IAAA,YAAI,GAAE,CAAA;IACf,CAAC;CACF;AARD,oDAQC"}
1
+ {"version":3,"file":"inventory-no-generator.js","sourceRoot":"","sources":["../../server/utils/inventory-no-generator.ts"],"names":[],"mappings":";;;;;;AAAA,iDAA0B;AAE1B,MAAa,oBAAoB;IAC/B,MAAM,CAAC,aAAa;QAClB,OAAO,IAAA,YAAI,GAAE,CAAA;IACf,CAAC;IAED,MAAM,CAAC,oBAAoB;QACzB,OAAO,IAAA,YAAI,GAAE,CAAA;IACf,CAAC;IAED,MAAM,CAAC,iBAAiB;QACtB,OAAO,IAAA,YAAI,GAAE,CAAA;IACf,CAAC;CACF;AAZD,oDAYC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/warehouse-base",
3
- "version": "4.1.33",
3
+ "version": "4.1.36",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -26,10 +26,10 @@
26
26
  "dependencies": {
27
27
  "@things-factory/biz-base": "^4.1.28",
28
28
  "@things-factory/id-rule-base": "^4.1.28",
29
- "@things-factory/integration-sellercraft": "^4.1.33",
30
- "@things-factory/marketplace-base": "^4.1.33",
31
- "@things-factory/product-base": "^4.1.28",
29
+ "@things-factory/integration-sellercraft": "^4.1.35",
30
+ "@things-factory/marketplace-base": "^4.1.36",
31
+ "@things-factory/product-base": "^4.1.34",
32
32
  "@things-factory/setting-base": "^4.1.28"
33
33
  },
34
- "gitHead": "1be06c783733190b91ab6c4b7b32f34d22aeaed6"
34
+ "gitHead": "5b86caac48cdae550c7469ec25dd4c71f73b5582"
35
35
  }
@@ -9,7 +9,8 @@ export const INVENTORY_STATUS = {
9
9
  TRANSFERED: 'TRANSFERED',
10
10
  DELETED: 'DELETED',
11
11
  CHECKED: 'CHECKED',
12
- PICKED: 'PICKED'
12
+ PICKED: 'PICKED',
13
+ PICKING: 'PICKING'
13
14
  }
14
15
 
15
16
  export const INVENTORY_TYPES = {
@@ -49,3 +50,9 @@ export const INVENTORY_TRANSACTION_TYPE = {
49
50
  UNDO_REVERSE_KITTING: 'UNDO_REVERSE_KITTING',
50
51
  DIRECT_DEDUCTION: 'DIRECT_DEDUCTION'
51
52
  }
53
+
54
+ export const INVENTORY_ITEM_SOURCE = {
55
+ INBOUND: 'INBOUND',
56
+ OUTBOUND: 'OUTBOUND',
57
+ ADJUSTMENT: 'ADJUSTMENT'
58
+ }