@things-factory/product-base 4.3.671 → 4.3.672

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 (111) hide show
  1. package/dist-server/constants/index.js +18 -0
  2. package/dist-server/constants/index.js.map +1 -0
  3. package/dist-server/constants/product.js +25 -0
  4. package/dist-server/constants/product.js.map +1 -0
  5. package/dist-server/controllers/index.js +1 -0
  6. package/dist-server/controllers/index.js.map +1 -0
  7. package/dist-server/index.js +19 -0
  8. package/dist-server/index.js.map +1 -0
  9. package/dist-server/middlewares/index.js +1 -0
  10. package/dist-server/middlewares/index.js.map +1 -0
  11. package/dist-server/migrations/index.js +12 -0
  12. package/dist-server/migrations/index.js.map +1 -0
  13. package/dist-server/service/index.js +74 -0
  14. package/dist-server/service/index.js.map +1 -0
  15. package/dist-server/service/product/index.js +10 -0
  16. package/dist-server/service/product/index.js.map +1 -0
  17. package/dist-server/service/product/product-mutation.js +408 -0
  18. package/dist-server/service/product/product-mutation.js.map +1 -0
  19. package/dist-server/service/product/product-query.js +373 -0
  20. package/dist-server/service/product/product-query.js.map +1 -0
  21. package/dist-server/service/product/product-types.js +618 -0
  22. package/dist-server/service/product/product-types.js.map +1 -0
  23. package/dist-server/service/product/product.js +615 -0
  24. package/dist-server/service/product/product.js.map +1 -0
  25. package/dist-server/service/product/validate-product.js +26 -0
  26. package/dist-server/service/product/validate-product.js.map +1 -0
  27. package/dist-server/service/product-barcode/index.js +9 -0
  28. package/dist-server/service/product-barcode/index.js.map +1 -0
  29. package/dist-server/service/product-barcode/product-barcode-mutation.js +120 -0
  30. package/dist-server/service/product-barcode/product-barcode-mutation.js.map +1 -0
  31. package/dist-server/service/product-barcode/product-barcode-query.js +87 -0
  32. package/dist-server/service/product-barcode/product-barcode-query.js.map +1 -0
  33. package/dist-server/service/product-barcode/product-barcode-type.js +63 -0
  34. package/dist-server/service/product-barcode/product-barcode-type.js.map +1 -0
  35. package/dist-server/service/product-barcode/product-barcode.js +104 -0
  36. package/dist-server/service/product-barcode/product-barcode.js.map +1 -0
  37. package/dist-server/service/product-bundle/index.js +9 -0
  38. package/dist-server/service/product-bundle/index.js.map +1 -0
  39. package/dist-server/service/product-bundle/product-bundle-mutation.js +130 -0
  40. package/dist-server/service/product-bundle/product-bundle-mutation.js.map +1 -0
  41. package/dist-server/service/product-bundle/product-bundle-query.js +128 -0
  42. package/dist-server/service/product-bundle/product-bundle-query.js.map +1 -0
  43. package/dist-server/service/product-bundle/product-bundle-types.js +85 -0
  44. package/dist-server/service/product-bundle/product-bundle-types.js.map +1 -0
  45. package/dist-server/service/product-bundle/product-bundle.js +128 -0
  46. package/dist-server/service/product-bundle/product-bundle.js.map +1 -0
  47. package/dist-server/service/product-bundle-setting/index.js +9 -0
  48. package/dist-server/service/product-bundle-setting/index.js.map +1 -0
  49. package/dist-server/service/product-bundle-setting/product-bundle-setting-mutation.js +165 -0
  50. package/dist-server/service/product-bundle-setting/product-bundle-setting-mutation.js.map +1 -0
  51. package/dist-server/service/product-bundle-setting/product-bundle-setting-query.js +113 -0
  52. package/dist-server/service/product-bundle-setting/product-bundle-setting-query.js.map +1 -0
  53. package/dist-server/service/product-bundle-setting/product-bundle-setting-types.js +69 -0
  54. package/dist-server/service/product-bundle-setting/product-bundle-setting-types.js.map +1 -0
  55. package/dist-server/service/product-bundle-setting/product-bundle-setting.js +63 -0
  56. package/dist-server/service/product-bundle-setting/product-bundle-setting.js.map +1 -0
  57. package/dist-server/service/product-combination/index.js +9 -0
  58. package/dist-server/service/product-combination/index.js.map +1 -0
  59. package/dist-server/service/product-combination/product-combination-mutation.js +137 -0
  60. package/dist-server/service/product-combination/product-combination-mutation.js.map +1 -0
  61. package/dist-server/service/product-combination/product-combination-query.js +86 -0
  62. package/dist-server/service/product-combination/product-combination-query.js.map +1 -0
  63. package/dist-server/service/product-combination/product-combination-type.js +83 -0
  64. package/dist-server/service/product-combination/product-combination-type.js.map +1 -0
  65. package/dist-server/service/product-combination/product-combination.js +133 -0
  66. package/dist-server/service/product-combination/product-combination.js.map +1 -0
  67. package/dist-server/service/product-combination-setting/index.js +9 -0
  68. package/dist-server/service/product-combination-setting/index.js.map +1 -0
  69. package/dist-server/service/product-combination-setting/product-combination-setting-mutation.js +221 -0
  70. package/dist-server/service/product-combination-setting/product-combination-setting-mutation.js.map +1 -0
  71. package/dist-server/service/product-combination-setting/product-combination-setting-query.js +177 -0
  72. package/dist-server/service/product-combination-setting/product-combination-setting-query.js.map +1 -0
  73. package/dist-server/service/product-combination-setting/product-combination-setting-type.js +75 -0
  74. package/dist-server/service/product-combination-setting/product-combination-setting-type.js.map +1 -0
  75. package/dist-server/service/product-combination-setting/product-combination-setting.js +105 -0
  76. package/dist-server/service/product-combination-setting/product-combination-setting.js.map +1 -0
  77. package/dist-server/service/product-detail/index.js +9 -0
  78. package/dist-server/service/product-detail/index.js.map +1 -0
  79. package/dist-server/service/product-detail/product-detail-mutation.js +374 -0
  80. package/dist-server/service/product-detail/product-detail-mutation.js.map +1 -0
  81. package/dist-server/service/product-detail/product-detail-query.js +223 -0
  82. package/dist-server/service/product-detail/product-detail-query.js.map +1 -0
  83. package/dist-server/service/product-detail/product-detail-types.js +392 -0
  84. package/dist-server/service/product-detail/product-detail-types.js.map +1 -0
  85. package/dist-server/service/product-detail/product-detail.js +444 -0
  86. package/dist-server/service/product-detail/product-detail.js.map +1 -0
  87. package/dist-server/service/product-detail-bizplace-setting/index.js +9 -0
  88. package/dist-server/service/product-detail-bizplace-setting/index.js.map +1 -0
  89. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-mutation.js +118 -0
  90. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-mutation.js.map +1 -0
  91. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-query.js +107 -0
  92. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-query.js.map +1 -0
  93. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-types.js +99 -0
  94. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-types.js.map +1 -0
  95. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting.js +120 -0
  96. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting.js.map +1 -0
  97. package/dist-server/service/product-set/index.js +9 -0
  98. package/dist-server/service/product-set/index.js.map +1 -0
  99. package/dist-server/service/product-set/product-set-mutation.js +146 -0
  100. package/dist-server/service/product-set/product-set-mutation.js.map +1 -0
  101. package/dist-server/service/product-set/product-set-query.js +136 -0
  102. package/dist-server/service/product-set/product-set-query.js.map +1 -0
  103. package/dist-server/service/product-set/product-set-types.js +77 -0
  104. package/dist-server/service/product-set/product-set-types.js.map +1 -0
  105. package/dist-server/service/product-set/product-set.js +118 -0
  106. package/dist-server/service/product-set/product-set.js.map +1 -0
  107. package/dist-server/utils/index.js +18 -0
  108. package/dist-server/utils/index.js.map +1 -0
  109. package/dist-server/utils/product-util.js +16 -0
  110. package/dist-server/utils/product-util.js.map +1 -0
  111. package/package.json +4 -4
@@ -0,0 +1,373 @@
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, _c, _d, _e;
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.ProductQuery = void 0;
17
+ const type_graphql_1 = require("type-graphql");
18
+ const typeorm_1 = require("typeorm");
19
+ const attachment_base_1 = require("@things-factory/attachment-base");
20
+ const auth_base_1 = require("@things-factory/auth-base");
21
+ const biz_base_1 = require("@things-factory/biz-base");
22
+ const env_1 = require("@things-factory/env");
23
+ const shell_1 = require("@things-factory/shell");
24
+ const product_detail_1 = require("../product-detail/product-detail");
25
+ const product_1 = require("./product");
26
+ const product_types_1 = require("./product-types");
27
+ let ProductQuery = class ProductQuery {
28
+ async product(sku, context) {
29
+ var _a;
30
+ const { domain, user } = context.state;
31
+ if ((_a = context === null || context === void 0 ? void 0 : context.state) === null || _a === void 0 ? void 0 : _a.bizplace) {
32
+ return await (0, typeorm_1.getRepository)(product_1.Product).findOne({
33
+ where: {
34
+ domain: domain,
35
+ sku,
36
+ bizplace: context.state.bizplace
37
+ },
38
+ relations: ['domain', 'bizplace', 'productRef', 'creator', 'updater']
39
+ });
40
+ }
41
+ else {
42
+ return await (0, typeorm_1.getRepository)(product_1.Product).findOne({
43
+ where: {
44
+ domain: domain,
45
+ sku,
46
+ bizplace: (0, typeorm_1.In)(await (0, biz_base_1.getPermittedBizplaceIds)(domain, user))
47
+ },
48
+ relations: ['domain', 'bizplace', 'productRef', 'creator', 'updater']
49
+ });
50
+ }
51
+ }
52
+ async products(params, context) {
53
+ var _a;
54
+ const { domain, user } = context.state;
55
+ const { domains } = user;
56
+ let bizplaces;
57
+ if (!params.filters.find((filter) => filter.name === 'bizplace_id')) {
58
+ const warehouseDomain = domain;
59
+ const companiesBizplaces = await (0, biz_base_1.getCompaniesBizplaces)(domains, warehouseDomain);
60
+ const partnersCompanyBizplaces = await (0, biz_base_1.getPartnersCompanyBizplaces)(domain, user);
61
+ bizplaces = [...companiesBizplaces, ...partnersCompanyBizplaces];
62
+ }
63
+ else {
64
+ const bizplaceId = params.filters.filter(param => param.name == 'bizplace_id').map(item => item.value);
65
+ const foundBizplace = await (0, typeorm_1.getRepository)(biz_base_1.Bizplace).findOne({
66
+ where: { id: bizplaceId[0] },
67
+ relations: ['company', 'company.domain']
68
+ });
69
+ if (foundBizplace) {
70
+ const companyDomain = (_a = foundBizplace.company) === null || _a === void 0 ? void 0 : _a.domain;
71
+ const companyBizplace = await (0, typeorm_1.getRepository)(biz_base_1.Bizplace).findOne({ where: { domain: companyDomain } });
72
+ bizplaces = [companyBizplace, foundBizplace];
73
+ }
74
+ }
75
+ const qb = buildCustomConditions(params, context, bizplaces);
76
+ let [items, total] = await qb
77
+ .leftJoinAndSelect('product.productDetails', 'productDetails')
78
+ .leftJoinAndSelect('productDetails.productBarcodes', 'productBarcodes')
79
+ .leftJoinAndSelect('productDetails.childProductDetail', 'childProductDetail')
80
+ .getManyAndCount();
81
+ return { items, total };
82
+ }
83
+ async myBizplaceProducts(params, context) {
84
+ try {
85
+ const { domain, user } = context.state;
86
+ const bizplaceFilter = params.filters.find(filter => filter.name === 'bizplace_id');
87
+ let bizplaces = [];
88
+ if (!bizplaceFilter) {
89
+ bizplaces.push(await (0, typeorm_1.getRepository)(biz_base_1.Bizplace).findOne({ where: { domain } }));
90
+ }
91
+ const qb = buildCustomConditions(params, context, bizplaces);
92
+ let [items, total] = await qb
93
+ .leftJoinAndSelect('product.productDetails', 'productDetails')
94
+ .leftJoinAndSelect('productDetails.productBarcodes', 'productBarcodes')
95
+ .leftJoinAndSelect('product.routing', 'routing')
96
+ .getManyAndCount();
97
+ items = items.map(itm => {
98
+ let defaultProductDetail = itm.productDetails.find(itm => itm.isDefault);
99
+ return Object.assign(Object.assign(Object.assign({}, itm), new product_detail_1.ProductDetail(defaultProductDetail, true)), { productDetails: itm.productDetails });
100
+ });
101
+ return { items, total };
102
+ }
103
+ catch (error) {
104
+ env_1.logger.error(`product-query[myBizplaceProducts]: ${error}`);
105
+ throw error;
106
+ }
107
+ }
108
+ async productsByBizplace(params, context) {
109
+ const { domain, user } = context.state;
110
+ const bizplaceFilter = params.filters.find(x => x.name == 'bizplace');
111
+ try {
112
+ let bizplaces;
113
+ if (!bizplaceFilter || bizplaceFilter.value == '') {
114
+ bizplaces = [await (0, biz_base_1.getMyBizplace)(domain, user), await (0, biz_base_1.getCompanyBizplace)(domain, user)];
115
+ }
116
+ else {
117
+ let myBizplace = await (0, typeorm_1.getRepository)(biz_base_1.Bizplace).findOne(bizplaceFilter.value, {
118
+ relations: ['company', 'company.domain']
119
+ });
120
+ bizplaces = [
121
+ myBizplace,
122
+ await (0, typeorm_1.getRepository)(biz_base_1.Bizplace).findOne({
123
+ where: { domain: myBizplace.company.domain }
124
+ })
125
+ ];
126
+ }
127
+ const qb = buildCustomConditions(params, context, bizplaces);
128
+ let [items, total] = await qb.leftJoinAndSelect('product.productDetails', 'productDetails').getManyAndCount();
129
+ items = items.map(itm => {
130
+ var _a;
131
+ let defaultProductDetail = (_a = itm.productDetails) === null || _a === void 0 ? void 0 : _a.find(itm => itm.isDefault);
132
+ return Object.assign(Object.assign({}, itm), new product_detail_1.ProductDetail(defaultProductDetail, true));
133
+ });
134
+ return { items, total };
135
+ }
136
+ catch (error) {
137
+ throw error;
138
+ }
139
+ }
140
+ /**
141
+ * @description this resolver was specially made to return huge products data
142
+ * without dropping off performance due to typegraphql limitations
143
+ * @returns pure product data only. there will be no other table joined to avoid
144
+ * ORM lagging issue (converting to object extremely withdraws the performance)
145
+ * */
146
+ async pureProductsByBizplace(params, context) {
147
+ const { domain, user } = context.state;
148
+ const bizplaceFilter = params.filters.find(x => x.name == 'bizplace');
149
+ try {
150
+ let bizplaces;
151
+ if (!bizplaceFilter || bizplaceFilter.value == '') {
152
+ bizplaces = [await (0, biz_base_1.getMyBizplace)(domain, user), await (0, biz_base_1.getCompanyBizplace)(domain, user)];
153
+ }
154
+ else {
155
+ let myBizplace = await (0, typeorm_1.getRepository)(biz_base_1.Bizplace).findOne(bizplaceFilter.value, {
156
+ relations: ['company', 'company.domain']
157
+ });
158
+ bizplaces = [
159
+ myBizplace,
160
+ await (0, typeorm_1.getRepository)(biz_base_1.Bizplace).findOne({
161
+ where: { domain: myBizplace.company.domain }
162
+ })
163
+ ];
164
+ }
165
+ const qb = buildCustomConditions(params, context, bizplaces);
166
+ let items = await (await qb.getRawMany()).map(item => new product_1.Product(item));
167
+ let total = await qb.getCount();
168
+ return { items, total };
169
+ }
170
+ catch (error) {
171
+ throw error;
172
+ }
173
+ }
174
+ async productBrands(params, context) {
175
+ const { domain, user } = context.state;
176
+ const { domains } = user;
177
+ let [items, total] = await (0, typeorm_1.getRepository)(product_1.Product)
178
+ .createQueryBuilder('product')
179
+ .leftJoinAndSelect('product.productDetails', 'productDetails')
180
+ .leftJoinAndSelect('productDetails.productBarcodes', 'productBarcodes')
181
+ .leftJoinAndSelect('productDetails.childProductDetail', 'childProductDetail')
182
+ .where('product.domain_id =:domain', { domain: context.state.domain.id })
183
+ .getManyAndCount();
184
+ // gives out different brand only
185
+ const brand = [...new Map(items.map(obj => [obj['brand'], obj])).values()];
186
+ items = brand;
187
+ return { items, total };
188
+ }
189
+ async domain(product) {
190
+ if (product.domainId)
191
+ return await (0, typeorm_1.getRepository)(shell_1.Domain).findOne(product.domainId);
192
+ else
193
+ return null;
194
+ }
195
+ async bizplace(product) {
196
+ if (product.bizplaceId)
197
+ return await (0, typeorm_1.getRepository)(biz_base_1.Bizplace).findOne(product.bizplaceId);
198
+ else
199
+ return null;
200
+ }
201
+ async creator(product) {
202
+ if (product.creatorId)
203
+ return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(product.creatorId);
204
+ else
205
+ return null;
206
+ }
207
+ async updater(product) {
208
+ if (product.updaterId)
209
+ return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(product.updaterId);
210
+ else
211
+ return null;
212
+ }
213
+ async parentProductRef(product) {
214
+ if (product.parentProductRefId)
215
+ return await (0, typeorm_1.getRepository)(product_1.Product).findOne(product.parentProductRefId);
216
+ else
217
+ return null;
218
+ }
219
+ async productRef(product) {
220
+ if (product.productRefId)
221
+ return await (0, typeorm_1.getRepository)(product_1.Product).findOne(product.productRefId);
222
+ else
223
+ return null;
224
+ }
225
+ async thumbnail(product) {
226
+ const attachment = await (0, typeorm_1.getRepository)(attachment_base_1.Attachment).findOne({
227
+ where: {
228
+ domain: product.domainId,
229
+ refBy: product.id
230
+ }
231
+ });
232
+ return attachment === null || attachment === void 0 ? void 0 : attachment.fullpath;
233
+ }
234
+ productInformation(product) {
235
+ return `[${product.sku}] ${product.name}${product.description ? ` - ${product.description}` : ''}`;
236
+ }
237
+ };
238
+ __decorate([
239
+ (0, type_graphql_1.Directive)('@privilege(category: "order", privilege: "query")'),
240
+ (0, type_graphql_1.Query)(returns => product_1.Product),
241
+ __param(0, (0, type_graphql_1.Arg)('sku')),
242
+ __param(1, (0, type_graphql_1.Ctx)()),
243
+ __metadata("design:type", Function),
244
+ __metadata("design:paramtypes", [String, Object]),
245
+ __metadata("design:returntype", Promise)
246
+ ], ProductQuery.prototype, "product", null);
247
+ __decorate([
248
+ (0, type_graphql_1.Directive)('@privilege(category: "order", privilege: "query")'),
249
+ (0, type_graphql_1.Query)(returns => product_types_1.ProductList),
250
+ __param(0, (0, type_graphql_1.Args)()),
251
+ __param(1, (0, type_graphql_1.Ctx)()),
252
+ __metadata("design:type", Function),
253
+ __metadata("design:paramtypes", [typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object, Object]),
254
+ __metadata("design:returntype", Promise)
255
+ ], ProductQuery.prototype, "products", null);
256
+ __decorate([
257
+ (0, type_graphql_1.Directive)('@privilege(category: "order", privilege: "query")'),
258
+ (0, type_graphql_1.Query)(returns => product_types_1.ProductList),
259
+ __param(0, (0, type_graphql_1.Args)()),
260
+ __param(1, (0, type_graphql_1.Ctx)()),
261
+ __metadata("design:type", Function),
262
+ __metadata("design:paramtypes", [typeof (_b = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _b : Object, Object]),
263
+ __metadata("design:returntype", Promise)
264
+ ], ProductQuery.prototype, "myBizplaceProducts", null);
265
+ __decorate([
266
+ (0, type_graphql_1.Directive)('@privilege(category: "order", privilege: "query")'),
267
+ (0, type_graphql_1.Query)(returns => product_types_1.ProductList),
268
+ __param(0, (0, type_graphql_1.Args)()),
269
+ __param(1, (0, type_graphql_1.Ctx)()),
270
+ __metadata("design:type", Function),
271
+ __metadata("design:paramtypes", [typeof (_c = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _c : Object, Object]),
272
+ __metadata("design:returntype", Promise)
273
+ ], ProductQuery.prototype, "productsByBizplace", null);
274
+ __decorate([
275
+ (0, type_graphql_1.Directive)('@privilege(category: "order", privilege: "query")'),
276
+ (0, type_graphql_1.Query)(returns => product_types_1.ProductList),
277
+ __param(0, (0, type_graphql_1.Args)()),
278
+ __param(1, (0, type_graphql_1.Ctx)()),
279
+ __metadata("design:type", Function),
280
+ __metadata("design:paramtypes", [typeof (_d = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _d : Object, Object]),
281
+ __metadata("design:returntype", Promise)
282
+ ], ProductQuery.prototype, "pureProductsByBizplace", null);
283
+ __decorate([
284
+ (0, type_graphql_1.Directive)('@privilege(category: "order", privilege: "query")'),
285
+ (0, type_graphql_1.Query)(returns => product_types_1.ProductList),
286
+ __param(0, (0, type_graphql_1.Args)()),
287
+ __param(1, (0, type_graphql_1.Ctx)()),
288
+ __metadata("design:type", Function),
289
+ __metadata("design:paramtypes", [typeof (_e = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _e : Object, Object]),
290
+ __metadata("design:returntype", Promise)
291
+ ], ProductQuery.prototype, "productBrands", null);
292
+ __decorate([
293
+ (0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
294
+ __param(0, (0, type_graphql_1.Root)()),
295
+ __metadata("design:type", Function),
296
+ __metadata("design:paramtypes", [product_1.Product]),
297
+ __metadata("design:returntype", Promise)
298
+ ], ProductQuery.prototype, "domain", null);
299
+ __decorate([
300
+ (0, type_graphql_1.FieldResolver)(type => biz_base_1.Bizplace),
301
+ __param(0, (0, type_graphql_1.Root)()),
302
+ __metadata("design:type", Function),
303
+ __metadata("design:paramtypes", [product_1.Product]),
304
+ __metadata("design:returntype", Promise)
305
+ ], ProductQuery.prototype, "bizplace", null);
306
+ __decorate([
307
+ (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
308
+ __param(0, (0, type_graphql_1.Root)()),
309
+ __metadata("design:type", Function),
310
+ __metadata("design:paramtypes", [product_1.Product]),
311
+ __metadata("design:returntype", Promise)
312
+ ], ProductQuery.prototype, "creator", null);
313
+ __decorate([
314
+ (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
315
+ __param(0, (0, type_graphql_1.Root)()),
316
+ __metadata("design:type", Function),
317
+ __metadata("design:paramtypes", [product_1.Product]),
318
+ __metadata("design:returntype", Promise)
319
+ ], ProductQuery.prototype, "updater", null);
320
+ __decorate([
321
+ (0, type_graphql_1.FieldResolver)(type => product_1.Product),
322
+ __param(0, (0, type_graphql_1.Root)()),
323
+ __metadata("design:type", Function),
324
+ __metadata("design:paramtypes", [product_1.Product]),
325
+ __metadata("design:returntype", Promise)
326
+ ], ProductQuery.prototype, "parentProductRef", null);
327
+ __decorate([
328
+ (0, type_graphql_1.FieldResolver)(type => product_1.Product),
329
+ __param(0, (0, type_graphql_1.Root)()),
330
+ __metadata("design:type", Function),
331
+ __metadata("design:paramtypes", [product_1.Product]),
332
+ __metadata("design:returntype", Promise)
333
+ ], ProductQuery.prototype, "productRef", null);
334
+ __decorate([
335
+ (0, type_graphql_1.FieldResolver)(type => String),
336
+ __param(0, (0, type_graphql_1.Root)()),
337
+ __metadata("design:type", Function),
338
+ __metadata("design:paramtypes", [product_1.Product]),
339
+ __metadata("design:returntype", Promise)
340
+ ], ProductQuery.prototype, "thumbnail", null);
341
+ __decorate([
342
+ (0, type_graphql_1.FieldResolver)(type => String),
343
+ __param(0, (0, type_graphql_1.Root)()),
344
+ __metadata("design:type", Function),
345
+ __metadata("design:paramtypes", [product_1.Product]),
346
+ __metadata("design:returntype", String)
347
+ ], ProductQuery.prototype, "productInformation", null);
348
+ ProductQuery = __decorate([
349
+ (0, type_graphql_1.Resolver)(product_1.Product)
350
+ ], ProductQuery);
351
+ exports.ProductQuery = ProductQuery;
352
+ function buildCustomConditions(params, context, bizplaces) {
353
+ const deletedFilter = params.filters.find(x => x.name == 'deleted');
354
+ const productFilters = params.filters.find(x => x.name == 'product_info');
355
+ const productFilterColumns = ['sku', 'brandSku', 'name', 'description', 'brand', 'subBrand'];
356
+ params.filters = [
357
+ ...params.filters.filter(x => ['product_info', 'bizplace', 'bizplace_id', 'deleted'].indexOf(x.name) == -1),
358
+ { name: 'deletedAt', operator: (deletedFilter === null || deletedFilter === void 0 ? void 0 : deletedFilter.value) ? 'is_not_null' : 'is_null' },
359
+ { name: 'bizplace_id', operator: 'in', value: bizplaces.map(bizplace => bizplace.id) }
360
+ ];
361
+ const qb = (0, typeorm_1.getRepository)(product_1.Product).createQueryBuilder('product');
362
+ (0, shell_1.buildQuery)(qb, params, context, false);
363
+ if (productFilters) {
364
+ qb.andWhere(new typeorm_1.Brackets(qb2 => {
365
+ productFilterColumns.forEach(filter => {
366
+ const condition = (0, shell_1.buildCondition)(qb.alias, filter, productFilters.operator, productFilters.value, productFilters.relation, Object.keys(qb.getParameters()).length);
367
+ qb2.orWhere(condition.clause, condition.parameters);
368
+ });
369
+ }));
370
+ }
371
+ return qb;
372
+ }
373
+ //# sourceMappingURL=product-query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"product-query.js","sourceRoot":"","sources":["../../../server/service/product/product-query.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA8F;AAC9F,qCAAyE;AAEzE,qEAA4D;AAC5D,yDAAgD;AAChD,uDAOiC;AACjC,6CAA4C;AAC5C,iDAAqF;AAErF,qEAAgE;AAChE,uCAAmC;AACnC,mDAA6C;AAGtC,IAAM,YAAY,GAAlB,MAAM,YAAY;IAGjB,A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