@things-factory/product-base 4.0.21 → 4.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-server/entities/index.js +30 -0
- package/dist-server/entities/index.js.map +1 -0
- package/dist-server/entities/product-bundle-setting.js +47 -0
- package/dist-server/entities/product-bundle-setting.js.map +1 -0
- package/dist-server/entities/product-bundle.js +98 -0
- package/dist-server/entities/product-bundle.js.map +1 -0
- package/dist-server/entities/product-combination-setting.js +48 -0
- package/dist-server/entities/product-combination-setting.js.map +1 -0
- package/dist-server/entities/product-combination.js +91 -0
- package/dist-server/entities/product-combination.js.map +1 -0
- package/dist-server/entities/product-detail-bizplace-setting.js +91 -0
- package/dist-server/entities/product-detail-bizplace-setting.js.map +1 -0
- package/dist-server/entities/product-detail.js +338 -0
- package/dist-server/entities/product-detail.js.map +1 -0
- package/dist-server/entities/product-set.js +90 -0
- package/dist-server/entities/product-set.js.map +1 -0
- package/dist-server/entities/product.js +293 -0
- package/dist-server/entities/product.js.map +1 -0
- package/dist-server/graphql/index.js +30 -0
- package/dist-server/graphql/index.js.map +1 -0
- package/dist-server/graphql/resolvers/index.js +21 -0
- package/dist-server/graphql/resolvers/index.js.map +1 -0
- package/dist-server/graphql/resolvers/product/create-product.js +60 -0
- package/dist-server/graphql/resolvers/product/create-product.js.map +1 -0
- package/dist-server/graphql/resolvers/product/create-products.js +24 -0
- package/dist-server/graphql/resolvers/product/create-products.js.map +1 -0
- package/dist-server/graphql/resolvers/product/delete-product.js +14 -0
- package/dist-server/graphql/resolvers/product/delete-product.js.map +1 -0
- package/dist-server/graphql/resolvers/product/delete-products.js +17 -0
- package/dist-server/graphql/resolvers/product/delete-products.js.map +1 -0
- package/dist-server/graphql/resolvers/product/import-multiple-product.js +35 -0
- package/dist-server/graphql/resolvers/product/import-multiple-product.js.map +1 -0
- package/dist-server/graphql/resolvers/product/index.js +20 -0
- package/dist-server/graphql/resolvers/product/index.js.map +1 -0
- package/dist-server/graphql/resolvers/product/link-product.js +41 -0
- package/dist-server/graphql/resolvers/product/link-product.js.map +1 -0
- package/dist-server/graphql/resolvers/product/my-bizplace-products.js +47 -0
- package/dist-server/graphql/resolvers/product/my-bizplace-products.js.map +1 -0
- package/dist-server/graphql/resolvers/product/product-query.js +94 -0
- package/dist-server/graphql/resolvers/product/product-query.js.map +1 -0
- package/dist-server/graphql/resolvers/product/product.js +33 -0
- package/dist-server/graphql/resolvers/product/product.js.map +1 -0
- package/dist-server/graphql/resolvers/product/products-by-bizplace.js +60 -0
- package/dist-server/graphql/resolvers/product/products-by-bizplace.js.map +1 -0
- package/dist-server/graphql/resolvers/product/products.js +68 -0
- package/dist-server/graphql/resolvers/product/products.js.map +1 -0
- package/dist-server/graphql/resolvers/product/undelete-products.js +17 -0
- package/dist-server/graphql/resolvers/product/undelete-products.js.map +1 -0
- package/dist-server/graphql/resolvers/product/update-multiple-product.js +33 -0
- package/dist-server/graphql/resolvers/product/update-multiple-product.js.map +1 -0
- package/dist-server/graphql/resolvers/product/update-product.js +58 -0
- package/dist-server/graphql/resolvers/product/update-product.js.map +1 -0
- package/dist-server/graphql/resolvers/product/validate-product.js +38 -0
- package/dist-server/graphql/resolvers/product/validate-product.js.map +1 -0
- package/dist-server/graphql/resolvers/product-bundle/create-product-bundle.js +12 -0
- package/dist-server/graphql/resolvers/product-bundle/create-product-bundle.js.map +1 -0
- package/dist-server/graphql/resolvers/product-bundle/delete-product-bundle.js +13 -0
- package/dist-server/graphql/resolvers/product-bundle/delete-product-bundle.js.map +1 -0
- package/dist-server/graphql/resolvers/product-bundle/delete-product-bundles.js +19 -0
- package/dist-server/graphql/resolvers/product-bundle/delete-product-bundles.js.map +1 -0
- package/dist-server/graphql/resolvers/product-bundle/index.js +15 -0
- package/dist-server/graphql/resolvers/product-bundle/index.js.map +1 -0
- package/dist-server/graphql/resolvers/product-bundle/my-bizplace-product-bundles.js +43 -0
- package/dist-server/graphql/resolvers/product-bundle/my-bizplace-product-bundles.js.map +1 -0
- package/dist-server/graphql/resolvers/product-bundle/product-bundle-query.js +21 -0
- package/dist-server/graphql/resolvers/product-bundle/product-bundle-query.js.map +1 -0
- package/dist-server/graphql/resolvers/product-bundle/update-multiple-product-bundle.js +50 -0
- package/dist-server/graphql/resolvers/product-bundle/update-multiple-product-bundle.js.map +1 -0
- package/dist-server/graphql/resolvers/product-bundle/update-product-bundle.js +16 -0
- package/dist-server/graphql/resolvers/product-bundle/update-product-bundle.js.map +1 -0
- package/dist-server/graphql/resolvers/product-bundle-setting/create-product-bundle-setting.js +12 -0
- package/dist-server/graphql/resolvers/product-bundle-setting/create-product-bundle-setting.js.map +1 -0
- package/dist-server/graphql/resolvers/product-bundle-setting/delete-product-bundle-setting.js +12 -0
- package/dist-server/graphql/resolvers/product-bundle-setting/delete-product-bundle-setting.js.map +1 -0
- package/dist-server/graphql/resolvers/product-bundle-setting/delete-product-bundle-settings.js +14 -0
- package/dist-server/graphql/resolvers/product-bundle-setting/delete-product-bundle-settings.js.map +1 -0
- package/dist-server/graphql/resolvers/product-bundle-setting/index.js +15 -0
- package/dist-server/graphql/resolvers/product-bundle-setting/index.js.map +1 -0
- package/dist-server/graphql/resolvers/product-bundle-setting/link-product-bundle.js +77 -0
- package/dist-server/graphql/resolvers/product-bundle-setting/link-product-bundle.js.map +1 -0
- package/dist-server/graphql/resolvers/product-bundle-setting/product-bundle-sets.js +75 -0
- package/dist-server/graphql/resolvers/product-bundle-setting/product-bundle-sets.js.map +1 -0
- package/dist-server/graphql/resolvers/product-bundle-setting/product-bundle-setting-query.js +14 -0
- package/dist-server/graphql/resolvers/product-bundle-setting/product-bundle-setting-query.js.map +1 -0
- package/dist-server/graphql/resolvers/product-bundle-setting/update-multiple-product-bundle-setting.js +33 -0
- package/dist-server/graphql/resolvers/product-bundle-setting/update-multiple-product-bundle-setting.js.map +1 -0
- package/dist-server/graphql/resolvers/product-combination/create-product-combination.js +12 -0
- package/dist-server/graphql/resolvers/product-combination/create-product-combination.js.map +1 -0
- package/dist-server/graphql/resolvers/product-combination/delete-product-combination.js +13 -0
- package/dist-server/graphql/resolvers/product-combination/delete-product-combination.js.map +1 -0
- package/dist-server/graphql/resolvers/product-combination/delete-product-combinations.js +19 -0
- package/dist-server/graphql/resolvers/product-combination/delete-product-combinations.js.map +1 -0
- package/dist-server/graphql/resolvers/product-combination/index.js +14 -0
- package/dist-server/graphql/resolvers/product-combination/index.js.map +1 -0
- package/dist-server/graphql/resolvers/product-combination/product-combination-query.js +21 -0
- package/dist-server/graphql/resolvers/product-combination/product-combination-query.js.map +1 -0
- package/dist-server/graphql/resolvers/product-combination/update-multiple-product-combination.js +44 -0
- package/dist-server/graphql/resolvers/product-combination/update-multiple-product-combination.js.map +1 -0
- package/dist-server/graphql/resolvers/product-combination/update-product-combination.js +16 -0
- package/dist-server/graphql/resolvers/product-combination/update-product-combination.js.map +1 -0
- package/dist-server/graphql/resolvers/product-combination-setting/create-product-combination-setting.js +12 -0
- package/dist-server/graphql/resolvers/product-combination-setting/create-product-combination-setting.js.map +1 -0
- package/dist-server/graphql/resolvers/product-combination-setting/delete-product-combination-setting.js +12 -0
- package/dist-server/graphql/resolvers/product-combination-setting/delete-product-combination-setting.js.map +1 -0
- package/dist-server/graphql/resolvers/product-combination-setting/delete-product-combination-settings.js +14 -0
- package/dist-server/graphql/resolvers/product-combination-setting/delete-product-combination-settings.js.map +1 -0
- package/dist-server/graphql/resolvers/product-combination-setting/index.js +15 -0
- package/dist-server/graphql/resolvers/product-combination-setting/index.js.map +1 -0
- package/dist-server/graphql/resolvers/product-combination-setting/link-product-combination.js +73 -0
- package/dist-server/graphql/resolvers/product-combination-setting/link-product-combination.js.map +1 -0
- package/dist-server/graphql/resolvers/product-combination-setting/product-combination-sets.js +87 -0
- package/dist-server/graphql/resolvers/product-combination-setting/product-combination-sets.js.map +1 -0
- package/dist-server/graphql/resolvers/product-combination-setting/product-combination-setting-query.js +16 -0
- package/dist-server/graphql/resolvers/product-combination-setting/product-combination-setting-query.js.map +1 -0
- package/dist-server/graphql/resolvers/product-combination-setting/update-multiple-product-combination-setting.js +33 -0
- package/dist-server/graphql/resolvers/product-combination-setting/update-multiple-product-combination-setting.js.map +1 -0
- package/dist-server/graphql/resolvers/product-detail/create-product-detail.js +17 -0
- package/dist-server/graphql/resolvers/product-detail/create-product-detail.js.map +1 -0
- package/dist-server/graphql/resolvers/product-detail/delete-product-detail.js +13 -0
- package/dist-server/graphql/resolvers/product-detail/delete-product-detail.js.map +1 -0
- package/dist-server/graphql/resolvers/product-detail/delete-product-details.js +16 -0
- package/dist-server/graphql/resolvers/product-detail/delete-product-details.js.map +1 -0
- package/dist-server/graphql/resolvers/product-detail/index.js +15 -0
- package/dist-server/graphql/resolvers/product-detail/index.js.map +1 -0
- package/dist-server/graphql/resolvers/product-detail/product-detail-query.js +114 -0
- package/dist-server/graphql/resolvers/product-detail/product-detail-query.js.map +1 -0
- package/dist-server/graphql/resolvers/product-detail/update-multiple-product-detail.js +112 -0
- package/dist-server/graphql/resolvers/product-detail/update-multiple-product-detail.js.map +1 -0
- package/dist-server/graphql/resolvers/product-detail/update-product-detail.js +20 -0
- package/dist-server/graphql/resolvers/product-detail/update-product-detail.js.map +1 -0
- package/dist-server/graphql/resolvers/product-detail-bizplace-setting/create-product-detail-bizplace-setting.js +12 -0
- package/dist-server/graphql/resolvers/product-detail-bizplace-setting/create-product-detail-bizplace-setting.js.map +1 -0
- package/dist-server/graphql/resolvers/product-detail-bizplace-setting/delete-product-detail-bizplace-setting.js +13 -0
- package/dist-server/graphql/resolvers/product-detail-bizplace-setting/delete-product-detail-bizplace-setting.js.map +1 -0
- package/dist-server/graphql/resolvers/product-detail-bizplace-setting/delete-product-detail-bizplace-settings.js +16 -0
- package/dist-server/graphql/resolvers/product-detail-bizplace-setting/delete-product-detail-bizplace-settings.js.map +1 -0
- package/dist-server/graphql/resolvers/product-detail-bizplace-setting/index.js +15 -0
- package/dist-server/graphql/resolvers/product-detail-bizplace-setting/index.js.map +1 -0
- package/dist-server/graphql/resolvers/product-detail-bizplace-setting/product-detail-bizplace-setting-query.js +56 -0
- package/dist-server/graphql/resolvers/product-detail-bizplace-setting/product-detail-bizplace-setting-query.js.map +1 -0
- package/dist-server/graphql/resolvers/product-detail-bizplace-setting/update-multiple-product-detail-bizplace-setting.js +35 -0
- package/dist-server/graphql/resolvers/product-detail-bizplace-setting/update-multiple-product-detail-bizplace-setting.js.map +1 -0
- package/dist-server/graphql/resolvers/product-detail-bizplace-setting/update-product-detail-bizplace-setting.js +16 -0
- package/dist-server/graphql/resolvers/product-detail-bizplace-setting/update-product-detail-bizplace-setting.js.map +1 -0
- package/dist-server/graphql/resolvers/product-set/create-product-set.js +27 -0
- package/dist-server/graphql/resolvers/product-set/create-product-set.js.map +1 -0
- package/dist-server/graphql/resolvers/product-set/delete-product-set.js +14 -0
- package/dist-server/graphql/resolvers/product-set/delete-product-set.js.map +1 -0
- package/dist-server/graphql/resolvers/product-set/delete-product-sets.js +20 -0
- package/dist-server/graphql/resolvers/product-set/delete-product-sets.js.map +1 -0
- package/dist-server/graphql/resolvers/product-set/index.js +15 -0
- package/dist-server/graphql/resolvers/product-set/index.js.map +1 -0
- package/dist-server/graphql/resolvers/product-set/my-bizplace-product-sets.js +39 -0
- package/dist-server/graphql/resolvers/product-set/my-bizplace-product-sets.js.map +1 -0
- package/dist-server/graphql/resolvers/product-set/product-set-query.js +30 -0
- package/dist-server/graphql/resolvers/product-set/product-set-query.js.map +1 -0
- package/dist-server/graphql/resolvers/product-set/product-set.js +16 -0
- package/dist-server/graphql/resolvers/product-set/product-set.js.map +1 -0
- package/dist-server/graphql/resolvers/product-set/product-sets.js +22 -0
- package/dist-server/graphql/resolvers/product-set/product-sets.js.map +1 -0
- package/dist-server/graphql/resolvers/product-set/update-multiple-product-set.js +28 -0
- package/dist-server/graphql/resolvers/product-set/update-multiple-product-set.js.map +1 -0
- package/dist-server/graphql/resolvers/product-set/update-product-set.js +23 -0
- package/dist-server/graphql/resolvers/product-set/update-product-set.js.map +1 -0
- package/dist-server/graphql/types/index.js +21 -0
- package/dist-server/graphql/types/index.js.map +1 -0
- package/dist-server/graphql/types/product/index.js +61 -0
- package/dist-server/graphql/types/product/index.js.map +1 -0
- package/dist-server/graphql/types/product/new-product.js +66 -0
- package/dist-server/graphql/types/product/new-product.js.map +1 -0
- package/dist-server/graphql/types/product/product-list.js +14 -0
- package/dist-server/graphql/types/product/product-list.js.map +1 -0
- package/dist-server/graphql/types/product/product-patch.js +70 -0
- package/dist-server/graphql/types/product/product-patch.js.map +1 -0
- package/dist-server/graphql/types/product/product.js +73 -0
- package/dist-server/graphql/types/product/product.js.map +1 -0
- package/dist-server/graphql/types/product-bundle/index.js +37 -0
- package/dist-server/graphql/types/product-bundle/index.js.map +1 -0
- package/dist-server/graphql/types/product-bundle/new-product-bundle.js +14 -0
- package/dist-server/graphql/types/product-bundle/new-product-bundle.js.map +1 -0
- package/dist-server/graphql/types/product-bundle/product-bundle-list.js +14 -0
- package/dist-server/graphql/types/product-bundle/product-bundle-list.js.map +1 -0
- package/dist-server/graphql/types/product-bundle/product-bundle-patch.js +21 -0
- package/dist-server/graphql/types/product-bundle/product-bundle-patch.js.map +1 -0
- package/dist-server/graphql/types/product-bundle/product-bundle.js +26 -0
- package/dist-server/graphql/types/product-bundle/product-bundle.js.map +1 -0
- package/dist-server/graphql/types/product-bundle-setting/index.js +38 -0
- package/dist-server/graphql/types/product-bundle-setting/index.js.map +1 -0
- package/dist-server/graphql/types/product-bundle-setting/new-product-bundle-setting.js +14 -0
- package/dist-server/graphql/types/product-bundle-setting/new-product-bundle-setting.js.map +1 -0
- package/dist-server/graphql/types/product-bundle-setting/product-bundle-setting-list.js +14 -0
- package/dist-server/graphql/types/product-bundle-setting/product-bundle-setting-list.js.map +1 -0
- package/dist-server/graphql/types/product-bundle-setting/product-bundle-setting-patch.js +21 -0
- package/dist-server/graphql/types/product-bundle-setting/product-bundle-setting-patch.js.map +1 -0
- package/dist-server/graphql/types/product-bundle-setting/product-bundle-setting.js +36 -0
- package/dist-server/graphql/types/product-bundle-setting/product-bundle-setting.js.map +1 -0
- package/dist-server/graphql/types/product-combination/index.js +39 -0
- package/dist-server/graphql/types/product-combination/index.js.map +1 -0
- package/dist-server/graphql/types/product-combination/new-product-combination.js +15 -0
- package/dist-server/graphql/types/product-combination/new-product-combination.js.map +1 -0
- package/dist-server/graphql/types/product-combination/product-combination-list.js +14 -0
- package/dist-server/graphql/types/product-combination/product-combination-list.js.map +1 -0
- package/dist-server/graphql/types/product-combination/product-combination-patch.js +19 -0
- package/dist-server/graphql/types/product-combination/product-combination-patch.js.map +1 -0
- package/dist-server/graphql/types/product-combination/product-combination.js +26 -0
- package/dist-server/graphql/types/product-combination/product-combination.js.map +1 -0
- package/dist-server/graphql/types/product-combination-setting/index.js +44 -0
- package/dist-server/graphql/types/product-combination-setting/index.js.map +1 -0
- package/dist-server/graphql/types/product-combination-setting/new-product-combination-setting.js +14 -0
- package/dist-server/graphql/types/product-combination-setting/new-product-combination-setting.js.map +1 -0
- package/dist-server/graphql/types/product-combination-setting/product-combination-setting-list.js +14 -0
- package/dist-server/graphql/types/product-combination-setting/product-combination-setting-list.js.map +1 -0
- package/dist-server/graphql/types/product-combination-setting/product-combination-setting-patch.js +18 -0
- package/dist-server/graphql/types/product-combination-setting/product-combination-setting-patch.js.map +1 -0
- package/dist-server/graphql/types/product-combination-setting/product-combination-setting.js +33 -0
- package/dist-server/graphql/types/product-combination-setting/product-combination-setting.js.map +1 -0
- package/dist-server/graphql/types/product-detail/index.js +36 -0
- package/dist-server/graphql/types/product-detail/index.js.map +1 -0
- package/dist-server/graphql/types/product-detail/new-product-detail.js +55 -0
- package/dist-server/graphql/types/product-detail/new-product-detail.js.map +1 -0
- package/dist-server/graphql/types/product-detail/product-detail-list.js +14 -0
- package/dist-server/graphql/types/product-detail/product-detail-list.js.map +1 -0
- package/dist-server/graphql/types/product-detail/product-detail-patch.js +57 -0
- package/dist-server/graphql/types/product-detail/product-detail-patch.js.map +1 -0
- package/dist-server/graphql/types/product-detail-bizplace-setting/index.js +36 -0
- package/dist-server/graphql/types/product-detail-bizplace-setting/index.js.map +1 -0
- package/dist-server/graphql/types/product-detail-bizplace-setting/new-product-detail-bizplace-setting.js +18 -0
- package/dist-server/graphql/types/product-detail-bizplace-setting/new-product-detail-bizplace-setting.js.map +1 -0
- package/dist-server/graphql/types/product-detail-bizplace-setting/product-detail-bizplace-setting-list.js +14 -0
- package/dist-server/graphql/types/product-detail-bizplace-setting/product-detail-bizplace-setting-list.js.map +1 -0
- package/dist-server/graphql/types/product-detail-bizplace-setting/product-detail-bizplace-setting-patch.js +20 -0
- package/dist-server/graphql/types/product-detail-bizplace-setting/product-detail-bizplace-setting-patch.js.map +1 -0
- package/dist-server/graphql/types/product-detail-bizplace-setting/product-detail-bizplace-setting.js +30 -0
- package/dist-server/graphql/types/product-detail-bizplace-setting/product-detail-bizplace-setting.js.map +1 -0
- package/dist-server/graphql/types/product-set/index.js +52 -0
- package/dist-server/graphql/types/product-set/index.js.map +1 -0
- package/dist-server/graphql/types/product-set/new-product-set.js +16 -0
- package/dist-server/graphql/types/product-set/new-product-set.js.map +1 -0
- package/dist-server/graphql/types/product-set/product-set-list.js +14 -0
- package/dist-server/graphql/types/product-set/product-set-list.js.map +1 -0
- package/dist-server/graphql/types/product-set/product-set-patch.js +17 -0
- package/dist-server/graphql/types/product-set/product-set-patch.js.map +1 -0
- package/dist-server/graphql/types/product-set/product-set.js +24 -0
- package/dist-server/graphql/types/product-set/product-set.js.map +1 -0
- package/package.json +4 -3
|
@@ -0,0 +1,293 @@
|
|
|
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 Product_1, _a, _b, _c, _d;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.Product = void 0;
|
|
14
|
+
const typeorm_1 = require("typeorm");
|
|
15
|
+
const auth_base_1 = require("@things-factory/auth-base");
|
|
16
|
+
const biz_base_1 = require("@things-factory/biz-base");
|
|
17
|
+
const shell_1 = require("@things-factory/shell");
|
|
18
|
+
const _1 = require("./");
|
|
19
|
+
let Product = Product_1 = class Product {
|
|
20
|
+
};
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], Product.prototype, "id", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
27
|
+
__metadata("design:type", typeof (_a = typeof shell_1.Domain !== "undefined" && shell_1.Domain) === "function" ? _a : Object)
|
|
28
|
+
], Product.prototype, "domain", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.ManyToOne)(type => biz_base_1.Bizplace),
|
|
31
|
+
__metadata("design:type", typeof (_b = typeof biz_base_1.Bizplace !== "undefined" && biz_base_1.Bizplace) === "function" ? _b : Object)
|
|
32
|
+
], Product.prototype, "bizplace", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.Column)({ default: false }),
|
|
35
|
+
__metadata("design:type", Boolean)
|
|
36
|
+
], Product.prototype, "isCompany", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.Column)(),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], Product.prototype, "sku", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], Product.prototype, "brandSku", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], Product.prototype, "brand", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
51
|
+
__metadata("design:type", String)
|
|
52
|
+
], Product.prototype, "subBrand", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
55
|
+
__metadata("design:type", String)
|
|
56
|
+
], Product.prototype, "gtin", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
59
|
+
__metadata("design:type", String)
|
|
60
|
+
], Product.prototype, "caseGtin", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, typeorm_1.Column)(),
|
|
63
|
+
__metadata("design:type", String)
|
|
64
|
+
], Product.prototype, "name", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, typeorm_1.Column)(),
|
|
67
|
+
__metadata("design:type", String)
|
|
68
|
+
], Product.prototype, "type", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
71
|
+
__metadata("design:type", String)
|
|
72
|
+
], Product.prototype, "packingType", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
75
|
+
__metadata("design:type", String)
|
|
76
|
+
], Product.prototype, "description", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
(0, typeorm_1.OneToMany)(type => _1.ProductDetail, productDetails => productDetails.product, { nullable: true }),
|
|
79
|
+
__metadata("design:type", Array)
|
|
80
|
+
], Product.prototype, "productDetails", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
(0, typeorm_1.ManyToOne)(type => Product_1, { nullable: true }),
|
|
83
|
+
__metadata("design:type", Product
|
|
84
|
+
//// To be removed ////
|
|
85
|
+
)
|
|
86
|
+
], Product.prototype, "productRef", void 0);
|
|
87
|
+
__decorate([
|
|
88
|
+
(0, typeorm_1.ManyToOne)(type => Product_1, { nullable: true }),
|
|
89
|
+
__metadata("design:type", Product
|
|
90
|
+
//// To be removed ////
|
|
91
|
+
)
|
|
92
|
+
], Product.prototype, "parentProductRef", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
(0, typeorm_1.OneToMany)(type => Product_1, product => product.parentProductRef, { nullable: true }),
|
|
95
|
+
__metadata("design:type", Array)
|
|
96
|
+
], Product.prototype, "childProducts", void 0);
|
|
97
|
+
__decorate([
|
|
98
|
+
(0, typeorm_1.Column)('float', { nullable: true }),
|
|
99
|
+
__metadata("design:type", Number)
|
|
100
|
+
], Product.prototype, "bundleQty", void 0);
|
|
101
|
+
__decorate([
|
|
102
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
103
|
+
__metadata("design:type", Number)
|
|
104
|
+
], Product.prototype, "expirationPeriod", void 0);
|
|
105
|
+
__decorate([
|
|
106
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
107
|
+
__metadata("design:type", String)
|
|
108
|
+
], Product.prototype, "weightUnit", void 0);
|
|
109
|
+
__decorate([
|
|
110
|
+
(0, typeorm_1.Column)('float', { nullable: true }),
|
|
111
|
+
__metadata("design:type", Number)
|
|
112
|
+
], Product.prototype, "weight", void 0);
|
|
113
|
+
__decorate([
|
|
114
|
+
(0, typeorm_1.Column)('float', { nullable: true }),
|
|
115
|
+
__metadata("design:type", Number)
|
|
116
|
+
], Product.prototype, "grossWeight", void 0);
|
|
117
|
+
__decorate([
|
|
118
|
+
(0, typeorm_1.Column)('float', { nullable: true }),
|
|
119
|
+
__metadata("design:type", Number)
|
|
120
|
+
], Product.prototype, "caseWeight", void 0);
|
|
121
|
+
__decorate([
|
|
122
|
+
(0, typeorm_1.Column)('float', { nullable: true }),
|
|
123
|
+
__metadata("design:type", Number)
|
|
124
|
+
], Product.prototype, "caseGrossWeight", void 0);
|
|
125
|
+
__decorate([
|
|
126
|
+
(0, typeorm_1.Column)('float', { nullable: true }),
|
|
127
|
+
__metadata("design:type", Number)
|
|
128
|
+
], Product.prototype, "density", void 0);
|
|
129
|
+
__decorate([
|
|
130
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
131
|
+
__metadata("design:type", String)
|
|
132
|
+
], Product.prototype, "lengthUnit", void 0);
|
|
133
|
+
__decorate([
|
|
134
|
+
(0, typeorm_1.Column)('float', { nullable: true }),
|
|
135
|
+
__metadata("design:type", Number)
|
|
136
|
+
], Product.prototype, "costPrice", void 0);
|
|
137
|
+
__decorate([
|
|
138
|
+
(0, typeorm_1.Column)('float', { nullable: true }),
|
|
139
|
+
__metadata("design:type", Number)
|
|
140
|
+
], Product.prototype, "mrpPrice", void 0);
|
|
141
|
+
__decorate([
|
|
142
|
+
(0, typeorm_1.Column)('float', { nullable: true }),
|
|
143
|
+
__metadata("design:type", Number)
|
|
144
|
+
], Product.prototype, "sellPrice", void 0);
|
|
145
|
+
__decorate([
|
|
146
|
+
(0, typeorm_1.Column)('float', { nullable: true }),
|
|
147
|
+
__metadata("design:type", Number)
|
|
148
|
+
], Product.prototype, "afterTaxCostPrice", void 0);
|
|
149
|
+
__decorate([
|
|
150
|
+
(0, typeorm_1.Column)('float', { nullable: true }),
|
|
151
|
+
__metadata("design:type", Number)
|
|
152
|
+
], Product.prototype, "afterTaxSalesPrice", void 0);
|
|
153
|
+
__decorate([
|
|
154
|
+
(0, typeorm_1.Column)('float', { nullable: true }),
|
|
155
|
+
__metadata("design:type", Number)
|
|
156
|
+
], Product.prototype, "width", void 0);
|
|
157
|
+
__decorate([
|
|
158
|
+
(0, typeorm_1.Column)('float', { nullable: true }),
|
|
159
|
+
__metadata("design:type", Number)
|
|
160
|
+
], Product.prototype, "depth", void 0);
|
|
161
|
+
__decorate([
|
|
162
|
+
(0, typeorm_1.Column)('float', { nullable: true }),
|
|
163
|
+
__metadata("design:type", Number)
|
|
164
|
+
], Product.prototype, "height", void 0);
|
|
165
|
+
__decorate([
|
|
166
|
+
(0, typeorm_1.Column)('float', { nullable: true }),
|
|
167
|
+
__metadata("design:type", Number)
|
|
168
|
+
], Product.prototype, "volume", void 0);
|
|
169
|
+
__decorate([
|
|
170
|
+
(0, typeorm_1.Column)('float', { nullable: true }),
|
|
171
|
+
__metadata("design:type", Number)
|
|
172
|
+
], Product.prototype, "caseWidth", void 0);
|
|
173
|
+
__decorate([
|
|
174
|
+
(0, typeorm_1.Column)('float', { nullable: true }),
|
|
175
|
+
__metadata("design:type", Number)
|
|
176
|
+
], Product.prototype, "caseDepth", void 0);
|
|
177
|
+
__decorate([
|
|
178
|
+
(0, typeorm_1.Column)('float', { nullable: true }),
|
|
179
|
+
__metadata("design:type", Number)
|
|
180
|
+
], Product.prototype, "caseHeight", void 0);
|
|
181
|
+
__decorate([
|
|
182
|
+
(0, typeorm_1.Column)('float', { nullable: true }),
|
|
183
|
+
__metadata("design:type", Number)
|
|
184
|
+
], Product.prototype, "caseVolume", void 0);
|
|
185
|
+
__decorate([
|
|
186
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
187
|
+
__metadata("design:type", String)
|
|
188
|
+
], Product.prototype, "volumeSize", void 0);
|
|
189
|
+
__decorate([
|
|
190
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
191
|
+
__metadata("design:type", String)
|
|
192
|
+
], Product.prototype, "primaryUnit", void 0);
|
|
193
|
+
__decorate([
|
|
194
|
+
(0, typeorm_1.Column)('float', { nullable: true }),
|
|
195
|
+
__metadata("design:type", Number)
|
|
196
|
+
], Product.prototype, "primaryValue", void 0);
|
|
197
|
+
__decorate([
|
|
198
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
199
|
+
__metadata("design:type", String)
|
|
200
|
+
], Product.prototype, "auxUnit1", void 0);
|
|
201
|
+
__decorate([
|
|
202
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
203
|
+
__metadata("design:type", String)
|
|
204
|
+
], Product.prototype, "auxValue1", void 0);
|
|
205
|
+
__decorate([
|
|
206
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
207
|
+
__metadata("design:type", String)
|
|
208
|
+
], Product.prototype, "auxUnit2", void 0);
|
|
209
|
+
__decorate([
|
|
210
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
211
|
+
__metadata("design:type", String)
|
|
212
|
+
], Product.prototype, "auxValue2", void 0);
|
|
213
|
+
__decorate([
|
|
214
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
215
|
+
__metadata("design:type", String)
|
|
216
|
+
], Product.prototype, "auxUnit3", void 0);
|
|
217
|
+
__decorate([
|
|
218
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
219
|
+
__metadata("design:type", String)
|
|
220
|
+
], Product.prototype, "auxValue3", void 0);
|
|
221
|
+
__decorate([
|
|
222
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
223
|
+
__metadata("design:type", String)
|
|
224
|
+
], Product.prototype, "inventoryAccountCode", void 0);
|
|
225
|
+
__decorate([
|
|
226
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
227
|
+
__metadata("design:type", String)
|
|
228
|
+
], Product.prototype, "cogsAccountCode", void 0);
|
|
229
|
+
__decorate([
|
|
230
|
+
(0, typeorm_1.ManyToOne)(type => _1.ProductSet, productSet => productSet.product, { nullable: true }),
|
|
231
|
+
__metadata("design:type", _1.ProductSet
|
|
232
|
+
//// To be removed ////
|
|
233
|
+
)
|
|
234
|
+
], Product.prototype, "productSet", void 0);
|
|
235
|
+
__decorate([
|
|
236
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
237
|
+
__metadata("design:type", String)
|
|
238
|
+
], Product.prototype, "movement", void 0);
|
|
239
|
+
__decorate([
|
|
240
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
241
|
+
__metadata("design:type", Number)
|
|
242
|
+
], Product.prototype, "bufferQty", void 0);
|
|
243
|
+
__decorate([
|
|
244
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
245
|
+
__metadata("design:type", Number)
|
|
246
|
+
], Product.prototype, "minQty", void 0);
|
|
247
|
+
__decorate([
|
|
248
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
249
|
+
__metadata("design:type", Number)
|
|
250
|
+
], Product.prototype, "maxQty", void 0);
|
|
251
|
+
__decorate([
|
|
252
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
253
|
+
__metadata("design:type", Number)
|
|
254
|
+
], Product.prototype, "discountId", void 0);
|
|
255
|
+
__decorate([
|
|
256
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
257
|
+
__metadata("design:type", String)
|
|
258
|
+
], Product.prototype, "status", void 0);
|
|
259
|
+
__decorate([
|
|
260
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
261
|
+
__metadata("design:type", Boolean)
|
|
262
|
+
], Product.prototype, "isTrackedAsInventory", void 0);
|
|
263
|
+
__decorate([
|
|
264
|
+
(0, typeorm_1.Column)({ default: false }),
|
|
265
|
+
__metadata("design:type", Boolean)
|
|
266
|
+
], Product.prototype, "isRequiredCheckExpiry", void 0);
|
|
267
|
+
__decorate([
|
|
268
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
269
|
+
__metadata("design:type", Date)
|
|
270
|
+
], Product.prototype, "deletedAt", void 0);
|
|
271
|
+
__decorate([
|
|
272
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
273
|
+
__metadata("design:type", typeof (_c = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _c : Object)
|
|
274
|
+
], Product.prototype, "creator", void 0);
|
|
275
|
+
__decorate([
|
|
276
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
277
|
+
__metadata("design:type", typeof (_d = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _d : Object)
|
|
278
|
+
], Product.prototype, "updater", void 0);
|
|
279
|
+
__decorate([
|
|
280
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
281
|
+
__metadata("design:type", Date)
|
|
282
|
+
], Product.prototype, "createdAt", void 0);
|
|
283
|
+
__decorate([
|
|
284
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
285
|
+
__metadata("design:type", Date)
|
|
286
|
+
], Product.prototype, "updatedAt", void 0);
|
|
287
|
+
Product = Product_1 = __decorate([
|
|
288
|
+
(0, typeorm_1.Entity)(),
|
|
289
|
+
(0, typeorm_1.Index)('ix_product_0', (product) => [product.domain, product.bizplace, product.name, product.description, product.weight], { unique: true }),
|
|
290
|
+
(0, typeorm_1.Index)('ix_product_1', (product) => [product.bizplace])
|
|
291
|
+
], Product);
|
|
292
|
+
exports.Product = Product;
|
|
293
|
+
//# sourceMappingURL=product.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product.js","sourceRoot":"","sources":["../../server/entities/product.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,qCASgB;AAEhB,yDAAgD;AAChD,uDAAmD;AACnD,iDAA8C;AAE9C,yBAA8C;AAS9C,IAAa,OAAO,eAApB,MAAa,OAAO;CAiPnB,CAAA;AA/OC;IADC,IAAA,gCAAsB,EAAC,MAAM,CAAC;;mCACrB;AAGV;IADC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;kDAClB,cAAM,oBAAN,cAAM;uCAAA;AAGd;IADC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,mBAAQ,CAAC;kDAClB,mBAAQ,oBAAR,mBAAQ;yCAAA;AAGlB;IADC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,KAAK,EA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,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;kDACnC,gBAAI,oBAAJ,gBAAI;wCAAA;AAGb;IADC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;kDACnC,gBAAI,oBAAJ,gBAAI;wCAAA;AAGb;IADC,IAAA,0BAAgB,GAAE;8BACR,IAAI;0CAAA;AAGf;IADC,IAAA,0BAAgB,GAAE;8BACR,IAAI;0CAAA;AAhPJ,OAAO;IAPnB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EACJ,cAAc,EACd,CAAC,OAAgB,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,MAAM,CAAC,EAC3G,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;IACA,IAAA,eAAK,EAAC,cAAc,EAAE,CAAC,OAAgB,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;GACnD,OAAO,CAiPnB;AAjPY,0BAAO"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.schema = void 0;
|
|
23
|
+
const utils_1 = require("@things-factory/utils");
|
|
24
|
+
const resolvers = __importStar(require("./resolvers"));
|
|
25
|
+
const typeDefs = __importStar(require("./types"));
|
|
26
|
+
exports.schema = {
|
|
27
|
+
typeDefs,
|
|
28
|
+
resolvers: utils_1.deepMerge.apply(null, Object.values(resolvers))
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/graphql/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAiD;AAEjD,uDAAwC;AACxC,kDAAmC;AAEtB,QAAA,MAAM,GAAG;IACpB,QAAQ;IACR,SAAS,EAAE,iBAAS,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;CAC3D,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./product-bundle-setting"), exports);
|
|
14
|
+
__exportStar(require("./product-bundle"), exports);
|
|
15
|
+
__exportStar(require("./product-set"), exports);
|
|
16
|
+
__exportStar(require("./product"), exports);
|
|
17
|
+
__exportStar(require("./product-detail"), exports);
|
|
18
|
+
__exportStar(require("./product-detail-bizplace-setting"), exports);
|
|
19
|
+
__exportStar(require("./product-combination"), exports);
|
|
20
|
+
__exportStar(require("./product-combination-setting"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/graphql/resolvers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2DAAwC;AACxC,mDAAgC;AAChC,gDAA6B;AAC7B,4CAAyB;AACzB,mDAAgC;AAChC,oEAAiD;AACjD,wDAAqC;AACrC,gEAA6C"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createProduct = exports.createProductResolver = void 0;
|
|
4
|
+
const typeorm_1 = require("typeorm");
|
|
5
|
+
const biz_base_1 = require("@things-factory/biz-base");
|
|
6
|
+
const entities_1 = require("../../../entities");
|
|
7
|
+
const update_multiple_product_detail_1 = require("../product-detail/update-multiple-product-detail");
|
|
8
|
+
const validate_product_1 = require("./validate-product");
|
|
9
|
+
exports.createProductResolver = {
|
|
10
|
+
async createProduct(_, { product }, context) {
|
|
11
|
+
return await createProduct(product, context);
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
async function createProduct(product, context) {
|
|
15
|
+
var _a, _b, _c;
|
|
16
|
+
try {
|
|
17
|
+
const { domain, user, tx } = context.state;
|
|
18
|
+
const productRepo = tx.getRepository(entities_1.Product) || (0, typeorm_1.getRepository)(entities_1.Product);
|
|
19
|
+
const bizplaceRepo = tx.getRepository(biz_base_1.Bizplace) || (0, typeorm_1.getRepository)(biz_base_1.Bizplace);
|
|
20
|
+
let bizplace;
|
|
21
|
+
if ((_a = product.bizplace) === null || _a === void 0 ? void 0 : _a.id) {
|
|
22
|
+
bizplace = await bizplaceRepo.findOne(product.bizplace.id);
|
|
23
|
+
}
|
|
24
|
+
else if ((_b = context.state) === null || _b === void 0 ? void 0 : _b.bizplace) {
|
|
25
|
+
bizplace = context.state.bizplace;
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
bizplace = await bizplaceRepo.findOne({ where: { domain } });
|
|
29
|
+
}
|
|
30
|
+
if ((_c = product === null || product === void 0 ? void 0 : product.productRef) === null || _c === void 0 ? void 0 : _c.id) {
|
|
31
|
+
product.productRef = await productRepo.findOne(product.productRef.id);
|
|
32
|
+
}
|
|
33
|
+
if (!(product === null || product === void 0 ? void 0 : product.id))
|
|
34
|
+
delete product.id;
|
|
35
|
+
await (0, validate_product_1.validateProduct)(Object.assign(Object.assign({}, product), { bizplace,
|
|
36
|
+
domain }), context);
|
|
37
|
+
if (product.uom) {
|
|
38
|
+
product.primaryUnit = product.uom;
|
|
39
|
+
}
|
|
40
|
+
if (product.uomValue) {
|
|
41
|
+
product.primaryValue = product.uomValue;
|
|
42
|
+
}
|
|
43
|
+
const result = await productRepo.save(Object.assign(Object.assign({}, product), { bizplace,
|
|
44
|
+
domain, creator: user, updater: user }));
|
|
45
|
+
let productDetails = product.productDetails;
|
|
46
|
+
if (!productDetails) {
|
|
47
|
+
productDetails = [new entities_1.ProductDetail(Object.assign(Object.assign({}, product), { product: result, isDefault: true }))];
|
|
48
|
+
if (productDetails[0].gtin == null || productDetails[0] == undefined) {
|
|
49
|
+
productDetails[0].gtin = product.sku;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
await (0, update_multiple_product_detail_1.updateMultipleProductDetail)(result.id, productDetails, context);
|
|
53
|
+
return result;
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
throw error;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.createProduct = createProduct;
|
|
60
|
+
//# sourceMappingURL=create-product.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-product.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/product/create-product.ts"],"names":[],"mappings":";;;AAAA,qCAAkE;AAGlE,uDAAmD;AAGnD,gDAA0D;AAC1D,qGAA8F;AAC9F,yDAAoD;AAEvC,QAAA,qBAAqB,GAAG;IACnC,KAAK,CAAC,aAAa,CAAC,CAAM,EAAE,EAAE,OAAO,EAAE,EAAE,OAAY;QACnD,OAAO,MAAM,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IAC9C,CAAC;CACF,CAAA;AAEM,KAAK,UAAU,aAAa,CAAC,OAAY,EAAE,OAAY;;IAC5D,IAAI;QACF,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAsD,OAAO,CAAC,KAAK,CAAA;QAE7F,MAAM,WAAW,GAAwB,EAAE,CAAC,aAAa,CAAC,kBAAO,CAAC,IAAI,IAAA,uBAAa,EAAC,kBAAO,CAAC,CAAA;QAC5F,MAAM,YAAY,GAAyB,EAAE,CAAC,aAAa,CAAC,mBAAQ,CAAC,IAAI,IAAA,uBAAa,EAAC,mBAAQ,CAAC,CAAA;QAEhG,IAAI,QAAkB,CAAA;QACtB,IAAI,MAAA,OAAO,CAAC,QAAQ,0CAAE,EAAE,EAAE;YACxB,QAAQ,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;SAC3D;aAAM,IAAI,MAAA,OAAO,CAAC,KAAK,0CAAE,QAAQ,EAAE;YAClC,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAA;S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IAAA,4DAA2B,EAAC,MAAM,CAAC,EAAE,EAAE,cAAc,EAAE,OAAO,CAAC,CAAA;QAErE,OAAO,MAAM,CAAA;KACd;IAAC,OAAO,KAAK,EAAE;QACd,MAAM,KAAK,CAAA;KACZ;AACH,CAAC;AA7DD,sCA6DC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createProducts = exports.createProductsResolver = void 0;
|
|
7
|
+
const promises_all_1 = __importDefault(require("promises-all"));
|
|
8
|
+
const create_product_1 = require("./create-product");
|
|
9
|
+
const env_1 = require("@things-factory/env");
|
|
10
|
+
exports.createProductsResolver = {
|
|
11
|
+
async createProducts(_, { products }, context) {
|
|
12
|
+
return await createProducts(products, context);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
async function createProducts(products, context) {
|
|
16
|
+
const { resolve, reject } = await promises_all_1.default.all(products.map(product => (0, create_product_1.createProduct)(product, context)));
|
|
17
|
+
if (reject.length) {
|
|
18
|
+
reject.forEach(({ name, message }) => env_1.logger.error(`${name}: ${message}`));
|
|
19
|
+
return reject;
|
|
20
|
+
}
|
|
21
|
+
return resolve;
|
|
22
|
+
}
|
|
23
|
+
exports.createProducts = createProducts;
|
|
24
|
+
//# sourceMappingURL=create-products.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-products.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/product/create-products.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAsC;AACtC,qDAAgD;AAChD,6CAA4C;AAE/B,QAAA,sBAAsB,GAAG;IACpC,KAAK,CAAC,cAAc,CAAC,CAAM,EAAE,EAAE,QAAQ,EAAE,EAAE,OAAY;QACrD,OAAO,MAAM,cAAc,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;IAChD,CAAC;CACF,CAAA;AAEM,KAAK,UAAU,cAAc,CAAC,QAAQ,EAAE,OAAY;IACzD,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,sBAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,IAAA,8BAAa,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAA;IAE3G,IAAI,MAAM,CAAC,MAAM,EAAE;QACjB,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,YAAM,CAAC,KAAK,CAAC,GAAG,IAAI,KAAK,OAAO,EAAE,CAAC,CAAC,CAAA;QAE1E,OAAO,MAAM,CAAA;KACd;IAED,OAAO,OAAO,CAAA;AAChB,CAAC;AAVD,wCAUC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deleteProduct = void 0;
|
|
4
|
+
const entities_1 = require("../../../entities");
|
|
5
|
+
const constants_1 = require("../../../constants");
|
|
6
|
+
exports.deleteProduct = {
|
|
7
|
+
async deleteProduct(_, { name }, context) {
|
|
8
|
+
const { tx, user, domain } = context.state;
|
|
9
|
+
const productSetRepo = tx.getRepository(entities_1.Product);
|
|
10
|
+
const productSet = await productSetRepo.findOne({ domain, name });
|
|
11
|
+
return await productSetRepo.save(Object.assign(Object.assign({}, productSet), { status: constants_1.PRODUCT_STATUS.DELETED, updater: user }));
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=delete-product.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-product.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/product/delete-product.ts"],"names":[],"mappings":";;;AACA,gDAA2C;AAG3C,kDAAmD;AAEtC,QAAA,aAAa,GAAG;IAC3B,KAAK,CAAC,aAAa,CAAC,CAAM,EAAE,EAAE,IAAI,EAAE,EAAE,OAAY;QAChD,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,GAAsD,OAAO,CAAC,KAAK,CAAA;QAC7F,MAAM,cAAc,GAAwB,EAAE,CAAC,aAAa,CAAC,kBAAO,CAAC,CAAA;QACrE,MAAM,UAAU,GAAG,MAAM,cAAc,CAAC,OAAO,CAAC,EAAC,MAAM,EAAE,IAAI,EAAC,CAAC,CAAA;QAE/D,OAAO,MAAM,cAAc,CAAC,IAAI,iCAC3B,UAAU,KACb,MAAM,EAAE,0BAAc,CAAC,OAAO,EAC9B,OAAO,EAAE,IAAI,IACb,CAAA;IACJ,CAAC;CACF,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deleteProducts = void 0;
|
|
4
|
+
const typeorm_1 = require("typeorm");
|
|
5
|
+
const entities_1 = require("../../../entities");
|
|
6
|
+
exports.deleteProducts = {
|
|
7
|
+
async deleteProducts(_, { ids }, context) {
|
|
8
|
+
const { tx, user } = context.state;
|
|
9
|
+
const productRepo = tx.getRepository(entities_1.Product);
|
|
10
|
+
await productRepo.update({
|
|
11
|
+
id: (0, typeorm_1.In)(ids)
|
|
12
|
+
}, {
|
|
13
|
+
deletedAt: new Date()
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=delete-products.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-products.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/product/delete-products.ts"],"names":[],"mappings":";;;AAAA,qCAA0D;AAE1D,gDAA2C;AAI9B,QAAA,cAAc,GAAG;IAC5B,KAAK,CAAC,cAAc,CAAC,CAAM,EAAE,EAAE,GAAG,EAAE,EAAE,OAAY;QAChD,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,GAAsC,OAAO,CAAC,KAAK,CAAA;QACrE,MAAM,WAAW,GAAG,EAAE,CAAC,aAAa,CAAC,kBAAO,CAAC,CAAA;QAE7C,MAAM,WAAW,CAAC,MAAM,CACtB;YACE,EAAE,EAAE,IAAA,YAAE,EAAC,GAAG,CAAC;SACZ,EACD;YACE,SAAS,EAAE,IAAI,IAAI,EAAE;SACtB,CACF,CAAA;IACH,CAAC;CACF,CAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.importMultipleProduct = void 0;
|
|
4
|
+
const entities_1 = require("../../../entities");
|
|
5
|
+
const create_product_1 = require("./create-product");
|
|
6
|
+
exports.importMultipleProduct = {
|
|
7
|
+
async importMultipleProduct(_, { patches }, context) {
|
|
8
|
+
try {
|
|
9
|
+
let results = [];
|
|
10
|
+
//// 1. Group and massage data based on sku for Product and Product Details.
|
|
11
|
+
let massagedPatch = patches.reduce(function (acc, currentObj) {
|
|
12
|
+
let existingParent = acc.find(itm => itm.sku == currentObj.sku);
|
|
13
|
+
if (existingParent) {
|
|
14
|
+
existingParent.productDetails = [...existingParent.productDetails, new entities_1.ProductDetail(Object.assign(Object.assign({}, currentObj), { childProductDetail: currentObj.childGtin }))];
|
|
15
|
+
return acc;
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
let newProduct = Object.assign(Object.assign({}, currentObj), { productDetails: [new entities_1.ProductDetail(Object.assign(Object.assign({}, currentObj), { childProductDetail: currentObj.childGtin, isDefault: true }))] });
|
|
19
|
+
return [...acc, newProduct];
|
|
20
|
+
}
|
|
21
|
+
}, []);
|
|
22
|
+
//// 2. Update all Grouped Product data and Product Details Data
|
|
23
|
+
for (let i = 0; i < massagedPatch.length; i++) {
|
|
24
|
+
const patch = massagedPatch[i];
|
|
25
|
+
const result = await (0, create_product_1.createProduct)(patch, context);
|
|
26
|
+
results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
|
|
27
|
+
}
|
|
28
|
+
return results;
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
throw error;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=import-multiple-product.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import-multiple-product.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/product/import-multiple-product.ts"],"names":[],"mappings":";;;AAAA,gDAA0D;AAC1D,qDAAgD;AAEnC,QAAA,qBAAqB,GAAG;IACnC,KAAK,CAAC,qBAAqB,CAAC,CAAM,EAAE,EAAE,OAAO,EAAE,EAAE,OAAY;QAC3D,IAAI;YACF,IAAI,OAAO,GAAG,EAAE,CAAA;YAEhB,4EAA4E;YAC5E,IAAI,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,UAAS,GAAG,EAAE,UAAU;gBACzD,IAAI,cAAc,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,CAAA;gBAC/D,IAAG,cAAc,EAAC;oBAChB,cAAc,CAAC,cAAc,GAAG,CAAC,GAAG,cAAc,CAAC,cAAc,EAAE,IAAI,wBAAa,iCAAK,UAAU,KAAE,kBAAkB,EAAE,UAAU,CAAC,SAAS,IAAE,CAAC,CAAA;oBAChJ,OAAO,GAAG,CAAA;iBACX;qBAAI;oBACH,IAAI,UAAU,mCAAO,UAAU,KAAE,cAAc,EAAE,CAAC,IAAI,wBAAa,iCAAK,UAAU,KAAE,kBAAkB,EAAE,UAAU,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,IAAE,CAAC,GAAC,CAAA;oBACjJ,OAAO,CAAC,GAAG,GAAG,EAAE,UAAU,CAAC,CAAA;iBAC5B;YACH,CAAC,EAAE,EAAE,CAAC,CAAA;YAGN,gEAAgE;YAChE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBAC7C,MAAM,KAAK,GAAY,aAAa,CAAC,CAAC,CAAC,CAAA;gBACvC,MAAM,MAAM,GAAG,MAAM,IAAA,8BAAa,EAAC,KAAK,EAAE,OAAO,CAAC,CAAA;gBAClD,OAAO,CAAC,IAAI,iCAAM,MAAM,KAAE,MAAM,EAAE,GAAG,IAAG,CAAA;aACzC;YAED,OAAO,OAAO,CAAA;SACf;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,KAAK,CAAA;SACZ;IACH,CAAC;CACF,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProductResolver = void 0;
|
|
4
|
+
const product_query_1 = require("./product-query");
|
|
5
|
+
const create_product_1 = require("./create-product");
|
|
6
|
+
const create_products_1 = require("./create-products");
|
|
7
|
+
const delete_product_1 = require("./delete-product");
|
|
8
|
+
const delete_products_1 = require("./delete-products");
|
|
9
|
+
const undelete_products_1 = require("./undelete-products");
|
|
10
|
+
const link_product_1 = require("./link-product");
|
|
11
|
+
const my_bizplace_products_1 = require("./my-bizplace-products");
|
|
12
|
+
const products_by_bizplace_1 = require("./products-by-bizplace");
|
|
13
|
+
const import_multiple_product_1 = require("./import-multiple-product");
|
|
14
|
+
const update_multiple_product_1 = require("./update-multiple-product");
|
|
15
|
+
const update_product_1 = require("./update-product");
|
|
16
|
+
exports.ProductResolver = {
|
|
17
|
+
Query: Object.assign(Object.assign(Object.assign({}, product_query_1.Query), my_bizplace_products_1.myBizplaceProducts), products_by_bizplace_1.productsByBizplace),
|
|
18
|
+
Mutation: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, create_product_1.createProductResolver), create_products_1.createProductsResolver), delete_product_1.deleteProduct), delete_products_1.deleteProducts), undelete_products_1.undeleteProducts), import_multiple_product_1.importMultipleProduct), update_multiple_product_1.updateMultipleProduct), update_product_1.updateProductResolver), link_product_1.linkProductResolver)
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/product/index.ts"],"names":[],"mappings":";;;AAAA,mDAAuC;AAEvC,qDAAwD;AACxD,uDAA0D;AAC1D,qDAAgD;AAChD,uDAAkD;AAClD,2DAAsD;AACtD,iDAAoD;AACpD,iEAA2D;AAC3D,iEAA2D;AAC3D,uEAAiE;AACjE,uEAAiE;AACjE,qDAAwD;AAE3C,QAAA,eAAe,GAAG;IAC7B,KAAK,gDACA,qBAAK,GACL,yCAAkB,GAClB,yCAAkB,CACtB;IACD,QAAQ,oIACH,sCAAqB,GACrB,wCAAsB,GACtB,8BAAa,GACb,gCAAc,GACd,oCAAgB,GAChB,+CAAqB,GACrB,+CAAqB,GACrB,sCAAqB,GACrB,kCAAmB,CACvB;CACF,CAAA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.linkProductResolver = void 0;
|
|
4
|
+
const entities_1 = require("../../../entities");
|
|
5
|
+
const update_product_1 = require("./update-product");
|
|
6
|
+
exports.linkProductResolver = {
|
|
7
|
+
async linkProduct(_, { productSetId, patches }, context) {
|
|
8
|
+
const { tx } = context.state;
|
|
9
|
+
let productSet = await tx.getRepository(entities_1.ProductSet).findOne({
|
|
10
|
+
where: { id: productSetId },
|
|
11
|
+
relations: ['domain', 'creator', 'updater', 'product']
|
|
12
|
+
});
|
|
13
|
+
let existingProductLink = productSet.product;
|
|
14
|
+
let newProductLink = patches.reduce((acc, curr) => {
|
|
15
|
+
if (!existingProductLink.find(itm => itm.id == curr.id)) {
|
|
16
|
+
acc.push({ id: curr.id });
|
|
17
|
+
}
|
|
18
|
+
return acc;
|
|
19
|
+
}, []);
|
|
20
|
+
let removeProductLink = existingProductLink.reduce((acc, curr) => {
|
|
21
|
+
if (!patches.find(itm => itm.id == curr.id)) {
|
|
22
|
+
acc.push({ id: curr.id });
|
|
23
|
+
}
|
|
24
|
+
return acc;
|
|
25
|
+
}, []);
|
|
26
|
+
if (newProductLink.length > 0) {
|
|
27
|
+
for (let i = 0; i < newProductLink.length; i++) {
|
|
28
|
+
const patch = Object.assign(Object.assign({}, newProductLink[i]), { productSet });
|
|
29
|
+
await (0, update_product_1.updateProduct)(newProductLink[i].id, patch, context);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (removeProductLink.length > 0) {
|
|
33
|
+
for (let i = 0; i < removeProductLink.length; i++) {
|
|
34
|
+
const patch = Object.assign(Object.assign({}, removeProductLink[i]), { productSet: null });
|
|
35
|
+
await (0, update_product_1.updateProduct)(removeProductLink[i].id, patch, context);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=link-product.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link-product.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/product/link-product.ts"],"names":[],"mappings":";;;AACA,gDAAuD;AACvD,qDAAgD;AAEnC,QAAA,mBAAmB,GAAG;IACjC,KAAK,CAAC,WAAW,CAAC,CAAM,EAAE,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,OAAY;QAC/D,MAAM,EAAE,EAAE,EAAE,GAA0B,OAAO,CAAC,KAAK,CAAA;QAEnD,IAAI,UAAU,GAAG,MAAM,EAAE,CAAC,aAAa,CAAC,qBAAU,CAAC,CAAC,OAAO,CAAC;YAC1D,KAAK,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE;YAC3B,SAAS,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,EA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