@things-factory/product-base 4.3.654 → 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 (112) hide show
  1. package/package.json +4 -4
  2. package/server/service/product-detail/product-detail-query.ts +1 -0
  3. package/dist-server/constants/index.js +0 -18
  4. package/dist-server/constants/index.js.map +0 -1
  5. package/dist-server/constants/product.js +0 -25
  6. package/dist-server/constants/product.js.map +0 -1
  7. package/dist-server/controllers/index.js +0 -1
  8. package/dist-server/controllers/index.js.map +0 -1
  9. package/dist-server/index.js +0 -19
  10. package/dist-server/index.js.map +0 -1
  11. package/dist-server/middlewares/index.js +0 -1
  12. package/dist-server/middlewares/index.js.map +0 -1
  13. package/dist-server/migrations/index.js +0 -12
  14. package/dist-server/migrations/index.js.map +0 -1
  15. package/dist-server/service/index.js +0 -74
  16. package/dist-server/service/index.js.map +0 -1
  17. package/dist-server/service/product/index.js +0 -10
  18. package/dist-server/service/product/index.js.map +0 -1
  19. package/dist-server/service/product/product-mutation.js +0 -408
  20. package/dist-server/service/product/product-mutation.js.map +0 -1
  21. package/dist-server/service/product/product-query.js +0 -373
  22. package/dist-server/service/product/product-query.js.map +0 -1
  23. package/dist-server/service/product/product-types.js +0 -618
  24. package/dist-server/service/product/product-types.js.map +0 -1
  25. package/dist-server/service/product/product.js +0 -615
  26. package/dist-server/service/product/product.js.map +0 -1
  27. package/dist-server/service/product/validate-product.js +0 -26
  28. package/dist-server/service/product/validate-product.js.map +0 -1
  29. package/dist-server/service/product-barcode/index.js +0 -9
  30. package/dist-server/service/product-barcode/index.js.map +0 -1
  31. package/dist-server/service/product-barcode/product-barcode-mutation.js +0 -120
  32. package/dist-server/service/product-barcode/product-barcode-mutation.js.map +0 -1
  33. package/dist-server/service/product-barcode/product-barcode-query.js +0 -87
  34. package/dist-server/service/product-barcode/product-barcode-query.js.map +0 -1
  35. package/dist-server/service/product-barcode/product-barcode-type.js +0 -63
  36. package/dist-server/service/product-barcode/product-barcode-type.js.map +0 -1
  37. package/dist-server/service/product-barcode/product-barcode.js +0 -104
  38. package/dist-server/service/product-barcode/product-barcode.js.map +0 -1
  39. package/dist-server/service/product-bundle/index.js +0 -9
  40. package/dist-server/service/product-bundle/index.js.map +0 -1
  41. package/dist-server/service/product-bundle/product-bundle-mutation.js +0 -130
  42. package/dist-server/service/product-bundle/product-bundle-mutation.js.map +0 -1
  43. package/dist-server/service/product-bundle/product-bundle-query.js +0 -128
  44. package/dist-server/service/product-bundle/product-bundle-query.js.map +0 -1
  45. package/dist-server/service/product-bundle/product-bundle-types.js +0 -85
  46. package/dist-server/service/product-bundle/product-bundle-types.js.map +0 -1
  47. package/dist-server/service/product-bundle/product-bundle.js +0 -128
  48. package/dist-server/service/product-bundle/product-bundle.js.map +0 -1
  49. package/dist-server/service/product-bundle-setting/index.js +0 -9
  50. package/dist-server/service/product-bundle-setting/index.js.map +0 -1
  51. package/dist-server/service/product-bundle-setting/product-bundle-setting-mutation.js +0 -165
  52. package/dist-server/service/product-bundle-setting/product-bundle-setting-mutation.js.map +0 -1
  53. package/dist-server/service/product-bundle-setting/product-bundle-setting-query.js +0 -113
  54. package/dist-server/service/product-bundle-setting/product-bundle-setting-query.js.map +0 -1
  55. package/dist-server/service/product-bundle-setting/product-bundle-setting-types.js +0 -69
  56. package/dist-server/service/product-bundle-setting/product-bundle-setting-types.js.map +0 -1
  57. package/dist-server/service/product-bundle-setting/product-bundle-setting.js +0 -63
  58. package/dist-server/service/product-bundle-setting/product-bundle-setting.js.map +0 -1
  59. package/dist-server/service/product-combination/index.js +0 -9
  60. package/dist-server/service/product-combination/index.js.map +0 -1
  61. package/dist-server/service/product-combination/product-combination-mutation.js +0 -137
  62. package/dist-server/service/product-combination/product-combination-mutation.js.map +0 -1
  63. package/dist-server/service/product-combination/product-combination-query.js +0 -86
  64. package/dist-server/service/product-combination/product-combination-query.js.map +0 -1
  65. package/dist-server/service/product-combination/product-combination-type.js +0 -83
  66. package/dist-server/service/product-combination/product-combination-type.js.map +0 -1
  67. package/dist-server/service/product-combination/product-combination.js +0 -133
  68. package/dist-server/service/product-combination/product-combination.js.map +0 -1
  69. package/dist-server/service/product-combination-setting/index.js +0 -9
  70. package/dist-server/service/product-combination-setting/index.js.map +0 -1
  71. package/dist-server/service/product-combination-setting/product-combination-setting-mutation.js +0 -221
  72. package/dist-server/service/product-combination-setting/product-combination-setting-mutation.js.map +0 -1
  73. package/dist-server/service/product-combination-setting/product-combination-setting-query.js +0 -177
  74. package/dist-server/service/product-combination-setting/product-combination-setting-query.js.map +0 -1
  75. package/dist-server/service/product-combination-setting/product-combination-setting-type.js +0 -75
  76. package/dist-server/service/product-combination-setting/product-combination-setting-type.js.map +0 -1
  77. package/dist-server/service/product-combination-setting/product-combination-setting.js +0 -105
  78. package/dist-server/service/product-combination-setting/product-combination-setting.js.map +0 -1
  79. package/dist-server/service/product-detail/index.js +0 -9
  80. package/dist-server/service/product-detail/index.js.map +0 -1
  81. package/dist-server/service/product-detail/product-detail-mutation.js +0 -374
  82. package/dist-server/service/product-detail/product-detail-mutation.js.map +0 -1
  83. package/dist-server/service/product-detail/product-detail-query.js +0 -223
  84. package/dist-server/service/product-detail/product-detail-query.js.map +0 -1
  85. package/dist-server/service/product-detail/product-detail-types.js +0 -392
  86. package/dist-server/service/product-detail/product-detail-types.js.map +0 -1
  87. package/dist-server/service/product-detail/product-detail.js +0 -444
  88. package/dist-server/service/product-detail/product-detail.js.map +0 -1
  89. package/dist-server/service/product-detail-bizplace-setting/index.js +0 -9
  90. package/dist-server/service/product-detail-bizplace-setting/index.js.map +0 -1
  91. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-mutation.js +0 -118
  92. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-mutation.js.map +0 -1
  93. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-query.js +0 -107
  94. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-query.js.map +0 -1
  95. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-types.js +0 -99
  96. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-types.js.map +0 -1
  97. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting.js +0 -120
  98. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting.js.map +0 -1
  99. package/dist-server/service/product-set/index.js +0 -9
  100. package/dist-server/service/product-set/index.js.map +0 -1
  101. package/dist-server/service/product-set/product-set-mutation.js +0 -146
  102. package/dist-server/service/product-set/product-set-mutation.js.map +0 -1
  103. package/dist-server/service/product-set/product-set-query.js +0 -136
  104. package/dist-server/service/product-set/product-set-query.js.map +0 -1
  105. package/dist-server/service/product-set/product-set-types.js +0 -77
  106. package/dist-server/service/product-set/product-set-types.js.map +0 -1
  107. package/dist-server/service/product-set/product-set.js +0 -118
  108. package/dist-server/service/product-set/product-set.js.map +0 -1
  109. package/dist-server/utils/index.js +0 -18
  110. package/dist-server/utils/index.js.map +0 -1
  111. package/dist-server/utils/product-util.js +0 -16
  112. package/dist-server/utils/product-util.js.map +0 -1
@@ -1,133 +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.ProductCombination = exports.ProductCombinationStatus = 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 shell_1 = require("@things-factory/shell");
18
- const product_combination_setting_1 = require("../product-combination-setting/product-combination-setting");
19
- const product_detail_1 = require("../product-detail/product-detail");
20
- const product_1 = require("../product/product");
21
- var ProductCombinationStatus;
22
- (function (ProductCombinationStatus) {
23
- ProductCombinationStatus["ACTIVE"] = "ACTIVE";
24
- ProductCombinationStatus["ACTIVATED"] = "ACTIVATED";
25
- ProductCombinationStatus["DELETED"] = "DELETED";
26
- ProductCombinationStatus["INACTIVE"] = "INACTIVE";
27
- })(ProductCombinationStatus = exports.ProductCombinationStatus || (exports.ProductCombinationStatus = {}));
28
- (0, type_graphql_1.registerEnumType)(ProductCombinationStatus, {
29
- name: 'ProductCombinationStatus',
30
- description: 'status enumeration of a productCombination'
31
- });
32
- let ProductCombination = class ProductCombination {
33
- };
34
- __decorate([
35
- (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
36
- (0, type_graphql_1.Field)(type => type_graphql_1.ID),
37
- __metadata("design:type", String)
38
- ], ProductCombination.prototype, "id", void 0);
39
- __decorate([
40
- (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
41
- (0, type_graphql_1.Field)({ nullable: true }),
42
- __metadata("design:type", typeof (_a = typeof shell_1.Domain !== "undefined" && shell_1.Domain) === "function" ? _a : Object)
43
- ], ProductCombination.prototype, "domain", void 0);
44
- __decorate([
45
- (0, typeorm_1.RelationId)((productCombination) => productCombination.domain),
46
- __metadata("design:type", String)
47
- ], ProductCombination.prototype, "domainId", void 0);
48
- __decorate([
49
- (0, typeorm_1.Column)(),
50
- (0, type_graphql_1.Field)(),
51
- __metadata("design:type", String)
52
- ], ProductCombination.prototype, "name", void 0);
53
- __decorate([
54
- (0, typeorm_1.OneToMany)(type => product_combination_setting_1.ProductCombinationSetting, productCombinationSetting => productCombinationSetting.productCombination),
55
- (0, type_graphql_1.Field)(type => [product_combination_setting_1.ProductCombinationSetting], { nullable: true }),
56
- __metadata("design:type", Array)
57
- ], ProductCombination.prototype, "productCombinationSettings", void 0);
58
- __decorate([
59
- (0, typeorm_1.ManyToOne)(type => product_1.Product),
60
- (0, type_graphql_1.Field)(type => product_1.Product),
61
- __metadata("design:type", product_1.Product)
62
- ], ProductCombination.prototype, "product", void 0);
63
- __decorate([
64
- (0, typeorm_1.RelationId)((productCombination) => productCombination.product),
65
- __metadata("design:type", String)
66
- ], ProductCombination.prototype, "productId", void 0);
67
- __decorate([
68
- (0, typeorm_1.ManyToOne)(type => product_detail_1.ProductDetail, { nullable: false }),
69
- (0, type_graphql_1.Field)(type => product_detail_1.ProductDetail),
70
- __metadata("design:type", product_detail_1.ProductDetail)
71
- ], ProductCombination.prototype, "productDetail", void 0);
72
- __decorate([
73
- (0, typeorm_1.RelationId)((productCombination) => productCombination.productDetail),
74
- __metadata("design:type", String)
75
- ], ProductCombination.prototype, "productDetailId", void 0);
76
- __decorate([
77
- (0, typeorm_1.Column)({ nullable: true }),
78
- (0, type_graphql_1.Field)({ nullable: true }),
79
- __metadata("design:type", String)
80
- ], ProductCombination.prototype, "description", void 0);
81
- __decorate([
82
- (0, typeorm_1.Column)({ nullable: true }),
83
- __metadata("design:type", Date)
84
- ], ProductCombination.prototype, "deletedAt", void 0);
85
- __decorate([
86
- (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
87
- (0, type_graphql_1.Field)({ nullable: true }),
88
- __metadata("design:type", typeof (_b = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _b : Object)
89
- ], ProductCombination.prototype, "deletedBy", void 0);
90
- __decorate([
91
- (0, typeorm_1.RelationId)((productCombination) => productCombination.deletedBy),
92
- __metadata("design:type", String)
93
- ], ProductCombination.prototype, "deletedById", void 0);
94
- __decorate([
95
- (0, typeorm_1.Column)({ nullable: true }),
96
- (0, type_graphql_1.Field)({ nullable: true }),
97
- __metadata("design:type", String)
98
- ], ProductCombination.prototype, "status", void 0);
99
- __decorate([
100
- (0, typeorm_1.CreateDateColumn)(),
101
- (0, type_graphql_1.Field)({ nullable: true }),
102
- __metadata("design:type", Date)
103
- ], ProductCombination.prototype, "createdAt", void 0);
104
- __decorate([
105
- (0, typeorm_1.UpdateDateColumn)(),
106
- (0, type_graphql_1.Field)({ nullable: true }),
107
- __metadata("design:type", Date)
108
- ], ProductCombination.prototype, "updatedAt", void 0);
109
- __decorate([
110
- (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
111
- (0, type_graphql_1.Field)({ nullable: true }),
112
- __metadata("design:type", typeof (_c = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _c : Object)
113
- ], ProductCombination.prototype, "creator", void 0);
114
- __decorate([
115
- (0, typeorm_1.RelationId)((productCombination) => productCombination.creator),
116
- __metadata("design:type", String)
117
- ], ProductCombination.prototype, "creatorId", void 0);
118
- __decorate([
119
- (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
120
- (0, type_graphql_1.Field)({ nullable: true }),
121
- __metadata("design:type", typeof (_d = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _d : Object)
122
- ], ProductCombination.prototype, "updater", void 0);
123
- __decorate([
124
- (0, typeorm_1.RelationId)((productCombination) => productCombination.updater),
125
- __metadata("design:type", String)
126
- ], ProductCombination.prototype, "updaterId", void 0);
127
- ProductCombination = __decorate([
128
- (0, typeorm_1.Entity)(),
129
- (0, typeorm_1.Index)('ix_product_combination_0', (productCombination) => [productCombination.domain, productCombination.id], { unique: true }),
130
- (0, type_graphql_1.ObjectType)({ description: 'Entity for ProductCombination' })
131
- ], ProductCombination);
132
- exports.ProductCombination = ProductCombination;
133
- //# sourceMappingURL=product-combination.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"product-combination.js","sourceRoot":"","sources":["../../../server/service/product-combination/product-combination.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,+CAAsE;AACtE,qCAUgB;AAEhB,yDAAgD;AA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AClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACd,IAAI;qDAAA;AAEhB;IAAC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;kDAChB,gBAAI,oBAAJ,gBAAI;mDAAA;AAEd;IAAC,IAAA,oBAAU,EAAC,CAAC,kBAAsC,EAAE,EAAE,CAAC,kBAAkB,CAAC,OAAO,CAAC;;qDACjE;AAElB;IAAC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;kDAChB,gBAAI,oBAAJ,gBAAI;mDAAA;AAEd;IAAC,IAAA,oBAAU,EAAC,CAAC,kBAAsC,EAAE,EAAE,CAAC,kBAAkB,CAAC,OAAO,CAAC;;qDACjE;AA3EP,kBAAkB;IAP9B,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EACJ,0BAA0B,EAC1B,CAAC,kBAAsC,EAAE,EAAE,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE,kBAAkB,CAAC,EAAE,CAAC,EAC9F,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;IACA,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,+BAA+B,EAAE,CAAC;GAChD,kBAAkB,CA4E9B;AA5EY,gDAAkB"}
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.resolvers = exports.entities = void 0;
4
- const product_combination_setting_1 = require("./product-combination-setting");
5
- const product_combination_setting_query_1 = require("./product-combination-setting-query");
6
- const product_combination_setting_mutation_1 = require("./product-combination-setting-mutation");
7
- exports.entities = [product_combination_setting_1.ProductCombinationSetting];
8
- exports.resolvers = [product_combination_setting_query_1.ProductCombinationSettingQuery, product_combination_setting_mutation_1.ProductCombinationSettingMutation];
9
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/product-combination-setting/index.ts"],"names":[],"mappings":";;;AAAA,+EAAyE;AACzE,2FAAoF;AACpF,iGAA0F;AAE7E,QAAA,QAAQ,GAAG,CAAC,uDAAyB,CAAC,CAAA;AACtC,QAAA,SAAS,GAAG,CAAC,kEAA8B,EAAE,wEAAiC,CAAC,CAAA"}
@@ -1,221 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- var __param = (this && this.__param) || function (paramIndex, decorator) {
12
- return function (target, key) { decorator(target, key, paramIndex); }
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.updateMultipleProductCombinationSetting = exports.ProductCombinationSettingMutation = void 0;
16
- const type_graphql_1 = require("type-graphql");
17
- const typeorm_1 = require("typeorm");
18
- const product_combination_setting_1 = require("./product-combination-setting");
19
- const product_combination_setting_type_1 = require("./product-combination-setting-type");
20
- const debug = require('debug')('things-factory:product-base:productCombinationSetting');
21
- let ProductCombinationSettingMutation = class ProductCombinationSettingMutation {
22
- async createProductCombinationSetting(productCombinationSetting, context) {
23
- const { domain, user, tx } = context.state;
24
- return await tx.getRepository(product_combination_setting_1.ProductCombinationSetting).save(Object.assign(Object.assign({}, productCombinationSetting), { domain, creator: user, updater: user }));
25
- }
26
- async updateProductCombinationSetting(id, patch, context) {
27
- const { domain, user, tx } = context.state;
28
- const repository = tx.getRepository(product_combination_setting_1.ProductCombinationSetting);
29
- const productCombinationSetting = await repository.findOne({
30
- where: { domain, id }
31
- });
32
- return await repository.save(Object.assign(Object.assign(Object.assign({}, productCombinationSetting), patch), { updater: user }));
33
- }
34
- async updateMultipleProductCombinationSetting(patches, context) {
35
- const { domain, user, tx } = context.state;
36
- let results = [];
37
- const _createRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === '+');
38
- const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
39
- const productCombinationSettingRepo = tx.getRepository(product_combination_setting_1.ProductCombinationSetting);
40
- if (_createRecords.length > 0) {
41
- for (let i = 0; i < _createRecords.length; i++) {
42
- const newRecord = _createRecords[i];
43
- const result = await productCombinationSettingRepo.save(Object.assign(Object.assign({}, newRecord), { domain, creator: user, updater: user }));
44
- results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
45
- }
46
- }
47
- if (_updateRecords.length > 0) {
48
- for (let i = 0; i < _updateRecords.length; i++) {
49
- const newRecord = _updateRecords[i];
50
- const productCombinationSetting = await productCombinationSettingRepo.findOne(newRecord.id);
51
- const result = await productCombinationSettingRepo.save(Object.assign(Object.assign(Object.assign({}, productCombinationSetting), newRecord), { updater: user }));
52
- results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
53
- }
54
- }
55
- return results;
56
- }
57
- async deleteProductCombinationSetting(id, context) {
58
- const { domain, tx } = context.state;
59
- await tx.getRepository(product_combination_setting_1.ProductCombinationSetting).delete({ domain, id });
60
- return true;
61
- }
62
- async deleteProductCombinationSettings(ids, context) {
63
- const { domain, tx } = context.state;
64
- await tx.getRepository(product_combination_setting_1.ProductCombinationSetting).delete({
65
- domain,
66
- id: (0, typeorm_1.In)(ids)
67
- });
68
- return true;
69
- }
70
- async linkProductCombination(productCombinationId, patches, context) {
71
- try {
72
- const { domain, tx } = context.state;
73
- const qb = tx
74
- .getRepository(product_combination_setting_1.ProductCombinationSetting)
75
- .createQueryBuilder('pbs')
76
- .innerJoinAndSelect('pbs.product', 'prd')
77
- .innerJoinAndSelect('pbs.productDetail', 'pd')
78
- .innerJoinAndSelect('pbs.productCombination', 'pc')
79
- .where('pc.id = :productCombinationId', { productCombinationId })
80
- .andWhere('pc.domain_id = :domainId', { domainId: domain.id });
81
- const existingCombinationLink = await qb.getMany();
82
- let newCombinationLink = patches.reduce((acc, curr) => {
83
- if (!existingCombinationLink.find(item => item.product.id === curr.product.id && item.productDetail.id === curr.productDetail.id)) {
84
- acc.push({
85
- productCombination: { id: productCombinationId },
86
- product: { id: curr.product.id },
87
- productDetail: { id: curr.productDetail.id },
88
- qty: curr.qty,
89
- cuFlag: '+'
90
- });
91
- }
92
- // check if there is existing bundle link but changes in bundle qty
93
- else if (existingCombinationLink.find(item => item.product.id === curr.product.id &&
94
- item.productDetail.id === curr.productDetail.id &&
95
- item.qty !== curr.qty)) {
96
- acc.push({
97
- id: curr.id,
98
- productCombination: { id: productCombinationId },
99
- product: { id: curr.product.id },
100
- productDetail: { id: curr.productDetail.id },
101
- qty: curr.qty,
102
- cuFlag: 'M'
103
- });
104
- }
105
- return acc;
106
- }, []);
107
- let removeCombinationLink = existingCombinationLink.reduce((acc, curr) => {
108
- if (!patches.find(item => item.product.id == curr.product.id && item.productDetail.id == curr.productDetail.id)) {
109
- acc.push({
110
- id: curr.id,
111
- productCombination: { id: productCombinationId },
112
- product: { id: curr.product.id },
113
- productDetail: { id: curr.productDetail.id },
114
- qty: curr.qty
115
- });
116
- }
117
- return acc;
118
- }, []);
119
- if (newCombinationLink.length > 0) {
120
- await updateMultipleProductCombinationSetting(newCombinationLink, context);
121
- }
122
- if (removeCombinationLink.length > 0) {
123
- await tx.getRepository(product_combination_setting_1.ProductCombinationSetting).delete({
124
- id: (0, typeorm_1.In)(removeCombinationLink.map(combinationLink => combinationLink.id))
125
- });
126
- }
127
- return true;
128
- }
129
- catch (error) {
130
- debug('link-product-combination', error);
131
- throw error;
132
- }
133
- }
134
- };
135
- __decorate([
136
- (0, type_graphql_1.Directive)('@transaction'),
137
- (0, type_graphql_1.Mutation)(returns => product_combination_setting_1.ProductCombinationSetting, { description: 'To create new ProductCombinationSetting' }),
138
- __param(0, (0, type_graphql_1.Arg)('productCombinationSetting')),
139
- __param(1, (0, type_graphql_1.Ctx)()),
140
- __metadata("design:type", Function),
141
- __metadata("design:paramtypes", [product_combination_setting_type_1.NewProductCombinationSetting, Object]),
142
- __metadata("design:returntype", Promise)
143
- ], ProductCombinationSettingMutation.prototype, "createProductCombinationSetting", null);
144
- __decorate([
145
- (0, type_graphql_1.Directive)('@transaction'),
146
- (0, type_graphql_1.Mutation)(returns => product_combination_setting_1.ProductCombinationSetting, { description: 'To modify ProductCombinationSetting information' }),
147
- __param(0, (0, type_graphql_1.Arg)('id')),
148
- __param(1, (0, type_graphql_1.Arg)('patch')),
149
- __param(2, (0, type_graphql_1.Ctx)()),
150
- __metadata("design:type", Function),
151
- __metadata("design:paramtypes", [String, product_combination_setting_type_1.ProductCombinationSettingPatch, Object]),
152
- __metadata("design:returntype", Promise)
153
- ], ProductCombinationSettingMutation.prototype, "updateProductCombinationSetting", null);
154
- __decorate([
155
- (0, type_graphql_1.Directive)('@transaction'),
156
- (0, type_graphql_1.Mutation)(returns => [product_combination_setting_1.ProductCombinationSetting], {
157
- description: "To modify multiple ProductCombinationSettings' information"
158
- }),
159
- __param(0, (0, type_graphql_1.Arg)('patches', type => [product_combination_setting_type_1.ProductCombinationSettingPatch])),
160
- __param(1, (0, type_graphql_1.Ctx)()),
161
- __metadata("design:type", Function),
162
- __metadata("design:paramtypes", [Array, Object]),
163
- __metadata("design:returntype", Promise)
164
- ], ProductCombinationSettingMutation.prototype, "updateMultipleProductCombinationSetting", null);
165
- __decorate([
166
- (0, type_graphql_1.Directive)('@transaction'),
167
- (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete ProductCombinationSetting' }),
168
- __param(0, (0, type_graphql_1.Arg)('id')),
169
- __param(1, (0, type_graphql_1.Ctx)()),
170
- __metadata("design:type", Function),
171
- __metadata("design:paramtypes", [String, Object]),
172
- __metadata("design:returntype", Promise)
173
- ], ProductCombinationSettingMutation.prototype, "deleteProductCombinationSetting", null);
174
- __decorate([
175
- (0, type_graphql_1.Directive)('@transaction'),
176
- (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple productCombinationSettings' }),
177
- __param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
178
- __param(1, (0, type_graphql_1.Ctx)()),
179
- __metadata("design:type", Function),
180
- __metadata("design:paramtypes", [Array, Object]),
181
- __metadata("design:returntype", Promise)
182
- ], ProductCombinationSettingMutation.prototype, "deleteProductCombinationSettings", null);
183
- __decorate([
184
- (0, type_graphql_1.Directive)('@transaction'),
185
- (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To link product combination for kitting process' }),
186
- __param(0, (0, type_graphql_1.Arg)('productCombinationId', type => String)),
187
- __param(1, (0, type_graphql_1.Arg)('patches', type => [product_combination_setting_type_1.ProductCombinationSettingPatch])),
188
- __param(2, (0, type_graphql_1.Ctx)()),
189
- __metadata("design:type", Function),
190
- __metadata("design:paramtypes", [String, Array, Object]),
191
- __metadata("design:returntype", Promise)
192
- ], ProductCombinationSettingMutation.prototype, "linkProductCombination", null);
193
- ProductCombinationSettingMutation = __decorate([
194
- (0, type_graphql_1.Resolver)(product_combination_setting_1.ProductCombinationSetting)
195
- ], ProductCombinationSettingMutation);
196
- exports.ProductCombinationSettingMutation = ProductCombinationSettingMutation;
197
- async function updateMultipleProductCombinationSetting(patches, context) {
198
- const { domain, user, tx } = context.state;
199
- let results = [];
200
- const _createRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === '+');
201
- const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
202
- const productCombinationSettingRepo = tx.getRepository(product_combination_setting_1.ProductCombinationSetting);
203
- if (_createRecords.length > 0) {
204
- for (let i = 0; i < _createRecords.length; i++) {
205
- const newRecord = _createRecords[i];
206
- const result = await productCombinationSettingRepo.save(Object.assign(Object.assign({}, newRecord), { domain, creator: user, updater: user }));
207
- results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
208
- }
209
- }
210
- if (_updateRecords.length > 0) {
211
- for (let i = 0; i < _updateRecords.length; i++) {
212
- const newRecord = _updateRecords[i];
213
- const productCombinationSetting = await productCombinationSettingRepo.findOne(newRecord.id);
214
- const result = await productCombinationSettingRepo.save(Object.assign(Object.assign(Object.assign({}, productCombinationSetting), newRecord), { updater: user }));
215
- results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
216
- }
217
- }
218
- return results;
219
- }
220
- exports.updateMultipleProductCombinationSetting = updateMultipleProductCombinationSetting;
221
- //# sourceMappingURL=product-combination-setting-mutation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"product-combination-setting-mutation.js","sourceRoot":"","sources":["../../../server/service/product-combination-setting/product-combination-setting-mutation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAAsE;AACtE,qCAAgD;AAEhD,+EAAyE;AACzE,yFAAiH;AAEjH,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,uDAAuD,CAAC,CAAA;AAGhF,IAAM,iCAAiC,GAAvC,MAAM,iCAAiC;IAGtC,AAAN,KAAK,CAAC,+BAA+B,CACD,yBAAuD,EAClF,OAAY;QAEnB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,OAAO,MAAM,EAAE,CAAC,aAAa,CAAC,uDAAyB,CAAC,CAAC,IAAI,iCACxD,yBAAyB,KAC5B,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,I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AAC,EAAE,CAAC,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC9C,MAAM,SAAS,GAAG,cAAc,CAAC,CAAC,CAAC,CAAA;YACnC,MAAM,yBAAyB,GAAG,MAAM,6BAA6B,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;YAE3F,MAAM,MAAM,GAAG,MAAM,6BAA6B,CAAC,IAAI,+CAClD,yBAAyB,GACzB,SAAS,KACZ,OAAO,EAAE,IAAI,IACb,CAAA;YAEF,OAAO,CAAC,IAAI,iCAAM,MAAM,KAAE,MAAM,EAAE,GAAG,IAAG,CAAA;SACzC;KACF;IAED,OAAO,OAAO,CAAA;AAChB,CAAC;AAvCD,0FAuCC"}
@@ -1,177 +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, _b;
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.ProductCombinationSettingQuery = void 0;
17
- const type_graphql_1 = require("type-graphql");
18
- const typeorm_1 = require("typeorm");
19
- const biz_base_1 = require("@things-factory/biz-base");
20
- const shell_1 = require("@things-factory/shell");
21
- const product_combination_1 = require("../product-combination/product-combination");
22
- const product_detail_1 = require("../product-detail/product-detail");
23
- const product_1 = require("../product/product");
24
- const product_combination_setting_1 = require("./product-combination-setting");
25
- const product_combination_setting_type_1 = require("./product-combination-setting-type");
26
- let ProductCombinationSettingQuery = class ProductCombinationSettingQuery {
27
- async productCombinationSetting(productCombinationId, context) {
28
- const productCombination = await (0, typeorm_1.getRepository)(product_combination_1.ProductCombination).findOne({
29
- where: { id: productCombinationId },
30
- relations: ['productCombinationSetting']
31
- });
32
- const productCombinationSettings = productCombination.productCombinationSettings;
33
- return productCombinationSettings;
34
- }
35
- async productCombinationSettings(params, context) {
36
- const { domain } = context.state;
37
- const convertedParams = (0, shell_1.convertListParams)(params, domain.id);
38
- const [items, total] = await (0, typeorm_1.getRepository)(product_combination_setting_1.ProductCombinationSetting).findAndCount(convertedParams);
39
- return { items, total };
40
- }
41
- async productCombinationSets(params, context) {
42
- var _a;
43
- const { domain } = context.state;
44
- const page = params.pagination.page;
45
- const limit = params.pagination.limit;
46
- const filters = params.filters.filter(x => x.name !== 'product_info' && x.name !== 'productCombinationId' && x.name !== 'bizplace_id');
47
- const bizplaceFilter = params.filters.find(x => x.name == 'bizplace_id');
48
- const productCombinationId = params.filters.find(x => x.name === 'productCombinationId');
49
- const productInfoFilter = params.filters.find(x => x.name === 'product_info');
50
- const productInfoColumns = ['sku', 'name', 'description'];
51
- params.filters = [...filters];
52
- params.sortings = [
53
- { name: 'prd.sku' },
54
- { name: 'prdDet.gtin' },
55
- ...params.sortings.map(sorting => {
56
- const name = sorting.name.replace('product', '').toLowerCase();
57
- return Object.assign(Object.assign({}, sorting), { name });
58
- })
59
- ];
60
- if (bizplaceFilter === null || bizplaceFilter === void 0 ? void 0 : bizplaceFilter.value) {
61
- const bizplaceId = bizplaceFilter.value;
62
- const foundBizplace = await (0, typeorm_1.getRepository)(biz_base_1.Bizplace).findOne({
63
- where: { id: bizplaceId },
64
- relations: ['company', 'company.domain']
65
- });
66
- if (foundBizplace) {
67
- const companyDomain = (_a = foundBizplace.company) === null || _a === void 0 ? void 0 : _a.domain;
68
- const companyBizplace = await (0, typeorm_1.getRepository)(biz_base_1.Bizplace).findOne({ where: { domain: companyDomain } });
69
- const bizplaceIds = [companyBizplace.id, foundBizplace.id];
70
- params.filters = [...filters, { name: 'bizplace_id', operator: 'in', value: [...new Set(bizplaceIds)] }];
71
- }
72
- }
73
- else {
74
- let bizplace = await (0, typeorm_1.getRepository)(biz_base_1.Bizplace).findOne({ where: { domain } });
75
- params.filters = [...filters, { name: 'bizplace_id', operator: 'in', value: [bizplace.id] }];
76
- }
77
- const qb = (0, typeorm_1.getRepository)(product_1.Product).createQueryBuilder('prd');
78
- (0, shell_1.buildQuery)(qb, params, context, false);
79
- qb.innerJoinAndSelect('product_details', 'prdDet', 'prdDet.product_id = prd.id');
80
- qb.leftJoinAndSelect('product_combination_settings', 'pcs', `pcs.product_id = prd.id and pcs.product_detail_id = prdDet.id ${productCombinationId && productCombinationId.operator === 'noteq' ? 'and pcs.product_detail_id = null' : ''}`);
81
- qb.leftJoinAndSelect('pcs.productCombination', 'pc');
82
- if (productInfoFilter) {
83
- qb.andWhere(new typeorm_1.Brackets(qb2 => {
84
- productInfoColumns.forEach(filter => {
85
- const condition = (0, shell_1.buildCondition)(qb.alias, filter, productInfoFilter.operator, productInfoFilter.value, productInfoFilter.relation, Object.keys(qb.getParameters()).length);
86
- qb2.orWhere(condition.clause, condition.parameters);
87
- });
88
- }));
89
- }
90
- if (productCombinationId && productCombinationId.operator === 'eq') {
91
- qb.andWhere('pc.id = :combinationId::uuid', {
92
- combinationId: productCombinationId.value
93
- });
94
- }
95
- let productCombinationSets = await qb
96
- .offset((page - 1) * limit)
97
- .limit(limit)
98
- .getRawMany();
99
- const items = productCombinationSets.map(item => {
100
- return {
101
- id: item.pcs_id,
102
- productDetailId: item.prdDet_id,
103
- gtin: item.prdDet_gtin,
104
- packingType: item.prdDet_packing_type,
105
- packingSize: item.prdDet_packing_size,
106
- productId: item.prd_id,
107
- productSku: item.prd_sku,
108
- productName: item.prd_name,
109
- productDescription: item.prd_description,
110
- productType: item.prd_type,
111
- combinationId: item.pc_id,
112
- qty: item.pcs_qty
113
- };
114
- });
115
- const total = await qb.getCount();
116
- return { items, total };
117
- }
118
- async product(productCombinationSetting) {
119
- return await (0, typeorm_1.getRepository)(product_1.Product).findOne(productCombinationSetting.productId);
120
- }
121
- async productDetail(productCombinationSetting) {
122
- return await (0, typeorm_1.getRepository)(product_detail_1.ProductDetail).findOne(productCombinationSetting.productDetailId);
123
- }
124
- async productCombination(productCombinationSetting) {
125
- return await (0, typeorm_1.getRepository)(product_combination_1.ProductCombination).findOne(productCombinationSetting.productCombinationId);
126
- }
127
- };
128
- __decorate([
129
- (0, type_graphql_1.Query)(returns => product_combination_setting_1.ProductCombinationSetting, { description: 'To fetch a ProductCombinationSetting' }),
130
- __param(0, (0, type_graphql_1.Arg)('productCombinationId')),
131
- __param(1, (0, type_graphql_1.Ctx)()),
132
- __metadata("design:type", Function),
133
- __metadata("design:paramtypes", [String, Object]),
134
- __metadata("design:returntype", Promise)
135
- ], ProductCombinationSettingQuery.prototype, "productCombinationSetting", null);
136
- __decorate([
137
- (0, type_graphql_1.Query)(returns => product_combination_setting_type_1.ProductCombinationSettingList, { description: 'To fetch multiple ProductCombinationSettings' }),
138
- __param(0, (0, type_graphql_1.Args)()),
139
- __param(1, (0, type_graphql_1.Ctx)()),
140
- __metadata("design:type", Function),
141
- __metadata("design:paramtypes", [typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object, Object]),
142
- __metadata("design:returntype", Promise)
143
- ], ProductCombinationSettingQuery.prototype, "productCombinationSettings", null);
144
- __decorate([
145
- (0, type_graphql_1.Query)(returns => product_combination_setting_type_1.ProductCombinationSettingList, { description: 'To fetch a set of product combinations' }),
146
- __param(0, (0, type_graphql_1.Args)()),
147
- __param(1, (0, type_graphql_1.Ctx)()),
148
- __metadata("design:type", Function),
149
- __metadata("design:paramtypes", [typeof (_b = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _b : Object, Object]),
150
- __metadata("design:returntype", Promise)
151
- ], ProductCombinationSettingQuery.prototype, "productCombinationSets", null);
152
- __decorate([
153
- (0, type_graphql_1.FieldResolver)(type => product_1.Product),
154
- __param(0, (0, type_graphql_1.Root)()),
155
- __metadata("design:type", Function),
156
- __metadata("design:paramtypes", [product_combination_setting_1.ProductCombinationSetting]),
157
- __metadata("design:returntype", Promise)
158
- ], ProductCombinationSettingQuery.prototype, "product", null);
159
- __decorate([
160
- (0, type_graphql_1.FieldResolver)(type => product_detail_1.ProductDetail),
161
- __param(0, (0, type_graphql_1.Root)()),
162
- __metadata("design:type", Function),
163
- __metadata("design:paramtypes", [product_combination_setting_1.ProductCombinationSetting]),
164
- __metadata("design:returntype", Promise)
165
- ], ProductCombinationSettingQuery.prototype, "productDetail", null);
166
- __decorate([
167
- (0, type_graphql_1.FieldResolver)(type => product_combination_1.ProductCombination),
168
- __param(0, (0, type_graphql_1.Root)()),
169
- __metadata("design:type", Function),
170
- __metadata("design:paramtypes", [product_combination_setting_1.ProductCombinationSetting]),
171
- __metadata("design:returntype", Promise)
172
- ], ProductCombinationSettingQuery.prototype, "productCombination", null);
173
- ProductCombinationSettingQuery = __decorate([
174
- (0, type_graphql_1.Resolver)(product_combination_setting_1.ProductCombinationSetting)
175
- ], ProductCombinationSettingQuery);
176
- exports.ProductCombinationSettingQuery = ProductCombinationSettingQuery;
177
- //# sourceMappingURL=product-combination-setting-query.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"product-combination-setting-query.js","sourceRoot":"","sources":["../../../server/service/product-combination-setting/product-combination-setting-query.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAAmF;AACnF,qCAAqE;AAErE,uDAAmD;AACnD,iDAAwG;AAExG,oFAA+E;AAC/E,qEAAgE;AAChE,gDAA4C;AAC5C,+EAAyE;AACzE,yFAAkF;AAG3E,IAAM,8BAA8B,GAApC,MAAM,8BAA8B;IAEnC,AAAN,KAAK,CAAC,yBAA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