@things-factory/product-base 5.0.1 → 5.0.11

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 (92) hide show
  1. package/dist-server/constants/index.js +2 -15
  2. package/dist-server/constants/index.js.map +1 -1
  3. package/dist-server/constants/product.js.map +1 -1
  4. package/dist-server/controllers/index.js.map +1 -1
  5. package/dist-server/index.js +3 -16
  6. package/dist-server/index.js.map +1 -1
  7. package/dist-server/middlewares/index.js.map +1 -1
  8. package/dist-server/migrations/index.js.map +1 -1
  9. package/dist-server/service/index.js +17 -30
  10. package/dist-server/service/index.js.map +1 -1
  11. package/dist-server/service/product/index.js.map +1 -1
  12. package/dist-server/service/product/product-mutation.js +61 -73
  13. package/dist-server/service/product/product-mutation.js.map +1 -1
  14. package/dist-server/service/product/product-query.js +78 -89
  15. package/dist-server/service/product/product-query.js.map +1 -1
  16. package/dist-server/service/product/product-types.js +261 -272
  17. package/dist-server/service/product/product-types.js.map +1 -1
  18. package/dist-server/service/product/product.js +179 -187
  19. package/dist-server/service/product/product.js.map +1 -1
  20. package/dist-server/service/product/validate-product.js +2 -4
  21. package/dist-server/service/product/validate-product.js.map +1 -1
  22. package/dist-server/service/product-bundle/index.js.map +1 -1
  23. package/dist-server/service/product-bundle/product-bundle-mutation.js +33 -44
  24. package/dist-server/service/product-bundle/product-bundle-mutation.js.map +1 -1
  25. package/dist-server/service/product-bundle/product-bundle-query.js +35 -46
  26. package/dist-server/service/product-bundle/product-bundle-query.js.map +1 -1
  27. package/dist-server/service/product-bundle/product-bundle-types.js +30 -38
  28. package/dist-server/service/product-bundle/product-bundle-types.js.map +1 -1
  29. package/dist-server/service/product-bundle/product-bundle.js +40 -48
  30. package/dist-server/service/product-bundle/product-bundle.js.map +1 -1
  31. package/dist-server/service/product-bundle-setting/index.js.map +1 -1
  32. package/dist-server/service/product-bundle-setting/product-bundle-setting-mutation.js +27 -38
  33. package/dist-server/service/product-bundle-setting/product-bundle-setting-mutation.js.map +1 -1
  34. package/dist-server/service/product-bundle-setting/product-bundle-setting-query.js +14 -25
  35. package/dist-server/service/product-bundle-setting/product-bundle-setting-query.js.map +1 -1
  36. package/dist-server/service/product-bundle-setting/product-bundle-setting-types.js +23 -31
  37. package/dist-server/service/product-bundle-setting/product-bundle-setting-types.js.map +1 -1
  38. package/dist-server/service/product-bundle-setting/product-bundle-setting.js +16 -24
  39. package/dist-server/service/product-bundle-setting/product-bundle-setting.js.map +1 -1
  40. package/dist-server/service/product-combination/index.js.map +1 -1
  41. package/dist-server/service/product-combination/product-combination-mutation.js +34 -45
  42. package/dist-server/service/product-combination/product-combination-mutation.js.map +1 -1
  43. package/dist-server/service/product-combination/product-combination-query.js +29 -40
  44. package/dist-server/service/product-combination/product-combination-query.js.map +1 -1
  45. package/dist-server/service/product-combination/product-combination-type.js +28 -36
  46. package/dist-server/service/product-combination/product-combination-type.js.map +1 -1
  47. package/dist-server/service/product-combination/product-combination.js +42 -50
  48. package/dist-server/service/product-combination/product-combination.js.map +1 -1
  49. package/dist-server/service/product-combination-setting/index.js.map +1 -1
  50. package/dist-server/service/product-combination-setting/product-combination-setting-mutation.js +40 -51
  51. package/dist-server/service/product-combination-setting/product-combination-setting-mutation.js.map +1 -1
  52. package/dist-server/service/product-combination-setting/product-combination-setting-query.js +35 -46
  53. package/dist-server/service/product-combination-setting/product-combination-setting-query.js.map +1 -1
  54. package/dist-server/service/product-combination-setting/product-combination-setting-type.js +24 -32
  55. package/dist-server/service/product-combination-setting/product-combination-setting-type.js.map +1 -1
  56. package/dist-server/service/product-combination-setting/product-combination-setting.js +36 -44
  57. package/dist-server/service/product-combination-setting/product-combination-setting.js.map +1 -1
  58. package/dist-server/service/product-detail/index.js.map +1 -1
  59. package/dist-server/service/product-detail/product-detail-mutation.js +30 -51
  60. package/dist-server/service/product-detail/product-detail-mutation.js.map +1 -1
  61. package/dist-server/service/product-detail/product-detail-query.js +33 -44
  62. package/dist-server/service/product-detail/product-detail-query.js.map +1 -1
  63. package/dist-server/service/product-detail/product-detail-types.js +180 -188
  64. package/dist-server/service/product-detail/product-detail-types.js.map +1 -1
  65. package/dist-server/service/product-detail/product-detail.js +127 -135
  66. package/dist-server/service/product-detail/product-detail.js.map +1 -1
  67. package/dist-server/service/product-detail-bizplace-setting/index.js.map +1 -1
  68. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-mutation.js +28 -39
  69. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-mutation.js.map +1 -1
  70. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-query.js +29 -40
  71. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-query.js.map +1 -1
  72. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-types.js +36 -44
  73. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-types.js.map +1 -1
  74. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting.js +32 -40
  75. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting.js.map +1 -1
  76. package/dist-server/service/product-set/index.js.map +1 -1
  77. package/dist-server/service/product-set/product-set-mutation.js +33 -44
  78. package/dist-server/service/product-set/product-set-mutation.js.map +1 -1
  79. package/dist-server/service/product-set/product-set-query.js +35 -46
  80. package/dist-server/service/product-set/product-set-query.js.map +1 -1
  81. package/dist-server/service/product-set/product-set-types.js +26 -34
  82. package/dist-server/service/product-set/product-set-types.js.map +1 -1
  83. package/dist-server/service/product-set/product-set.js +34 -42
  84. package/dist-server/service/product-set/product-set.js.map +1 -1
  85. package/dist-server/tsconfig.tsbuildinfo +1 -0
  86. package/dist-server/utils/index.js +2 -15
  87. package/dist-server/utils/index.js.map +1 -1
  88. package/dist-server/utils/product-util.js.map +1 -1
  89. package/package.json +4 -4
  90. package/server/service/product/product-mutation.ts +2 -0
  91. package/server/service/product/product-query.ts +1 -1
  92. package/server/service/product/product.ts +2 -2
@@ -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, _d;
12
3
  Object.defineProperty(exports, "__esModule", { value: true });
13
4
  exports.ProductBundle = void 0;
5
+ const tslib_1 = require("tslib");
14
6
  const auth_base_1 = require("@things-factory/auth-base");
15
7
  const biz_base_1 = require("@things-factory/biz-base");
16
8
  const shell_1 = require("@things-factory/shell");
@@ -19,105 +11,105 @@ const typeorm_1 = require("typeorm");
19
11
  const product_bundle_setting_1 = require("../product-bundle-setting/product-bundle-setting");
20
12
  let ProductBundle = class ProductBundle {
21
13
  };
22
- __decorate([
14
+ tslib_1.__decorate([
23
15
  (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
24
16
  (0, type_graphql_1.Field)(type => type_graphql_1.ID),
25
- __metadata("design:type", String)
17
+ tslib_1.__metadata("design:type", String)
26
18
  ], ProductBundle.prototype, "id", void 0);
27
- __decorate([
19
+ tslib_1.__decorate([
28
20
  (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
29
21
  (0, type_graphql_1.Field)(),
30
- __metadata("design:type", typeof (_a = typeof shell_1.Domain !== "undefined" && shell_1.Domain) === "function" ? _a : Object)
22
+ tslib_1.__metadata("design:type", typeof (_a = typeof shell_1.Domain !== "undefined" && shell_1.Domain) === "function" ? _a : Object)
31
23
  ], ProductBundle.prototype, "domain", void 0);
32
- __decorate([
24
+ tslib_1.__decorate([
33
25
  (0, typeorm_1.RelationId)((productBundle) => productBundle.domain),
34
- __metadata("design:type", String)
26
+ tslib_1.__metadata("design:type", String)
35
27
  ], ProductBundle.prototype, "domainId", void 0);
36
- __decorate([
28
+ tslib_1.__decorate([
37
29
  (0, typeorm_1.ManyToOne)(type => biz_base_1.Bizplace, {
38
30
  nullable: false
39
31
  }),
40
32
  (0, type_graphql_1.Field)({ nullable: true }),
41
- __metadata("design:type", typeof (_b = typeof biz_base_1.Bizplace !== "undefined" && biz_base_1.Bizplace) === "function" ? _b : Object)
33
+ tslib_1.__metadata("design:type", typeof (_b = typeof biz_base_1.Bizplace !== "undefined" && biz_base_1.Bizplace) === "function" ? _b : Object)
42
34
  ], ProductBundle.prototype, "bizplace", void 0);
43
- __decorate([
35
+ tslib_1.__decorate([
44
36
  (0, typeorm_1.OneToMany)(type => product_bundle_setting_1.ProductBundleSetting, productBundleSetting => productBundleSetting.productBundle),
45
37
  (0, type_graphql_1.Field)(type => [product_bundle_setting_1.ProductBundleSetting]),
46
- __metadata("design:type", Array)
38
+ tslib_1.__metadata("design:type", Array)
47
39
  ], ProductBundle.prototype, "productBundleSettings", void 0);
48
- __decorate([
40
+ tslib_1.__decorate([
49
41
  (0, typeorm_1.Column)(),
50
42
  (0, type_graphql_1.Field)(),
51
- __metadata("design:type", String)
43
+ tslib_1.__metadata("design:type", String)
52
44
  ], ProductBundle.prototype, "sku", void 0);
53
- __decorate([
45
+ tslib_1.__decorate([
54
46
  (0, typeorm_1.Column)({ nullable: true }),
55
47
  (0, type_graphql_1.Field)({ nullable: true }),
56
- __metadata("design:type", String)
48
+ tslib_1.__metadata("design:type", String)
57
49
  ], ProductBundle.prototype, "refCode", void 0);
58
- __decorate([
50
+ tslib_1.__decorate([
59
51
  (0, typeorm_1.Column)(),
60
52
  (0, type_graphql_1.Field)(),
61
- __metadata("design:type", String)
53
+ tslib_1.__metadata("design:type", String)
62
54
  ], ProductBundle.prototype, "name", void 0);
63
- __decorate([
55
+ tslib_1.__decorate([
64
56
  (0, typeorm_1.Column)({ nullable: true }),
65
57
  (0, type_graphql_1.Field)({ nullable: true }),
66
- __metadata("design:type", String)
58
+ tslib_1.__metadata("design:type", String)
67
59
  ], ProductBundle.prototype, "description", void 0);
68
- __decorate([
60
+ tslib_1.__decorate([
69
61
  (0, typeorm_1.Column)({ nullable: true }),
70
62
  (0, type_graphql_1.Field)({ nullable: true }),
71
- __metadata("design:type", String)
63
+ tslib_1.__metadata("design:type", String)
72
64
  ], ProductBundle.prototype, "type", void 0);
73
- __decorate([
65
+ tslib_1.__decorate([
74
66
  (0, typeorm_1.Column)(),
75
67
  (0, type_graphql_1.Field)(),
76
- __metadata("design:type", String)
68
+ tslib_1.__metadata("design:type", String)
77
69
  ], ProductBundle.prototype, "status", void 0);
78
- __decorate([
70
+ tslib_1.__decorate([
79
71
  (0, typeorm_1.Column)(),
80
72
  (0, type_graphql_1.Field)(),
81
- __metadata("design:type", String)
73
+ tslib_1.__metadata("design:type", String)
82
74
  ], ProductBundle.prototype, "packingType", void 0);
83
- __decorate([
75
+ tslib_1.__decorate([
84
76
  (0, typeorm_1.Column)({ type: 'float', default: 1 }),
85
77
  (0, type_graphql_1.Field)(),
86
- __metadata("design:type", Number)
78
+ tslib_1.__metadata("design:type", Number)
87
79
  ], ProductBundle.prototype, "packingSize", void 0);
88
- __decorate([
80
+ tslib_1.__decorate([
89
81
  (0, typeorm_1.CreateDateColumn)(),
90
82
  (0, type_graphql_1.Field)({ nullable: true }),
91
- __metadata("design:type", Date)
83
+ tslib_1.__metadata("design:type", Date)
92
84
  ], ProductBundle.prototype, "createdAt", void 0);
93
- __decorate([
85
+ tslib_1.__decorate([
94
86
  (0, typeorm_1.UpdateDateColumn)(),
95
87
  (0, type_graphql_1.Field)({ nullable: true }),
96
- __metadata("design:type", Date)
88
+ tslib_1.__metadata("design:type", Date)
97
89
  ], ProductBundle.prototype, "updatedAt", void 0);
98
- __decorate([
90
+ tslib_1.__decorate([
99
91
  (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
100
92
  nullable: true
101
93
  }),
102
94
  (0, type_graphql_1.Field)({ nullable: true }),
103
- __metadata("design:type", typeof (_c = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _c : Object)
95
+ tslib_1.__metadata("design:type", typeof (_c = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _c : Object)
104
96
  ], ProductBundle.prototype, "creator", void 0);
105
- __decorate([
97
+ tslib_1.__decorate([
106
98
  (0, typeorm_1.RelationId)((productBundle) => productBundle.creator),
107
- __metadata("design:type", String)
99
+ tslib_1.__metadata("design:type", String)
108
100
  ], ProductBundle.prototype, "creatorId", void 0);
109
- __decorate([
101
+ tslib_1.__decorate([
110
102
  (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
111
103
  nullable: true
112
104
  }),
113
105
  (0, type_graphql_1.Field)({ nullable: true }),
114
- __metadata("design:type", typeof (_d = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _d : Object)
106
+ tslib_1.__metadata("design:type", typeof (_d = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _d : Object)
115
107
  ], ProductBundle.prototype, "updater", void 0);
116
- __decorate([
108
+ tslib_1.__decorate([
117
109
  (0, typeorm_1.RelationId)((productBundle) => productBundle.updater),
118
- __metadata("design:type", String)
110
+ tslib_1.__metadata("design:type", String)
119
111
  ], ProductBundle.prototype, "updaterId", void 0);
120
- ProductBundle = __decorate([
112
+ ProductBundle = tslib_1.__decorate([
121
113
  (0, typeorm_1.Entity)(),
122
114
  (0, typeorm_1.Index)('ix_product_bundle_0', (productBundle) => [productBundle.domain, productBundle.id], {
123
115
  unique: true
@@ -1 +1 @@
1
- {"version":3,"file":"product-bundle.js","sourceRoot":"","sources":["../../../server/service/product-bundle/product-bundle.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,yDAAgD;AAChD,uDAAmD;AACnD,iDAA8C;AAC9C,+CAAoD;AACpD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,IAAA,oBAAU,EAAC,CAAC,aAA4B,EAAE,EAAE,CAAC,aAAa,CAAC,OAAO,CAAC;;gDACnD;AAMjB;IAJC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE;QACvB,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;0DACjB,gBAAI,oBAAJ,gBAAI;8CAAA;AAGb;IADC,IAAA,oBAAU,EAAC,CAAC,aAA4B,EAAE,EAAE,CAAC,aAAa,CAAC,OAAO,CAAC;;gDACnD;AA9EN,aAAa;IALzB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,qBAAqB,EAAE,CAAC,aAA4B,EAAE,EAAE,CAAC,CAAC,aAAa,CAAC,MAAM,EAAE,aAAa,CAAC,EAAE,CAAC,EAAE;QACxG,MAAM,EAAE,IAAI;KACb,CAAC;IACD,IAAA,yBAAU,GAAE;GACA,aAAa,CA+EzB;AA/EY,sCAAa","sourcesContent":["import { User } from '@things-factory/auth-base'\nimport { Bizplace } from '@things-factory/biz-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 OneToMany,\n PrimaryGeneratedColumn,\n RelationId,\n UpdateDateColumn\n} from 'typeorm'\nimport { ProductBundleSetting } from '../product-bundle-setting/product-bundle-setting'\n\n@Entity()\n@Index('ix_product_bundle_0', (productBundle: ProductBundle) => [productBundle.domain, productBundle.id], {\n unique: true\n})\n@ObjectType()\nexport class ProductBundle {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field()\n domain: Domain\n\n @RelationId((productBundle: ProductBundle) => productBundle.domain)\n domainId: string\n\n @ManyToOne(type => Bizplace, {\n nullable: false\n })\n @Field({ nullable: true })\n bizplace: Bizplace\n\n @OneToMany(type => ProductBundleSetting, productBundleSetting => productBundleSetting.productBundle)\n @Field(type => [ProductBundleSetting])\n productBundleSettings: ProductBundleSetting[]\n\n @Column()\n @Field()\n sku: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n refCode: string\n\n @Column()\n @Field()\n name: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n description: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n type: string\n\n @Column()\n @Field()\n status: string\n\n @Column()\n @Field()\n packingType: string\n\n @Column({ type: 'float', default: 1 })\n @Field()\n packingSize: 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((productBundle: ProductBundle) => productBundle.creator)\n creatorId: string\n\n @ManyToOne(type => User, {\n nullable: true\n })\n @Field({ nullable: true })\n updater: User\n\n @RelationId((productBundle: ProductBundle) => productBundle.updater)\n updaterId: string\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/product-bundle-setting/index.ts"],"names":[],"mappings":";;;AAAA,qEAA+D;AAC/D,uFAAgF;AAChF,iFAA0E;AAE7D,QAAA,QAAQ,GAAG,CAAC,6CAAoB,CAAC,CAAA;AACjC,QAAA,SAAS,GAAG,CAAC,wDAAyB,EAAE,8DAA4B,CAAC,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/product-bundle-setting/index.ts"],"names":[],"mappings":";;;AAAA,qEAA+D;AAC/D,uFAAgF;AAChF,iFAA0E;AAE7D,QAAA,QAAQ,GAAG,CAAC,6CAAoB,CAAC,CAAA;AACjC,QAAA,SAAS,GAAG,CAAC,wDAAyB,EAAE,8DAA4B,CAAC,CAAA","sourcesContent":["import { ProductBundleSetting } from './product-bundle-setting'\nimport { ProductBundleSettingMutation } from './product-bundle-setting-mutation'\nimport { ProductBundleSettingQuery } from './product-bundle-setting-query'\n\nexport const entities = [ProductBundleSetting]\nexport const resolvers = [ProductBundleSettingQuery, ProductBundleSettingMutation]\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.updateMultipleProductBundleSetting = exports.ProductBundleSettingMutation = void 0;
4
+ const tslib_1 = require("tslib");
16
5
  const type_graphql_1 = require("type-graphql");
17
6
  const typeorm_1 = require("typeorm");
18
7
  const product_bundle_setting_1 = require("./product-bundle-setting");
@@ -101,41 +90,41 @@ let ProductBundleSettingMutation = class ProductBundleSettingMutation {
101
90
  }
102
91
  }
103
92
  };
104
- __decorate([
93
+ tslib_1.__decorate([
105
94
  (0, type_graphql_1.Mutation)(returns => [product_bundle_setting_1.ProductBundleSetting]),
106
- __param(0, (0, type_graphql_1.Arg)('patches', type => [product_bundle_setting_types_1.ProductBundleSettingPatch])),
107
- __param(1, (0, type_graphql_1.Ctx)()),
108
- __metadata("design:type", Function),
109
- __metadata("design:paramtypes", [Array, Object]),
110
- __metadata("design:returntype", Promise)
95
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [product_bundle_setting_types_1.ProductBundleSettingPatch])),
96
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
97
+ tslib_1.__metadata("design:type", Function),
98
+ tslib_1.__metadata("design:paramtypes", [Array, Object]),
99
+ tslib_1.__metadata("design:returntype", Promise)
111
100
  ], ProductBundleSettingMutation.prototype, "updateMultipleProductBundleSetting", null);
112
- __decorate([
101
+ tslib_1.__decorate([
113
102
  (0, type_graphql_1.Mutation)(returns => Boolean),
114
- __param(0, (0, type_graphql_1.Arg)('id')),
115
- __param(1, (0, type_graphql_1.Ctx)()),
116
- __metadata("design:type", Function),
117
- __metadata("design:paramtypes", [String, Object]),
118
- __metadata("design:returntype", Promise)
103
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
104
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
105
+ tslib_1.__metadata("design:type", Function),
106
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
107
+ tslib_1.__metadata("design:returntype", Promise)
119
108
  ], ProductBundleSettingMutation.prototype, "deleteProductBundleSetting", null);
120
- __decorate([
109
+ tslib_1.__decorate([
121
110
  (0, type_graphql_1.Mutation)(returns => Boolean),
122
- __param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
123
- __param(1, (0, type_graphql_1.Ctx)()),
124
- __metadata("design:type", Function),
125
- __metadata("design:paramtypes", [Array, Object]),
126
- __metadata("design:returntype", Promise)
111
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
112
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
113
+ tslib_1.__metadata("design:type", Function),
114
+ tslib_1.__metadata("design:paramtypes", [Array, Object]),
115
+ tslib_1.__metadata("design:returntype", Promise)
127
116
  ], ProductBundleSettingMutation.prototype, "deleteProductBundleSettings", null);
128
- __decorate([
117
+ tslib_1.__decorate([
129
118
  (0, type_graphql_1.Directive)('@transaction'),
130
119
  (0, type_graphql_1.Mutation)(returns => Boolean),
131
- __param(0, (0, type_graphql_1.Arg)('productBundleId')),
132
- __param(1, (0, type_graphql_1.Arg)('patches', type => [product_bundle_setting_types_1.ProductBundleSettingPatch])),
133
- __param(2, (0, type_graphql_1.Ctx)()),
134
- __metadata("design:type", Function),
135
- __metadata("design:paramtypes", [String, Array, Object]),
136
- __metadata("design:returntype", Promise)
120
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('productBundleId')),
121
+ tslib_1.__param(1, (0, type_graphql_1.Arg)('patches', type => [product_bundle_setting_types_1.ProductBundleSettingPatch])),
122
+ tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
123
+ tslib_1.__metadata("design:type", Function),
124
+ tslib_1.__metadata("design:paramtypes", [String, Array, Object]),
125
+ tslib_1.__metadata("design:returntype", Promise)
137
126
  ], ProductBundleSettingMutation.prototype, "linkProductBundle", null);
138
- ProductBundleSettingMutation = __decorate([
127
+ ProductBundleSettingMutation = tslib_1.__decorate([
139
128
  (0, type_graphql_1.Resolver)(product_bundle_setting_1.ProductBundleSetting)
140
129
  ], ProductBundleSettingMutation);
141
130
  exports.ProductBundleSettingMutation = ProductBundleSettingMutation;
@@ -1 +1 @@
1
- {"version":3,"file":"product-bundle-setting-mutation.js","sourceRoot":"","sources":["../../../server/service/product-bundle-setting/product-bundle-setting-mutation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAAsE;AACtE,qCAA8E;AAI9E,qEAA+D;AAC/D,iFAA0E;AAE1E,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,2CAA2C,CAAC,CAAA;AAG3E,IAAa,4BAA4B,GAAzC,MAAa,4BAA4B;IAEvC,KAAK,CAAC,kCAAkC,CACe,OAAoC,EAClF,OAAY;QAEnB,OAAO,MAAM,kCAAkC,CAAC,OAAO,CAAC,CAAA;IAC1D,CAAC;IAGD,KAAK,CAAC,0BAA0B,CAAY,EAAU,EAAS,OAAY;QACzE,MAAM,IAAA,uBAAa,EAAC,6CAAoB,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,C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C,MAAM,EAAE,CAAC,EAAE,EAAE;YAC9C,MAAM,SAAS,GAAG,cAAc,CAAC,CAAC,CAAC,CAAA;YAEnC,MAAM,MAAM,GAAG,MAAM,wBAAwB,CAAC,IAAI,mBAC7C,SAAS,EACZ,CAAA;YAEF,OAAO,CAAC,IAAI,iCAAM,MAAM,KAAE,MAAM,EAAE,GAAG,IAAG,CAAA;SACzC;KACF;IAED,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE;QAC7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC9C,MAAM,SAAS,GAAG,cAAc,CAAC,CAAC,CAAC,CAAA;YACnC,MAAM,oBAAoB,GAAG,MAAM,wBAAwB,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,SAAS,CAAC,EAAE,EAAE,CAAC,CAAA;YAEzF,MAAM,MAAM,GAAG,MAAM,wBAAwB,CAAC,IAAI,iCAC7C,oBAAoB,GACpB,SAAS,EACZ,CAAA;YAEF,OAAO,CAAC,IAAI,iCAAM,MAAM,KAAE,MAAM,EAAE,GAAG,IAAG,CAAA;SACzC;KACF;IAED,OAAO,OAAO,CAAA;AAChB,CAAC;AApCD,gFAoCC"}
1
+ {"version":3,"file":"product-bundle-setting-mutation.js","sourceRoot":"","sources":["../../../server/service/product-bundle-setting/product-bundle-setting-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA8E;AAI9E,qEAA+D;AAC/D,iFAA0E;AAE1E,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,2CAA2C,CAAC,CAAA;AAG3E,IAAa,4BAA4B,GAAzC,MAAa,4BAA4B;IAEvC,KAAK,CAAC,kCAAkC,CACe,OAAoC,EAClF,OAAY;QAEnB,OAAO,MAAM,kCAAkC,CAAC,OAAO,CAAC,CAAA;IAC1D,CAAC;IAGD,KAAK,CAAC,0BAA0B,CAAY,EAAU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IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE;QAC7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC9C,MAAM,SAAS,GAAG,cAAc,CAAC,CAAC,CAAC,CAAA;YAEnC,MAAM,MAAM,GAAG,MAAM,wBAAwB,CAAC,IAAI,mBAC7C,SAAS,EACZ,CAAA;YAEF,OAAO,CAAC,IAAI,iCAAM,MAAM,KAAE,MAAM,EAAE,GAAG,IAAG,CAAA;SACzC;KACF;IAED,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE;QAC7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC9C,MAAM,SAAS,GAAG,cAAc,CAAC,CAAC,CAAC,CAAA;YACnC,MAAM,oBAAoB,GAAG,MAAM,wBAAwB,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,SAAS,CAAC,EAAE,EAAE,CAAC,CAAA;YAEzF,MAAM,MAAM,GAAG,MAAM,wBAAwB,CAAC,IAAI,iCAC7C,oBAAoB,GACpB,SAAS,EACZ,CAAA;YAEF,OAAO,CAAC,IAAI,iCAAM,MAAM,KAAE,MAAM,EAAE,GAAG,IAAG,CAAA;SACzC;KACF;IAED,OAAO,OAAO,CAAA;AAChB,CAAC;AApCD,gFAoCC","sourcesContent":["import { Arg, Ctx, Mutation, Resolver, Directive } from 'type-graphql'\nimport { EntityManager, getRepository, In, SelectQueryBuilder } from 'typeorm'\n\nimport { Domain } from '@things-factory/shell'\n\nimport { ProductBundleSetting } from './product-bundle-setting'\nimport { ProductBundleSettingPatch } from './product-bundle-setting-types'\n\nconst debug = require('debug')('things-factory:product-base:productBundle')\n\n@Resolver(ProductBundleSetting)\nexport class ProductBundleSettingMutation {\n @Mutation(returns => [ProductBundleSetting])\n async updateMultipleProductBundleSetting(\n @Arg('patches', type => [ProductBundleSettingPatch]) patches: ProductBundleSettingPatch[],\n @Ctx() context: any\n ): Promise<ProductBundleSetting[]> {\n return await updateMultipleProductBundleSetting(patches)\n }\n\n @Mutation(returns => Boolean)\n async deleteProductBundleSetting(@Arg('id') id: string, @Ctx() context: any): Promise<Boolean> {\n await getRepository(ProductBundleSetting).delete({ id })\n\n return true\n }\n\n @Mutation(returns => Boolean)\n async deleteProductBundleSettings(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: any\n ): Promise<Boolean> {\n await getRepository(ProductBundleSetting).delete({\n product: In(ids)\n })\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean)\n async linkProductBundle(\n @Arg('productBundleId') productBundleId: string,\n @Arg('patches', type => [ProductBundleSettingPatch]) patches: ProductBundleSettingPatch[],\n @Ctx() context: any\n ): Promise<Boolean> {\n try {\n const { domain, tx }: { domain: Domain; tx: EntityManager } = context.state\n\n // const existingBundleLink: ProductBundleSetting[] = await tx.getRepository(ProductBundleSetting).find({\n // where: { productBundle: productBundleId },\n // relations: ['product', 'productDetail', 'productBundle']\n // })\n\n const qb: SelectQueryBuilder<ProductBundleSetting> = tx\n .getRepository(ProductBundleSetting)\n .createQueryBuilder('pbs')\n .innerJoinAndSelect('pbs.product', 'prd')\n .innerJoinAndSelect('pbs.productDetail', 'pd')\n .innerJoinAndSelect('pbs.productBundle', 'pb')\n .where('pb.id = :productBundleId', { productBundleId })\n .andWhere('pb.domain_id = :domainId', { domainId: domain.id })\n\n const existingBundleLink = await qb.getMany()\n\n let newBundleLink: ProductBundleSetting[] = patches.reduce((acc, curr) => {\n if (\n !existingBundleLink.find(\n item => item.product.id === curr.product.id && item.productDetail.id === curr.productDetail.id\n )\n ) {\n acc.push({\n productBundle: { id: productBundleId },\n product: { id: curr.product.id },\n productDetail: { id: curr.productDetail.id },\n bundleQty: curr.bundleQty,\n cuFlag: '+'\n })\n }\n // check if there is existing bundle link but changes in bundle qty\n else if (\n existingBundleLink.find(\n item =>\n item.product.id === curr.product.id &&\n item.productDetail.id === curr.productDetail.id &&\n item.bundleQty !== curr.bundleQty\n )\n ) {\n acc.push({\n id: curr.id,\n productBundle: { id: productBundleId },\n product: { id: curr.product.id },\n productDetail: { id: curr.productDetail.id },\n bundleQty: curr.bundleQty,\n cuFlag: 'M'\n })\n }\n return acc\n }, [])\n\n let removeBundleLink: ProductBundleSetting[] = existingBundleLink.reduce((acc, curr) => {\n if (!patches.find(item => item.id == curr.id)) {\n acc.push({\n id: curr.id,\n productBundle: { id: productBundleId },\n product: { id: curr.product.id },\n productDetail: { id: curr.productDetail.id },\n bundleQty: curr.bundleQty\n })\n }\n return acc\n }, [])\n\n if (newBundleLink.length > 0) {\n await updateMultipleProductBundleSetting(newBundleLink, tx)\n }\n\n if (removeBundleLink.length > 0) {\n await tx.getRepository(ProductBundleSetting).delete({\n id: In(removeBundleLink.map(bundleLink => bundleLink.id))\n })\n }\n\n return true\n } catch (error) {\n debug('link-product-bundle', error)\n throw error\n }\n }\n}\n\nexport async function updateMultipleProductBundleSetting(\n patches: ProductBundleSettingPatch[],\n tx?: EntityManager\n): Promise<ProductBundleSetting[]> {\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 const productBundleSettingRepo = tx.getRepository(ProductBundleSetting)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await productBundleSettingRepo.save({\n ...newRecord\n })\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const newRecord = _updateRecords[i]\n const productBundleSetting = await productBundleSettingRepo.findOne({ id: newRecord.id })\n\n const result = await productBundleSettingRepo.save({\n ...productBundleSetting,\n ...newRecord\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n}\n"]}
@@ -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, _b;
15
3
  Object.defineProperty(exports, "__esModule", { value: true });
16
4
  exports.ProductBundleSettingQuery = 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 biz_base_1 = require("@things-factory/biz-base");
@@ -88,23 +77,23 @@ let ProductBundleSettingQuery = class ProductBundleSettingQuery {
88
77
  return { items, total };
89
78
  }
90
79
  };
91
- __decorate([
80
+ tslib_1.__decorate([
92
81
  (0, type_graphql_1.Query)(returns => product_bundle_setting_types_1.ProductBundleSettingList),
93
- __param(0, (0, type_graphql_1.Args)()),
94
- __param(1, (0, type_graphql_1.Ctx)()),
95
- __metadata("design:type", Function),
96
- __metadata("design:paramtypes", [typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object, Object]),
97
- __metadata("design:returntype", Promise)
82
+ tslib_1.__param(0, (0, type_graphql_1.Args)()),
83
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
84
+ tslib_1.__metadata("design:type", Function),
85
+ tslib_1.__metadata("design:paramtypes", [typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object, Object]),
86
+ tslib_1.__metadata("design:returntype", Promise)
98
87
  ], ProductBundleSettingQuery.prototype, "productBundleSettings", null);
99
- __decorate([
88
+ tslib_1.__decorate([
100
89
  (0, type_graphql_1.Query)(returns => product_bundle_setting_types_1.ProductBundleSettingList),
101
- __param(0, (0, type_graphql_1.Args)()),
102
- __param(1, (0, type_graphql_1.Ctx)()),
103
- __metadata("design:type", Function),
104
- __metadata("design:paramtypes", [typeof (_b = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _b : Object, Object]),
105
- __metadata("design:returntype", Promise)
90
+ tslib_1.__param(0, (0, type_graphql_1.Args)()),
91
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
92
+ tslib_1.__metadata("design:type", Function),
93
+ tslib_1.__metadata("design:paramtypes", [typeof (_b = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _b : Object, Object]),
94
+ tslib_1.__metadata("design:returntype", Promise)
106
95
  ], ProductBundleSettingQuery.prototype, "productBundleSets", null);
107
- ProductBundleSettingQuery = __decorate([
96
+ ProductBundleSettingQuery = tslib_1.__decorate([
108
97
  (0, type_graphql_1.Resolver)(product_bundle_setting_1.ProductBundleSetting)
109
98
  ], ProductBundleSettingQuery);
110
99
  exports.ProductBundleSettingQuery = ProductBundleSettingQuery;
@@ -1 +1 @@
1
- {"version":3,"file":"product-bundle-setting-query.js","sourceRoot":"","sources":["../../../server/service/product-bundle-setting/product-bundle-setting-query.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAAyD;AACzD,qCAAqE;AAErE,uDAAmD;AACnD,iDAAwG;AAExG,gDAA4C;AAC5C,qEAA+D;AAC/D,iFAAyE;AAGzE,IAAa,yBAAyB,GAAtC,MAAa,yBAAyB;IAEpC,KAAK,CAAC,qBAAqB,CAAS,MAAiB,EAAS,OAAY;QACxE,MAAM,eAAe,GAAG,IAAA,yBAAiB,EAAC,MAAM,C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,CAAA;IACzB,CAAC;CACF,CAAA;AAvHC;IADC,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,uDAAwB,CAAC;IACd,WAAA,IAAA,mBAAI,GAAE,CAAA;IAAqB,WAAA,IAAA,kBAAG,GAAE,CAAA;;yDAAjB,iBAAS,oBAAT,iBAAS;;sEAOpD;AAGD;IADC,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,uDAAwB,CAAC;IAClB,WAAA,IAAA,mBAAI,GAAE,CAAA;IAAqB,WAAA,IAAA,kBAAG,GAAE,CAAA;;yDAAjB,iBAAS,oBAAT,iBAAS;;kEA4GhD;AAxHU,yBAAyB;IADrC,IAAA,uBAAQ,EAAC,6CAAoB,CAAC;GAClB,yBAAyB,CAyHrC;AAzHY,8DAAyB"}
1
+ {"version":3,"file":"product-bundle-setting-query.js","sourceRoot":"","sources":["../../../server/service/product-bundle-setting/product-bundle-setting-query.ts"],"names":[],"mappings":";;;;;AAAA,+CAAyD;AACzD,qCAAqE;AAErE,uDAAmD;AACnD,iDAAwG;AAExG,gDAA4C;AAC5C,qEAA+D;AAC/D,iFAAyE;AAGzE,IAAa,yBAAyB,GAAtC,MAAa,yBAAyB;IAEpC,KAAK,CAAC,qBAAqB,CAAS,MAAiB,EAAS,OAAY;QACxE,MAAM,eAAe,GAAG,IAAA,yBAAiB,EAAC,MAAM,CAAC,CAAA;QACjD,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,IAAA,uBAAa,EAAC,6CAAoB,CAAC,CAAC,YAAY,mBACxE,eAAe,EAClB,CAAA;QAEF,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;IAGD,KAAK,CAAC,iBAAiB,CAAS,MAAiB,EAAS,OAAY;QACpE,MAAM,EAAE,MAAM,EAAE,GAAuB,OAAO,CAAC,KAAK,CAAA;QACpD,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAA;QACnC,MA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AS,oBAAT,iBAAS;;kEA4GhD;AAxHU,yBAAyB;IADrC,IAAA,uBAAQ,EAAC,6CAAoB,CAAC;GAClB,yBAAyB,CAyHrC;AAzHY,8DAAyB","sourcesContent":["import { Args, Ctx, Query, Resolver } from 'type-graphql'\nimport { Brackets, getRepository, SelectQueryBuilder } from 'typeorm'\n\nimport { Bizplace } from '@things-factory/biz-base'\nimport { buildCondition, buildQuery, convertListParams, Domain, ListParam } from '@things-factory/shell'\n\nimport { Product } from '../product/product'\nimport { ProductBundleSetting } from './product-bundle-setting'\nimport { ProductBundleSettingList } from './product-bundle-setting-types'\n\n@Resolver(ProductBundleSetting)\nexport class ProductBundleSettingQuery {\n @Query(returns => ProductBundleSettingList)\n async productBundleSettings(@Args() params: ListParam, @Ctx() context: any): Promise<ProductBundleSettingList> {\n const convertedParams = convertListParams(params)\n const [items, total] = await getRepository(ProductBundleSetting).findAndCount({\n ...convertedParams\n })\n\n return { items, total }\n }\n\n @Query(returns => ProductBundleSettingList)\n async productBundleSets(@Args() params: ListParam, @Ctx() context: any): Promise<ProductBundleSettingList> {\n const { domain }: { domain: Domain } = context.state\n const page = params.pagination.page\n const limit = params.pagination.limit\n\n const filters = params.filters.filter(x => x.name !== 'product_info' && x.name !== 'productBundleId')\n const productBundleId = params.filters.find(x => x.name === 'productBundleId')\n const productInfoFilter = params.filters.find(x => x.name === 'product_info')\n const productInfoColumns = ['sku', 'name', 'description']\n params.filters = [...filters]\n\n params.sortings = [\n { name: 'prd.sku' },\n { name: 'prdDet.gtin' },\n ...params.sortings.map(sorting => {\n const name = sorting.name.replace('product', '').toLowerCase()\n return {\n ...sorting,\n name\n }\n })\n ]\n\n if (!params.filters.find(filter => filter.name === 'bizplace_id')) {\n let bizplace: Bizplace = await getRepository(Bizplace).findOne({ where: { domain } })\n params.filters = [...filters, { name: 'bizplace_id', operator: 'in', value: [bizplace.id] }]\n }\n\n const qb: SelectQueryBuilder<Product> = getRepository(Product).createQueryBuilder('prd')\n buildQuery(qb, params, context)\n\n qb.innerJoinAndSelect('product_details', 'prdDet', 'prdDet.product_id = prd.id')\n qb.leftJoinAndSelect(\n 'product_bundle_settings',\n 'pbs',\n 'pbs.product_id = prd.id and pbs.product_detail_id = prdDet.id'\n )\n qb.leftJoinAndSelect('pbs.productBundle', 'pb')\n\n if (productInfoFilter) {\n qb.andWhere(\n new Brackets(qb2 => {\n productInfoColumns.forEach(filter => {\n const condition = buildCondition(\n qb.alias,\n filter,\n productInfoFilter.operator,\n productInfoFilter.value,\n productInfoFilter.relation,\n Object.keys(qb.getParameters()).length\n )\n\n qb2.orWhere(condition.clause, condition.parameters)\n })\n })\n )\n }\n\n if (productBundleId && productBundleId.operator === 'eq') {\n qb.andWhere('pb.id = :bundleId::uuid', {\n bundleId: productBundleId.value\n })\n }\n\n let productBundleSets = await qb\n .offset((page - 1) * limit)\n .limit(limit)\n .getRawMany()\n\n const items = productBundleSets.map(item => {\n return {\n // id: item.pbs_id,\n // productDetailId: item.prdDet_id,\n // gtin: item.prdDet_gtin,\n // packingType: item.prdDet_packing_type,\n // packingSize: item.prdDet_packing_size,\n // productId: item.prd_id,\n // productSku: item.prd_sku,\n // productName: item.prd_name,\n // productDescription: item.prd_description,\n // productType: item.prd_type,\n // bundleId: item.pb_id,\n // bundleSku: item.pb_sku,\n // bundleName: item.pb_name,\n // bundleDescription: item.pb_description,\n // bundleQty: item.pbs_bundle_qty\n ...item,\n id: item.pbs_id,\n product: {\n id: item.prd_id,\n sku: item.prd_sku,\n name: item.prd_name,\n description: item.prd_description,\n type: item.prd_type\n },\n productDetail: {\n id: item.prdDet_id,\n gtin: item.prdDet_gtin,\n packingType: item.prdDet_packing_type,\n packingSize: item.prdDet_packing_size\n },\n bundleQty: item.pbs_bundle_qty\n }\n })\n\n const total = await qb.getCount()\n\n return { items, total }\n }\n}\n"]}
@@ -1,68 +1,60 @@
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.ProductBundleSettingPatch = exports.ProductBundleSettingList = 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_bundle_setting_1 = require("./product-bundle-setting");
17
9
  let ProductBundleSettingList = class ProductBundleSettingList {
18
10
  };
19
- __decorate([
11
+ tslib_1.__decorate([
20
12
  (0, type_graphql_1.Field)(type => [product_bundle_setting_1.ProductBundleSetting], { nullable: true }),
21
- __metadata("design:type", Array)
13
+ tslib_1.__metadata("design:type", Array)
22
14
  ], ProductBundleSettingList.prototype, "items", void 0);
23
- __decorate([
15
+ tslib_1.__decorate([
24
16
  (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
25
- __metadata("design:type", Number)
17
+ tslib_1.__metadata("design:type", Number)
26
18
  ], ProductBundleSettingList.prototype, "total", void 0);
27
- ProductBundleSettingList = __decorate([
19
+ ProductBundleSettingList = tslib_1.__decorate([
28
20
  (0, type_graphql_1.ObjectType)()
29
21
  ], ProductBundleSettingList);
30
22
  exports.ProductBundleSettingList = ProductBundleSettingList;
31
23
  let ProductBundleSettingPatch = class ProductBundleSettingPatch {
32
24
  };
33
- __decorate([
25
+ tslib_1.__decorate([
34
26
  (0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
35
- __metadata("design:type", String)
27
+ tslib_1.__metadata("design:type", String)
36
28
  ], ProductBundleSettingPatch.prototype, "id", void 0);
37
- __decorate([
29
+ tslib_1.__decorate([
38
30
  (0, type_graphql_1.Field)({ nullable: true }),
39
- __metadata("design:type", typeof (_a = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _a : Object)
31
+ tslib_1.__metadata("design:type", typeof (_a = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _a : Object)
40
32
  ], ProductBundleSettingPatch.prototype, "product", void 0);
41
- __decorate([
33
+ tslib_1.__decorate([
42
34
  (0, type_graphql_1.Field)({ nullable: true }),
43
- __metadata("design:type", typeof (_b = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _b : Object)
35
+ tslib_1.__metadata("design:type", typeof (_b = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _b : Object)
44
36
  ], ProductBundleSettingPatch.prototype, "productDetail", void 0);
45
- __decorate([
37
+ tslib_1.__decorate([
46
38
  (0, type_graphql_1.Field)({ nullable: true }),
47
- __metadata("design:type", typeof (_c = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _c : Object)
39
+ tslib_1.__metadata("design:type", typeof (_c = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _c : Object)
48
40
  ], ProductBundleSettingPatch.prototype, "productBundle", void 0);
49
- __decorate([
41
+ tslib_1.__decorate([
50
42
  (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
51
- __metadata("design:type", Number)
43
+ tslib_1.__metadata("design:type", Number)
52
44
  ], ProductBundleSettingPatch.prototype, "bundleQty", void 0);
53
- __decorate([
45
+ tslib_1.__decorate([
54
46
  (0, type_graphql_1.Field)({ nullable: true }),
55
- __metadata("design:type", String)
47
+ tslib_1.__metadata("design:type", String)
56
48
  ], ProductBundleSettingPatch.prototype, "packingType", void 0);
57
- __decorate([
49
+ tslib_1.__decorate([
58
50
  (0, type_graphql_1.Field)(type => type_graphql_1.Float, { nullable: true }),
59
- __metadata("design:type", Number)
51
+ tslib_1.__metadata("design:type", Number)
60
52
  ], ProductBundleSettingPatch.prototype, "packingSize", void 0);
61
- __decorate([
53
+ tslib_1.__decorate([
62
54
  (0, type_graphql_1.Field)({ nullable: true }),
63
- __metadata("design:type", String)
55
+ tslib_1.__metadata("design:type", String)
64
56
  ], ProductBundleSettingPatch.prototype, "cuFlag", void 0);
65
- ProductBundleSettingPatch = __decorate([
57
+ ProductBundleSettingPatch = tslib_1.__decorate([
66
58
  (0, type_graphql_1.InputType)()
67
59
  ], ProductBundleSettingPatch);
68
60
  exports.ProductBundleSettingPatch = ProductBundleSettingPatch;
@@ -1 +1 @@
1
- {"version":3,"file":"product-bundle-setting-types.js","sourceRoot":"","sources":["../../../server/service/product-bundle-setting/product-bundle-setting-types.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,+CAA2E;AAE3E,iDAAiD;AAEjD,qEAA+D;AAG/D,IAAa,wBAAwB,GAArC,MAAa,wBAAwB;CAMpC,CAAA;AAJC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,6CAAoB,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDAC5B;AAG9B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDACzB;AALH,wBAAwB;IADpC,IAAA,yBAAU,GAAE;GACA,wBAAwB,CAMpC;AANY,4DAAwB;AASrC,IAAa,yBAAyB,GAAtC,MAAa,yBAAyB;CAwBrC,CAAA;AAtBC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDAC3B;AAGX;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;kDAChB,iBAAS,oBAAT,iBAAS;0DAAA;AAGnB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;kDACV,iBAAS,oBAAT,iBAAS;gEAAA;AAGzB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;kDACV,iBAAS,oBAAT,iBAAS;gEAAA;AAGzB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4DACrB;AAGlB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8DACN;AAGpB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,oBAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8DACrB;AAGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yDACX;AAvBJ,yBAAyB;IADrC,IAAA,wBAAS,GAAE;GACC,yBAAyB,CAwBrC;AAxBY,8DAAyB"}
1
+ {"version":3,"file":"product-bundle-setting-types.js","sourceRoot":"","sources":["../../../server/service/product-bundle-setting/product-bundle-setting-types.ts"],"names":[],"mappings":";;;;;AAAA,+CAA2E;AAE3E,iDAAiD;AAEjD,qEAA+D;AAG/D,IAAa,wBAAwB,GAArC,MAAa,wBAAwB;CAMpC,CAAA;AAJC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,6CAAoB,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDAC5B;AAG9B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDACzB;AALH,wBAAwB;IADpC,IAAA,yBAAU,GAAE;GACA,wBAAwB,CAMpC;AANY,4DAAwB;AASrC,IAAa,yBAAyB,GAAtC,MAAa,yBAAyB;CAwBrC,CAAA;AAtBC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDAC3B;AAGX;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;0DAChB,iBAAS,oBAAT,iBAAS;0DAAA;AAGnB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;0DACV,iBAAS,oBAAT,iBAAS;gEAAA;AAGzB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;0DACV,iBAAS,oBAAT,iBAAS;gEAAA;AAGzB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4DACrB;AAGlB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8DACN;AAGpB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,oBAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8DACrB;AAGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yDACX;AAvBJ,yBAAyB;IADrC,IAAA,wBAAS,GAAE;GACC,yBAAyB,CAwBrC;AAxBY,8DAAyB","sourcesContent":["import { Field, Float, ID, InputType, Int, ObjectType } from 'type-graphql'\n\nimport { ObjectRef } from '@things-factory/shell'\n\nimport { ProductBundleSetting } from './product-bundle-setting'\n\n@ObjectType()\nexport class ProductBundleSettingList {\n @Field(type => [ProductBundleSetting], { nullable: true })\n items?: ProductBundleSetting[]\n\n @Field(type => Int, { nullable: true })\n total?: number\n}\n\n@InputType()\nexport class ProductBundleSettingPatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n product?: ObjectRef\n\n @Field({ nullable: true })\n productDetail?: ObjectRef\n\n @Field({ nullable: true })\n productBundle?: ObjectRef\n\n @Field(type => Int, { nullable: true })\n bundleQty?: number\n\n @Field({ nullable: true })\n packingType?: string\n\n @Field(type => Float, { nullable: true })\n packingSize?: number\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n"]}
@@ -1,15 +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
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.ProductBundleSetting = void 0;
4
+ const tslib_1 = require("tslib");
13
5
  const type_graphql_1 = require("type-graphql");
14
6
  const typeorm_1 = require("typeorm");
15
7
  const product_bundle_1 = require("../product-bundle/product-bundle");
@@ -17,40 +9,40 @@ const product_detail_1 = require("../product-detail/product-detail");
17
9
  const product_1 = require("../product/product");
18
10
  let ProductBundleSetting = class ProductBundleSetting {
19
11
  };
20
- __decorate([
12
+ tslib_1.__decorate([
21
13
  (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
22
14
  (0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
23
- __metadata("design:type", String)
15
+ tslib_1.__metadata("design:type", String)
24
16
  ], ProductBundleSetting.prototype, "id", void 0);
25
- __decorate([
17
+ tslib_1.__decorate([
26
18
  (0, typeorm_1.ManyToOne)(type => product_1.Product, { nullable: true }),
27
19
  (0, type_graphql_1.Field)(type => product_1.Product, { nullable: true }),
28
- __metadata("design:type", product_1.Product)
20
+ tslib_1.__metadata("design:type", product_1.Product)
29
21
  ], ProductBundleSetting.prototype, "product", void 0);
30
- __decorate([
22
+ tslib_1.__decorate([
31
23
  (0, typeorm_1.ManyToOne)(type => product_detail_1.ProductDetail, { nullable: true }),
32
24
  (0, type_graphql_1.Field)(type => product_detail_1.ProductDetail, { nullable: true }),
33
- __metadata("design:type", product_detail_1.ProductDetail)
25
+ tslib_1.__metadata("design:type", product_detail_1.ProductDetail)
34
26
  ], ProductBundleSetting.prototype, "productDetail", void 0);
35
- __decorate([
27
+ tslib_1.__decorate([
36
28
  (0, typeorm_1.ManyToOne)(type => product_bundle_1.ProductBundle, { nullable: true }),
37
29
  (0, type_graphql_1.Field)(type => product_bundle_1.ProductBundle, { nullable: true }),
38
- __metadata("design:type", product_bundle_1.ProductBundle)
30
+ tslib_1.__metadata("design:type", product_bundle_1.ProductBundle)
39
31
  ], ProductBundleSetting.prototype, "productBundle", void 0);
40
- __decorate([
32
+ tslib_1.__decorate([
41
33
  (0, typeorm_1.Column)({ nullable: true }),
42
34
  (0, type_graphql_1.Field)({ nullable: true }),
43
- __metadata("design:type", Number)
35
+ tslib_1.__metadata("design:type", Number)
44
36
  ], ProductBundleSetting.prototype, "bundleQty", void 0);
45
- __decorate([
37
+ tslib_1.__decorate([
46
38
  (0, type_graphql_1.Field)({ nullable: true }),
47
- __metadata("design:type", String)
39
+ tslib_1.__metadata("design:type", String)
48
40
  ], ProductBundleSetting.prototype, "productId", void 0);
49
- __decorate([
41
+ tslib_1.__decorate([
50
42
  (0, type_graphql_1.Field)({ nullable: true }),
51
- __metadata("design:type", String)
43
+ tslib_1.__metadata("design:type", String)
52
44
  ], ProductBundleSetting.prototype, "bundleId", void 0);
53
- ProductBundleSetting = __decorate([
45
+ ProductBundleSetting = tslib_1.__decorate([
54
46
  (0, typeorm_1.Entity)(),
55
47
  (0, typeorm_1.Index)('ix_product_bundle_setting_0', (productBundleSetting) => [
56
48
  productBundleSetting.product,
@@ -1 +1 @@
1
- {"version":3,"file":"product-bundle-setting.js","sourceRoot":"","sources":["../../../server/service/product-bundle-setting/product-bundle-setting.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAAoD;AACpD,qCAAkF;AAElF,qEAAgE;AAChE,qEAAgE;AAChE,gDAA4C;AAa5C,IAAa,oBAAoB,GAAjC,MAAa,oBAAoB;CA0BhC,CAAA;AAvBC;IAFC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDAClB;AAIpB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAO,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC9C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAO,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACjC,iBAAO;qDAAA;AAIjB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,8BAAa,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACpD,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,8BAAa,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACjC,8BAAa;2DAAA;AAI7B;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,8BAAa,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACpD,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,8BAAa,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACjC,8BAAa;2DAAA;AAI7B;IAFC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC1B,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDACR;AAGlB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDACR;AAGlB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDACT;AAzBN,oBAAoB;IAXhC,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EACJ,6BAA6B,EAC7B,CAAC,oBAA0C,EAAE,EAAE,CAAC;QAC9C,oBAAoB,CAAC,OAAO;QAC5B,oBAAoB,CAAC,aAAa;QAClC,oBAAoB,CAAC,aAAa;KACnC,EACD,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;IACA,IAAA,yBAAU,GAAE;GACA,oBAAoB,CA0BhC;AA1BY,oDAAoB"}
1
+ {"version":3,"file":"product-bundle-setting.js","sourceRoot":"","sources":["../../../server/service/product-bundle-setting/product-bundle-setting.ts"],"names":[],"mappings":";;;;AAAA,+CAAoD;AACpD,qCAAkF;AAElF,qEAAgE;AAChE,qEAAgE;AAChE,gDAA4C;AAa5C,IAAa,oBAAoB,GAAjC,MAAa,oBAAoB;CA0BhC,CAAA;AAvBC;IAFC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDAClB;AAIpB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAO,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC9C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAO,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACjC,iBAAO;qDAAA;AAIjB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,8BAAa,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACpD,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,8BAAa,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACjC,8BAAa;2DAAA;AAI7B;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,8BAAa,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACpD,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,8BAAa,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACjC,8BAAa;2DAAA;AAI7B;IAFC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC1B,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDACR;AAGlB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDACR;AAGlB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDACT;AAzBN,oBAAoB;IAXhC,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EACJ,6BAA6B,EAC7B,CAAC,oBAA0C,EAAE,EAAE,CAAC;QAC9C,oBAAoB,CAAC,OAAO;QAC5B,oBAAoB,CAAC,aAAa;QAClC,oBAAoB,CAAC,aAAa;KACnC,EACD,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;IACA,IAAA,yBAAU,GAAE;GACA,oBAAoB,CA0BhC;AA1BY,oDAAoB","sourcesContent":["import { Field, ID, ObjectType } from 'type-graphql'\nimport { Column, Entity, Index, ManyToOne, PrimaryGeneratedColumn } from 'typeorm'\n\nimport { ProductBundle } from '../product-bundle/product-bundle'\nimport { ProductDetail } from '../product-detail/product-detail'\nimport { Product } from '../product/product'\n\n@Entity()\n@Index(\n 'ix_product_bundle_setting_0',\n (productBundleSetting: ProductBundleSetting) => [\n productBundleSetting.product,\n productBundleSetting.productDetail,\n productBundleSetting.productBundle\n ],\n { unique: true }\n)\n@ObjectType()\nexport class ProductBundleSetting {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { nullable: true })\n readonly id?: string\n\n @ManyToOne(type => Product, { nullable: true })\n @Field(type => Product, { nullable: true })\n product?: Product\n\n @ManyToOne(type => ProductDetail, { nullable: true })\n @Field(type => ProductDetail, { nullable: true })\n productDetail?: ProductDetail\n\n @ManyToOne(type => ProductBundle, { nullable: true })\n @Field(type => ProductBundle, { nullable: true })\n productBundle?: ProductBundle\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n bundleQty?: number\n\n @Field({ nullable: true })\n productId?: string\n\n @Field({ nullable: true })\n bundleId?: string\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/product-combination/index.ts"],"names":[],"mappings":";;;AAAA,+DAA0D;AAC1D,2EAAqE;AACrE,iFAA2E;AAE9D,QAAA,QAAQ,GAAG,CAAC,wCAAkB,CAAC,CAAA;AAC/B,QAAA,SAAS,GAAG,CAAC,mDAAuB,EAAE,yDAA0B,CAAC,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/product-combination/index.ts"],"names":[],"mappings":";;;AAAA,+DAA0D;AAC1D,2EAAqE;AACrE,iFAA2E;AAE9D,QAAA,QAAQ,GAAG,CAAC,wCAAkB,CAAC,CAAA;AAC/B,QAAA,SAAS,GAAG,CAAC,mDAAuB,EAAE,yDAA0B,CAAC,CAAA","sourcesContent":["import { ProductCombination } from './product-combination'\nimport { ProductCombinationQuery } from './product-combination-query'\nimport { ProductCombinationMutation } from './product-combination-mutation'\n\nexport const entities = [ProductCombination]\nexport const resolvers = [ProductCombinationQuery, ProductCombinationMutation]\n"]}