@things-factory/product-base 4.3.671 → 4.3.673

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/dist-server/constants/index.js +18 -0
  2. package/dist-server/constants/index.js.map +1 -0
  3. package/dist-server/constants/product.js +25 -0
  4. package/dist-server/constants/product.js.map +1 -0
  5. package/dist-server/controllers/index.js +1 -0
  6. package/dist-server/controllers/index.js.map +1 -0
  7. package/dist-server/index.js +19 -0
  8. package/dist-server/index.js.map +1 -0
  9. package/dist-server/middlewares/index.js +1 -0
  10. package/dist-server/middlewares/index.js.map +1 -0
  11. package/dist-server/migrations/index.js +12 -0
  12. package/dist-server/migrations/index.js.map +1 -0
  13. package/dist-server/service/index.js +74 -0
  14. package/dist-server/service/index.js.map +1 -0
  15. package/dist-server/service/product/index.js +10 -0
  16. package/dist-server/service/product/index.js.map +1 -0
  17. package/dist-server/service/product/product-mutation.js +408 -0
  18. package/dist-server/service/product/product-mutation.js.map +1 -0
  19. package/dist-server/service/product/product-query.js +373 -0
  20. package/dist-server/service/product/product-query.js.map +1 -0
  21. package/dist-server/service/product/product-types.js +618 -0
  22. package/dist-server/service/product/product-types.js.map +1 -0
  23. package/dist-server/service/product/product.js +615 -0
  24. package/dist-server/service/product/product.js.map +1 -0
  25. package/dist-server/service/product/validate-product.js +26 -0
  26. package/dist-server/service/product/validate-product.js.map +1 -0
  27. package/dist-server/service/product-barcode/index.js +9 -0
  28. package/dist-server/service/product-barcode/index.js.map +1 -0
  29. package/dist-server/service/product-barcode/product-barcode-mutation.js +120 -0
  30. package/dist-server/service/product-barcode/product-barcode-mutation.js.map +1 -0
  31. package/dist-server/service/product-barcode/product-barcode-query.js +87 -0
  32. package/dist-server/service/product-barcode/product-barcode-query.js.map +1 -0
  33. package/dist-server/service/product-barcode/product-barcode-type.js +63 -0
  34. package/dist-server/service/product-barcode/product-barcode-type.js.map +1 -0
  35. package/dist-server/service/product-barcode/product-barcode.js +104 -0
  36. package/dist-server/service/product-barcode/product-barcode.js.map +1 -0
  37. package/dist-server/service/product-bundle/index.js +9 -0
  38. package/dist-server/service/product-bundle/index.js.map +1 -0
  39. package/dist-server/service/product-bundle/product-bundle-mutation.js +130 -0
  40. package/dist-server/service/product-bundle/product-bundle-mutation.js.map +1 -0
  41. package/dist-server/service/product-bundle/product-bundle-query.js +128 -0
  42. package/dist-server/service/product-bundle/product-bundle-query.js.map +1 -0
  43. package/dist-server/service/product-bundle/product-bundle-types.js +85 -0
  44. package/dist-server/service/product-bundle/product-bundle-types.js.map +1 -0
  45. package/dist-server/service/product-bundle/product-bundle.js +128 -0
  46. package/dist-server/service/product-bundle/product-bundle.js.map +1 -0
  47. package/dist-server/service/product-bundle-setting/index.js +9 -0
  48. package/dist-server/service/product-bundle-setting/index.js.map +1 -0
  49. package/dist-server/service/product-bundle-setting/product-bundle-setting-mutation.js +165 -0
  50. package/dist-server/service/product-bundle-setting/product-bundle-setting-mutation.js.map +1 -0
  51. package/dist-server/service/product-bundle-setting/product-bundle-setting-query.js +113 -0
  52. package/dist-server/service/product-bundle-setting/product-bundle-setting-query.js.map +1 -0
  53. package/dist-server/service/product-bundle-setting/product-bundle-setting-types.js +69 -0
  54. package/dist-server/service/product-bundle-setting/product-bundle-setting-types.js.map +1 -0
  55. package/dist-server/service/product-bundle-setting/product-bundle-setting.js +63 -0
  56. package/dist-server/service/product-bundle-setting/product-bundle-setting.js.map +1 -0
  57. package/dist-server/service/product-combination/index.js +9 -0
  58. package/dist-server/service/product-combination/index.js.map +1 -0
  59. package/dist-server/service/product-combination/product-combination-mutation.js +137 -0
  60. package/dist-server/service/product-combination/product-combination-mutation.js.map +1 -0
  61. package/dist-server/service/product-combination/product-combination-query.js +86 -0
  62. package/dist-server/service/product-combination/product-combination-query.js.map +1 -0
  63. package/dist-server/service/product-combination/product-combination-type.js +83 -0
  64. package/dist-server/service/product-combination/product-combination-type.js.map +1 -0
  65. package/dist-server/service/product-combination/product-combination.js +133 -0
  66. package/dist-server/service/product-combination/product-combination.js.map +1 -0
  67. package/dist-server/service/product-combination-setting/index.js +9 -0
  68. package/dist-server/service/product-combination-setting/index.js.map +1 -0
  69. package/dist-server/service/product-combination-setting/product-combination-setting-mutation.js +221 -0
  70. package/dist-server/service/product-combination-setting/product-combination-setting-mutation.js.map +1 -0
  71. package/dist-server/service/product-combination-setting/product-combination-setting-query.js +177 -0
  72. package/dist-server/service/product-combination-setting/product-combination-setting-query.js.map +1 -0
  73. package/dist-server/service/product-combination-setting/product-combination-setting-type.js +75 -0
  74. package/dist-server/service/product-combination-setting/product-combination-setting-type.js.map +1 -0
  75. package/dist-server/service/product-combination-setting/product-combination-setting.js +105 -0
  76. package/dist-server/service/product-combination-setting/product-combination-setting.js.map +1 -0
  77. package/dist-server/service/product-detail/index.js +9 -0
  78. package/dist-server/service/product-detail/index.js.map +1 -0
  79. package/dist-server/service/product-detail/product-detail-mutation.js +374 -0
  80. package/dist-server/service/product-detail/product-detail-mutation.js.map +1 -0
  81. package/dist-server/service/product-detail/product-detail-query.js +223 -0
  82. package/dist-server/service/product-detail/product-detail-query.js.map +1 -0
  83. package/dist-server/service/product-detail/product-detail-types.js +392 -0
  84. package/dist-server/service/product-detail/product-detail-types.js.map +1 -0
  85. package/dist-server/service/product-detail/product-detail.js +444 -0
  86. package/dist-server/service/product-detail/product-detail.js.map +1 -0
  87. package/dist-server/service/product-detail-bizplace-setting/index.js +9 -0
  88. package/dist-server/service/product-detail-bizplace-setting/index.js.map +1 -0
  89. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-mutation.js +118 -0
  90. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-mutation.js.map +1 -0
  91. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-query.js +107 -0
  92. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-query.js.map +1 -0
  93. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-types.js +99 -0
  94. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-types.js.map +1 -0
  95. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting.js +120 -0
  96. package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting.js.map +1 -0
  97. package/dist-server/service/product-set/index.js +9 -0
  98. package/dist-server/service/product-set/index.js.map +1 -0
  99. package/dist-server/service/product-set/product-set-mutation.js +146 -0
  100. package/dist-server/service/product-set/product-set-mutation.js.map +1 -0
  101. package/dist-server/service/product-set/product-set-query.js +136 -0
  102. package/dist-server/service/product-set/product-set-query.js.map +1 -0
  103. package/dist-server/service/product-set/product-set-types.js +77 -0
  104. package/dist-server/service/product-set/product-set-types.js.map +1 -0
  105. package/dist-server/service/product-set/product-set.js +118 -0
  106. package/dist-server/service/product-set/product-set.js.map +1 -0
  107. package/dist-server/utils/index.js +18 -0
  108. package/dist-server/utils/index.js.map +1 -0
  109. package/dist-server/utils/product-util.js +16 -0
  110. package/dist-server/utils/product-util.js.map +1 -0
  111. package/package.json +4 -4
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./product"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/constants/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAAyB"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PRODUCT_COMBINATION_STATUS = exports.PRODUCT_BUNDLE_STATUS = exports.PRODUCT_SET_STATUS = exports.PRODUCT_STATUS = void 0;
4
+ exports.PRODUCT_STATUS = {
5
+ ACTIVE: 'ACTIVE',
6
+ DELETED: 'DELETED',
7
+ INACTIVE: 'INACTIVE'
8
+ };
9
+ exports.PRODUCT_SET_STATUS = {
10
+ ACTIVE: 'ACTIVE',
11
+ DELETED: 'DELETED',
12
+ INACTIVE: 'INACTIVE'
13
+ };
14
+ exports.PRODUCT_BUNDLE_STATUS = {
15
+ ACTIVE: 'ACTIVE',
16
+ DELETED: 'DELETED',
17
+ INACTIVE: 'INACTIVE'
18
+ };
19
+ exports.PRODUCT_COMBINATION_STATUS = {
20
+ ACTIVE: 'ACTIVE',
21
+ ACTIVATED: 'ACTIVATED',
22
+ DELETED: 'DELETED',
23
+ INACTIVE: 'INACTIVE'
24
+ };
25
+ //# sourceMappingURL=product.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"product.js","sourceRoot":"","sources":["../../server/constants/product.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAG;IAC5B,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,UAAU;CACrB,CAAA;AAEY,QAAA,kBAAkB,GAAG;IAChC,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,UAAU;CACrB,CAAA;AAEY,QAAA,qBAAqB,GAAG;IACnC,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,UAAU;CACrB,CAAA;AAEY,QAAA,0BAA0B,GAAG;IACxC,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,WAAW;IACtB,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,UAAU;CACrB,CAAA"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/controllers/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./service"), exports);
18
+ __exportStar(require("./migrations"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../server/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAAyB;AACzB,+CAA4B"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/middlewares/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.migrations = void 0;
4
+ const glob = require('glob');
5
+ const path = require('path');
6
+ exports.migrations = [];
7
+ glob.sync(path.resolve(__dirname, '.', '**', '*.js')).forEach(function (file) {
8
+ if (file.indexOf('index.js') !== -1)
9
+ return;
10
+ exports.migrations = exports.migrations.concat(Object.values(require(path.resolve(file))) || []);
11
+ });
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/migrations/index.ts"],"names":[],"mappings":";;;AAAA,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAC5B,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAEjB,QAAA,UAAU,GAAG,EAAE,CAAA;AAE1B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,UAAS,IAAI;IACzE,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAAE,OAAM;IAC3C,kBAAU,GAAG,kBAAU,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAA;AAClF,CAAC,CAAC,CAAA"}
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.updateProduct = exports.createProduct = exports.schema = exports.entities = void 0;
18
+ const product_1 = require("./product");
19
+ const product_bundle_1 = require("./product-bundle");
20
+ const product_bundle_setting_1 = require("./product-bundle-setting");
21
+ const product_detail_1 = require("./product-detail");
22
+ const product_detail_bizplace_setting_1 = require("./product-detail-bizplace-setting");
23
+ const product_set_1 = require("./product-set");
24
+ const product_combination_1 = require("./product-combination");
25
+ const product_combination_setting_1 = require("./product-combination-setting");
26
+ const product_barcode_1 = require("./product-barcode");
27
+ /* EXPORT ENTITY TYPES */
28
+ __exportStar(require("./product-barcode/product-barcode"), exports);
29
+ __exportStar(require("./product-combination-setting/product-combination-setting"), exports);
30
+ __exportStar(require("./product-combination/product-combination"), exports);
31
+ __exportStar(require("./product/product"), exports);
32
+ __exportStar(require("./product-detail/product-detail"), exports);
33
+ __exportStar(require("./product-bundle/product-bundle"), exports);
34
+ __exportStar(require("./product-bundle-setting/product-bundle-setting"), exports);
35
+ __exportStar(require("./product-detail-bizplace-setting/product-detail-bizplace-setting"), exports);
36
+ __exportStar(require("./product-set/product-set"), exports);
37
+ /* EXPORT TYPES */
38
+ __exportStar(require("./product-barcode/product-barcode-type"), exports);
39
+ __exportStar(require("./product-combination/product-combination-type"), exports);
40
+ __exportStar(require("./product-combination-setting/product-combination-setting-type"), exports);
41
+ __exportStar(require("./product/product-types"), exports);
42
+ __exportStar(require("./product-detail/product-detail-types"), exports);
43
+ __exportStar(require("./product-bundle/product-bundle-types"), exports);
44
+ __exportStar(require("./product-bundle-setting/product-bundle-setting-types"), exports);
45
+ __exportStar(require("./product-detail-bizplace-setting/product-detail-bizplace-setting-types"), exports);
46
+ __exportStar(require("./product-set/product-set-types"), exports);
47
+ exports.entities = [
48
+ ...product_1.entities,
49
+ ...product_detail_1.entities,
50
+ ...product_bundle_1.entities,
51
+ ...product_bundle_setting_1.entities,
52
+ ...product_detail_bizplace_setting_1.entities,
53
+ ...product_set_1.entities,
54
+ ...product_combination_1.entities,
55
+ ...product_combination_setting_1.entities,
56
+ ...product_barcode_1.entities
57
+ ];
58
+ exports.schema = {
59
+ resolverClasses: [
60
+ ...product_1.resolvers,
61
+ ...product_detail_1.resolvers,
62
+ ...product_bundle_1.resolvers,
63
+ ...product_bundle_setting_1.resolvers,
64
+ ...product_detail_bizplace_setting_1.resolvers,
65
+ ...product_set_1.resolvers,
66
+ ...product_combination_1.resolvers,
67
+ ...product_combination_setting_1.resolvers,
68
+ ...product_barcode_1.resolvers
69
+ ]
70
+ };
71
+ var product_mutation_1 = require("./product/product-mutation");
72
+ Object.defineProperty(exports, "createProduct", { enumerable: true, get: function () { return product_mutation_1.createProduct; } });
73
+ Object.defineProperty(exports, "updateProduct", { enumerable: true, get: function () { return product_mutation_1.updateProduct; } });
74
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,uCAAsF;AACtF,qDAAyG;AACzG,qEAGiC;AACjC,qDAAyG;AACzG,uFAG0C;AAC1C,+CAAgG;AAChG,+DAAwH;AACxH,+EAGsC;AACtC,uDAA4G;AAG5G,yBAAyB;AACzB,oEAAiD;AACjD,4FAAyE;AACzE,4EAAyD;AACzD,oDAAiC;AACjC,kEAA+C;AAC/C,kEAA+C;AAC/C,kFAA+D;AAC/D,oGAAiF;AACjF,4DAAyC;AAEzC,kBAAkB;AAClB,yEAAsD;AACtD,iFAA8D;AAC9D,iGAA8E;AAC9E,0DAAuC;AACvC,wEAAqD;AACrD,wEAAqD;AACrD,wFAAqE;AACrE,0GAAuF;AACvF,kEAA+C;AAElC,QAAA,QAAQ,GAAG;IACtB,GAAG,kBAAe;IAClB,GAAG,yBAAqB;IACxB,GAAG,yBAAqB;IACxB,GAAG,iCAA4B;IAC/B,GAAG,0CAAoC;IACvC,GAAG,sBAAkB;IACrB,GAAG,8BAA0B;IAC7B,GAAG,sCAAiC;IACpC,GAAG,0BAAsB;CAC1B,CAAA;AAEY,QAAA,MAAM,GAAG;IACpB,eAAe,EAAE;QACf,GAAG,mBAAgB;QACnB,GAAG,0BAAsB;QACzB,GAAG,0BAAsB;QACzB,GAAG,kCAA6B;QAChC,GAAG,2CAAoC;QACvC,GAAG,uBAAmB;QACtB,GAAG,+BAA2B;QAC9B,GAAG,uCAAkC;QACrC,GAAG,2BAAuB;KAC3B;CACF,CAAA;AAED,+DAAyE;AAAhE,iHAAA,aAAa,OAAA;AAAE,iHAAA,aAAa,OAAA"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolvers = exports.entities = void 0;
4
+ const product_1 = require("./product");
5
+ const product_mutation_1 = require("./product-mutation");
6
+ const product_query_1 = require("./product-query");
7
+ exports.entities = [product_1.Product];
8
+ exports.resolvers = [product_query_1.ProductQuery, product_mutation_1.ProductMutation];
9
+ //product entity
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/product/index.ts"],"names":[],"mappings":";;;AAAA,uCAAmC;AACnC,yDAAoD;AACpD,mDAA8C;AAEjC,QAAA,QAAQ,GAAG,CAAC,iBAAO,CAAC,CAAA;AACpB,QAAA,SAAS,GAAG,CAAC,4BAAY,EAAE,kCAAe,CAAC,CAAA;AAExD,gBAAgB"}
@@ -0,0 +1,408 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ var __importDefault = (this && this.__importDefault) || function (mod) {
15
+ return (mod && mod.__esModule) ? mod : { "default": mod };
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.updateProduct = exports.createProducts = exports.createProduct = exports.ProductMutation = void 0;
19
+ const promises_all_1 = __importDefault(require("promises-all"));
20
+ const type_graphql_1 = require("type-graphql");
21
+ const typeorm_1 = require("typeorm");
22
+ const attachment_base_1 = require("@things-factory/attachment-base");
23
+ const biz_base_1 = require("@things-factory/biz-base");
24
+ const env_1 = require("@things-factory/env");
25
+ const constants_1 = require("../../constants");
26
+ const product_detail_1 = require("../product-detail/product-detail");
27
+ const product_detail_mutation_1 = require("../product-detail/product-detail-mutation");
28
+ const product_set_1 = require("../product-set/product-set");
29
+ const product_1 = require("./product");
30
+ const product_types_1 = require("./product-types");
31
+ const validate_product_1 = require("./validate-product");
32
+ let ProductMutation = class ProductMutation {
33
+ async createProduct(product, context) {
34
+ return await createProduct(product, context);
35
+ }
36
+ async createProducts(products, context) {
37
+ return await createProducts(products, context);
38
+ }
39
+ async updateProduct(id, patch, context) {
40
+ return await updateProduct(id, patch, context);
41
+ }
42
+ async importMultipleProduct(patches, context) {
43
+ try {
44
+ let results = [];
45
+ //// 1. Group and massage data based on sku for Product and Product Details.
46
+ let massagedPatch = patches.reduce(function (acc, currentObj) {
47
+ let existingParent = acc.find(itm => itm.sku == currentObj.sku);
48
+ if (existingParent) {
49
+ existingParent.productDetails = [
50
+ ...existingParent.productDetails,
51
+ new product_detail_1.ProductDetail(Object.assign(Object.assign({}, currentObj), { childProductDetail: currentObj.childGtin }))
52
+ ];
53
+ return acc;
54
+ }
55
+ else {
56
+ let newProduct = Object.assign(Object.assign({}, currentObj), { productDetails: [
57
+ new product_detail_1.ProductDetail(Object.assign(Object.assign({}, currentObj), { childProductDetail: currentObj.childGtin, isDefault: true }))
58
+ ] });
59
+ return [...acc, newProduct];
60
+ }
61
+ }, []);
62
+ //// 2. Update all Grouped Product data and Product Details Data
63
+ for (let i = 0; i < massagedPatch.length; i++) {
64
+ const patch = massagedPatch[i];
65
+ const result = await createProduct(patch, context);
66
+ results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
67
+ }
68
+ return results;
69
+ }
70
+ catch (error) {
71
+ throw error;
72
+ }
73
+ }
74
+ async updateMultipleProduct(patches, context) {
75
+ try {
76
+ let results = [];
77
+ const _createRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === '+');
78
+ const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
79
+ if (_createRecords.length > 0) {
80
+ for (let i = 0; i < _createRecords.length; i++) {
81
+ const patch = _createRecords[i];
82
+ const result = await createProduct(patch, context);
83
+ if (result.costPrice) {
84
+ result.costPrice = result.costPrice.toFixed(2);
85
+ }
86
+ results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
87
+ }
88
+ }
89
+ if (_updateRecords.length > 0) {
90
+ for (let i = 0; i < _updateRecords.length; i++) {
91
+ const patch = _updateRecords[i];
92
+ const result = await updateProduct(patch.id, patch, context);
93
+ if (result.costPrice) {
94
+ result.costPrice = +result.costPrice.toFixed(2);
95
+ }
96
+ results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
97
+ }
98
+ }
99
+ return results;
100
+ }
101
+ catch (error) {
102
+ throw error;
103
+ }
104
+ }
105
+ async linkProduct(productSetId, patches, context) {
106
+ const { tx } = context.state;
107
+ let productSet = await tx.getRepository(product_set_1.ProductSet).findOne({
108
+ where: { id: productSetId },
109
+ relations: ['domain', 'creator', 'updater', 'product']
110
+ });
111
+ let existingProductLink = productSet.product;
112
+ let newProductLink = patches.reduce((acc, curr) => {
113
+ if (!existingProductLink.find(itm => itm.id == curr.id)) {
114
+ acc.push({ id: curr.id });
115
+ }
116
+ return acc;
117
+ }, []);
118
+ let removeProductLink = existingProductLink.reduce((acc, curr) => {
119
+ if (!patches.find(itm => itm.id == curr.id)) {
120
+ acc.push({ id: curr.id });
121
+ }
122
+ return acc;
123
+ }, []);
124
+ if (newProductLink.length > 0) {
125
+ for (let i = 0; i < newProductLink.length; i++) {
126
+ const patch = Object.assign(Object.assign({}, newProductLink[i]), { productSet });
127
+ await updateProduct(newProductLink[i].id, patch, context);
128
+ }
129
+ }
130
+ if (removeProductLink.length > 0) {
131
+ for (let i = 0; i < removeProductLink.length; i++) {
132
+ const patch = Object.assign(Object.assign({}, removeProductLink[i]), { productSet: null });
133
+ await updateProduct(removeProductLink[i].id, patch, context);
134
+ }
135
+ }
136
+ return true;
137
+ }
138
+ async deleteProduct(id, context) {
139
+ const { tx, user, domain } = context.state;
140
+ const productSetRepo = tx.getRepository(product_1.Product);
141
+ const productSet = await productSetRepo.findOne({ domain, id });
142
+ await productSetRepo.save(Object.assign(Object.assign({}, productSet), { status: constants_1.PRODUCT_STATUS.DELETED, updater: user }));
143
+ return true;
144
+ }
145
+ async deleteProducts(ids, context) {
146
+ const { tx, user } = context.state;
147
+ const productRepo = tx.getRepository(product_1.Product);
148
+ await productRepo.update({
149
+ id: (0, typeorm_1.In)(ids)
150
+ }, {
151
+ deletedAt: new Date()
152
+ });
153
+ return true;
154
+ }
155
+ async undeleteProducts(ids, context) {
156
+ const { tx, user } = context.state;
157
+ const productRepo = tx.getRepository(product_1.Product);
158
+ await productRepo.update({
159
+ id: (0, typeorm_1.In)(ids)
160
+ }, {
161
+ deletedAt: null
162
+ });
163
+ return true;
164
+ }
165
+ };
166
+ __decorate([
167
+ (0, type_graphql_1.Directive)('@transaction'),
168
+ (0, type_graphql_1.Mutation)(returns => product_1.Product),
169
+ __param(0, (0, type_graphql_1.Arg)('product')),
170
+ __param(1, (0, type_graphql_1.Ctx)()),
171
+ __metadata("design:type", Function),
172
+ __metadata("design:paramtypes", [product_types_1.NewProduct, Object]),
173
+ __metadata("design:returntype", Promise)
174
+ ], ProductMutation.prototype, "createProduct", null);
175
+ __decorate([
176
+ (0, type_graphql_1.Directive)('@transaction'),
177
+ (0, type_graphql_1.Mutation)(returns => [product_1.Product]),
178
+ __param(0, (0, type_graphql_1.Arg)('products', type => [product_types_1.NewProduct])),
179
+ __param(1, (0, type_graphql_1.Ctx)()),
180
+ __metadata("design:type", Function),
181
+ __metadata("design:paramtypes", [Array, Object]),
182
+ __metadata("design:returntype", Promise)
183
+ ], ProductMutation.prototype, "createProducts", null);
184
+ __decorate([
185
+ (0, type_graphql_1.Directive)('@transaction'),
186
+ (0, type_graphql_1.Mutation)(returns => product_1.Product),
187
+ __param(0, (0, type_graphql_1.Arg)('id')),
188
+ __param(1, (0, type_graphql_1.Arg)('patch')),
189
+ __param(2, (0, type_graphql_1.Ctx)()),
190
+ __metadata("design:type", Function),
191
+ __metadata("design:paramtypes", [String, product_types_1.ProductPatch, Object]),
192
+ __metadata("design:returntype", Promise)
193
+ ], ProductMutation.prototype, "updateProduct", null);
194
+ __decorate([
195
+ (0, type_graphql_1.Directive)('@transaction'),
196
+ (0, type_graphql_1.Mutation)(returns => [product_1.Product]),
197
+ __param(0, (0, type_graphql_1.Arg)('patches', type => [product_types_1.ProductPatch])),
198
+ __param(1, (0, type_graphql_1.Ctx)()),
199
+ __metadata("design:type", Function),
200
+ __metadata("design:paramtypes", [Array, Object]),
201
+ __metadata("design:returntype", Promise)
202
+ ], ProductMutation.prototype, "importMultipleProduct", null);
203
+ __decorate([
204
+ (0, type_graphql_1.Directive)('@transaction'),
205
+ (0, type_graphql_1.Mutation)(returns => [product_1.Product]),
206
+ __param(0, (0, type_graphql_1.Arg)('patches', type => [product_types_1.ProductPatch])),
207
+ __param(1, (0, type_graphql_1.Ctx)()),
208
+ __metadata("design:type", Function),
209
+ __metadata("design:paramtypes", [Array, Object]),
210
+ __metadata("design:returntype", Promise)
211
+ ], ProductMutation.prototype, "updateMultipleProduct", null);
212
+ __decorate([
213
+ (0, type_graphql_1.Directive)('@privilege(category: "order", privilege: "mutation") '),
214
+ (0, type_graphql_1.Directive)('@transaction'),
215
+ (0, type_graphql_1.Mutation)(returns => Boolean),
216
+ __param(0, (0, type_graphql_1.Arg)('productSetId')),
217
+ __param(1, (0, type_graphql_1.Arg)('patches', type => [product_types_1.ProductPatch])),
218
+ __param(2, (0, type_graphql_1.Ctx)()),
219
+ __metadata("design:type", Function),
220
+ __metadata("design:paramtypes", [String, Array, Object]),
221
+ __metadata("design:returntype", Promise)
222
+ ], ProductMutation.prototype, "linkProduct", null);
223
+ __decorate([
224
+ (0, type_graphql_1.Directive)('@privilege(category: "order", privilege: "mutation") '),
225
+ (0, type_graphql_1.Directive)('@transaction'),
226
+ (0, type_graphql_1.Mutation)(returns => Boolean),
227
+ __param(0, (0, type_graphql_1.Arg)('id')),
228
+ __param(1, (0, type_graphql_1.Ctx)()),
229
+ __metadata("design:type", Function),
230
+ __metadata("design:paramtypes", [String, Object]),
231
+ __metadata("design:returntype", Promise)
232
+ ], ProductMutation.prototype, "deleteProduct", null);
233
+ __decorate([
234
+ (0, type_graphql_1.Directive)('@privilege(category: "order", privilege: "mutation") '),
235
+ (0, type_graphql_1.Directive)('@transaction'),
236
+ (0, type_graphql_1.Mutation)(returns => Boolean),
237
+ __param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
238
+ __param(1, (0, type_graphql_1.Ctx)()),
239
+ __metadata("design:type", Function),
240
+ __metadata("design:paramtypes", [Array, Object]),
241
+ __metadata("design:returntype", Promise)
242
+ ], ProductMutation.prototype, "deleteProducts", null);
243
+ __decorate([
244
+ (0, type_graphql_1.Directive)('@privilege(category: "order", privilege: "mutation") '),
245
+ (0, type_graphql_1.Directive)('@transaction'),
246
+ (0, type_graphql_1.Mutation)(returns => Boolean),
247
+ __param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
248
+ __param(1, (0, type_graphql_1.Ctx)()),
249
+ __metadata("design:type", Function),
250
+ __metadata("design:paramtypes", [Array, Object]),
251
+ __metadata("design:returntype", Promise)
252
+ ], ProductMutation.prototype, "undeleteProducts", null);
253
+ ProductMutation = __decorate([
254
+ (0, type_graphql_1.Resolver)(product_1.Product)
255
+ ], ProductMutation);
256
+ exports.ProductMutation = ProductMutation;
257
+ async function createProduct(product, context) {
258
+ var _a, _b, _c;
259
+ try {
260
+ const { domain, user, tx } = context.state;
261
+ const productRepo = (tx === null || tx === void 0 ? void 0 : tx.getRepository(product_1.Product)) || (0, typeorm_1.getRepository)(product_1.Product);
262
+ const bizplaceRepo = (tx === null || tx === void 0 ? void 0 : tx.getRepository(biz_base_1.Bizplace)) || (0, typeorm_1.getRepository)(biz_base_1.Bizplace);
263
+ let bizplace;
264
+ if ((_a = product.bizplace) === null || _a === void 0 ? void 0 : _a.id) {
265
+ bizplace = await bizplaceRepo.findOne(product.bizplace.id);
266
+ }
267
+ else if ((_b = context.state) === null || _b === void 0 ? void 0 : _b.bizplace) {
268
+ bizplace = context.state.bizplace;
269
+ }
270
+ else {
271
+ bizplace = await bizplaceRepo.findOne({ where: { domain } });
272
+ }
273
+ if ((_c = product === null || product === void 0 ? void 0 : product.productRef) === null || _c === void 0 ? void 0 : _c.id) {
274
+ product.productRef = await productRepo.findOne(product.productRef.id);
275
+ }
276
+ let foundExistingProduct = await productRepo.findOne({ sku: product.sku, domain });
277
+ if (foundExistingProduct) {
278
+ throw new Error('Duplicated sku matching with existing products found');
279
+ }
280
+ if (!(product === null || product === void 0 ? void 0 : product.id))
281
+ delete product.id;
282
+ await (0, validate_product_1.validateProduct)(Object.assign(Object.assign({}, product), { bizplace,
283
+ domain }), context);
284
+ if (product.uom) {
285
+ product.primaryUnit = product.uom;
286
+ }
287
+ if (product.uomValue) {
288
+ product.primaryValue = product.uomValue;
289
+ }
290
+ const result = await productRepo.save(Object.assign(Object.assign({}, product), { bizplace,
291
+ domain, creator: user, updater: user }));
292
+ let productDetails;
293
+ if (product.productDetails) {
294
+ productDetails = product.productDetails.reduce((acc, currentObj) => {
295
+ let existingProductDetail = acc.find(itm => itm.packingType == currentObj.packingType && itm.uom == currentObj.uom && itm.name == currentObj.name);
296
+ if (existingProductDetail) {
297
+ existingProductDetail.productBarcodes = [...existingProductDetail.productBarcodes, { gtin: currentObj.gtin }];
298
+ return acc;
299
+ }
300
+ else {
301
+ let newProductDetail = Object.assign(Object.assign({}, currentObj), { productBarcodes: currentObj.productBarcodes ? [...currentObj.productBarcodes] : [{ gtin: currentObj.gtin }] });
302
+ return [...acc, newProductDetail];
303
+ }
304
+ }, []);
305
+ }
306
+ else {
307
+ productDetails = [new product_detail_1.ProductDetail(Object.assign(Object.assign({}, product), { product: result, isDefault: true }))];
308
+ if (!productDetails[0].productBarcodes || productDetails[0].productBarcodes.length < 1) {
309
+ productDetails[0].productBarcodes = [{ gtin: product.gtin ? product.gtin : product.sku }];
310
+ }
311
+ }
312
+ productDetails.map((pd, index) => {
313
+ const count = index + 1;
314
+ pd.refCode = pd.refCode && pd.refCode !== '' ? pd.refCode : product.sku + '-000' + count;
315
+ });
316
+ await (0, product_detail_mutation_1.updateMultipleProductDetail)(result.id, productDetails, context);
317
+ if (product.thumbnail) {
318
+ await (0, attachment_base_1.createAttachment)(null, {
319
+ attachment: {
320
+ file: product.thumbnail,
321
+ refBy: result.id
322
+ }
323
+ }, context);
324
+ }
325
+ return result;
326
+ }
327
+ catch (error) {
328
+ throw error;
329
+ }
330
+ }
331
+ exports.createProduct = createProduct;
332
+ async function createProducts(products, context) {
333
+ const { resolve, reject } = await promises_all_1.default.all(products.map(product => createProduct(product, context)));
334
+ if (reject.length) {
335
+ reject.forEach(({ name, message }) => env_1.logger.error(`${name}: ${message}`));
336
+ return reject;
337
+ }
338
+ return resolve;
339
+ }
340
+ exports.createProducts = createProducts;
341
+ async function updateProduct(id, patch, context) {
342
+ var _a;
343
+ try {
344
+ const { user, tx, domain } = context.state;
345
+ const bizplaceRepo = tx.getRepository(biz_base_1.Bizplace);
346
+ const productRepo = tx.getRepository(product_1.Product);
347
+ const productDetailRepo = tx.getRepository(product_detail_1.ProductDetail);
348
+ let product = await productRepo.findOne({ where: { id }, relations: ['domain'] });
349
+ let productDetail = await productDetailRepo.findOne({
350
+ where: { product: { id }, isDefault: true },
351
+ relations: ['domain']
352
+ });
353
+ let multipleProductDetail;
354
+ if (Array.isArray(patch.productDetails)) {
355
+ multipleProductDetail = await productDetailRepo.find({
356
+ where: { product: { id } },
357
+ relations: ['domain']
358
+ });
359
+ }
360
+ if (patch.productRef && patch.productRef.id) {
361
+ patch.productRef = await productRepo.findOne(patch.productRef.id);
362
+ }
363
+ let bizplace;
364
+ if ((_a = product.bizplace) === null || _a === void 0 ? void 0 : _a.id) {
365
+ bizplace = await bizplaceRepo.findOne(product.bizplace.id);
366
+ }
367
+ else {
368
+ bizplace = await bizplaceRepo.findOne({ where: { name: domain.name } });
369
+ }
370
+ await (0, validate_product_1.validateProduct)(Object.assign(Object.assign(Object.assign({}, product), patch), { bizplace,
371
+ domain }), context);
372
+ if (patch.uom) {
373
+ product.primaryUnit = patch.uom;
374
+ }
375
+ if (patch.uomValue) {
376
+ product.primaryValue = patch.uomValue;
377
+ }
378
+ product = await productRepo.save(Object.assign(Object.assign(Object.assign({}, product), patch), { domain, updater: user }));
379
+ if (Array.isArray(patch.productDetails)) {
380
+ await (0, product_detail_mutation_1.updateMultipleProductDetail)(product.id, patch.productDetails, context, multipleProductDetail);
381
+ }
382
+ else if (productDetail) {
383
+ if (product.gtin) {
384
+ delete product.gtin;
385
+ }
386
+ productDetail = await (0, product_detail_mutation_1.updateProductDetail)(productDetail.id, new product_detail_1.ProductDetail(Object.assign(Object.assign(Object.assign({}, product), patch), { product })), context);
387
+ }
388
+ else {
389
+ productDetail = await (0, product_detail_mutation_1.createProductDetail)(new product_detail_1.ProductDetail(Object.assign(Object.assign(Object.assign({}, product), patch), { product, isDefault: true })), context);
390
+ }
391
+ const productId = id;
392
+ if (patch.thumbnail) {
393
+ await (0, attachment_base_1.deleteAttachmentsByRef)(null, { refBys: [productId] }, context);
394
+ await (0, attachment_base_1.createAttachment)(null, {
395
+ attachment: {
396
+ file: patch.thumbnail,
397
+ refBy: product.id
398
+ }
399
+ }, context);
400
+ }
401
+ return product;
402
+ }
403
+ catch (error) {
404
+ throw error;
405
+ }
406
+ }
407
+ exports.updateProduct = updateProduct;
408
+ //# sourceMappingURL=product-mutation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"product-mutation.js","sourceRoot":"","sources":["../../../server/service/product/product-mutation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,gEAAsC;AACtC,+CAAsE;AACtE,qCAAsE;AAEtE,qEAA0F;AAE1F,uDAAmD;AACnD,6CAA4C;AAG5C,+CAAgD;AAChD,qEAAgE;AAChE,uFAIkD;AAClD,4DAAuD;AACvD,uCAAmC;AACnC,mDAA0D;AAC1D,yDAAoD;AAG7C,IAAM,eAAe,GAArB,MAAM,eAAe;IAGpB,AAAN,KAAK,CAAC,aAAa,CAAiB,OAAmB,EAAS,OAAY;QAC1E,OAAO,MAAM,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IAC9C,CAAC;IAIK,AAAN,KAAK,CAAC,cAAc,CACqB,QAAsB,EACtD,OAAY;QAEnB,OAAO,MAAM,cAAc,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;IAChD,CAAC;IAIK,AAAN,KAAK,CAAC,aAAa,CAAY,EAAU,EAAgB,KAAmB,EAAS,OAAY;QAC/F,OAAO,MAAM,aAAa,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,CAAA;IAChD,CAAC;IAIK,AAAN,KAAK,CAAC,qBAAqB,CACe,OAAuB,EACxD,OAAY;QAEnB,IAAI;YACF,IAAI,OAAO,GAAG,EAAE,CAAA;YAEhB,4EAA4E;YAC5E,IAAI,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,UAAU,GAAG,EAAE,UAAU;gBAC1D,IAAI,cAAc,GAAG,GAAG,CAAC,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