@things-factory/product-base 6.2.177 → 6.3.0

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 (119) hide show
  1. package/dist-server/constants/index.d.ts +1 -0
  2. package/dist-server/constants/product.d.ts +21 -0
  3. package/dist-server/controllers/index.d.ts +0 -0
  4. package/dist-server/index.d.ts +2 -0
  5. package/dist-server/middlewares/index.d.ts +0 -0
  6. package/dist-server/migrations/index.d.ts +1 -0
  7. package/dist-server/service/index.d.ts +20 -0
  8. package/dist-server/service/product/index.d.ts +5 -0
  9. package/dist-server/service/product/product-mutation.d.ts +16 -0
  10. package/dist-server/service/product/product-mutation.js +6 -6
  11. package/dist-server/service/product/product-mutation.js.map +1 -1
  12. package/dist-server/service/product/product-query.d.ts +28 -0
  13. package/dist-server/service/product/product-query.js +2 -2
  14. package/dist-server/service/product/product-query.js.map +1 -1
  15. package/dist-server/service/product/product-types.d.ts +151 -0
  16. package/dist-server/service/product/product-types.js +7 -8
  17. package/dist-server/service/product/product-types.js.map +1 -1
  18. package/dist-server/service/product/product.d.ts +112 -0
  19. package/dist-server/service/product/product.js +10 -12
  20. package/dist-server/service/product/product.js.map +1 -1
  21. package/dist-server/service/product/validate-product.d.ts +2 -0
  22. package/dist-server/service/product/validate-product.js +1 -2
  23. package/dist-server/service/product/validate-product.js.map +1 -1
  24. package/dist-server/service/product-bundle/index.d.ts +5 -0
  25. package/dist-server/service/product-bundle/product-bundle-mutation.d.ts +9 -0
  26. package/dist-server/service/product-bundle/product-bundle-mutation.js +2 -2
  27. package/dist-server/service/product-bundle/product-bundle-mutation.js.map +1 -1
  28. package/dist-server/service/product-bundle/product-bundle-query.d.ts +12 -0
  29. package/dist-server/service/product-bundle/product-bundle-query.js +2 -2
  30. package/dist-server/service/product-bundle/product-bundle-query.js.map +1 -1
  31. package/dist-server/service/product-bundle/product-bundle-types.d.ts +20 -0
  32. package/dist-server/service/product-bundle/product-bundle-types.js +6 -6
  33. package/dist-server/service/product-bundle/product-bundle-types.js.map +1 -1
  34. package/dist-server/service/product-bundle/product-bundle.d.ts +25 -0
  35. package/dist-server/service/product-bundle/product-bundle.js +3 -4
  36. package/dist-server/service/product-bundle/product-bundle.js.map +1 -1
  37. package/dist-server/service/product-bundle-setting/index.d.ts +5 -0
  38. package/dist-server/service/product-bundle-setting/product-bundle-setting-mutation.d.ts +10 -0
  39. package/dist-server/service/product-bundle-setting/product-bundle-setting-mutation.js +4 -4
  40. package/dist-server/service/product-bundle-setting/product-bundle-setting-mutation.js.map +1 -1
  41. package/dist-server/service/product-bundle-setting/product-bundle-setting-query.d.ts +6 -0
  42. package/dist-server/service/product-bundle-setting/product-bundle-setting-query.js +2 -2
  43. package/dist-server/service/product-bundle-setting/product-bundle-setting-query.js.map +1 -1
  44. package/dist-server/service/product-bundle-setting/product-bundle-setting-types.d.ts +16 -0
  45. package/dist-server/service/product-bundle-setting/product-bundle-setting-types.js +4 -4
  46. package/dist-server/service/product-bundle-setting/product-bundle-setting-types.js.map +1 -1
  47. package/dist-server/service/product-bundle-setting/product-bundle-setting.d.ts +12 -0
  48. package/dist-server/service/product-bundle-setting/product-bundle-setting.js +2 -2
  49. package/dist-server/service/product-bundle-setting/product-bundle-setting.js.map +1 -1
  50. package/dist-server/service/product-combination/index.d.ts +5 -0
  51. package/dist-server/service/product-combination/product-combination-mutation.d.ts +9 -0
  52. package/dist-server/service/product-combination/product-combination-mutation.js +2 -2
  53. package/dist-server/service/product-combination/product-combination-mutation.js.map +1 -1
  54. package/dist-server/service/product-combination/product-combination-query.d.ts +11 -0
  55. package/dist-server/service/product-combination/product-combination-query.js +2 -2
  56. package/dist-server/service/product-combination/product-combination-query.js.map +1 -1
  57. package/dist-server/service/product-combination/product-combination-type.d.ts +20 -0
  58. package/dist-server/service/product-combination/product-combination-type.js +6 -6
  59. package/dist-server/service/product-combination/product-combination-type.js.map +1 -1
  60. package/dist-server/service/product-combination/product-combination.d.ts +33 -0
  61. package/dist-server/service/product-combination/product-combination.js +3 -3
  62. package/dist-server/service/product-combination/product-combination.js.map +1 -1
  63. package/dist-server/service/product-combination-setting/index.d.ts +5 -0
  64. package/dist-server/service/product-combination-setting/product-combination-setting-mutation.d.ts +11 -0
  65. package/dist-server/service/product-combination-setting/product-combination-setting-mutation.js +4 -4
  66. package/dist-server/service/product-combination-setting/product-combination-setting-mutation.js.map +1 -1
  67. package/dist-server/service/product-combination-setting/product-combination-setting-query.d.ts +14 -0
  68. package/dist-server/service/product-combination-setting/product-combination-setting-query.js +2 -2
  69. package/dist-server/service/product-combination-setting/product-combination-setting-query.js.map +1 -1
  70. package/dist-server/service/product-combination-setting/product-combination-setting-type.d.ts +18 -0
  71. package/dist-server/service/product-combination-setting/product-combination-setting-type.js +6 -6
  72. package/dist-server/service/product-combination-setting/product-combination-setting-type.js.map +1 -1
  73. package/dist-server/service/product-combination-setting/product-combination-setting.d.ts +22 -0
  74. package/dist-server/service/product-combination-setting/product-combination-setting.js +2 -2
  75. package/dist-server/service/product-combination-setting/product-combination-setting.js.map +1 -1
  76. package/dist-server/service/product-detail/index.d.ts +5 -0
  77. package/dist-server/service/product-detail/product-detail-mutation.d.ts +11 -0
  78. package/dist-server/service/product-detail/product-detail-mutation.js +18 -23
  79. package/dist-server/service/product-detail/product-detail-mutation.js.map +1 -1
  80. package/dist-server/service/product-detail/product-detail-query.d.ts +12 -0
  81. package/dist-server/service/product-detail/product-detail-query.js +2 -2
  82. package/dist-server/service/product-detail/product-detail-query.js.map +1 -1
  83. package/dist-server/service/product-detail/product-detail-types.d.ts +98 -0
  84. package/dist-server/service/product-detail/product-detail-types.js +6 -6
  85. package/dist-server/service/product-detail/product-detail-types.js.map +1 -1
  86. package/dist-server/service/product-detail/product-detail.d.ts +121 -0
  87. package/dist-server/service/product-detail/product-detail.js +7 -8
  88. package/dist-server/service/product-detail/product-detail.js.map +1 -1
  89. package/dist-server/service/product-detail-bizplace-setting/index.d.ts +5 -0
  90. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-mutation.d.ts +8 -0
  91. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-mutation.js +2 -2
  92. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-mutation.js.map +1 -1
  93. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-query.d.ts +11 -0
  94. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-query.js +2 -2
  95. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-query.js.map +1 -1
  96. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-types.d.ts +24 -0
  97. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-types.js +6 -6
  98. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-types.js.map +1 -1
  99. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting.d.ts +34 -0
  100. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting.js +2 -2
  101. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting.js.map +1 -1
  102. package/dist-server/service/product-set/index.d.ts +5 -0
  103. package/dist-server/service/product-set/product-set-mutation.d.ts +39 -0
  104. package/dist-server/service/product-set/product-set-mutation.js +5 -5
  105. package/dist-server/service/product-set/product-set-mutation.js.map +1 -1
  106. package/dist-server/service/product-set/product-set-query.d.ts +12 -0
  107. package/dist-server/service/product-set/product-set-query.js +2 -2
  108. package/dist-server/service/product-set/product-set-query.js.map +1 -1
  109. package/dist-server/service/product-set/product-set-types.d.ts +18 -0
  110. package/dist-server/service/product-set/product-set-types.js +6 -6
  111. package/dist-server/service/product-set/product-set-types.js.map +1 -1
  112. package/dist-server/service/product-set/product-set.d.ts +22 -0
  113. package/dist-server/service/product-set/product-set.js +3 -4
  114. package/dist-server/service/product-set/product-set.js.map +1 -1
  115. package/dist-server/tsconfig.tsbuildinfo +1 -1
  116. package/dist-server/utils/index.d.ts +1 -0
  117. package/dist-server/utils/product-util.d.ts +3 -0
  118. package/package.json +5 -5
  119. package/server/service/product/product.ts +1 -1
@@ -0,0 +1,34 @@
1
+ import { User } from '@things-factory/auth-base';
2
+ import { Domain } from '@things-factory/shell';
3
+ import { ProductDetail } from '../product-detail/product-detail';
4
+ /**
5
+ * @prop {string} id - Primary Key.
6
+ * @prop {Object} domain - Foreign field. Relation to Domain Entity / Table.
7
+ * @prop {Object} productDetail - Foreign field. Relation to Product Detail Entity / Table.
8
+ * @prop {string} name - Product Detail Name.
9
+ * @prop {boolean} requirePacking - Default SKU info.
10
+ * @prop {?number} bufferQty - Quantity for reservation.
11
+ * @prop {?number} minQty - Minimum Quantity targetted in inventory. For reporting purposes.
12
+ * @prop {?number} maxQty - Maximum Quantity targetted in inventory. For reporting purposes.
13
+ * @prop {Date} createdAt - Created Date and Time.
14
+ * @prop {Date} updatedAt - Updated Date and Time.
15
+ * @prop {?Object} creator - Foreign field. Relation to User Entity / Table.
16
+ * @prop {?Object} updater - Foreign field. Relation to User Entity / Table.
17
+ **/
18
+ export declare class ProductDetailBizplaceSetting {
19
+ readonly id: string;
20
+ domain: Domain;
21
+ domainId: string;
22
+ productDetail: ProductDetail;
23
+ name: string;
24
+ requirePacking: boolean;
25
+ bufferQty: number;
26
+ minQty: number;
27
+ maxQty: number;
28
+ createdAt: Date;
29
+ updatedAt: Date;
30
+ creator: User;
31
+ creatorId: string;
32
+ updater: User;
33
+ updaterId: string;
34
+ }
@@ -23,6 +23,7 @@ const product_detail_1 = require("../product-detail/product-detail");
23
23
  **/
24
24
  let ProductDetailBizplaceSetting = class ProductDetailBizplaceSetting {
25
25
  };
26
+ exports.ProductDetailBizplaceSetting = ProductDetailBizplaceSetting;
26
27
  tslib_1.__decorate([
27
28
  (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
28
29
  (0, type_graphql_1.Field)(type => type_graphql_1.ID),
@@ -99,10 +100,9 @@ tslib_1.__decorate([
99
100
  (0, typeorm_1.RelationId)((productDetailBizplaceSetting) => productDetailBizplaceSetting.updater),
100
101
  tslib_1.__metadata("design:type", String)
101
102
  ], ProductDetailBizplaceSetting.prototype, "updaterId", void 0);
102
- ProductDetailBizplaceSetting = tslib_1.__decorate([
103
+ exports.ProductDetailBizplaceSetting = ProductDetailBizplaceSetting = tslib_1.__decorate([
103
104
  (0, typeorm_1.Entity)(),
104
105
  (0, typeorm_1.Index)('ix_product_detail_bizplace_setting_0', (productDetailBizplaceSetting) => [productDetailBizplaceSetting.domain, productDetailBizplaceSetting.productDetail], { unique: true }),
105
106
  (0, type_graphql_1.ObjectType)()
106
107
  ], ProductDetailBizplaceSetting);
107
- exports.ProductDetailBizplaceSetting = ProductDetailBizplaceSetting;
108
108
  //# sourceMappingURL=product-detail-bizplace-setting.js.map
@@ -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":";;;;AAAA,+CAAoD;AACpD,qCAAkI;AAElI,yDAAgD;AAChD,iDAAgE;AAEhE,qEAAgE;AAEhE;;;;;;;;;;;;;IAaI;AASG,IAAM,4BAA4B,GAAlC,MAAM,4BAA4B;CA6DxC,CAAA;AA5DC;IAAC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;wDACC;AAEnB;IAAC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,GAAE;sCACA,cAAM;4DAAA;AAEd;IAAC,IAAA,oBAAU,EAAC,CAAC,4BAA0D,EAAE,EAAE,CAAC,4BAA4B,CAAC,MAAM,CAAC;;8DAChG;AAEhB;IAAC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,8BAAa,CAAC;IAChC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,8BAAa,CAAC;sCACd,8BAAa;mEAAA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CACjB,gBAAI;6DAAA;AAEb;IAAC,IAAA,oBAAU,EAAC,CAAC,4BAA0D,EAAE,EAAE,CAAC,4BAA4B,CAAC,OAAO,CAAC;;+DAChG;AA5DN,4BAA4B;IAPxC,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EACJ,sCAAsC,EACtC,CAAC,4BAA0D,EAAE,EAAE,CAAC,CAAC,4BAA4B,CAAC,MAAM,EAAE,4BAA4B,CAAC,aAAa,CAAC,EACjJ,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;IACA,IAAA,yBAAU,GAAE;GACA,4BAA4B,CA6DxC;AA7DY,oEAA4B","sourcesContent":["import { Field, ID, ObjectType } from 'type-graphql'\nimport { Column, CreateDateColumn, Entity, Index, ManyToOne, PrimaryGeneratedColumn, RelationId, UpdateDateColumn } from 'typeorm'\n\nimport { User } from '@things-factory/auth-base'\nimport { Domain, roundTransformer } from '@things-factory/shell'\n\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) => [productDetailBizplaceSetting.domain, productDetailBizplaceSetting.productDetail],\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('float', { default: 0, transformer: roundTransformer })\n @Field()\n minQty: number\n\n @Column('float', { default: 0, transformer: roundTransformer })\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
+ {"version":3,"file":"product-detail-bizplace-setting.js","sourceRoot":"","sources":["../../../server/service/product-detail-bizplace-setting/product-detail-bizplace-setting.ts"],"names":[],"mappings":";;;;AAAA,+CAAoD;AACpD,qCAAkI;AAElI,yDAAgD;AAChD,iDAAgE;AAEhE,qEAAgE;AAEhE;;;;;;;;;;;;;IAaI;AASG,IAAM,4BAA4B,GAAlC,MAAM,4BAA4B;CA6DxC,CAAA;AA7DY,oEAA4B;AAG9B;IAFR,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,oBAA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6DAAA;AAGb;IADC,IAAA,oBAAU,EAAC,CAAC,4BAA0D,EAAE,EAAE,CAAC,4BAA4B,CAAC,OAAO,CAAC;;+DAChG;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;sCACjB,gBAAI;6DAAA;AAGb;IADC,IAAA,oBAAU,EAAC,CAAC,4BAA0D,EAAE,EAAE,CAAC,4BAA4B,CAAC,OAAO,CAAC;;+DAChG;uCA5DN,4BAA4B;IAPxC,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EACJ,sCAAsC,EACtC,CAAC,4BAA0D,EAAE,EAAE,CAAC,CAAC,4BAA4B,CAAC,MAAM,EAAE,4BAA4B,CAAC,aAAa,CAAC,EACjJ,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;IACA,IAAA,yBAAU,GAAE;GACA,4BAA4B,CA6DxC","sourcesContent":["import { Field, ID, ObjectType } from 'type-graphql'\nimport { Column, CreateDateColumn, Entity, Index, ManyToOne, PrimaryGeneratedColumn, RelationId, UpdateDateColumn } from 'typeorm'\n\nimport { User } from '@things-factory/auth-base'\nimport { Domain, roundTransformer } from '@things-factory/shell'\n\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) => [productDetailBizplaceSetting.domain, productDetailBizplaceSetting.productDetail],\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('float', { default: 0, transformer: roundTransformer })\n @Field()\n minQty: number\n\n @Column('float', { default: 0, transformer: roundTransformer })\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"]}
@@ -0,0 +1,5 @@
1
+ import { ProductSet } from './product-set';
2
+ import { ProductSetMutation } from './product-set-mutation';
3
+ import { ProductSetQuery } from './product-set-query';
4
+ export declare const entities: (typeof ProductSet)[];
5
+ export declare const resolvers: (typeof ProductSetMutation | typeof ProductSetQuery)[];
@@ -0,0 +1,39 @@
1
+ import { Bizplace } from '@things-factory/biz-base';
2
+ import { ProductSet } from './product-set';
3
+ import { NewProductSet, ProductSetPatch } from './product-set-types';
4
+ export declare class ProductSetMutation {
5
+ createProductSet(productSet: NewProductSet, context: ResolverContext): Promise<ProductSet>;
6
+ updateProductSet(id: string, patch: ProductSetPatch, context: ResolverContext): Promise<ProductSet>;
7
+ updateMultipleProductSet(patches: ProductSetPatch[], context: ResolverContext): Promise<ProductSet[]>;
8
+ deleteProductSet(id: string, context: ResolverContext): Promise<Boolean>;
9
+ deleteProductSets(ids: string[], context: ResolverContext): Promise<Boolean>;
10
+ }
11
+ export declare function createProductSet(productSet: NewProductSet, context: ResolverContext): Promise<{
12
+ code: string;
13
+ bizplace: Bizplace;
14
+ creator: import("@things-factory/auth-base").User;
15
+ updater: import("@things-factory/auth-base").User;
16
+ name: string;
17
+ description?: string;
18
+ status?: string;
19
+ type?: string;
20
+ } & ProductSet>;
21
+ export declare function updateProductSet(id: string, patch: ProductSetPatch, context: ResolverContext): Promise<{
22
+ updater: import("@things-factory/auth-base").User;
23
+ id: string;
24
+ name: string;
25
+ description: string;
26
+ type: string;
27
+ cuFlag?: string;
28
+ domain: import("@things-factory/shell").Domain;
29
+ domainId: string;
30
+ bizplace: Bizplace;
31
+ code: string;
32
+ product: import("..").Product[];
33
+ status: string;
34
+ createdAt: Date;
35
+ updatedAt: Date;
36
+ creator: import("@things-factory/auth-base").User;
37
+ creatorId: string;
38
+ updaterId: string;
39
+ } & ProductSet>;
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateProductSet = exports.createProductSet = exports.ProductSetMutation = void 0;
3
+ exports.ProductSetMutation = void 0;
4
+ exports.createProductSet = createProductSet;
5
+ exports.updateProductSet = updateProductSet;
4
6
  const tslib_1 = require("tslib");
5
7
  const type_graphql_1 = require("type-graphql");
6
8
  const biz_base_1 = require("@things-factory/biz-base");
@@ -55,6 +57,7 @@ let ProductSetMutation = class ProductSetMutation {
55
57
  return true;
56
58
  }
57
59
  };
60
+ exports.ProductSetMutation = ProductSetMutation;
58
61
  tslib_1.__decorate([
59
62
  (0, type_graphql_1.Directive)('@privilege(category: "order", privilege: "mutation")'),
60
63
  (0, type_graphql_1.Directive)('@transaction'),
@@ -106,10 +109,9 @@ tslib_1.__decorate([
106
109
  tslib_1.__metadata("design:paramtypes", [Array, Object]),
107
110
  tslib_1.__metadata("design:returntype", Promise)
108
111
  ], ProductSetMutation.prototype, "deleteProductSets", null);
109
- ProductSetMutation = tslib_1.__decorate([
112
+ exports.ProductSetMutation = ProductSetMutation = tslib_1.__decorate([
110
113
  (0, type_graphql_1.Resolver)(product_set_1.ProductSet)
111
114
  ], ProductSetMutation);
112
- exports.ProductSetMutation = ProductSetMutation;
113
115
  async function createProductSet(productSet, context) {
114
116
  const { domain, user, tx } = context.state;
115
117
  const productSetRepo = tx.getRepository(product_set_1.ProductSet);
@@ -123,7 +125,6 @@ async function createProductSet(productSet, context) {
123
125
  bizplace = await bizplaceRepo.findOne({ where: { name: domain.name } });
124
126
  return await productSetRepo.save(Object.assign(Object.assign({}, productSet), { code: utils_1.ProductUtil.productSetCode(), bizplace, creator: user, updater: user }));
125
127
  }
126
- exports.createProductSet = createProductSet;
127
128
  async function updateProductSet(id, patch, context) {
128
129
  const { user, tx } = context.state;
129
130
  const bizplaceRepo = tx.getRepository(biz_base_1.Bizplace);
@@ -131,5 +132,4 @@ async function updateProductSet(id, patch, context) {
131
132
  const productSet = await productRepo.findOneBy({ id });
132
133
  return productRepo.save(Object.assign(Object.assign(Object.assign({}, productSet), patch), { updater: user }));
133
134
  }
134
- exports.updateProductSet = updateProductSet;
135
135
  //# sourceMappingURL=product-set-mutation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"product-set-mutation.js","sourceRoot":"","sources":["../../../server/service/product-set/product-set-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AAGtE,uDAAmD;AAEnD,+CAAoD;AACpD,uCAAyC;AACzC,+CAA0C;AAC1C,2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ACjG,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;IAElC,MAAM,YAAY,GAAyB,EAAE,CAAC,aAAa,CAAC,mBAAQ,CAAC,CAAA;IACrE,MAAM,WAAW,GAA2B,EAAE,CAAC,aAAa,CAAC,wBAAU,CAAC,CAAA;IACxE,MAAM,UAAU,GAAG,MAAM,WAAW,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA;IAEtD,OAAO,WAAW,CAAC,IAAI,+CAClB,UAAU,GACV,KAAK,KACR,OAAO,EAAE,IAAI,IACb,CAAA;AACJ,CAAC;AAZD,4CAYC","sourcesContent":["import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\nimport { Repository } from 'typeorm'\n\nimport { Bizplace } from '@things-factory/biz-base'\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(\n @Arg('productSet') productSet: NewProductSet,\n @Ctx() context: ResolverContext\n ): 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: ResolverContext\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: ResolverContext\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: ResolverContext): Promise<Boolean> {\n const { tx, user } = context.state\n const productSetRepo: Repository<ProductSet> = tx.getRepository(ProductSet)\n const productSet = await productSetRepo.findOneBy({ 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(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: ResolverContext\n ): Promise<Boolean> {\n const { tx, 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: ResolverContext) {\n const { domain, user, tx } = 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.findOneBy({ id: 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: ResolverContext) {\n const { user, tx } = context.state\n\n const bizplaceRepo: Repository<Bizplace> = tx.getRepository(Bizplace)\n const productRepo: Repository<ProductSet> = tx.getRepository(ProductSet)\n const productSet = await productRepo.findOneBy({ id })\n\n return productRepo.save({\n ...productSet,\n ...patch,\n updater: user\n })\n}\n"]}
1
+ {"version":3,"file":"product-set-mutation.js","sourceRoot":"","sources":["../../../server/service/product-set/product-set-mutation.ts"],"names":[],"mappings":";;;AA6GA,4CAqBC;AAED,4CAYC;;AAhJD,+CAAsE;AAGtE,uDAAmD;AAEnD,+CAAoD;AACpD,uCAAyC;AACzC,+CAA0C;AAC1C,2DAAoE;AAG7D,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAIvB,AAAN,KAAK,CAAC,gBAAgB,CACD,UAAyB,EACrC,OAAwB;QAE/B,OAAO,MAAM,gBAAgB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAA;IACpD,CAAC;IAKK,AAAN,KAAK,CAAC,gBAAgB,CACT,EAAU,EACP,KAAsB,EAC7B,OAAwB;QAE/B,OAAO,MAAM,gBAAgB,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,CAAA;IACnD,CAAC;IAKK,AAAN,KAAK,CAAC,wBAAwB,CACe,OAA0B,EAC9D,OAAwB;QAE/B,IAAI,OAAO,GAAG,EAAE,CAAA;QAChB,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,GAAG,CAAC,CAAA;QACzF,MAAM,cAA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xF,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;IAE1C,MAAM,cAAc,GAA2B,EAAE,CAAC,aAAa,CAAC,wBAAU,CAAC,CAAA;IAC3E,MAAM,YAAY,GAAyB,EAAE,CAAC,aAAa,CAAC,mBAAQ,CAAC,CAAA;IAErE,IAAI,QAAkB,CAAA;IACtB,iCAAiC;IACjC,4EAA4E;IAC5E,WAAW;IACX,4EAA4E;IAC5E,IAAI;IACJ,QAAQ,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;IAEvE,OAAO,MAAM,cAAc,CAAC,IAAI,iCAC3B,UAAU,KACb,IAAI,EAAE,mBAAW,CAAC,cAAc,EAAE,EAClC,QAAQ,EACR,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;AACJ,CAAC;AAEM,KAAK,UAAU,gBAAgB,CAAC,EAAU,EAAE,KAAsB,EAAE,OAAwB;IACjG,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;IAElC,MAAM,YAAY,GAAyB,EAAE,CAAC,aAAa,CAAC,mBAAQ,CAAC,CAAA;IACrE,MAAM,WAAW,GAA2B,EAAE,CAAC,aAAa,CAAC,wBAAU,CAAC,CAAA;IACxE,MAAM,UAAU,GAAG,MAAM,WAAW,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA;IAEtD,OAAO,WAAW,CAAC,IAAI,+CAClB,UAAU,GACV,KAAK,KACR,OAAO,EAAE,IAAI,IACb,CAAA;AACJ,CAAC","sourcesContent":["import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\nimport { Repository } from 'typeorm'\n\nimport { Bizplace } from '@things-factory/biz-base'\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(\n @Arg('productSet') productSet: NewProductSet,\n @Ctx() context: ResolverContext\n ): 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: ResolverContext\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: ResolverContext\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: ResolverContext): Promise<Boolean> {\n const { tx, user } = context.state\n const productSetRepo: Repository<ProductSet> = tx.getRepository(ProductSet)\n const productSet = await productSetRepo.findOneBy({ 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(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: ResolverContext\n ): Promise<Boolean> {\n const { tx, 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: ResolverContext) {\n const { domain, user, tx } = 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.findOneBy({ id: 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: ResolverContext) {\n const { user, tx } = context.state\n\n const bizplaceRepo: Repository<Bizplace> = tx.getRepository(Bizplace)\n const productRepo: Repository<ProductSet> = tx.getRepository(ProductSet)\n const productSet = await productRepo.findOneBy({ id })\n\n return productRepo.save({\n ...productSet,\n ...patch,\n updater: user\n })\n}\n"]}
@@ -0,0 +1,12 @@
1
+ import { User } from '@things-factory/auth-base';
2
+ import { Domain, ListParam } from '@things-factory/shell';
3
+ import { ProductSet } from './product-set';
4
+ import { ProductSetList } from './product-set-types';
5
+ export declare class ProductSetQuery {
6
+ myBizplaceProductSets(params: ListParam, context: ResolverContext): Promise<ProductSetList>;
7
+ productSets(params: ListParam, context: ResolverContext): Promise<ProductSetList>;
8
+ productSet(name: string, context: ResolverContext): Promise<ProductSet>;
9
+ domain(productSet: ProductSet): Promise<Domain>;
10
+ creator(productSet: ProductSet): Promise<User>;
11
+ updater(productSet: ProductSet): Promise<User>;
12
+ }
@@ -69,6 +69,7 @@ let ProductSetQuery = class ProductSetQuery {
69
69
  return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: productSet.updaterId });
70
70
  }
71
71
  };
72
+ exports.ProductSetQuery = ProductSetQuery;
72
73
  tslib_1.__decorate([
73
74
  (0, type_graphql_1.Directive)('@privilege(category: "order", privilege: "query", domainOwnerGranted: true)'),
74
75
  (0, type_graphql_1.Query)(returns => product_set_types_1.ProductSetList),
@@ -117,8 +118,7 @@ tslib_1.__decorate([
117
118
  tslib_1.__metadata("design:paramtypes", [product_set_1.ProductSet]),
118
119
  tslib_1.__metadata("design:returntype", Promise)
119
120
  ], ProductSetQuery.prototype, "updater", null);
120
- ProductSetQuery = tslib_1.__decorate([
121
+ exports.ProductSetQuery = ProductSetQuery = tslib_1.__decorate([
121
122
  (0, type_graphql_1.Resolver)(product_set_1.ProductSet)
122
123
  ], ProductSetQuery);
123
- exports.ProductSetQuery = ProductSetQuery;
124
124
  //# sourceMappingURL=product-set-query.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"product-set-query.js","sourceRoot":"","sources":["../../../server/service/product-set/product-set-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAC9F,qCAAsD;AAEtD,yDAAgD;AAChD,uDAAsF;AACtF,iDAAuH;AAEvH,+CAA0C;AAC1C,2DAAoD;AAG7C,IAAM,eAAe,GAArB,MAAM,eAAe;IAGpB,AAAN,KAAK,CAAC,qBAAqB,CAAS,MAAiB,EAAS,OAAwB;QACpF,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE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I,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,wBAAU;;8CAE3C;AA/FU,eAAe;IAD3B,IAAA,uBAAQ,EAAC,wBAAU,CAAC;GACR,eAAe,CAgG3B;AAhGY,0CAAe","sourcesContent":["import { Arg, Args, Ctx, Directive, FieldResolver, Query, Resolver, Root } from 'type-graphql'\nimport { Brackets, SelectQueryBuilder } from 'typeorm'\n\nimport { User } from '@things-factory/auth-base'\nimport { Bizplace, getCompanyBizplace, getMyBizplace } from '@things-factory/biz-base'\nimport { buildCondition, buildQuery, convertListParams, Domain, getRepository, ListParam } from '@things-factory/shell'\n\nimport { ProductSet } from './product-set'\nimport { ProductSetList } from './product-set-types'\n\n@Resolver(ProductSet)\nexport class ProductSetQuery {\n @Directive('@privilege(category: \"order\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => ProductSetList)\n async myBizplaceProductSets(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<ProductSetList> {\n const { domain, user } = context.state\n const qb: SelectQueryBuilder<ProductSet> = getRepository(ProductSet).createQueryBuilder()\n\n const productFilters = params.filters.filter(x => x.name == 'product_set_info')\n const filters = params.filters.filter(x => x.name != 'product_set_info')\n const productFilterColumns = ['name', 'description']\n\n if (!params.filters.find(filter => filter.name === 'bizplace_id')) {\n const companyBizplace: Bizplace = await getCompanyBizplace(domain, user)\n const myBizplace: Bizplace = await getMyBizplace(domain, user)\n params.filters = [...filters, { name: 'bizplace_id', operator: 'in', value: [companyBizplace.id, myBizplace.id] }]\n }\n\n buildQuery(qb, params, context, { domainRef: false })\n if (productFilters && productFilters.length > 0) {\n let productInfo = productFilters[0]\n qb.andWhere(\n new Brackets(qb2 => {\n productFilterColumns.forEach(filter => {\n const condition = buildCondition(\n qb.alias,\n filter,\n productInfo.operator,\n productInfo.value,\n productInfo.relation,\n Object.keys(qb.getParameters()).length\n )\n\n qb2.orWhere(condition.clause, condition.parameters)\n })\n })\n )\n }\n\n const [items, total] = await qb\n .leftJoinAndSelect('ProductSet.bizplace', 'Bizplace')\n .leftJoinAndSelect('ProductSet.creator', 'Creator')\n .leftJoinAndSelect('ProductSet.updater', 'Updater')\n .leftJoinAndSelect('ProductSet.product', 'Product')\n .getManyAndCount()\n\n return { items, total }\n }\n\n @Directive('@privilege(category: \"order\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => ProductSetList)\n async productSets(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<ProductSetList> {\n const { domain, user } = context.state\n\n if (!params.filters.find((filter: any) => filter.name === 'bizplace_id')) {\n let bizplaceFilter = params.filters.find((filter: any) => filter.name === 'bizplace_id')\n const companyBizplace: Bizplace = await getCompanyBizplace(domain, user)\n const myBizplace: Bizplace = await getMyBizplace(domain, user)\n\n bizplaceFilter = { name: 'bizplace_id', operator: 'in', value: [companyBizplace.id, myBizplace.id] }\n }\n\n const convertedParams = convertListParams(params)\n const [items, total] = await getRepository(ProductSet).findAndCount({\n ...convertedParams,\n relations: ['domain', 'creator', 'updater', 'product']\n })\n\n return { items, total }\n }\n\n @Directive('@privilege(category: \"order\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => ProductSet)\n async productSet(@Arg('name') name: string, @Ctx() context: ResolverContext): Promise<ProductSet> {\n const { domain, user } = context.state\n const repository = getRepository(ProductSet)\n\n return await repository.findOne({\n where: { domain: { id: domain.id }, name },\n relations: ['domain', 'creator', 'updater']\n })\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() productSet: ProductSet): Promise<Domain> {\n return await getRepository(Domain).findOneBy({ id: productSet.domainId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() productSet: ProductSet): Promise<User> {\n return await getRepository(User).findOneBy({ id: productSet.creatorId })\n }\n\n @FieldResolver(type => User)\n async updater(@Root() productSet: ProductSet): Promise<User> {\n return await getRepository(User).findOneBy({ id: productSet.updaterId })\n }\n}\n"]}
1
+ {"version":3,"file":"product-set-query.js","sourceRoot":"","sources":["../../../server/service/product-set/product-set-query.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;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,wBAAU;;6CAE1C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,wBAAU;;8CAE3C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,wBAAU;;8CAE3C;0BA/FU,eAAe;IAD3B,IAAA,uBAAQ,EAAC,wBAAU,CAAC;GACR,eAAe,CAgG3B","sourcesContent":["import { Arg, Args, Ctx, Directive, FieldResolver, Query, Resolver, Root } from 'type-graphql'\nimport { Brackets, SelectQueryBuilder } from 'typeorm'\n\nimport { User } from '@things-factory/auth-base'\nimport { Bizplace, getCompanyBizplace, getMyBizplace } from '@things-factory/biz-base'\nimport { buildCondition, buildQuery, convertListParams, Domain, getRepository, ListParam } from '@things-factory/shell'\n\nimport { ProductSet } from './product-set'\nimport { ProductSetList } from './product-set-types'\n\n@Resolver(ProductSet)\nexport class ProductSetQuery {\n @Directive('@privilege(category: \"order\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => ProductSetList)\n async myBizplaceProductSets(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<ProductSetList> {\n const { domain, user } = context.state\n const qb: SelectQueryBuilder<ProductSet> = getRepository(ProductSet).createQueryBuilder()\n\n const productFilters = params.filters.filter(x => x.name == 'product_set_info')\n const filters = params.filters.filter(x => x.name != 'product_set_info')\n const productFilterColumns = ['name', 'description']\n\n if (!params.filters.find(filter => filter.name === 'bizplace_id')) {\n const companyBizplace: Bizplace = await getCompanyBizplace(domain, user)\n const myBizplace: Bizplace = await getMyBizplace(domain, user)\n params.filters = [...filters, { name: 'bizplace_id', operator: 'in', value: [companyBizplace.id, myBizplace.id] }]\n }\n\n buildQuery(qb, params, context, { domainRef: false })\n if (productFilters && productFilters.length > 0) {\n let productInfo = productFilters[0]\n qb.andWhere(\n new Brackets(qb2 => {\n productFilterColumns.forEach(filter => {\n const condition = buildCondition(\n qb.alias,\n filter,\n productInfo.operator,\n productInfo.value,\n productInfo.relation,\n Object.keys(qb.getParameters()).length\n )\n\n qb2.orWhere(condition.clause, condition.parameters)\n })\n })\n )\n }\n\n const [items, total] = await qb\n .leftJoinAndSelect('ProductSet.bizplace', 'Bizplace')\n .leftJoinAndSelect('ProductSet.creator', 'Creator')\n .leftJoinAndSelect('ProductSet.updater', 'Updater')\n .leftJoinAndSelect('ProductSet.product', 'Product')\n .getManyAndCount()\n\n return { items, total }\n }\n\n @Directive('@privilege(category: \"order\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => ProductSetList)\n async productSets(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<ProductSetList> {\n const { domain, user } = context.state\n\n if (!params.filters.find((filter: any) => filter.name === 'bizplace_id')) {\n let bizplaceFilter = params.filters.find((filter: any) => filter.name === 'bizplace_id')\n const companyBizplace: Bizplace = await getCompanyBizplace(domain, user)\n const myBizplace: Bizplace = await getMyBizplace(domain, user)\n\n bizplaceFilter = { name: 'bizplace_id', operator: 'in', value: [companyBizplace.id, myBizplace.id] }\n }\n\n const convertedParams = convertListParams(params)\n const [items, total] = await getRepository(ProductSet).findAndCount({\n ...convertedParams,\n relations: ['domain', 'creator', 'updater', 'product']\n })\n\n return { items, total }\n }\n\n @Directive('@privilege(category: \"order\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => ProductSet)\n async productSet(@Arg('name') name: string, @Ctx() context: ResolverContext): Promise<ProductSet> {\n const { domain, user } = context.state\n const repository = getRepository(ProductSet)\n\n return await repository.findOne({\n where: { domain: { id: domain.id }, name },\n relations: ['domain', 'creator', 'updater']\n })\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() productSet: ProductSet): Promise<Domain> {\n return await getRepository(Domain).findOneBy({ id: productSet.domainId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() productSet: ProductSet): Promise<User> {\n return await getRepository(User).findOneBy({ id: productSet.creatorId })\n }\n\n @FieldResolver(type => User)\n async updater(@Root() productSet: ProductSet): Promise<User> {\n return await getRepository(User).findOneBy({ id: productSet.updaterId })\n }\n}\n"]}
@@ -0,0 +1,18 @@
1
+ import { ProductSet } from './product-set';
2
+ export declare class NewProductSet {
3
+ name: string;
4
+ description?: string;
5
+ status?: string;
6
+ type?: string;
7
+ }
8
+ export declare class ProductSetList {
9
+ items?: ProductSet[];
10
+ total?: number;
11
+ }
12
+ export declare class ProductSetPatch {
13
+ id?: string;
14
+ name?: string;
15
+ description?: string;
16
+ type?: string;
17
+ cuFlag?: string;
18
+ }
@@ -6,6 +6,7 @@ const type_graphql_1 = require("type-graphql");
6
6
  const product_set_1 = require("./product-set");
7
7
  let NewProductSet = class NewProductSet {
8
8
  };
9
+ exports.NewProductSet = NewProductSet;
9
10
  tslib_1.__decorate([
10
11
  (0, type_graphql_1.Field)(),
11
12
  tslib_1.__metadata("design:type", String)
@@ -22,12 +23,12 @@ tslib_1.__decorate([
22
23
  (0, type_graphql_1.Field)({ nullable: true }),
23
24
  tslib_1.__metadata("design:type", String)
24
25
  ], NewProductSet.prototype, "type", void 0);
25
- NewProductSet = tslib_1.__decorate([
26
+ exports.NewProductSet = NewProductSet = tslib_1.__decorate([
26
27
  (0, type_graphql_1.InputType)()
27
28
  ], NewProductSet);
28
- exports.NewProductSet = NewProductSet;
29
29
  let ProductSetList = class ProductSetList {
30
30
  };
31
+ exports.ProductSetList = ProductSetList;
31
32
  tslib_1.__decorate([
32
33
  (0, type_graphql_1.Field)(type => [product_set_1.ProductSet], { nullable: true }),
33
34
  tslib_1.__metadata("design:type", Array)
@@ -36,12 +37,12 @@ tslib_1.__decorate([
36
37
  (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
37
38
  tslib_1.__metadata("design:type", Number)
38
39
  ], ProductSetList.prototype, "total", void 0);
39
- ProductSetList = tslib_1.__decorate([
40
+ exports.ProductSetList = ProductSetList = tslib_1.__decorate([
40
41
  (0, type_graphql_1.ObjectType)()
41
42
  ], ProductSetList);
42
- exports.ProductSetList = ProductSetList;
43
43
  let ProductSetPatch = class ProductSetPatch {
44
44
  };
45
+ exports.ProductSetPatch = ProductSetPatch;
45
46
  tslib_1.__decorate([
46
47
  (0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
47
48
  tslib_1.__metadata("design:type", String)
@@ -62,8 +63,7 @@ tslib_1.__decorate([
62
63
  (0, type_graphql_1.Field)({ nullable: true }),
63
64
  tslib_1.__metadata("design:type", String)
64
65
  ], ProductSetPatch.prototype, "cuFlag", void 0);
65
- ProductSetPatch = tslib_1.__decorate([
66
+ exports.ProductSetPatch = ProductSetPatch = tslib_1.__decorate([
66
67
  (0, type_graphql_1.InputType)()
67
68
  ], ProductSetPatch);
68
- exports.ProductSetPatch = ProductSetPatch;
69
69
  //# sourceMappingURL=product-set-types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"product-set-types.js","sourceRoot":"","sources":["../../../server/service/product-set/product-set-types.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AAEpE,+CAA0C;AAGnC,IAAM,aAAa,GAAnB,MAAM,aAAa;CAYzB,CAAA;AAXC;IAAC,IAAA,oBAAK,GAAE;;2CACI;AAEZ;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACN;AAEpB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACX;AAEf;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACb;AAXF,aAAa;IADzB,IAAA,wBAAS,GAAE;GACC,aAAa,CAYzB;AAZY,sCAAa;AAenB,IAAM,cAAc,GAApB,MAAM,cAAc;CAM1B,CAAA;AALC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,wBAAU,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CAC5B;AAEpB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACzB;AALH,cAAc;IAD1B,IAAA,yBAAU,GAAE;GACA,cAAc,CAM1B;AANY,wCAAc;AASpB,IAAM,eAAe,GAArB,MAAM,eAAe;CAe3B,CAAA;AAdC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CAC3B;AAEX;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACb;AAEb;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACN;AAEpB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACb;AAEb;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACX;AAdJ,eAAe;IAD3B,IAAA,wBAAS,GAAE;GACC,eAAe,CAe3B;AAfY,0CAAe","sourcesContent":["import { Field, ID, InputType, Int, ObjectType } from 'type-graphql'\n\nimport { ProductSet } from './product-set'\n\n@InputType()\nexport class NewProductSet {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n status?: string\n\n @Field({ nullable: true })\n type?: string\n}\n\n@ObjectType()\nexport class ProductSetList {\n @Field(type => [ProductSet], { nullable: true })\n items?: ProductSet[]\n\n @Field(type => Int, { nullable: true })\n total?: number\n}\n\n@InputType()\nexport class ProductSetPatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n type?: string\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n"]}
1
+ {"version":3,"file":"product-set-types.js","sourceRoot":"","sources":["../../../server/service/product-set/product-set-types.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AAEpE,+CAA0C;AAGnC,IAAM,aAAa,GAAnB,MAAM,aAAa;CAYzB,CAAA;AAZY,sCAAa;AAExB;IADC,IAAA,oBAAK,GAAE;;2CACI;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACN;AAGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACX;AAGf;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACb;wBAXF,aAAa;IADzB,IAAA,wBAAS,GAAE;GACC,aAAa,CAYzB;AAGM,IAAM,cAAc,GAApB,MAAM,cAAc;CAM1B,CAAA;AANY,wCAAc;AAEzB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,wBAAU,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CAC5B;AAGpB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACzB;yBALH,cAAc;IAD1B,IAAA,yBAAU,GAAE;GACA,cAAc,CAM1B;AAGM,IAAM,eAAe,GAArB,MAAM,eAAe;CAe3B,CAAA;AAfY,0CAAe;AAE1B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CAC3B;AAGX;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACb;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACN;AAGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACb;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACX;0BAdJ,eAAe;IAD3B,IAAA,wBAAS,GAAE;GACC,eAAe,CAe3B","sourcesContent":["import { Field, ID, InputType, Int, ObjectType } from 'type-graphql'\n\nimport { ProductSet } from './product-set'\n\n@InputType()\nexport class NewProductSet {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n status?: string\n\n @Field({ nullable: true })\n type?: string\n}\n\n@ObjectType()\nexport class ProductSetList {\n @Field(type => [ProductSet], { nullable: true })\n items?: ProductSet[]\n\n @Field(type => Int, { nullable: true })\n total?: number\n}\n\n@InputType()\nexport class ProductSetPatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n type?: string\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n"]}
@@ -0,0 +1,22 @@
1
+ import { User } from '@things-factory/auth-base';
2
+ import { Bizplace } from '@things-factory/biz-base';
3
+ import { Domain } from '@things-factory/shell';
4
+ import { Product } from '../product/product';
5
+ export declare class ProductSet {
6
+ readonly id: string;
7
+ domain: Domain;
8
+ domainId: string;
9
+ bizplace: Bizplace;
10
+ code: string;
11
+ name: string;
12
+ description: string;
13
+ product: Product[];
14
+ status: string;
15
+ type: string;
16
+ createdAt: Date;
17
+ updatedAt: Date;
18
+ creator: User;
19
+ creatorId: string;
20
+ updater: User;
21
+ updaterId: string;
22
+ }
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- var _a;
3
2
  Object.defineProperty(exports, "__esModule", { value: true });
4
3
  exports.ProductSet = void 0;
5
4
  const tslib_1 = require("tslib");
@@ -11,6 +10,7 @@ const typeorm_1 = require("typeorm");
11
10
  const product_1 = require("../product/product");
12
11
  let ProductSet = class ProductSet {
13
12
  };
13
+ exports.ProductSet = ProductSet;
14
14
  tslib_1.__decorate([
15
15
  (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
16
16
  (0, type_graphql_1.Field)(type => type_graphql_1.ID),
@@ -30,7 +30,7 @@ tslib_1.__decorate([
30
30
  nullable: false
31
31
  }),
32
32
  (0, type_graphql_1.Field)({ nullable: true }),
33
- tslib_1.__metadata("design:type", typeof (_a = typeof biz_base_1.Bizplace !== "undefined" && biz_base_1.Bizplace) === "function" ? _a : Object)
33
+ tslib_1.__metadata("design:type", biz_base_1.Bizplace)
34
34
  ], ProductSet.prototype, "bizplace", void 0);
35
35
  tslib_1.__decorate([
36
36
  (0, typeorm_1.Column)({ nullable: true }),
@@ -101,10 +101,9 @@ tslib_1.__decorate([
101
101
  (0, typeorm_1.RelationId)((productSet) => productSet.updater),
102
102
  tslib_1.__metadata("design:type", String)
103
103
  ], ProductSet.prototype, "updaterId", void 0);
104
- ProductSet = tslib_1.__decorate([
104
+ exports.ProductSet = ProductSet = tslib_1.__decorate([
105
105
  (0, typeorm_1.Entity)(),
106
106
  (0, typeorm_1.Index)('ix_product_set_0', (productSet) => [productSet.bizplace, productSet.name], { unique: true }),
107
107
  (0, type_graphql_1.ObjectType)()
108
108
  ], ProductSet);
109
- exports.ProductSet = ProductSet;
110
109
  //# sourceMappingURL=product-set.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"product-set.js","sourceRoot":"","sources":["../../../server/service/product-set/product-set.ts"],"names":[],"mappings":";;;;;AAAA,yDAAgD;AAChD,uDAAmD;AACnD,iDAA8C;AAC9C,+CAAoD;AACpD,qCAUgB;AAChB,gDAA4C;AAKrC,IAAM,UAAU,GAAhB,MAAM,UAAU;CA0EtB,CAAA;AAzEC;IAAC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAA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E;IACR,IAAA,oBAAK,GAAE;;wCACI;AAEZ;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACf,IAAI;6CAAA;AAEf;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACf,IAAI;6CAAA;AAEf;IAAC,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;sCACjB,gBAAI;2CAAA;AAEb;IAAC,IAAA,oBAAU,EAAC,CAAC,UAAsB,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC;;6CAC1C;AAEjB;IAAC,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;sCACjB,gBAAI;2CAAA;AAEb;IAAC,IAAA,oBAAU,EAAC,CAAC,UAAsB,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC;;6CAC1C;AAzEN,UAAU;IAHtB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,kBAAkB,EAAE,CAAC,UAAsB,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC/G,IAAA,yBAAU,GAAE;GACA,UAAU,CA0EtB;AA1EY,gCAAU","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 { Product } from '../product/product'\n\n@Entity()\n@Index('ix_product_set_0', (productSet: ProductSet) => [productSet.bizplace, productSet.name], { unique: true })\n@ObjectType()\nexport class ProductSet {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field()\n domain: Domain\n\n @RelationId((productSet: ProductSet) => productSet.domain)\n domainId: string\n\n @ManyToOne(type => Bizplace, {\n nullable: false\n })\n @Field({ nullable: true })\n bizplace: Bizplace\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n code: string\n\n @Column()\n @Field()\n name: string\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n description: string\n\n @OneToMany(type => Product, product => product.productSet, {\n nullable: true\n })\n @Field(type => [Product], { nullable: true })\n product: Product[]\n\n @Column({\n nullable: true,\n default: 'ACTIVE'\n })\n @Field({ nullable: true })\n status: string\n\n @Column()\n @Field()\n type: string\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((productSet: ProductSet) => productSet.creator)\n creatorId: string\n\n @ManyToOne(type => User, {\n nullable: true\n })\n @Field({ nullable: true })\n updater: User\n\n @RelationId((productSet: ProductSet) => productSet.updater)\n updaterId: string\n}\n"]}
1
+ {"version":3,"file":"product-set.js","sourceRoot":"","sources":["../../../server/service/product-set/product-set.ts"],"names":[],"mappings":";;;;AAAA,yDAAgD;AAChD,uDAAmD;AACnD,iDAA8C;AAC9C,+CAAoD;AACpD,qCAUgB;AAChB,gDAA4C;AAKrC,IAAM,UAAU,GAAhB,MAAM,UAAU;CA0EtB,CAAA;AA1EY,gCAAU;AAGZ;IAFR,IAAA,gCAAsB,EAAC,M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IAAI,EAAE,CAAC;;0CACZ;AAId;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,GAAE;;wCACI;AAIZ;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACf,IAAI;6CAAA;AAIf;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACf,IAAI;6CAAA;AAMf;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;sCACjB,gBAAI;2CAAA;AAGb;IADC,IAAA,oBAAU,EAAC,CAAC,UAAsB,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC;;6CAC1C;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;sCACjB,gBAAI;2CAAA;AAGb;IADC,IAAA,oBAAU,EAAC,CAAC,UAAsB,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC;;6CAC1C;qBAzEN,UAAU;IAHtB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,kBAAkB,EAAE,CAAC,UAAsB,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC/G,IAAA,yBAAU,GAAE;GACA,UAAU,CA0EtB","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 { Product } from '../product/product'\n\n@Entity()\n@Index('ix_product_set_0', (productSet: ProductSet) => [productSet.bizplace, productSet.name], { unique: true })\n@ObjectType()\nexport class ProductSet {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field()\n domain: Domain\n\n @RelationId((productSet: ProductSet) => productSet.domain)\n domainId: string\n\n @ManyToOne(type => Bizplace, {\n nullable: false\n })\n @Field({ nullable: true })\n bizplace: Bizplace\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n code: string\n\n @Column()\n @Field()\n name: string\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n description: string\n\n @OneToMany(type => Product, product => product.productSet, {\n nullable: true\n })\n @Field(type => [Product], { nullable: true })\n product: Product[]\n\n @Column({\n nullable: true,\n default: 'ACTIVE'\n })\n @Field({ nullable: true })\n status: string\n\n @Column()\n @Field()\n type: string\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((productSet: ProductSet) => productSet.creator)\n creatorId: string\n\n @ManyToOne(type => User, {\n nullable: true\n })\n @Field({ nullable: true })\n updater: User\n\n @RelationId((productSet: ProductSet) => productSet.updater)\n updaterId: string\n}\n"]}