@things-factory/product-base 5.0.2 → 5.0.14
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.
- package/dist-server/constants/index.js +2 -15
- package/dist-server/constants/index.js.map +1 -1
- package/dist-server/constants/product.js.map +1 -1
- package/dist-server/controllers/index.js.map +1 -1
- package/dist-server/index.js +3 -16
- package/dist-server/index.js.map +1 -1
- package/dist-server/middlewares/index.js.map +1 -1
- package/dist-server/migrations/index.js.map +1 -1
- package/dist-server/service/index.js +17 -30
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/product/index.js.map +1 -1
- package/dist-server/service/product/product-mutation.js +59 -73
- package/dist-server/service/product/product-mutation.js.map +1 -1
- package/dist-server/service/product/product-query.js +78 -89
- package/dist-server/service/product/product-query.js.map +1 -1
- package/dist-server/service/product/product-types.js +261 -272
- package/dist-server/service/product/product-types.js.map +1 -1
- package/dist-server/service/product/product.js +179 -187
- package/dist-server/service/product/product.js.map +1 -1
- package/dist-server/service/product/validate-product.js +2 -4
- package/dist-server/service/product/validate-product.js.map +1 -1
- package/dist-server/service/product-bundle/index.js.map +1 -1
- package/dist-server/service/product-bundle/product-bundle-mutation.js +33 -44
- package/dist-server/service/product-bundle/product-bundle-mutation.js.map +1 -1
- package/dist-server/service/product-bundle/product-bundle-query.js +35 -46
- package/dist-server/service/product-bundle/product-bundle-query.js.map +1 -1
- package/dist-server/service/product-bundle/product-bundle-types.js +30 -38
- package/dist-server/service/product-bundle/product-bundle-types.js.map +1 -1
- package/dist-server/service/product-bundle/product-bundle.js +40 -48
- package/dist-server/service/product-bundle/product-bundle.js.map +1 -1
- package/dist-server/service/product-bundle-setting/index.js.map +1 -1
- package/dist-server/service/product-bundle-setting/product-bundle-setting-mutation.js +27 -38
- package/dist-server/service/product-bundle-setting/product-bundle-setting-mutation.js.map +1 -1
- package/dist-server/service/product-bundle-setting/product-bundle-setting-query.js +14 -25
- package/dist-server/service/product-bundle-setting/product-bundle-setting-query.js.map +1 -1
- package/dist-server/service/product-bundle-setting/product-bundle-setting-types.js +23 -31
- package/dist-server/service/product-bundle-setting/product-bundle-setting-types.js.map +1 -1
- package/dist-server/service/product-bundle-setting/product-bundle-setting.js +16 -24
- package/dist-server/service/product-bundle-setting/product-bundle-setting.js.map +1 -1
- package/dist-server/service/product-combination/index.js.map +1 -1
- package/dist-server/service/product-combination/product-combination-mutation.js +34 -45
- package/dist-server/service/product-combination/product-combination-mutation.js.map +1 -1
- package/dist-server/service/product-combination/product-combination-query.js +29 -40
- package/dist-server/service/product-combination/product-combination-query.js.map +1 -1
- package/dist-server/service/product-combination/product-combination-type.js +28 -36
- package/dist-server/service/product-combination/product-combination-type.js.map +1 -1
- package/dist-server/service/product-combination/product-combination.js +42 -50
- package/dist-server/service/product-combination/product-combination.js.map +1 -1
- package/dist-server/service/product-combination-setting/index.js.map +1 -1
- package/dist-server/service/product-combination-setting/product-combination-setting-mutation.js +40 -51
- package/dist-server/service/product-combination-setting/product-combination-setting-mutation.js.map +1 -1
- package/dist-server/service/product-combination-setting/product-combination-setting-query.js +35 -46
- package/dist-server/service/product-combination-setting/product-combination-setting-query.js.map +1 -1
- package/dist-server/service/product-combination-setting/product-combination-setting-type.js +24 -32
- package/dist-server/service/product-combination-setting/product-combination-setting-type.js.map +1 -1
- package/dist-server/service/product-combination-setting/product-combination-setting.js +36 -44
- package/dist-server/service/product-combination-setting/product-combination-setting.js.map +1 -1
- package/dist-server/service/product-detail/index.js.map +1 -1
- package/dist-server/service/product-detail/product-detail-mutation.js +30 -51
- package/dist-server/service/product-detail/product-detail-mutation.js.map +1 -1
- package/dist-server/service/product-detail/product-detail-query.js +33 -44
- package/dist-server/service/product-detail/product-detail-query.js.map +1 -1
- package/dist-server/service/product-detail/product-detail-types.js +180 -188
- package/dist-server/service/product-detail/product-detail-types.js.map +1 -1
- package/dist-server/service/product-detail/product-detail.js +127 -135
- package/dist-server/service/product-detail/product-detail.js.map +1 -1
- package/dist-server/service/product-detail-bizplace-setting/index.js.map +1 -1
- package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-mutation.js +28 -39
- package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-mutation.js.map +1 -1
- package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-query.js +29 -40
- package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-query.js.map +1 -1
- package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-types.js +36 -44
- package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-types.js.map +1 -1
- package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting.js +32 -40
- package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting.js.map +1 -1
- package/dist-server/service/product-set/index.js.map +1 -1
- package/dist-server/service/product-set/product-set-mutation.js +33 -44
- package/dist-server/service/product-set/product-set-mutation.js.map +1 -1
- package/dist-server/service/product-set/product-set-query.js +35 -46
- package/dist-server/service/product-set/product-set-query.js.map +1 -1
- package/dist-server/service/product-set/product-set-types.js +26 -34
- package/dist-server/service/product-set/product-set-types.js.map +1 -1
- package/dist-server/service/product-set/product-set.js +34 -42
- package/dist-server/service/product-set/product-set.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -0
- package/dist-server/utils/index.js +2 -15
- package/dist-server/utils/index.js.map +1 -1
- package/dist-server/utils/product-util.js.map +1 -1
- package/package.json +4 -4
- package/server/service/product/product-query.ts +1 -1
- package/server/service/product/product.ts +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product-detail-bizplace-setting-mutation.js","sourceRoot":"","sources":["../../../server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-mutation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"product-detail-bizplace-setting-mutation.js","sourceRoot":"","sources":["../../../server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;A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AG,GAAE,CAAA;;;;8FAMzE;AAGD;IADC,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC;IAE1B,mBAAA,IAAA,kBAAG,EAAC,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAC9B,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;+FAUP;AAvGU,oCAAoC;IADhD,IAAA,uBAAQ,EAAC,8DAA4B,CAAC;GAC1B,oCAAoC,CAwGhD;AAxGY,oFAAoC","sourcesContent":["import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\nimport { getRepository, In } from 'typeorm'\n\nimport { ProductDetail } from '../product-detail/product-detail'\nimport { ProductDetailBizplaceSetting } from './product-detail-bizplace-setting'\nimport { ProductDetailBizplaceSettingPatch } from './product-detail-bizplace-setting-types'\n\n@Resolver(ProductDetailBizplaceSetting)\nexport class ProductDetailBizplaceSettingMutation {\n @Mutation(returns => ProductDetailBizplaceSetting)\n async updateProductDetailBizplaceSetting(\n @Arg('name') name: string,\n @Arg('patch') patch: ProductDetailBizplaceSettingPatch,\n @Ctx() context: any\n ): Promise<ProductDetailBizplaceSetting> {\n const { domain, user } = context.state\n\n const repository = getRepository(ProductDetailBizplaceSetting)\n const productDetailBizplaceSetting = await repository.findOne({\n where: { domain, name }\n })\n\n return await repository.save({\n ...productDetailBizplaceSetting,\n ...patch,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => [ProductDetailBizplaceSetting])\n async updateMultipleProductDetailBizplaceSetting(\n @Arg('productId') productId: string,\n @Arg('patches', type => [ProductDetailBizplaceSettingPatch]) patches: ProductDetailBizplaceSettingPatch[],\n @Ctx() context: any\n ): Promise<ProductDetailBizplaceSettingPatch[]> {\n const { domain, user, tx } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => !patch.id)\n const _updateRecords = patches.filter((patch: any) => patch.id)\n\n const productDetailBizplaceSettingRepo = tx.getRepository(ProductDetailBizplaceSetting)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n delete newRecord.id\n\n const productDetail = await tx.getRepository(ProductDetail).findOne(newRecord.productDetail.id)\n\n if (productDetail) {\n const result = await productDetailBizplaceSettingRepo.save({\n ...newRecord,\n name: productDetail.gtin,\n productDetail,\n domain: domain,\n creator: user,\n updater: user\n })\n results.push({ ...result, cuFlag: '+' })\n }\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const newRecord = _updateRecords[i]\n const productDetailBizplaceSetting = await productDetailBizplaceSettingRepo.findOne({\n domain,\n id: newRecord.id\n })\n const productDetail = await tx.getRepository(ProductDetail).findOne(newRecord.productDetail.id)\n\n const result = await productDetailBizplaceSettingRepo.save({\n ...productDetailBizplaceSetting,\n ...newRecord,\n name: productDetail.gtin,\n productDetail,\n updater: user\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Mutation(returns => Boolean)\n async deleteProductDetailBizplaceSetting(@Arg('name') name: string, @Ctx() context: any): Promise<Boolean> {\n const { domain } = context.state\n\n await getRepository(ProductDetailBizplaceSetting).delete({ domain, name })\n\n return true\n }\n\n @Mutation(returns => Boolean)\n async deleteProductDetailBizplaceSettings(\n @Arg('names', type => [String]) names: string[],\n @Ctx() context: any\n ): Promise<Boolean> {\n const { domain } = context.state\n\n await getRepository(ProductDetailBizplaceSetting).delete({\n domain,\n name: In(names)\n })\n\n return true\n }\n}\n"]}
|
package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-query.js
CHANGED
|
@@ -1,19 +1,8 @@
|
|
|
1
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
2
|
var _a;
|
|
15
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
4
|
exports.ProductDetailBizplaceSettingQuery = void 0;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
17
6
|
const type_graphql_1 = require("type-graphql");
|
|
18
7
|
const typeorm_1 = require("typeorm");
|
|
19
8
|
const auth_base_1 = require("@things-factory/auth-base");
|
|
@@ -65,44 +54,44 @@ let ProductDetailBizplaceSettingQuery = class ProductDetailBizplaceSettingQuery
|
|
|
65
54
|
return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(productDetailBizplaceSetting.creator.id);
|
|
66
55
|
}
|
|
67
56
|
};
|
|
68
|
-
__decorate([
|
|
57
|
+
tslib_1.__decorate([
|
|
69
58
|
(0, type_graphql_1.Query)(returns => product_detail_bizplace_setting_1.ProductDetailBizplaceSetting),
|
|
70
|
-
__param(0, (0, type_graphql_1.Arg)('name')),
|
|
71
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
72
|
-
__metadata("design:type", Function),
|
|
73
|
-
__metadata("design:paramtypes", [String, Object]),
|
|
74
|
-
__metadata("design:returntype", Promise)
|
|
59
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('name')),
|
|
60
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
61
|
+
tslib_1.__metadata("design:type", Function),
|
|
62
|
+
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
63
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
75
64
|
], ProductDetailBizplaceSettingQuery.prototype, "productDetailBizplaceSetting", null);
|
|
76
|
-
__decorate([
|
|
65
|
+
tslib_1.__decorate([
|
|
77
66
|
(0, type_graphql_1.Query)(returns => product_detail_bizplace_setting_types_1.ProductDetailBizplaceSettingList),
|
|
78
|
-
__param(0, (0, type_graphql_1.Args)()),
|
|
79
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
80
|
-
__metadata("design:type", Function),
|
|
81
|
-
__metadata("design:paramtypes", [typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object, Object]),
|
|
82
|
-
__metadata("design:returntype", Promise)
|
|
67
|
+
tslib_1.__param(0, (0, type_graphql_1.Args)()),
|
|
68
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
69
|
+
tslib_1.__metadata("design:type", Function),
|
|
70
|
+
tslib_1.__metadata("design:paramtypes", [typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object, Object]),
|
|
71
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
83
72
|
], ProductDetailBizplaceSettingQuery.prototype, "productDetailBizplaceSettings", null);
|
|
84
|
-
__decorate([
|
|
73
|
+
tslib_1.__decorate([
|
|
85
74
|
(0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
|
|
86
|
-
__param(0, (0, type_graphql_1.Root)()),
|
|
87
|
-
__metadata("design:type", Function),
|
|
88
|
-
__metadata("design:paramtypes", [product_detail_bizplace_setting_1.ProductDetailBizplaceSetting]),
|
|
89
|
-
__metadata("design:returntype", Promise)
|
|
75
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
76
|
+
tslib_1.__metadata("design:type", Function),
|
|
77
|
+
tslib_1.__metadata("design:paramtypes", [product_detail_bizplace_setting_1.ProductDetailBizplaceSetting]),
|
|
78
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
90
79
|
], ProductDetailBizplaceSettingQuery.prototype, "domain", null);
|
|
91
|
-
__decorate([
|
|
80
|
+
tslib_1.__decorate([
|
|
92
81
|
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
|
|
93
|
-
__param(0, (0, type_graphql_1.Root)()),
|
|
94
|
-
__metadata("design:type", Function),
|
|
95
|
-
__metadata("design:paramtypes", [product_detail_bizplace_setting_1.ProductDetailBizplaceSetting]),
|
|
96
|
-
__metadata("design:returntype", Promise)
|
|
82
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
83
|
+
tslib_1.__metadata("design:type", Function),
|
|
84
|
+
tslib_1.__metadata("design:paramtypes", [product_detail_bizplace_setting_1.ProductDetailBizplaceSetting]),
|
|
85
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
97
86
|
], ProductDetailBizplaceSettingQuery.prototype, "updater", null);
|
|
98
|
-
__decorate([
|
|
87
|
+
tslib_1.__decorate([
|
|
99
88
|
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
|
|
100
|
-
__param(0, (0, type_graphql_1.Root)()),
|
|
101
|
-
__metadata("design:type", Function),
|
|
102
|
-
__metadata("design:paramtypes", [product_detail_bizplace_setting_1.ProductDetailBizplaceSetting]),
|
|
103
|
-
__metadata("design:returntype", Promise)
|
|
89
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
90
|
+
tslib_1.__metadata("design:type", Function),
|
|
91
|
+
tslib_1.__metadata("design:paramtypes", [product_detail_bizplace_setting_1.ProductDetailBizplaceSetting]),
|
|
92
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
104
93
|
], ProductDetailBizplaceSettingQuery.prototype, "creator", null);
|
|
105
|
-
ProductDetailBizplaceSettingQuery = __decorate([
|
|
94
|
+
ProductDetailBizplaceSettingQuery = tslib_1.__decorate([
|
|
106
95
|
(0, type_graphql_1.Resolver)(product_detail_bizplace_setting_1.ProductDetailBizplaceSetting)
|
|
107
96
|
], ProductDetailBizplaceSettingQuery);
|
|
108
97
|
exports.ProductDetailBizplaceSettingQuery = ProductDetailBizplaceSettingQuery;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product-detail-bizplace-setting-query.js","sourceRoot":"","sources":["../../../server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-query.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"product-detail-bizplace-setting-query.js","sourceRoot":"","sources":["../../../server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-query.ts"],"names":[],"mappings":";;;;;AAAA,+CAAmF;AACnF,qCAAuC;AAEvC,yDAAgD;AAChD,iDAAqE;AAErE,qEAAgE;AAChE,uFAAgF;AAChF,mGAA0F;AAG1F,IAAa,iCAAiC,GAA9C,MAAa,iCAAiC;IAE5C,KAAK,CAAC,4BAA4B,CACnB,IAAY,EAClB,OAAY;QAEnB,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAChC,MAAM,UAAU,GAAG,IAAA,uBAAa,EAAC,8DAA4B,CAAC,CAAA;QAE9D,OAAO,MAAM,UAAU,CAAC,OAAO,CAAC;YAC9B,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;SACxB,CAAC,CAAA;IACJ,CAAC;IAGD,KAAK,CAAC,6BAA6B,CACzB,MAAiB,EAClB,OAAY;QAEnB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAmC,OAAO,CAAC,KAAK,CAAA;QAE/E,MAAM,YAAY,GAAG,IAAA,uBAAa,EAAC,8BAAa,CAAC,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAA;QAErF,IAAA,kBAAU,EAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE;YACxC,SAAS,EAAE,KAAK;SACjB,CAAC,CAAA;QAEF,IAAI,EAAE,GAAG,YAAY;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C,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,8DAA4B,CAAC;IAE5C,mBAAA,IAAA,kBAAG,EAAC,MAAM,CAAC,CAAA;IACX,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;qFAQP;AAGD;IADC,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,wEAAgC,CAAC;IAEhD,mBAAA,IAAA,mBAAI,GAAE,CAAA;IACN,mBAAA,IAAA,kBAAG,GAAE,CAAA;;iEADU,iBAAS,oBAAT,iBAAS;;sFA+C1B;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAA+B,8DAA4B;;+DAE9E;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAA+B,8DAA4B;;gEAE/E;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAA+B,8DAA4B;;gEAE/E;AA9EU,iCAAiC;IAD7C,IAAA,uBAAQ,EAAC,8DAA4B,CAAC;GAC1B,iCAAiC,CA+E7C;AA/EY,8EAAiC","sourcesContent":["import { Arg, Args, Ctx, FieldResolver, Query, Resolver, Root } from 'type-graphql'\nimport { getRepository } from 'typeorm'\n\nimport { User } from '@things-factory/auth-base'\nimport { buildQuery, Domain, ListParam } from '@things-factory/shell'\n\nimport { ProductDetail } from '../product-detail/product-detail'\nimport { ProductDetailBizplaceSetting } from './product-detail-bizplace-setting'\nimport { ProductDetailBizplaceSettingList } from './product-detail-bizplace-setting-types'\n\n@Resolver(ProductDetailBizplaceSetting)\nexport class ProductDetailBizplaceSettingQuery {\n @Query(returns => ProductDetailBizplaceSetting)\n async productDetailBizplaceSetting(\n @Arg('name') name: string,\n @Ctx() context: any\n ): Promise<ProductDetailBizplaceSetting> {\n const { domain } = context.state\n const repository = getRepository(ProductDetailBizplaceSetting)\n\n return await repository.findOne({\n where: { domain, name }\n })\n }\n\n @Query(returns => ProductDetailBizplaceSettingList)\n async productDetailBizplaceSettings(\n @Args() params: ListParam,\n @Ctx() context: any\n ): Promise<ProductDetailBizplaceSettingList> {\n const { domain, user: updater }: { domain: Domain; user: User } = context.state\n\n const queryBuilder = getRepository(ProductDetail).createQueryBuilder('productDetail')\n\n buildQuery(queryBuilder, params, context, {\n domainRef: false\n })\n\n let qb = queryBuilder\n .leftJoinAndSelect(\n 'productDetail.productDetailBizplaceSettings',\n 'pdbs',\n '\"pdbs\".\"product_detail_id\"=\"productDetail\".\"id\"'\n )\n .leftJoinAndSelect('productDetail.domain', 'domain')\n .leftJoinAndSelect('productDetail.creator', 'creator')\n .leftJoinAndSelect('productDetail.updater', 'updater')\n\n // qb.andWhere('pdbs.bizplace_id = :bizplaceId', { bizplaceId: bizplace.id })\n\n const [items, total] = await qb.getManyAndCount()\n\n return {\n items: items.map(itm => {\n let productDetailBizplaceSetting = itm.productDetailBizplaceSettings[0]\n\n return {\n requirePacking: false,\n bufferQty: 0,\n minQty: 0,\n maxQty: 0,\n productDetail: itm,\n ...productDetailBizplaceSetting\n }\n }),\n total\n }\n\n // const convertedParams = convertListParams(params)\n // const [items, total] = await getRepository(ProductDetailBizplaceSettingEntity).findAndCount({\n // ...convertedParams\n // })\n\n // return { items, total }\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() productDetailBizplaceSetting: ProductDetailBizplaceSetting): Promise<Domain> {\n return await getRepository(Domain).findOne(productDetailBizplaceSetting.domain.id)\n }\n\n @FieldResolver(type => User)\n async updater(@Root() productDetailBizplaceSetting: ProductDetailBizplaceSetting): Promise<User> {\n return await getRepository(User).findOne(productDetailBizplaceSetting.updater.id)\n }\n\n @FieldResolver(type => User)\n async creator(@Root() productDetailBizplaceSetting: ProductDetailBizplaceSetting): Promise<User> {\n return await getRepository(User).findOne(productDetailBizplaceSetting.creator.id)\n }\n}\n"]}
|
package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-types.js
CHANGED
|
@@ -1,98 +1,90 @@
|
|
|
1
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
2
|
var _a, _b;
|
|
12
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
4
|
exports.ProductDetailBizplaceSettingPatch = exports.ProductDetailBizplaceSettingList = exports.NewProductDetailBizplaceSetting = void 0;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
14
6
|
const type_graphql_1 = require("type-graphql");
|
|
15
7
|
const shell_1 = require("@things-factory/shell");
|
|
16
8
|
const product_detail_bizplace_setting_1 = require("./product-detail-bizplace-setting");
|
|
17
9
|
let NewProductDetailBizplaceSetting = class NewProductDetailBizplaceSetting {
|
|
18
10
|
};
|
|
19
|
-
__decorate([
|
|
11
|
+
tslib_1.__decorate([
|
|
20
12
|
(0, type_graphql_1.Field)(),
|
|
21
|
-
__metadata("design:type", String)
|
|
13
|
+
tslib_1.__metadata("design:type", String)
|
|
22
14
|
], NewProductDetailBizplaceSetting.prototype, "name", void 0);
|
|
23
|
-
__decorate([
|
|
15
|
+
tslib_1.__decorate([
|
|
24
16
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
25
|
-
__metadata("design:type", typeof (_a = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _a : Object)
|
|
17
|
+
tslib_1.__metadata("design:type", typeof (_a = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _a : Object)
|
|
26
18
|
], NewProductDetailBizplaceSetting.prototype, "productDetail", void 0);
|
|
27
|
-
__decorate([
|
|
19
|
+
tslib_1.__decorate([
|
|
28
20
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
29
|
-
__metadata("design:type", Boolean)
|
|
21
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
30
22
|
], NewProductDetailBizplaceSetting.prototype, "requirePacking", void 0);
|
|
31
|
-
__decorate([
|
|
23
|
+
tslib_1.__decorate([
|
|
32
24
|
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
|
|
33
|
-
__metadata("design:type", Number)
|
|
25
|
+
tslib_1.__metadata("design:type", Number)
|
|
34
26
|
], NewProductDetailBizplaceSetting.prototype, "bufferQty", void 0);
|
|
35
|
-
__decorate([
|
|
27
|
+
tslib_1.__decorate([
|
|
36
28
|
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
|
|
37
|
-
__metadata("design:type", Number)
|
|
29
|
+
tslib_1.__metadata("design:type", Number)
|
|
38
30
|
], NewProductDetailBizplaceSetting.prototype, "minQty", void 0);
|
|
39
|
-
__decorate([
|
|
31
|
+
tslib_1.__decorate([
|
|
40
32
|
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
|
|
41
|
-
__metadata("design:type", Number)
|
|
33
|
+
tslib_1.__metadata("design:type", Number)
|
|
42
34
|
], NewProductDetailBizplaceSetting.prototype, "maxQty", void 0);
|
|
43
|
-
NewProductDetailBizplaceSetting = __decorate([
|
|
35
|
+
NewProductDetailBizplaceSetting = tslib_1.__decorate([
|
|
44
36
|
(0, type_graphql_1.InputType)()
|
|
45
37
|
], NewProductDetailBizplaceSetting);
|
|
46
38
|
exports.NewProductDetailBizplaceSetting = NewProductDetailBizplaceSetting;
|
|
47
39
|
let ProductDetailBizplaceSettingList = class ProductDetailBizplaceSettingList {
|
|
48
40
|
};
|
|
49
|
-
__decorate([
|
|
41
|
+
tslib_1.__decorate([
|
|
50
42
|
(0, type_graphql_1.Field)(type => [product_detail_bizplace_setting_1.ProductDetailBizplaceSetting], { nullable: true }),
|
|
51
|
-
__metadata("design:type", Array)
|
|
43
|
+
tslib_1.__metadata("design:type", Array)
|
|
52
44
|
], ProductDetailBizplaceSettingList.prototype, "items", void 0);
|
|
53
|
-
__decorate([
|
|
45
|
+
tslib_1.__decorate([
|
|
54
46
|
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
|
|
55
|
-
__metadata("design:type", Number)
|
|
47
|
+
tslib_1.__metadata("design:type", Number)
|
|
56
48
|
], ProductDetailBizplaceSettingList.prototype, "total", void 0);
|
|
57
|
-
ProductDetailBizplaceSettingList = __decorate([
|
|
49
|
+
ProductDetailBizplaceSettingList = tslib_1.__decorate([
|
|
58
50
|
(0, type_graphql_1.ObjectType)()
|
|
59
51
|
], ProductDetailBizplaceSettingList);
|
|
60
52
|
exports.ProductDetailBizplaceSettingList = ProductDetailBizplaceSettingList;
|
|
61
53
|
let ProductDetailBizplaceSettingPatch = class ProductDetailBizplaceSettingPatch {
|
|
62
54
|
};
|
|
63
|
-
__decorate([
|
|
55
|
+
tslib_1.__decorate([
|
|
64
56
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
65
|
-
__metadata("design:type", String)
|
|
57
|
+
tslib_1.__metadata("design:type", String)
|
|
66
58
|
], ProductDetailBizplaceSettingPatch.prototype, "id", void 0);
|
|
67
|
-
__decorate([
|
|
59
|
+
tslib_1.__decorate([
|
|
68
60
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
69
|
-
__metadata("design:type", String)
|
|
61
|
+
tslib_1.__metadata("design:type", String)
|
|
70
62
|
], ProductDetailBizplaceSettingPatch.prototype, "name", void 0);
|
|
71
|
-
__decorate([
|
|
63
|
+
tslib_1.__decorate([
|
|
72
64
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
73
|
-
__metadata("design:type", typeof (_b = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _b : Object)
|
|
65
|
+
tslib_1.__metadata("design:type", typeof (_b = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _b : Object)
|
|
74
66
|
], ProductDetailBizplaceSettingPatch.prototype, "productDetail", void 0);
|
|
75
|
-
__decorate([
|
|
67
|
+
tslib_1.__decorate([
|
|
76
68
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
77
|
-
__metadata("design:type", Boolean)
|
|
69
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
78
70
|
], ProductDetailBizplaceSettingPatch.prototype, "requirePacking", void 0);
|
|
79
|
-
__decorate([
|
|
71
|
+
tslib_1.__decorate([
|
|
80
72
|
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
|
|
81
|
-
__metadata("design:type", Number)
|
|
73
|
+
tslib_1.__metadata("design:type", Number)
|
|
82
74
|
], ProductDetailBizplaceSettingPatch.prototype, "bufferQty", void 0);
|
|
83
|
-
__decorate([
|
|
75
|
+
tslib_1.__decorate([
|
|
84
76
|
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
|
|
85
|
-
__metadata("design:type", Number)
|
|
77
|
+
tslib_1.__metadata("design:type", Number)
|
|
86
78
|
], ProductDetailBizplaceSettingPatch.prototype, "minQty", void 0);
|
|
87
|
-
__decorate([
|
|
79
|
+
tslib_1.__decorate([
|
|
88
80
|
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
|
|
89
|
-
__metadata("design:type", Number)
|
|
81
|
+
tslib_1.__metadata("design:type", Number)
|
|
90
82
|
], ProductDetailBizplaceSettingPatch.prototype, "maxQty", void 0);
|
|
91
|
-
__decorate([
|
|
83
|
+
tslib_1.__decorate([
|
|
92
84
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
93
|
-
__metadata("design:type", String)
|
|
85
|
+
tslib_1.__metadata("design:type", String)
|
|
94
86
|
], ProductDetailBizplaceSettingPatch.prototype, "cuFlag", void 0);
|
|
95
|
-
ProductDetailBizplaceSettingPatch = __decorate([
|
|
87
|
+
ProductDetailBizplaceSettingPatch = tslib_1.__decorate([
|
|
96
88
|
(0, type_graphql_1.InputType)()
|
|
97
89
|
], ProductDetailBizplaceSettingPatch);
|
|
98
90
|
exports.ProductDetailBizplaceSettingPatch = ProductDetailBizplaceSettingPatch;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product-detail-bizplace-setting-types.js","sourceRoot":"","sources":["../../../server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"product-detail-bizplace-setting-types.js","sourceRoot":"","sources":["../../../server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-types.ts"],"names":[],"mappings":";;;;;AAAA,+CAAgE;AAEhE,iDAAiD;AAEjD,uFAAgF;AAGhF,IAAa,+BAA+B,GAA5C,MAAa,+BAA+B;CAkB3C,CAAA;AAhBC;IADC,IAAA,oBAAK,GAAE;;6DACI;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;0DACV,iBAAS,oBAAT,iBAAS;sEAAA;AAGzB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uEACF;AAGxB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kEACrB;AAGlB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,QAAQ,E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AAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iEACxB;AAGf;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iEACX;AAvBJ,iCAAiC;IAD7C,IAAA,wBAAS,GAAE;GACC,iCAAiC,CAwB7C;AAxBY,8EAAiC","sourcesContent":["import { Field, InputType, Int, ObjectType } from 'type-graphql'\n\nimport { ObjectRef } from '@things-factory/shell'\n\nimport { ProductDetailBizplaceSetting } from './product-detail-bizplace-setting'\n\n@InputType()\nexport class NewProductDetailBizplaceSetting {\n @Field()\n name: string\n\n @Field({ nullable: true })\n productDetail?: ObjectRef\n\n @Field({ nullable: true })\n requirePacking?: boolean\n\n @Field(type => Int, { nullable: true })\n bufferQty?: number\n\n @Field(type => Int, { nullable: true })\n minQty?: number\n\n @Field(type => Int, { nullable: true })\n maxQty?: number\n}\n\n@ObjectType()\nexport class ProductDetailBizplaceSettingList {\n @Field(type => [ProductDetailBizplaceSetting], { nullable: true })\n items?: ProductDetailBizplaceSetting[]\n\n @Field(type => Int, { nullable: true })\n total?: number\n}\n\n@InputType()\nexport class ProductDetailBizplaceSettingPatch {\n @Field({ nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n productDetail?: ObjectRef\n\n @Field({ nullable: true })\n requirePacking?: boolean\n\n @Field(type => Int, { nullable: true })\n bufferQty?: number\n\n @Field(type => Int, { nullable: true })\n minQty?: number\n\n @Field(type => Int, { nullable: true })\n maxQty?: number\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n"]}
|
package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting.js
CHANGED
|
@@ -1,16 +1,8 @@
|
|
|
1
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
2
|
var _a, _b, _c;
|
|
12
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
4
|
exports.ProductDetailBizplaceSetting = void 0;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
14
6
|
const auth_base_1 = require("@things-factory/auth-base");
|
|
15
7
|
const shell_1 = require("@things-factory/shell");
|
|
16
8
|
const type_graphql_1 = require("type-graphql");
|
|
@@ -32,83 +24,83 @@ const product_detail_1 = require("../product-detail/product-detail");
|
|
|
32
24
|
**/
|
|
33
25
|
let ProductDetailBizplaceSetting = class ProductDetailBizplaceSetting {
|
|
34
26
|
};
|
|
35
|
-
__decorate([
|
|
27
|
+
tslib_1.__decorate([
|
|
36
28
|
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
37
29
|
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
38
|
-
__metadata("design:type", String)
|
|
30
|
+
tslib_1.__metadata("design:type", String)
|
|
39
31
|
], ProductDetailBizplaceSetting.prototype, "id", void 0);
|
|
40
|
-
__decorate([
|
|
32
|
+
tslib_1.__decorate([
|
|
41
33
|
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
42
34
|
(0, type_graphql_1.Field)(),
|
|
43
|
-
__metadata("design:type", typeof (_a = typeof shell_1.Domain !== "undefined" && shell_1.Domain) === "function" ? _a : Object)
|
|
35
|
+
tslib_1.__metadata("design:type", typeof (_a = typeof shell_1.Domain !== "undefined" && shell_1.Domain) === "function" ? _a : Object)
|
|
44
36
|
], ProductDetailBizplaceSetting.prototype, "domain", void 0);
|
|
45
|
-
__decorate([
|
|
37
|
+
tslib_1.__decorate([
|
|
46
38
|
(0, typeorm_1.RelationId)((productDetailBizplaceSetting) => productDetailBizplaceSetting.domain),
|
|
47
|
-
__metadata("design:type", String)
|
|
39
|
+
tslib_1.__metadata("design:type", String)
|
|
48
40
|
], ProductDetailBizplaceSetting.prototype, "domainId", void 0);
|
|
49
|
-
__decorate([
|
|
41
|
+
tslib_1.__decorate([
|
|
50
42
|
(0, typeorm_1.ManyToOne)(type => product_detail_1.ProductDetail),
|
|
51
43
|
(0, type_graphql_1.Field)(type => product_detail_1.ProductDetail),
|
|
52
|
-
__metadata("design:type", product_detail_1.ProductDetail)
|
|
44
|
+
tslib_1.__metadata("design:type", product_detail_1.ProductDetail)
|
|
53
45
|
], ProductDetailBizplaceSetting.prototype, "productDetail", void 0);
|
|
54
|
-
__decorate([
|
|
46
|
+
tslib_1.__decorate([
|
|
55
47
|
(0, typeorm_1.Column)(),
|
|
56
48
|
(0, type_graphql_1.Field)(),
|
|
57
|
-
__metadata("design:type", String)
|
|
49
|
+
tslib_1.__metadata("design:type", String)
|
|
58
50
|
], ProductDetailBizplaceSetting.prototype, "name", void 0);
|
|
59
|
-
__decorate([
|
|
51
|
+
tslib_1.__decorate([
|
|
60
52
|
(0, typeorm_1.Column)({ default: false }),
|
|
61
53
|
(0, type_graphql_1.Field)(),
|
|
62
|
-
__metadata("design:type", Boolean)
|
|
54
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
63
55
|
], ProductDetailBizplaceSetting.prototype, "requirePacking", void 0);
|
|
64
|
-
__decorate([
|
|
56
|
+
tslib_1.__decorate([
|
|
65
57
|
(0, typeorm_1.Column)({ default: 0 }),
|
|
66
58
|
(0, type_graphql_1.Field)(),
|
|
67
|
-
__metadata("design:type", Number)
|
|
59
|
+
tslib_1.__metadata("design:type", Number)
|
|
68
60
|
], ProductDetailBizplaceSetting.prototype, "bufferQty", void 0);
|
|
69
|
-
__decorate([
|
|
61
|
+
tslib_1.__decorate([
|
|
70
62
|
(0, typeorm_1.Column)({ default: 0 }),
|
|
71
63
|
(0, type_graphql_1.Field)(),
|
|
72
|
-
__metadata("design:type", Number)
|
|
64
|
+
tslib_1.__metadata("design:type", Number)
|
|
73
65
|
], ProductDetailBizplaceSetting.prototype, "minQty", void 0);
|
|
74
|
-
__decorate([
|
|
66
|
+
tslib_1.__decorate([
|
|
75
67
|
(0, typeorm_1.Column)({ default: 0 }),
|
|
76
68
|
(0, type_graphql_1.Field)(),
|
|
77
|
-
__metadata("design:type", Number)
|
|
69
|
+
tslib_1.__metadata("design:type", Number)
|
|
78
70
|
], ProductDetailBizplaceSetting.prototype, "maxQty", void 0);
|
|
79
|
-
__decorate([
|
|
71
|
+
tslib_1.__decorate([
|
|
80
72
|
(0, typeorm_1.CreateDateColumn)(),
|
|
81
73
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
82
|
-
__metadata("design:type", Date)
|
|
74
|
+
tslib_1.__metadata("design:type", Date)
|
|
83
75
|
], ProductDetailBizplaceSetting.prototype, "createdAt", void 0);
|
|
84
|
-
__decorate([
|
|
76
|
+
tslib_1.__decorate([
|
|
85
77
|
(0, typeorm_1.UpdateDateColumn)(),
|
|
86
78
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
87
|
-
__metadata("design:type", Date)
|
|
79
|
+
tslib_1.__metadata("design:type", Date)
|
|
88
80
|
], ProductDetailBizplaceSetting.prototype, "updatedAt", void 0);
|
|
89
|
-
__decorate([
|
|
81
|
+
tslib_1.__decorate([
|
|
90
82
|
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
|
|
91
83
|
nullable: true
|
|
92
84
|
}),
|
|
93
85
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
94
|
-
__metadata("design:type", typeof (_b = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _b : Object)
|
|
86
|
+
tslib_1.__metadata("design:type", typeof (_b = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _b : Object)
|
|
95
87
|
], ProductDetailBizplaceSetting.prototype, "creator", void 0);
|
|
96
|
-
__decorate([
|
|
88
|
+
tslib_1.__decorate([
|
|
97
89
|
(0, typeorm_1.RelationId)((productDetailBizplaceSetting) => productDetailBizplaceSetting.creator),
|
|
98
|
-
__metadata("design:type", String)
|
|
90
|
+
tslib_1.__metadata("design:type", String)
|
|
99
91
|
], ProductDetailBizplaceSetting.prototype, "creatorId", void 0);
|
|
100
|
-
__decorate([
|
|
92
|
+
tslib_1.__decorate([
|
|
101
93
|
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
|
|
102
94
|
nullable: true
|
|
103
95
|
}),
|
|
104
96
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
105
|
-
__metadata("design:type", typeof (_c = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _c : Object)
|
|
97
|
+
tslib_1.__metadata("design:type", typeof (_c = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _c : Object)
|
|
106
98
|
], ProductDetailBizplaceSetting.prototype, "updater", void 0);
|
|
107
|
-
__decorate([
|
|
99
|
+
tslib_1.__decorate([
|
|
108
100
|
(0, typeorm_1.RelationId)((productDetailBizplaceSetting) => productDetailBizplaceSetting.updater),
|
|
109
|
-
__metadata("design:type", String)
|
|
101
|
+
tslib_1.__metadata("design:type", String)
|
|
110
102
|
], ProductDetailBizplaceSetting.prototype, "updaterId", void 0);
|
|
111
|
-
ProductDetailBizplaceSetting = __decorate([
|
|
103
|
+
ProductDetailBizplaceSetting = tslib_1.__decorate([
|
|
112
104
|
(0, typeorm_1.Entity)(),
|
|
113
105
|
(0, typeorm_1.Index)('ix_product_detail_bizplace_setting_0', (productDetailBizplaceSetting) => [
|
|
114
106
|
productDetailBizplaceSetting.domain,
|
package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product-detail-bizplace-setting.js","sourceRoot":"","sources":["../../../server/service/product-detail-bizplace-setting/product-detail-bizplace-setting.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"product-detail-bizplace-setting.js","sourceRoot":"","sources":["../../../server/service/product-detail-bizplace-setting/product-detail-bizplace-setting.ts"],"names":[],"mappings":";;;;;AAAA,yDAAgD;AAChD,iDAA8C;AAC9C,+CAAoD;AACpD,qCASgB;AAChB,qEAAgE;AAEhE;;;;;;;;;;;;;IAaI;AAYJ,IAAa,4BAA4B,GAAzC,MAAa,4BAA4B;CA6DxC,CAAA;AA1DC;IAFC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;wDACC;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,GAAE;0DACA,cAAM,oBAAN,cAAM;4DAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,4BAA0D,EAAE,EAAE,CAAC,4BAA4B,CAAC,MAAM,CAAC;;8DAChG;AAIhB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,8BAAa,CAAC;IAChC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,8BAAa,CAAC;sCACd,8BAAa;mEAAA;AAI5B;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,GAAE;;0DACI;AAIZ;IAFC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC1B,IAAA,oBAAK,GAAE;;oEACe;AAIvB;IAFC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IACtB,IAAA,oBAAK,GAAE;;+DACS;AAIjB;IAFC,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ACA,IAAA,yBAAU,GAAE;GACA,4BAA4B,CA6DxC;AA7DY,oEAA4B","sourcesContent":["import { User } from '@things-factory/auth-base'\nimport { Domain } from '@things-factory/shell'\nimport { Field, ID, ObjectType } from 'type-graphql'\nimport {\n Column,\n CreateDateColumn,\n Entity,\n Index,\n ManyToOne,\n PrimaryGeneratedColumn,\n RelationId,\n UpdateDateColumn\n} from 'typeorm'\nimport { ProductDetail } from '../product-detail/product-detail'\n\n/**\n * @prop {string} id - Primary Key.\n * @prop {Object} domain - Foreign field. Relation to Domain Entity / Table.\n * @prop {Object} productDetail - Foreign field. Relation to Product Detail Entity / Table.\n * @prop {string} name - Product Detail Name.\n * @prop {boolean} requirePacking - Default SKU info.\n * @prop {?number} bufferQty - Quantity for reservation.\n * @prop {?number} minQty - Minimum Quantity targetted in inventory. For reporting purposes.\n * @prop {?number} maxQty - Maximum Quantity targetted in inventory. For reporting purposes.\n * @prop {Date} createdAt - Created Date and Time.\n * @prop {Date} updatedAt - Updated Date and Time.\n * @prop {?Object} creator - Foreign field. Relation to User Entity / Table.\n * @prop {?Object} updater - Foreign field. Relation to User Entity / Table.\n **/\n\n@Entity()\n@Index(\n 'ix_product_detail_bizplace_setting_0',\n (productDetailBizplaceSetting: ProductDetailBizplaceSetting) => [\n productDetailBizplaceSetting.domain,\n productDetailBizplaceSetting.productDetail\n ],\n { unique: true }\n)\n@ObjectType()\nexport class ProductDetailBizplaceSetting {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field()\n domain: Domain\n\n @RelationId((productDetailBizplaceSetting: ProductDetailBizplaceSetting) => productDetailBizplaceSetting.domain)\n domainId: string\n\n @ManyToOne(type => ProductDetail)\n @Field(type => ProductDetail)\n productDetail: ProductDetail\n\n @Column()\n @Field()\n name: string\n\n @Column({ default: false })\n @Field()\n requirePacking: boolean\n\n @Column({ default: 0 })\n @Field()\n bufferQty: number\n\n @Column({ default: 0 })\n @Field()\n minQty: number\n\n @Column({ default: 0 })\n @Field()\n maxQty: number\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt: Date\n\n @ManyToOne(type => User, {\n nullable: true\n })\n @Field({ nullable: true })\n creator: User\n\n @RelationId((productDetailBizplaceSetting: ProductDetailBizplaceSetting) => productDetailBizplaceSetting.creator)\n creatorId: string\n\n @ManyToOne(type => User, {\n nullable: true\n })\n @Field({ nullable: true })\n updater: User\n\n @RelationId((productDetailBizplaceSetting: ProductDetailBizplaceSetting) => productDetailBizplaceSetting.updater)\n updaterId: string\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/product-set/index.ts"],"names":[],"mappings":";;;AAAA,+CAA0C;AAC1C,iEAA2D;AAC3D,2DAAqD;AAExC,QAAA,QAAQ,GAAG,CAAC,wBAAU,CAAC,CAAA;AACvB,QAAA,SAAS,GAAG,CAAC,mCAAe,EAAE,yCAAkB,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/product-set/index.ts"],"names":[],"mappings":";;;AAAA,+CAA0C;AAC1C,iEAA2D;AAC3D,2DAAqD;AAExC,QAAA,QAAQ,GAAG,CAAC,wBAAU,CAAC,CAAA;AACvB,QAAA,SAAS,GAAG,CAAC,mCAAe,EAAE,yCAAkB,CAAC,CAAA","sourcesContent":["import { ProductSet } from './product-set'\nimport { ProductSetMutation } from './product-set-mutation'\nimport { ProductSetQuery } from './product-set-query'\n\nexport const entities = [ProductSet]\nexport const resolvers = [ProductSetQuery, ProductSetMutation]\n"]}
|
|
@@ -1,18 +1,7 @@
|
|
|
1
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
3
|
exports.updateProductSet = exports.createProductSet = exports.ProductSetMutation = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
16
5
|
const type_graphql_1 = require("type-graphql");
|
|
17
6
|
const biz_base_1 = require("@things-factory/biz-base");
|
|
18
7
|
const constants_1 = require("../../constants");
|
|
@@ -66,58 +55,58 @@ let ProductSetMutation = class ProductSetMutation {
|
|
|
66
55
|
return true;
|
|
67
56
|
}
|
|
68
57
|
};
|
|
69
|
-
__decorate([
|
|
58
|
+
tslib_1.__decorate([
|
|
70
59
|
(0, type_graphql_1.Directive)('@privilege(category: "order", privilege: "mutation")'),
|
|
71
60
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
72
61
|
(0, type_graphql_1.Mutation)(returns => product_set_1.ProductSet),
|
|
73
|
-
__param(0, (0, type_graphql_1.Arg)('productSet')),
|
|
74
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
75
|
-
__metadata("design:type", Function),
|
|
76
|
-
__metadata("design:paramtypes", [product_set_types_1.NewProductSet, Object]),
|
|
77
|
-
__metadata("design:returntype", Promise)
|
|
62
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('productSet')),
|
|
63
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
64
|
+
tslib_1.__metadata("design:type", Function),
|
|
65
|
+
tslib_1.__metadata("design:paramtypes", [product_set_types_1.NewProductSet, Object]),
|
|
66
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
78
67
|
], ProductSetMutation.prototype, "createProductSet", null);
|
|
79
|
-
__decorate([
|
|
68
|
+
tslib_1.__decorate([
|
|
80
69
|
(0, type_graphql_1.Directive)('@privilege(category: "order", privilege: "mutation")'),
|
|
81
70
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
82
71
|
(0, type_graphql_1.Mutation)(returns => product_set_1.ProductSet),
|
|
83
|
-
__param(0, (0, type_graphql_1.Arg)('id')),
|
|
84
|
-
__param(1, (0, type_graphql_1.Arg)('patch')),
|
|
85
|
-
__param(2, (0, type_graphql_1.Ctx)()),
|
|
86
|
-
__metadata("design:type", Function),
|
|
87
|
-
__metadata("design:paramtypes", [String, product_set_types_1.ProductSetPatch, Object]),
|
|
88
|
-
__metadata("design:returntype", Promise)
|
|
72
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
73
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
|
|
74
|
+
tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
|
|
75
|
+
tslib_1.__metadata("design:type", Function),
|
|
76
|
+
tslib_1.__metadata("design:paramtypes", [String, product_set_types_1.ProductSetPatch, Object]),
|
|
77
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
89
78
|
], ProductSetMutation.prototype, "updateProductSet", null);
|
|
90
|
-
__decorate([
|
|
79
|
+
tslib_1.__decorate([
|
|
91
80
|
(0, type_graphql_1.Directive)('@privilege(category: "order", privilege: "mutation")'),
|
|
92
81
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
93
82
|
(0, type_graphql_1.Mutation)(returns => [product_set_1.ProductSet]),
|
|
94
|
-
__param(0, (0, type_graphql_1.Arg)('patches', type => [product_set_types_1.ProductSetPatch])),
|
|
95
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
96
|
-
__metadata("design:type", Function),
|
|
97
|
-
__metadata("design:paramtypes", [Array, Object]),
|
|
98
|
-
__metadata("design:returntype", Promise)
|
|
83
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [product_set_types_1.ProductSetPatch])),
|
|
84
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
85
|
+
tslib_1.__metadata("design:type", Function),
|
|
86
|
+
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
87
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
99
88
|
], ProductSetMutation.prototype, "updateMultipleProductSet", null);
|
|
100
|
-
__decorate([
|
|
89
|
+
tslib_1.__decorate([
|
|
101
90
|
(0, type_graphql_1.Directive)('@privilege(category: "order", privilege: "mutation")'),
|
|
102
91
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
103
92
|
(0, type_graphql_1.Mutation)(returns => Boolean),
|
|
104
|
-
__param(0, (0, type_graphql_1.Arg)('id')),
|
|
105
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
106
|
-
__metadata("design:type", Function),
|
|
107
|
-
__metadata("design:paramtypes", [String, Object]),
|
|
108
|
-
__metadata("design:returntype", Promise)
|
|
93
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
94
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
95
|
+
tslib_1.__metadata("design:type", Function),
|
|
96
|
+
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
97
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
109
98
|
], ProductSetMutation.prototype, "deleteProductSet", null);
|
|
110
|
-
__decorate([
|
|
99
|
+
tslib_1.__decorate([
|
|
111
100
|
(0, type_graphql_1.Directive)('@privilege(category: "order", privilege: "mutation")'),
|
|
112
101
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
113
102
|
(0, type_graphql_1.Mutation)(returns => Boolean),
|
|
114
|
-
__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
|
|
115
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
116
|
-
__metadata("design:type", Function),
|
|
117
|
-
__metadata("design:paramtypes", [Array, Object]),
|
|
118
|
-
__metadata("design:returntype", Promise)
|
|
103
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
|
|
104
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
105
|
+
tslib_1.__metadata("design:type", Function),
|
|
106
|
+
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
107
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
119
108
|
], ProductSetMutation.prototype, "deleteProductSets", null);
|
|
120
|
-
ProductSetMutation = __decorate([
|
|
109
|
+
ProductSetMutation = tslib_1.__decorate([
|
|
121
110
|
(0, type_graphql_1.Resolver)(product_set_1.ProductSet)
|
|
122
111
|
], ProductSetMutation);
|
|
123
112
|
exports.ProductSetMutation = ProductSetMutation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product-set-mutation.js","sourceRoot":"","sources":["../../../server/service/product-set/product-set-mutation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"product-set-mutation.js","sourceRoot":"","sources":["../../../server/service/product-set/product-set-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AAItE,uDAAmD;AAGnD,+CAAoD;AACpD,uCAAyC;AACzC,+CAA0C;AAC1C,2DAAoE;AAGpE,IAAa,kBAAkB,GAA/B,MAAa,kBAAkB;IAI7B,KAAK,CAAC,gBAAgB,CAAoB,UAAyB,EAAS,OAAY;QACtF,OAAO,MAAM,gBAAgB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAA;IACpD,CAAC;IAKD,KAAK,CAAC,gBAAgB,CACT,EAAU,EACP,KAAsB,EAC7B,OAAY;QAEnB,OAAO,MAAM,gBAAgB,CAAC,EAAE,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ACV,KAAK,KACR,OAAO,EAAE,IAAI,IACb,CAAA;AACJ,CAAC;AAZD,4CAYC","sourcesContent":["import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\nimport { EntityManager, Repository } from 'typeorm'\n\nimport { User } from '@things-factory/auth-base'\nimport { Bizplace } from '@things-factory/biz-base'\nimport { Domain } from '@things-factory/shell'\n\nimport { PRODUCT_SET_STATUS } from '../../constants'\nimport { ProductUtil } from '../../utils'\nimport { ProductSet } from './product-set'\nimport { NewProductSet, ProductSetPatch } from './product-set-types'\n\n@Resolver(ProductSet)\nexport class ProductSetMutation {\n @Directive('@privilege(category: \"order\", privilege: \"mutation\")')\n @Directive('@transaction')\n @Mutation(returns => ProductSet)\n async createProductSet(@Arg('productSet') productSet: NewProductSet, @Ctx() context: any): Promise<ProductSet> {\n return await createProductSet(productSet, context)\n }\n\n @Directive('@privilege(category: \"order\", privilege: \"mutation\")')\n @Directive('@transaction')\n @Mutation(returns => ProductSet)\n async updateProductSet(\n @Arg('id') id: string,\n @Arg('patch') patch: ProductSetPatch,\n @Ctx() context: any\n ): Promise<ProductSet> {\n return await updateProductSet(id, patch, context)\n }\n\n @Directive('@privilege(category: \"order\", privilege: \"mutation\")')\n @Directive('@transaction')\n @Mutation(returns => [ProductSet])\n async updateMultipleProductSet(\n @Arg('patches', type => [ProductSetPatch]) patches: ProductSetPatch[],\n @Ctx() context: any\n ): Promise<ProductSet[]> {\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const patch = _createRecords[i]\n const result = await createProductSet(patch as NewProductSet, context)\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const patch: ProductSetPatch = _updateRecords[i]\n const result = await updateProductSet(patch.id, patch, context)\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@privilege(category: \"order\", privilege: \"mutation\")')\n @Directive('@transaction')\n @Mutation(returns => Boolean)\n async deleteProductSet(@Arg('id') id: string, @Ctx() context: any): Promise<Boolean> {\n const { tx, user }: { tx: EntityManager; user: User } = context.state\n const productSetRepo: Repository<ProductSet> = tx.getRepository(ProductSet)\n const productSet = await productSetRepo.findOne(id)\n\n await productSetRepo.save({\n ...productSet,\n status: PRODUCT_SET_STATUS.DELETED,\n updater: user\n })\n\n return true\n }\n\n @Directive('@privilege(category: \"order\", privilege: \"mutation\")')\n @Directive('@transaction')\n @Mutation(returns => Boolean)\n async deleteProductSets(@Arg('ids', type => [String]) ids: string[], @Ctx() context: any): Promise<Boolean> {\n const { tx, user }: { tx: EntityManager; user: User } = context.state\n const productSetRepo = tx.getRepository(ProductSet)\n\n let results = []\n let productSets = productSetRepo.findByIds(ids)\n\n for (let i = 0; i < (await productSets).length; i++) {\n const productSet = productSets[i]\n\n const result = await productSetRepo.save({\n ...productSet,\n status: PRODUCT_SET_STATUS.DELETED,\n updater: user\n })\n\n results.push({ ...result })\n }\n\n return true\n }\n}\n\nexport async function createProductSet(productSet: NewProductSet, context: any) {\n const { domain, user, tx }: { domain: Domain; user: User; tx: EntityManager } = context.state\n\n const productSetRepo: Repository<ProductSet> = tx.getRepository(ProductSet)\n const bizplaceRepo: Repository<Bizplace> = tx.getRepository(Bizplace)\n\n let bizplace: Bizplace\n // if (productSet.bizplace?.id) {\n // bizplace = await bizplaceRepo.findOne(productSet.bizplace.id)\n // } else {\n // bizplace = await bizplaceRepo.findOne({ where: { name: domain.name } })\n // }\n bizplace = await bizplaceRepo.findOne({ where: { name: domain.name } })\n\n return await productSetRepo.save({\n ...productSet,\n code: ProductUtil.productSetCode(),\n bizplace,\n creator: user,\n updater: user\n })\n}\n\nexport async function updateProductSet(id: string, patch: ProductSetPatch, context: any) {\n const { user, tx }: { user: User; tx: EntityManager } = context.state\n\n const bizplaceRepo: Repository<Bizplace> = tx.getRepository(Bizplace)\n const productRepo: Repository<ProductSet> = tx.getRepository(ProductSet)\n const productSet = await productRepo.findOne(id)\n\n return productRepo.save({\n ...productSet,\n ...patch,\n updater: user\n })\n}\n"]}
|