@things-factory/warehouse-base 5.0.7 → 5.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-server/constants/index.js +6 -19
- package/dist-server/constants/index.js.map +1 -1
- package/dist-server/constants/inventory.js.map +1 -1
- package/dist-server/constants/location.js.map +1 -1
- package/dist-server/constants/pallet.js.map +1 -1
- package/dist-server/constants/rule-type.js.map +1 -1
- package/dist-server/constants/tote.js.map +1 -1
- package/dist-server/controllers/ecommerce/ecommerce-controller.js.map +1 -1
- package/dist-server/controllers/ecommerce/index.js +3 -16
- package/dist-server/controllers/ecommerce/index.js.map +1 -1
- package/dist-server/controllers/ecommerce/sellercraft-controller.js.map +1 -1
- package/dist-server/controllers/index.js +3 -16
- package/dist-server/controllers/index.js.map +1 -1
- package/dist-server/controllers/warehouse-controller.js.map +1 -1
- package/dist-server/index.js +6 -19
- package/dist-server/index.js.map +1 -1
- package/dist-server/middlewares/index.js.map +1 -1
- package/dist-server/migrations/index.js.map +1 -1
- package/dist-server/service/index.js +28 -41
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/inventory/index.js.map +1 -1
- package/dist-server/service/inventory/inventory-mutation.js +50 -61
- package/dist-server/service/inventory/inventory-mutation.js.map +1 -1
- package/dist-server/service/inventory/inventory-query.js +124 -135
- package/dist-server/service/inventory/inventory-query.js.map +1 -1
- package/dist-server/service/inventory/inventory-types.js +198 -206
- package/dist-server/service/inventory/inventory-types.js.map +1 -1
- package/dist-server/service/inventory/inventory.js +133 -141
- package/dist-server/service/inventory/inventory.js.map +1 -1
- package/dist-server/service/inventory-change/index.js.map +1 -1
- package/dist-server/service/inventory-change/inventory-change-mutation.js +51 -62
- package/dist-server/service/inventory-change/inventory-change-mutation.js.map +1 -1
- package/dist-server/service/inventory-change/inventory-change-query.js +29 -40
- package/dist-server/service/inventory-change/inventory-change-query.js.map +1 -1
- package/dist-server/service/inventory-change/inventory-change-types.js +20 -28
- package/dist-server/service/inventory-change/inventory-change-types.js.map +1 -1
- package/dist-server/service/inventory-change/inventory-change.js +68 -76
- package/dist-server/service/inventory-change/inventory-change.js.map +1 -1
- package/dist-server/service/inventory-history/index.js.map +1 -1
- package/dist-server/service/inventory-history/inventory-history-mutation.js +33 -44
- package/dist-server/service/inventory-history/inventory-history-mutation.js.map +1 -1
- package/dist-server/service/inventory-history/inventory-history-query.js +105 -116
- package/dist-server/service/inventory-history/inventory-history-query.js.map +1 -1
- package/dist-server/service/inventory-history/inventory-history-types.js +282 -290
- package/dist-server/service/inventory-history/inventory-history-types.js.map +1 -1
- package/dist-server/service/inventory-history/inventory-history.js +82 -90
- package/dist-server/service/inventory-history/inventory-history.js.map +1 -1
- package/dist-server/service/inventory-item/index.js.map +1 -1
- package/dist-server/service/inventory-item/inventory-item-mutation.js +47 -58
- package/dist-server/service/inventory-item/inventory-item-mutation.js.map +1 -1
- package/dist-server/service/inventory-item/inventory-item-query.js +41 -52
- package/dist-server/service/inventory-item/inventory-item-query.js.map +1 -1
- package/dist-server/service/inventory-item/inventory-item-type.js +44 -52
- package/dist-server/service/inventory-item/inventory-item-type.js.map +1 -1
- package/dist-server/service/inventory-item/inventory-item.js +44 -52
- package/dist-server/service/inventory-item/inventory-item.js.map +1 -1
- package/dist-server/service/inventory-item-change/index.js.map +1 -1
- package/dist-server/service/inventory-item-change/inventory-item-change-mutation.js +33 -44
- package/dist-server/service/inventory-item-change/inventory-item-change-mutation.js.map +1 -1
- package/dist-server/service/inventory-item-change/inventory-item-change-query.js +29 -40
- package/dist-server/service/inventory-item-change/inventory-item-change-query.js.map +1 -1
- package/dist-server/service/inventory-item-change/inventory-item-change-type.js +40 -48
- package/dist-server/service/inventory-item-change/inventory-item-change-type.js.map +1 -1
- package/dist-server/service/inventory-item-change/inventory-item-change.js +34 -42
- package/dist-server/service/inventory-item-change/inventory-item-change.js.map +1 -1
- package/dist-server/service/inventory-product/index.js.map +1 -1
- package/dist-server/service/inventory-product/inventory-product-mutation.js +33 -44
- package/dist-server/service/inventory-product/inventory-product-mutation.js.map +1 -1
- package/dist-server/service/inventory-product/inventory-product-query.js +29 -40
- package/dist-server/service/inventory-product/inventory-product-query.js.map +1 -1
- package/dist-server/service/inventory-product/inventory-product-type.js +34 -42
- package/dist-server/service/inventory-product/inventory-product-type.js.map +1 -1
- package/dist-server/service/inventory-product/inventory-product.js +34 -42
- package/dist-server/service/inventory-product/inventory-product.js.map +1 -1
- package/dist-server/service/location/index.js.map +1 -1
- package/dist-server/service/location/location-mutation.js +39 -50
- package/dist-server/service/location/location-mutation.js.map +1 -1
- package/dist-server/service/location/location-query.js +65 -76
- package/dist-server/service/location/location-query.js.map +1 -1
- package/dist-server/service/location/location-types.js +105 -113
- package/dist-server/service/location/location-types.js.map +1 -1
- package/dist-server/service/location/location.js +41 -49
- package/dist-server/service/location/location.js.map +1 -1
- package/dist-server/service/movement/index.js.map +1 -1
- package/dist-server/service/movement/movement-mutation.js +21 -32
- package/dist-server/service/movement/movement-mutation.js.map +1 -1
- package/dist-server/service/movement/movement-query.js +51 -65
- package/dist-server/service/movement/movement-query.js.map +1 -1
- package/dist-server/service/movement/movement-types.js +43 -51
- package/dist-server/service/movement/movement-types.js.map +1 -1
- package/dist-server/service/movement/movement.js +30 -38
- package/dist-server/service/movement/movement.js.map +1 -1
- package/dist-server/service/pallet/index.js.map +1 -1
- package/dist-server/service/pallet/pallet-mutation.js +39 -50
- package/dist-server/service/pallet/pallet-mutation.js.map +1 -1
- package/dist-server/service/pallet/pallet-query.js +48 -59
- package/dist-server/service/pallet/pallet-query.js.map +1 -1
- package/dist-server/service/pallet/pallet-types.js +39 -47
- package/dist-server/service/pallet/pallet-types.js.map +1 -1
- package/dist-server/service/pallet/pallet.js +34 -42
- package/dist-server/service/pallet/pallet.js.map +1 -1
- package/dist-server/service/pallet-count/index.js.map +1 -1
- package/dist-server/service/pallet-count/pallet-count-mutation.js +39 -50
- package/dist-server/service/pallet-count/pallet-count-mutation.js.map +1 -1
- package/dist-server/service/pallet-count/pallet-count-query.js +28 -39
- package/dist-server/service/pallet-count/pallet-count-query.js.map +1 -1
- package/dist-server/service/pallet-count/pallet-count-types.js +20 -28
- package/dist-server/service/pallet-count/pallet-count-types.js.map +1 -1
- package/dist-server/service/pallet-count/pallet-count.js +26 -34
- package/dist-server/service/pallet-count/pallet-count.js.map +1 -1
- package/dist-server/service/pallet-history/index.js.map +1 -1
- package/dist-server/service/pallet-history/pallet-history-mutation.js +33 -44
- package/dist-server/service/pallet-history/pallet-history-mutation.js.map +1 -1
- package/dist-server/service/pallet-history/pallet-history-query.js +29 -40
- package/dist-server/service/pallet-history/pallet-history-query.js.map +1 -1
- package/dist-server/service/pallet-history/pallet-history-types.js +20 -28
- package/dist-server/service/pallet-history/pallet-history-types.js.map +1 -1
- package/dist-server/service/pallet-history/pallet-history.js +34 -42
- package/dist-server/service/pallet-history/pallet-history.js.map +1 -1
- package/dist-server/service/reduced-inventory-history/index.js.map +1 -1
- package/dist-server/service/reduced-inventory-history/reduced-inventory-history.js +52 -60
- package/dist-server/service/reduced-inventory-history/reduced-inventory-history.js.map +1 -1
- package/dist-server/service/tote/index.js.map +1 -1
- package/dist-server/service/tote/tote-mutation.js +46 -57
- package/dist-server/service/tote/tote-mutation.js.map +1 -1
- package/dist-server/service/tote/tote-query.js +44 -55
- package/dist-server/service/tote/tote-query.js.map +1 -1
- package/dist-server/service/tote/tote-types.js +24 -32
- package/dist-server/service/tote/tote-types.js.map +1 -1
- package/dist-server/service/tote/tote.js +30 -38
- package/dist-server/service/tote/tote.js.map +1 -1
- package/dist-server/service/warehouse/index.js.map +1 -1
- package/dist-server/service/warehouse/warehouse-mutation.js +33 -44
- package/dist-server/service/warehouse/warehouse-mutation.js.map +1 -1
- package/dist-server/service/warehouse/warehouse-query.js +29 -40
- package/dist-server/service/warehouse/warehouse-query.js.map +1 -1
- package/dist-server/service/warehouse/warehouse-types.js +28 -36
- package/dist-server/service/warehouse/warehouse-types.js.map +1 -1
- package/dist-server/service/warehouse/warehouse.js +31 -39
- package/dist-server/service/warehouse/warehouse.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -0
- package/dist-server/utils/datetime-util.js.map +1 -1
- package/dist-server/utils/index.js +4 -17
- package/dist-server/utils/index.js.map +1 -1
- package/dist-server/utils/inventory-no-generator.js.map +1 -1
- package/dist-server/utils/inventory-util.js.map +1 -1
- package/package.json +8 -8
- package/server/service/inventory/inventory-mutation.ts +2 -2
- package/server/service/inventory/inventory-query.ts +2 -2
- package/server/service/inventory/inventory.ts +6 -5
- package/server/service/inventory-change/inventory-change-mutation.ts +1 -1
- package/server/service/inventory-change/inventory-change-query.ts +2 -2
- package/server/service/inventory-history/inventory-history-query.ts +29 -28
- package/server/service/inventory-history/inventory-history.ts +39 -39
- package/server/service/inventory-item/inventory-item-mutation.ts +3 -3
- package/server/service/movement/movement-query.ts +3 -6
|
@@ -1,22 +1,9 @@
|
|
|
1
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
18
|
-
__exportStar(require("./
|
|
19
|
-
__exportStar(require("./
|
|
20
|
-
__exportStar(require("./
|
|
21
|
-
__exportStar(require("./
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./inventory"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./location"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./pallet"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./rule-type"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./tote"), exports);
|
|
22
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/constants/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/constants/index.ts"],"names":[],"mappings":";;;AAAA,sDAA2B;AAC3B,qDAA0B;AAC1B,mDAAwB;AACxB,sDAA2B;AAC3B,iDAAsB","sourcesContent":["export * from './inventory'\nexport * from './location'\nexport * from './pallet'\nexport * from './rule-type'\nexport * from './tote'\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inventory.js","sourceRoot":"","sources":["../../server/constants/inventory.ts"],"names":[],"mappings":";;;AAAa,QAAA,gBAAgB,GAAG;IAC9B,QAAQ,EAAE,UAAU;IACpB,kBAAkB,EAAE,oBAAoB;IACxC,YAAY,EAAE,cAAc;IAC5B,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,WAAW;IACtB,UAAU,EAAE,YAAY;IACxB,UAAU,EAAE,YAAY;IACxB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;CACjB,CAAA;AAEY,QAAA,eAAe,GAAG;IAC7B,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;CACf,CAAA;AAEY,QAAA,0BAA0B,GAAG;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B,CAAA;AAEY,QAAA,0BAA0B,GAAG;IACxC,GAAG,EAAE,KAAK;IACV,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,SAAS;CACnB,CAAA","sourcesContent":["export const INVENTORY_STATUS = {\n UNLOADED: 'UNLOADED',\n PARTIALLY_UNLOADED: 'PARTIALLY_UNLOADED',\n PUTTING_AWAY: 'PUTTING_AWAY',\n STORED: 'STORED',\n LOADED: 'LOADED',\n INTRANSIT: 'INTRANSIT',\n TERMINATED: 'TERMINATED',\n TRANSFERED: 'TRANSFERED',\n DELETED: 'DELETED',\n CHECKED: 'CHECKED',\n PICKED: 'PICKED',\n PICKING: 'PICKING',\n SORTING: 'SORTING',\n SORTED: 'SORTED'\n}\n\nexport const INVENTORY_TYPES = {\n BUFFER: 'BUFFER',\n SHELF: 'SHELF'\n}\n\nexport const INVENTORY_TRANSACTION_TYPE = {\n NEW: 'NEW',\n UNLOADING: 'UNLOADING',\n UNDO_UNLOADING: 'UNDO_UNLOADING',\n PUTAWAY: 'PUTAWAY',\n UNDO_PUTAWAY: 'UNDO_PUTAWAY',\n UNDO_UNPACKING: 'UNDO_UNPACKING',\n ADJUSTMENT: 'ADJUSTMENT',\n CC_ADJUSTMENT: 'CC_ADJUSTMENT',\n SALES_ADJUSTMENT: 'SALES_ADJUSTMENT',\n RELOCATE: 'RELOCATE',\n PICKING: 'PICKING',\n PACKING: 'PACKING',\n LOADING: 'LOADING',\n SORTING: 'SORTING',\n UNDO_LOADING: 'UNDO_LOADING',\n CANCEL_ORDER: 'CANCEL_ORDER',\n RETURN: 'RETURN',\n EXTERNAL_RETURN: 'EXTERNAL_RETURN',\n TERMINATED: 'TERMINATED',\n TRANSFERED_IN: 'TRANSFERED_IN',\n TRANSFERED_OUT: 'TRANSFERED_OUT',\n RELABELING: 'RELABELING',\n REPACKAGING: 'REPACKAGING',\n REPACKAGING_RELABELING: 'REPACKAGING_RELABELING',\n REPALLETIZING: 'REPALLETIZING',\n UNPACKING: 'UNPACKING',\n UNPACKED: 'UNPACKED',\n REVERSE_KITTING: 'REVERSE_KITTING',\n UNDO_REVERSE_KITTING: 'UNDO_REVERSE_KITTING',\n DIRECT_DEDUCTION: 'DIRECT_DEDUCTION'\n}\n\nexport const INVENTORY_ITEM_SOURCE = {\n INBOUND: 'INBOUND',\n OUTBOUND: 'OUTBOUND',\n ADJUSTMENT: 'ADJUSTMENT'\n}\n\nexport const INVENTORY_ITEM_CHANGE_TYPE = {\n NEW: 'NEW',\n MODIFIED: 'MODIFIED',\n REMOVED: 'REMOVED'\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"location.js","sourceRoot":"","sources":["../../server/constants/location.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG;IAC7B,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;IACpB,IAAI,EAAE,MAAM;CACb,CAAA;AAEY,QAAA,aAAa,GAAG;IAC3B,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,GAAG,EAAE,KAAK;IACV,UAAU,EAAE,YAAY;IACxB,OAAO,EAAE,SAAS;CACnB,CAAA"}
|
|
1
|
+
{"version":3,"file":"location.js","sourceRoot":"","sources":["../../server/constants/location.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG;IAC7B,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;IACpB,IAAI,EAAE,MAAM;CACb,CAAA;AAEY,QAAA,aAAa,GAAG;IAC3B,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,GAAG,EAAE,KAAK;IACV,UAAU,EAAE,YAAY;IACxB,OAAO,EAAE,SAAS;CACnB,CAAA","sourcesContent":["export const LOCATION_STATUS = {\n EMPTY: 'EMPTY',\n OCCUPIED: 'OCCUPIED',\n FULL: 'FULL'\n}\n\nexport const LOCATION_TYPE = {\n BUFFER: 'BUFFER',\n SHELF: 'SHELF',\n FLOOR: 'FLOOR',\n BIN: 'BIN',\n QUARANTINE: 'QUARANTINE',\n RESERVE: 'RESERVE'\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pallet.js","sourceRoot":"","sources":["../../server/constants/pallet.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG;IAC3B,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;CACnB,CAAA;AAEY,QAAA,YAAY,GAAG;IAC1B,aAAa,EAAE,eAAe;IAC9B,eAAe,EAAE,iBAAiB;CACnC,CAAA"}
|
|
1
|
+
{"version":3,"file":"pallet.js","sourceRoot":"","sources":["../../server/constants/pallet.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG;IAC3B,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;CACnB,CAAA;AAEY,QAAA,YAAY,GAAG;IAC1B,aAAa,EAAE,eAAe;IAC9B,eAAe,EAAE,iBAAiB;CACnC,CAAA","sourcesContent":["export const PALLET_STATUS = {\n ACTIVE: 'ACTIVE',\n LOST: 'LOST',\n DAMAGED: 'DAMAGED'\n}\n\nexport const PALLET_TYPES = {\n WOODEN_PALLET: 'WOODEN_PALLET',\n REUSABLE_PALLET: 'REUSABLE_PALLET'\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rule-type.js","sourceRoot":"","sources":["../../server/constants/rule-type.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAG;IACvB,aAAa,EAAE,mBAAmB;IAClC,gBAAgB,EAAE,mBAAmB;CACtC,CAAA"}
|
|
1
|
+
{"version":3,"file":"rule-type.js","sourceRoot":"","sources":["../../server/constants/rule-type.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAG;IACvB,aAAa,EAAE,mBAAmB;IAClC,gBAAgB,EAAE,mBAAmB;CACtC,CAAA","sourcesContent":["export const RULE_TYPE = {\n LOT_NUMBER_ID: 'inbound_pallet_id',\n CARTON_NUMBER_ID: 'inbound_carton_id'\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tote.js","sourceRoot":"","sources":["../../server/constants/tote.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG;IACzB,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,YAAY;IACxB,OAAO,EAAE,SAAS;CACnB,CAAA"}
|
|
1
|
+
{"version":3,"file":"tote.js","sourceRoot":"","sources":["../../server/constants/tote.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG;IACzB,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,YAAY;IACxB,OAAO,EAAE,SAAS;CACnB,CAAA","sourcesContent":["export const TOTE_STATUS = {\n ACTIVE: 'ACTIVE',\n DISPATCHED: 'DISPATCHED',\n DAMAGED: 'DAMAGED'\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ecommerce-controller.js","sourceRoot":"","sources":["../../../server/controllers/ecommerce/ecommerce-controller.ts"],"names":[],"mappings":";;;AAAA,qCAAoC;AAEpC,qFAAwG;AACxG,uEAA8E;AAC9E,+DAAsD;AAGtD,+CAAiE;AACjE,iEAA6D;AAC7D,kEAA6D;AAE7D,MAAa,mBAAoB,SAAQ,0CAAmB;IAC1D,KAAK,CAAC,2BAA2B,CAC/B,iBAAqC,EACrC,SAAiB,EACjB,aAAqB;;QAErB,MAAM,OAAO,GAAY,MAAM,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,sBAAO,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;QACpF,IAAI,WAAW,GAAgB,MAAM,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,qBAAS,CAAC,CAAC,IAAI,CAAC;YAC7E,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,OAA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A4B,GAAU,EAAE,CAAA;gBAC5C,IAAI,gBAAgB,CAAC,uBAAuB,EAAE;oBAC5C,4BAA4B,GAAG,gBAAgB,CAAC,uBAAuB,CAAC,MAAM,CAC5E,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,MAAM,KAAK,QAAQ,CAC/C,CAAA;iBACF;gBAED,MAAM,kCAAQ,CAAC,gCAAgC,CAAC,gBAAgB,EAAE;oBAChE;wBACE,MAAM,EAAE,2BAA2B,CAAC,kBAAkB,CAAC,MAAM;wBAC7D,WAAW,EAAE,2BAA2B,CAAC,WAAW;wBACpD,YAAY,EAAE,2BAA2B,CAAC,YAAY;wBACtD,GAAG,EAAE,SAAS;wBACd,UAAU,EAAE,0BAA0B;wBACtC,eAAe,EAAE,2BAA2B,CAAC,eAAe;wBAC5D,YAAY,EAAE,4BAA4B;qBAC3C;iBACF,CAAC,CAAA;gBAEF,2BAA2B,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,GAAG,GAAG,CAAC,eAAe,GAAG,GAAG,CAAC,CAAC,CAAA;gBAC5F,2BAA2B,CAAC,OAAO,GAAG,IAAI,CAAC,IAAI,CAAA;gBAC/C,MAAM,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,8CAA2B,CAAC,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAA;aAC/F;SACF;IACH,CAAC;CACF;AA5FD,kDA4FC"}
|
|
1
|
+
{"version":3,"file":"ecommerce-controller.js","sourceRoot":"","sources":["../../../server/controllers/ecommerce/ecommerce-controller.ts"],"names":[],"mappings":";;;AAAA,qCAAoC;AAEpC,qFAAwG;AACxG,uEAA8E;AAC9E,+DAAsD;AAGtD,+CAAiE;AACjE,iEAA6D;AAC7D,kEAA6D;AAE7D,MAAa,mBAAoB,SAAQ,0CAAmB;IAC1D,KAAK,CAAC,2BAA2B,CAC/B,iBAAqC,EACrC,SAAiB,EACjB,aAAqB;;QAErB,MAAM,OAAO,GAAY,MAAM,IA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IAAI,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAA;oBAC/D,SAAS,GAAG,SAAS,GAAG,2BAA2B,CAAC,GAAG,CAAA;oBACvD,IAAI,MAAA,WAAW,CAAC,CAAC,CAAC,0CAAE,WAAW;wBAAE,0BAA0B,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAA;iBACzF;gBAED,IAAI,4BAA4B,GAAU,EAAE,CAAA;gBAC5C,IAAI,gBAAgB,CAAC,uBAAuB,EAAE;oBAC5C,4BAA4B,GAAG,gBAAgB,CAAC,uBAAuB,CAAC,MAAM,CAC5E,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,MAAM,KAAK,QAAQ,CAC/C,CAAA;iBACF;gBAED,MAAM,kCAAQ,CAAC,gCAAgC,CAAC,gBAAgB,EAAE;oBAChE;wBACE,MAAM,EAAE,2BAA2B,CAAC,kBAAkB,CAAC,MAAM;wBAC7D,WAAW,EAAE,2BAA2B,CAAC,WAAW;wBACpD,YAAY,EAAE,2BAA2B,CAAC,YAAY;wBACtD,GAAG,EAAE,SAAS;wBACd,UAAU,EAAE,0BAA0B;wBACtC,eAAe,EAAE,2BAA2B,CAAC,eAAe;wBAC5D,YAAY,EAAE,4BAA4B;qBAC3C;iBACF,CAAC,CAAA;gBAEF,2BAA2B,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,GAAG,GAAG,CAAC,eAAe,GAAG,GAAG,CAAC,CAAC,CAAA;gBAC5F,2BAA2B,CAAC,OAAO,GAAG,IAAI,CAAC,IAAI,CAAA;gBAC/C,MAAM,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,8CAA2B,CAAC,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAA;aAC/F;SACF;IACH,CAAC;CACF;AA5FD,kDA4FC","sourcesContent":["import { Equal, Not } from 'typeorm'\n\nimport { MarketplaceSetting, MarketplaceStore, StoreAPI } from '@things-factory/integration-marketplace'\nimport { MarketplaceProductVariation } from '@things-factory/marketplace-base'\nimport { Product } from '@things-factory/product-base'\nimport { Domain } from '@things-factory/shell'\n\nimport { INVENTORY_STATUS, LOCATION_TYPE } from '../../constants'\nimport { Inventory } from '../../service/inventory/inventory'\nimport { WarehouseController } from '../warehouse-controller'\n\nexport class EcommerceController extends WarehouseController {\n async updateProductVariationStock(\n marketplaceStores: MarketplaceStore[],\n productId: string,\n companyDomain: Domain\n ): Promise<void> {\n const product: Product = await this.trxMgr.getRepository(Product).findOne(productId)\n let inventories: Inventory[] = await this.trxMgr.getRepository(Inventory).find({\n where: { domain: this.domain, product, status: Not(Equal(INVENTORY_STATUS.TERMINATED)) },\n relations: ['location']\n })\n\n inventories = inventories.filter(\n inventory =>\n inventory?.location.type !== LOCATION_TYPE.QUARANTINE || inventory?.location.type !== LOCATION_TYPE.RESERVE\n )\n\n const inventoryQty: number = inventories.reduce((total, currentValue) => {\n total += currentValue.qty\n return total\n }, 0)\n\n const inventoryLockedQty: number = inventories.reduce((total, currentValue) => {\n total += currentValue.lockedQty\n return total\n }, 0)\n\n const inventoryProduct: any = {\n sku: product.sku,\n name: product.name,\n qty: inventoryQty - inventoryLockedQty\n }\n\n for (var i = 0; i < marketplaceStores.length; i++) {\n const marketplaceStore = marketplaceStores[i]\n\n // get marketplace setting based on marketplace connection\n const marketplaceSetting: MarketplaceSetting = await this.trxMgr.getRepository(MarketplaceSetting).findOne({\n where: { marketplaceStore, category: 'stock_allocation' }\n })\n\n const marketplaceProductVariations: MarketplaceProductVariation[] = await this.trxMgr\n .getRepository(MarketplaceProductVariation)\n .find({\n where: { domain: companyDomain, sku: inventoryProduct.sku },\n relations: ['marketplaceProduct', 'marketplaceProduct.marketplaceStore']\n })\n\n let marketplaceProductVariation: MarketplaceProductVariation = marketplaceProductVariations.filter(\n productVariation => productVariation.marketplaceProduct.marketplaceStore.id === marketplaceStore.id\n )[0]\n\n if (marketplaceProductVariation) {\n // update stock qty based on calculated inventory by product qty\n let percentageValue: number = 100\n if (marketplaceSetting) {\n percentageValue = parseInt(marketplaceSetting.value)\n }\n\n let productVariationLocationId = marketplaceProductVariation?.locationId\n let adjustQty: number = Math.floor(inventoryProduct.qty * (percentageValue / 100))\n if (marketplaceStore.platform === 'shopify') {\n let locationIds: any[] = JSON.parse(productVariationLocationId)\n adjustQty = adjustQty - marketplaceProductVariation.qty\n if (locationIds[0]?.location_id) productVariationLocationId = locationIds[0].location_id\n }\n\n let validMarketplaceDistributors: any[] = []\n if (marketplaceStore.marketplaceDistributors) {\n validMarketplaceDistributors = marketplaceStore.marketplaceDistributors.filter(\n distributor => distributor.status === 'ACTIVE'\n )\n }\n\n await StoreAPI.updateStoreProductVariationStock(marketplaceStore, [\n {\n itemId: marketplaceProductVariation.marketplaceProduct.itemId,\n variationId: marketplaceProductVariation.variationId,\n variationSku: marketplaceProductVariation.variationSku,\n qty: adjustQty,\n locationId: productVariationLocationId,\n inventoryItemId: marketplaceProductVariation.inventoryItemId,\n distributors: validMarketplaceDistributors\n }\n ])\n\n marketplaceProductVariation.qty = Math.floor(inventoryProduct.qty * (percentageValue / 100))\n marketplaceProductVariation.updater = this.user\n await this.trxMgr.getRepository(MarketplaceProductVariation).save(marketplaceProductVariation)\n }\n }\n }\n}\n"]}
|
|
@@ -1,19 +1,6 @@
|
|
|
1
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
18
|
-
__exportStar(require("./
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./ecommerce-controller"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./sellercraft-controller"), exports);
|
|
19
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/controllers/ecommerce/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/controllers/ecommerce/index.ts"],"names":[],"mappings":";;;AAAA,iEAAsC;AACtC,mEAAwC","sourcesContent":["export * from './ecommerce-controller'\nexport * from './sellercraft-controller'\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sellercraft-controller.js","sourceRoot":"","sources":["../../../server/controllers/ecommerce/sellercraft-controller.ts"],"names":[],"mappings":";;;AAAA,uDAAmD;AACnD,qFAAqF;AAGrF,+CAAiE;AACjE,iEAA6D;AAC7D,kEAA6D;AAE7D,MAAa,qBAAsB,SAAQ,0CAAmB;IAC5D,KAAK,CAAC,sBAAsB,CAAC,WAAwB,EAAE,SAAoB;QACzE,MAAM,QAAQ,GAAa,MAAM,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,mBAAQ,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC,CAAA;QAE5G,IAAI,OAAO,GAAY,SAAS,CAAC,OAAO,CAAA;QACxC,MAAM,cAAc,GAAoB,OAAO,CAAC,cAAc,CAAA;QAE9D,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,qBAAS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AM;iBAC7E;aACF;SACF,CAAA;QAED,MAAM,wCAAc,CAAC,aAAa,CAAC,WAAW,EAAE;YAC9C,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,EAAE,IAAI,EAAE,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,EAAE,EAAE;YAC9D,SAAS,EAAE,WAAW,CAAC,SAAS;YAChC,cAAc;SACf,CAAC,CAAA;IACJ,CAAC;CACF;AAjFD,sDAiFC","sourcesContent":["import { Bizplace } from '@things-factory/biz-base'\nimport { Sellercraft, SellercraftAPI } from '@things-factory/integration-sellercraft'\nimport { Product, ProductDetail } from '@things-factory/product-base'\n\nimport { INVENTORY_STATUS, LOCATION_TYPE } from '../../constants'\nimport { Inventory } from '../../service/inventory/inventory'\nimport { WarehouseController } from '../warehouse-controller'\n\nexport class SellercraftController extends WarehouseController {\n async updateSellercraftStock(sellercraft: Sellercraft, inventory: Inventory): Promise<void> {\n const bizplace: Bizplace = await this.trxMgr.getRepository(Bizplace).findOne({ domain: sellercraft.domain })\n\n let product: Product = inventory.product\n const productDetails: ProductDetail[] = product.productDetails\n\n let qb = await this.trxMgr.getRepository(Inventory).createQueryBuilder('inv')\n qb.leftJoinAndSelect('inv.location', 'loc')\n .andWhere('\"inv\".\"domain_id\" = :domainId')\n .andWhere('\"inv\".\"bizplace_id\" = :bizplaceId')\n .andWhere('\"inv\".\"product_id\" = :productId')\n .andWhere('\"inv\".\"status\" != :status')\n .andWhere('\"loc\".\"type\" NOT IN (:...locationTypes)')\n .setParameters({\n domainId: this.domain.id,\n bizplaceId: bizplace.id,\n productId: product.id,\n status: INVENTORY_STATUS.TERMINATED,\n locationTypes: [LOCATION_TYPE.QUARANTINE, LOCATION_TYPE.RESERVE]\n })\n\n let inventories: Inventory[] = await qb.getMany()\n\n let defaultProductDetail: ProductDetail = product.productDetails.find(productDetail => productDetail.isDefault)\n let inventoryTotalQty: number = 0\n let inventoryTotalLockedQty: number = 0\n\n if (inventories?.length > 0) {\n const sellercraftInvs: any[] = await Promise.all(\n inventories.map(async (inventory: Inventory) => {\n const inventoryPackingType: string = inventory.packingType\n\n let packingSize: number = 1\n if (inventoryPackingType !== defaultProductDetail.packingType) {\n const unmatchingProductDetail: ProductDetail = product.productDetails.find(\n productDetail => productDetail.packingType === inventoryPackingType\n )\n\n packingSize = await this.getChildPackingSize(productDetails, defaultProductDetail, unmatchingProductDetail)\n }\n\n return { totalQty: inventory.qty * packingSize, totalLockedQty: inventory.lockedQty * packingSize }\n })\n )\n\n inventoryTotalQty = sellercraftInvs.reduce((total, currentValue) => {\n total += currentValue.totalQty\n return total\n }, 0)\n\n inventoryTotalLockedQty = sellercraftInvs.reduce((total, currentValue) => {\n total += currentValue.totalLockedQty\n return total\n }, 0)\n }\n\n const sellercraftInv: any[] = [\n {\n sku: product.sku,\n gtin: defaultProductDetail.gtin,\n stock: {\n quantity_total: inventoryTotalQty,\n quantity_reserved: inventoryTotalLockedQty,\n unit_of_measure: 'EA'\n },\n package_weight_gm: defaultProductDetail.nettWeight < 1 ? 1 : defaultProductDetail.nettWeight,\n package_dimensions: {\n length_mm: defaultProductDetail.depth < 1 ? 1 : defaultProductDetail.depth,\n width_mm: defaultProductDetail.width < 1 ? 1 : defaultProductDetail.width,\n height_mm: defaultProductDetail.height < 1 ? 1 : defaultProductDetail.height\n }\n }\n ]\n\n await SellercraftAPI.updateProduct(sellercraft, {\n context: { state: { domain: this?.domain, user: this?.user } },\n accountId: sellercraft.accountId,\n sellercraftInv\n })\n }\n}\n"]}
|
|
@@ -1,19 +1,6 @@
|
|
|
1
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
18
|
-
__exportStar(require("./
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./ecommerce"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./warehouse-controller"), exports);
|
|
19
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/controllers/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/controllers/index.ts"],"names":[],"mappings":";;;AAAA,sDAA2B;AAC3B,iEAAsC","sourcesContent":["export * from './ecommerce'\nexport * from './warehouse-controller'\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"warehouse-controller.js","sourceRoot":"","sources":["../../server/controllers/warehouse-controller.ts"],"names":[],"mappings":";;;AAEA,yDAAsD;AACtD,uDAAmE;AACnE,+DAA+D;AAgB/D,MAAa,mBAAmB;IAgC9B,YAAY,MAAqB,EAAE,MAAc,EAAE,IAAU;QA/B7C,cAAS,GAAG;YAC1B,IAAI,EAAE;gBACJ,SAAS,EAAE,CAAC,SAAc,EAAE,EAAE,CAAC,6CAA6C,SAAS,EAAE;gBACvF,eAAe,EAAE,CAAC,SAAc,EAAE,EAAE,CAAC,kDAAkD,SAAS,EAAE;gB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BAAzB,yBAAyB,CAAE,kBAAkB,CAAC,CAAA;gBACzE,gBAAgB,GAAG,OAAO,CAAC,oBAAoB,CAAC,EAAE,KAAK,yBAAyB,CAAC,EAAE,CAAC,CAAA;aACrF;iBAAM,IAAI,CAAC,gBAAgB,IAAI,CAAC,gBAAgB,EAAE;gBACjD,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC,CAAA;aAC7E;SACF;QAED,OAAO,WAAW,CAAA;IACpB,CAAC;IAED;;;;;OAKG;IACH,QAAQ,CAAC,MAA2B;QAClC,IAAI,CAAC,MAAM,CAAC,MAAM;YAAE,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;QAC/C,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO;YAAE,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,IAAI,CAAA;QAC7D,IAAI,CAAC,MAAM,CAAC,OAAO;YAAE,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,IAAI,CAAA;QAE/C,OAAO,MAAM,CAAA;IACf,CAAC;IAED,cAAc,CAAC,MAA2B;QACxC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,GAAW,EAAE,EAAE;YAC1C,IAAI,MAAM,CAAC,GAAG,CAAC,KAAK,IAAI,IAAI,MAAM,CAAC,GAAG,CAAC,YAAY,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;gBAAE,OAAO,MAAM,CAAC,GAAG,CAAC,CAAA;QAC3G,CAAC,CAAC,CAAA;QAEF,OAAO,MAAM,CAAA;IACf,CAAC;CACF;AA3JD,kDA2JC","sourcesContent":["import { EntityManager } from 'typeorm'\n\nimport { Role, User } from '@things-factory/auth-base'\nimport { Bizplace, getDomainUsers } from '@things-factory/biz-base'\nimport { sendNotification } from '@things-factory/notification'\nimport { ProductDetail } from '@things-factory/product-base'\nimport { Domain } from '@things-factory/shell'\n\nexport interface BasicInterface {\n domain: Domain\n user: User\n}\n\nexport type NotificationMsgInterface = {\n title: string\n body: string\n url: string\n data: any\n}\n\nexport class WarehouseController {\n public readonly ERROR_MSG = {\n FIND: {\n NO_RESULT: (condition: any) => `There's no results matched with condition ${condition}`,\n NO_CHILD_RESULT: (condition: any) => `There's no child result matched with condition ${condition}`,\n NOT_MATCH: (source: any, target: any) => `Unable to find matching ${target} using ${source}`\n },\n CREATE: {\n ID_EXISTS: 'Target has ID already',\n EMPTY_CREATOR: 'Cannot create without creator',\n EMPTY_UPDATER: 'Cannot create without updater'\n },\n UPDATE: {\n ID_NOT_EXISTS: `Target doesn't have ID`,\n EMPTY_UPDATER: 'Cannot update without updater'\n },\n VALIDITY: {\n UNEXPECTED_FIELD_VALUE: (field: string, expectedValue: any, actualValue: any) =>\n `Expected ${field} value is ${expectedValue} but got ${actualValue}`,\n DUPLICATED: (field: string, value: any) => `There is duplicated ${field} value (${value})`,\n CANT_PROCEED_STEP_BY: (step: string, reason: string) => `Can't proceed to ${step} it because ${reason}`\n }\n }\n\n private readonly ROLE_NAMES: Record<string, string> = {\n OFFICE_ADMIN: 'Office Admin'\n }\n\n protected trxMgr: EntityManager\n protected domain: Domain\n protected user: User\n\n constructor(trxMgr: EntityManager, domain: Domain, user: User) {\n this.trxMgr = trxMgr\n this.domain = domain\n this.user = user\n }\n\n /**\n * @summary Notify to passed users\n * @description Passed notification message will be sent to passed users\n */\n async notifyToUsers(users: User[], message: NotificationMsgInterface): Promise<void> {\n const receivers: any[] = users.map(user => user.id)\n await sendNotification({\n receivers,\n message\n })\n }\n\n /**\n * @summary Notify to office admin\n * @description Passed notification message will be sent to office admin of current domain\n * default role name is defiend as ROLE_NAME.OFFICE_ADMIn by default\n * You can change role name by passing roleName as parameter\n */\n async notifyToOfficeAdmin(message: NotificationMsgInterface, roleName?: string): Promise<void> {\n const users: User[] = await this.trxMgr\n .getRepository('users_roles')\n .createQueryBuilder('ur')\n .select('ur.users_id', 'id')\n .where(qb => {\n const subQuery = qb\n .subQuery()\n .select('role.id')\n .from(Role, 'role')\n .where('role.name = :roleName', { roleName: roleName || this.ROLE_NAMES.OFFICE_ADMIN })\n .andWhere('role.domain_id = :domainId', { domainId: this.domain.id })\n .getQuery()\n return 'ur.roles_id IN ' + subQuery\n })\n .getRawMany()\n\n this.notifyToUsers(users, message)\n }\n\n /**\n * @summary Notify to customer of passed bizplace\n * @description Passed notification message will be sent to customer of passed bizplace\n */\n async notifyToCustomer(bizplace: Bizplace, message: NotificationMsgInterface): Promise<void> {\n const users: any[] = await getDomainUsers(bizplace, this.trxMgr)\n\n this.notifyToUsers(users, message)\n }\n\n async getChildPackingSize(\n productDetails: ProductDetail[],\n defaultProductDetail: ProductDetail,\n unmatchingProductDetail: ProductDetail\n ): Promise<number> {\n let hasChildRelation: boolean = Boolean(unmatchingProductDetail?.childProductDetail)\n let hasMatchingChild: boolean\n let packingSize: number = 1\n let currentChildProductDetail: ProductDetail\n\n if (hasChildRelation) {\n currentChildProductDetail = productDetails.find(\n (productDetail: ProductDetail) => productDetail.id === unmatchingProductDetail.childProductDetail.id\n )\n\n if (!currentChildProductDetail) {\n throw new Error(this.ERROR_MSG.FIND.NOT_MATCH('packing type', `GTIN (${unmatchingProductDetail.gtin})`))\n }\n\n hasMatchingChild = Boolean(defaultProductDetail.id === currentChildProductDetail.id)\n if (hasMatchingChild) {\n packingSize = unmatchingProductDetail.packingSize\n } else {\n packingSize = unmatchingProductDetail.packingSize * packingSize\n }\n } else {\n throw new Error(this.ERROR_MSG.FIND.NO_CHILD_RESULT(`${unmatchingProductDetail.gtin}`))\n }\n\n while (hasChildRelation && !hasMatchingChild) {\n if (hasMatchingChild) {\n packingSize = currentChildProductDetail.packingSize * packingSize // 12 x 10\n } else if (!hasMatchingChild && hasChildRelation) {\n packingSize = currentChildProductDetail.packingSize * packingSize // 12 x 10\n currentChildProductDetail = productDetails.find(\n (productDetail: ProductDetail) => productDetail.id === currentChildProductDetail.childProductDetail.id\n )\n\n hasChildRelation = Boolean(currentChildProductDetail?.childProductDetail)\n hasMatchingChild = Boolean(defaultProductDetail.id === currentChildProductDetail.id)\n } else if (!hasChildRelation && !hasMatchingChild) {\n throw new Error(this.ERROR_MSG.FIND.NO_RESULT(unmatchingProductDetail.gtin))\n }\n }\n\n return packingSize\n }\n\n /**\n * @summary set common stamp like domain, creator, updater\n * @description Set common stamp to passed record\n * If it doesn't have id it will handle it as creating one\n * If it has id it will handle it as updating one\n */\n setStamp(record: Record<string, any>): Record<string, any> {\n if (!record.domain) record.domain = this.domain\n if (!record.id && !record.creator) record.creator = this.user\n if (!record.updater) record.updater = this.user\n\n return record\n }\n\n tidyConditions(record: Record<string, any>): Record<string, any> {\n Object.keys(record).forEach((key: string) => {\n if (record[key] === null || record[key] instanceof Date || Array.isArray(record[key])) delete record[key]\n })\n\n return record\n }\n}\n"]}
|
package/dist-server/index.js
CHANGED
|
@@ -1,21 +1,8 @@
|
|
|
1
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
3
|
exports.approveInventoryChanges = exports.updateWarehouse = exports.deleteWarehouses = exports.deleteWarehouse = exports.createWarehouse = exports.updateLocation = exports.deleteLocations = exports.deleteLocation = exports.createLocation = void 0;
|
|
18
|
-
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
tslib_1.__exportStar(require("./constants"), exports);
|
|
19
6
|
var location_mutation_1 = require("./service/location/location-mutation");
|
|
20
7
|
Object.defineProperty(exports, "createLocation", { enumerable: true, get: function () { return location_mutation_1.createLocation; } });
|
|
21
8
|
Object.defineProperty(exports, "deleteLocation", { enumerable: true, get: function () { return location_mutation_1.deleteLocation; } });
|
|
@@ -26,10 +13,10 @@ Object.defineProperty(exports, "createWarehouse", { enumerable: true, get: funct
|
|
|
26
13
|
Object.defineProperty(exports, "deleteWarehouse", { enumerable: true, get: function () { return warehouse_mutation_1.deleteWarehouse; } });
|
|
27
14
|
Object.defineProperty(exports, "deleteWarehouses", { enumerable: true, get: function () { return warehouse_mutation_1.deleteWarehouses; } });
|
|
28
15
|
Object.defineProperty(exports, "updateWarehouse", { enumerable: true, get: function () { return warehouse_mutation_1.updateWarehouse; } });
|
|
29
|
-
__exportStar(require("./migrations"), exports);
|
|
30
|
-
__exportStar(require("./utils"), exports);
|
|
31
|
-
__exportStar(require("./service"), exports);
|
|
32
|
-
__exportStar(require("./service/inventory/inventory-query"), exports);
|
|
16
|
+
tslib_1.__exportStar(require("./migrations"), exports);
|
|
17
|
+
tslib_1.__exportStar(require("./utils"), exports);
|
|
18
|
+
tslib_1.__exportStar(require("./service"), exports);
|
|
19
|
+
tslib_1.__exportStar(require("./service/inventory/inventory-query"), exports);
|
|
33
20
|
var inventory_change_mutation_1 = require("./service/inventory-change/inventory-change-mutation");
|
|
34
21
|
Object.defineProperty(exports, "approveInventoryChanges", { enumerable: true, get: function () { return inventory_change_mutation_1.approveInventoryChanges; } });
|
|
35
22
|
//# sourceMappingURL=index.js.map
|
package/dist-server/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../server/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../server/index.ts"],"names":[],"mappings":";;;;AAAA,sDAA2B;AAC3B,0EAAsH;AAA7G,mHAAA,cAAc,OAAA;AAAE,mHAAA,cAAc,OAAA;AAAE,oHAAA,eAAe,OAAA;AAAE,mHAAA,cAAc,OAAA;AACxE,6EAK+C;AAJ7C,qHAAA,eAAe,OAAA;AACf,qHAAA,eAAe,OAAA;AACf,sHAAA,gBAAgB,OAAA;AAChB,qHAAA,eAAe,OAAA;AAEjB,uDAA4B;AAC5B,kDAAuB;AACvB,oDAAyB;AACzB,8EAAmD;AAEnD,kGAA8F;AAArF,oIAAA,uBAAuB,OAAA","sourcesContent":["export * from './constants'\nexport { createLocation, deleteLocation, deleteLocations, updateLocation } from './service/location/location-mutation'\nexport {\n createWarehouse,\n deleteWarehouse,\n deleteWarehouses,\n updateWarehouse\n} from './service/warehouse/warehouse-mutation'\nexport * from './migrations'\nexport * from './utils'\nexport * from './service'\nexport * from './service/inventory/inventory-query'\n\nexport { approveInventoryChanges } from './service/inventory-change/inventory-change-mutation'\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/middlewares/index.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/middlewares/index.ts"],"names":[],"mappings":"","sourcesContent":[""]}
|
|
@@ -1 +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"}
|
|
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","sourcesContent":["const glob = require('glob')\nconst path = require('path')\n\nexport var migrations = []\n\nglob.sync(path.resolve(__dirname, '.', '**', '*.js')).forEach(function(file) {\n if (file.indexOf('index.js') !== -1) return\n migrations = migrations.concat(Object.values(require(path.resolve(file))) || [])\n})\n"]}
|
|
@@ -1,20 +1,7 @@
|
|
|
1
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
3
|
exports.schema = exports.entities = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
18
5
|
const inventory_1 = require("./inventory");
|
|
19
6
|
const inventory_change_1 = require("./inventory-change");
|
|
20
7
|
const inventory_history_1 = require("./inventory-history");
|
|
@@ -29,34 +16,34 @@ const reduced_inventory_history_1 = require("./reduced-inventory-history");
|
|
|
29
16
|
const warehouse_1 = require("./warehouse");
|
|
30
17
|
const tote_1 = require("./tote");
|
|
31
18
|
/* EXPORT ENTITY TYPES */
|
|
32
|
-
__exportStar(require("./inventory-item-change/inventory-item-change"), exports);
|
|
33
|
-
__exportStar(require("./inventory-item/inventory-item"), exports);
|
|
34
|
-
__exportStar(require("./inventory-item-change/inventory-item-change"), exports);
|
|
35
|
-
__exportStar(require("./inventory/inventory"), exports);
|
|
36
|
-
__exportStar(require("./inventory-change/inventory-change"), exports);
|
|
37
|
-
__exportStar(require("./inventory-history/inventory-history"), exports);
|
|
38
|
-
__exportStar(require("./location/location"), exports);
|
|
39
|
-
__exportStar(require("./movement/movement"), exports);
|
|
40
|
-
__exportStar(require("./pallet/pallet"), exports);
|
|
41
|
-
__exportStar(require("./pallet-count/pallet-count"), exports);
|
|
42
|
-
__exportStar(require("./pallet-history/pallet-history"), exports);
|
|
43
|
-
__exportStar(require("./warehouse/warehouse"), exports);
|
|
44
|
-
__exportStar(require("./reduced-inventory-history/reduced-inventory-history"), exports);
|
|
45
|
-
__exportStar(require("./tote/tote"), exports);
|
|
19
|
+
tslib_1.__exportStar(require("./inventory-item-change/inventory-item-change"), exports);
|
|
20
|
+
tslib_1.__exportStar(require("./inventory-item/inventory-item"), exports);
|
|
21
|
+
tslib_1.__exportStar(require("./inventory-item-change/inventory-item-change"), exports);
|
|
22
|
+
tslib_1.__exportStar(require("./inventory/inventory"), exports);
|
|
23
|
+
tslib_1.__exportStar(require("./inventory-change/inventory-change"), exports);
|
|
24
|
+
tslib_1.__exportStar(require("./inventory-history/inventory-history"), exports);
|
|
25
|
+
tslib_1.__exportStar(require("./location/location"), exports);
|
|
26
|
+
tslib_1.__exportStar(require("./movement/movement"), exports);
|
|
27
|
+
tslib_1.__exportStar(require("./pallet/pallet"), exports);
|
|
28
|
+
tslib_1.__exportStar(require("./pallet-count/pallet-count"), exports);
|
|
29
|
+
tslib_1.__exportStar(require("./pallet-history/pallet-history"), exports);
|
|
30
|
+
tslib_1.__exportStar(require("./warehouse/warehouse"), exports);
|
|
31
|
+
tslib_1.__exportStar(require("./reduced-inventory-history/reduced-inventory-history"), exports);
|
|
32
|
+
tslib_1.__exportStar(require("./tote/tote"), exports);
|
|
46
33
|
/* EXPORT TYPES */
|
|
47
|
-
__exportStar(require("./inventory/inventory-types"), exports);
|
|
48
|
-
__exportStar(require("./inventory/inventory-types"), exports);
|
|
49
|
-
__exportStar(require("./inventory-item/inventory-item"), exports);
|
|
50
|
-
__exportStar(require("./inventory-item-change/inventory-item-change"), exports);
|
|
51
|
-
__exportStar(require("./inventory-change/inventory-change-types"), exports);
|
|
52
|
-
__exportStar(require("./inventory-history/inventory-history-types"), exports);
|
|
53
|
-
__exportStar(require("./location/location-types"), exports);
|
|
54
|
-
__exportStar(require("./movement/movement-types"), exports);
|
|
55
|
-
__exportStar(require("./pallet/pallet-types"), exports);
|
|
56
|
-
__exportStar(require("./pallet-count/pallet-count-types"), exports);
|
|
57
|
-
__exportStar(require("./pallet-history/pallet-history-types"), exports);
|
|
58
|
-
__exportStar(require("./warehouse/warehouse-types"), exports);
|
|
59
|
-
__exportStar(require("./tote/tote-types"), exports);
|
|
34
|
+
tslib_1.__exportStar(require("./inventory/inventory-types"), exports);
|
|
35
|
+
tslib_1.__exportStar(require("./inventory/inventory-types"), exports);
|
|
36
|
+
tslib_1.__exportStar(require("./inventory-item/inventory-item"), exports);
|
|
37
|
+
tslib_1.__exportStar(require("./inventory-item-change/inventory-item-change"), exports);
|
|
38
|
+
tslib_1.__exportStar(require("./inventory-change/inventory-change-types"), exports);
|
|
39
|
+
tslib_1.__exportStar(require("./inventory-history/inventory-history-types"), exports);
|
|
40
|
+
tslib_1.__exportStar(require("./location/location-types"), exports);
|
|
41
|
+
tslib_1.__exportStar(require("./movement/movement-types"), exports);
|
|
42
|
+
tslib_1.__exportStar(require("./pallet/pallet-types"), exports);
|
|
43
|
+
tslib_1.__exportStar(require("./pallet-count/pallet-count-types"), exports);
|
|
44
|
+
tslib_1.__exportStar(require("./pallet-history/pallet-history-types"), exports);
|
|
45
|
+
tslib_1.__exportStar(require("./warehouse/warehouse-types"), exports);
|
|
46
|
+
tslib_1.__exportStar(require("./tote/tote-types"), exports);
|
|
60
47
|
exports.entities = [
|
|
61
48
|
...inventory_1.entities,
|
|
62
49
|
...inventory_change_1.entities,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":";;;;AAAA,2CAA4F;AAC5F,yDAA+G;AAC/G,2DAAkH;AAClH,qDAAyG;AACzG,mEAGgC;AAChC,yCAAyF;AACzF,yCAAyF;AACzF,qCAAmF;AACnF,iDAAmG;AACnG,qDAAyG;AACzG,2EAAyF;AACzF,2CAA4F;AAC5F,iCAA6E;AAE7E,yBAAyB;AACzB,wFAA6D;AAC7D,0EAA+C;AAC/C,wFAA6D;AAC7D,gEAAqC;AACrC,8EAAmD;AACnD,gFAAqD;AACrD,8DAAmC;AACnC,8DAAmC;AACnC,0DAA+B;AAC/B,sEAA2C;AAC3C,0EAA+C;AAC/C,gEAAqC;AACrC,gGAAqE;AACrE,sDAA2B;AAE3B,kBAAkB;AAClB,sEAA2C;AAC3C,sEAA2C;AAC3C,0EAA+C;AAC/C,wFAA6D;AAC7D,oFAAyD;AACzD,sFAA2D;AAC3D,oEAAyC;AACzC,oEAAyC;AACzC,gEAAqC;AACrC,4EAAiD;AACjD,gFAAqD;AACrD,sEAA2C;AAC3C,4DAAiC;AAEpB,QAAA,QAAQ,GAAG;IACtB,GAAG,oBAAiB;IACpB,GAAG,2BAAuB;IAC1B,GAAG,4BAAwB;IAC3B,GAAG,yBAAqB;IACxB,GAAG,gCAA2B;IAC9B,GAAG,mBAAgB;IACnB,GAAG,mBAAgB;IACnB,GAAG,iBAAc;IACjB,GAAG,uBAAmB;IACtB,GAAG,yBAAqB;IACxB,GAAG,oBAAiB;IACpB,GAAG,oCAA+B;IAClC,GAAG,eAAY;CAChB,CAAA;AAEY,QAAA,MAAM,GAAG;IACpB,eAAe,EAAE;QACf,GAAG,qBAAkB;QACrB,GAAG,4BAAwB;QAC3B,GAAG,6BAAyB;QAC5B,GAAG,0BAAsB;QACzB,GAAG,iCAA4B;QAC/B,GAAG,oBAAiB;QACpB,GAAG,oBAAiB;QACpB,GAAG,kBAAe;QAClB,GAAG,wBAAoB;QACvB,GAAG,0BAAsB;QACzB,GAAG,qBAAkB;QACrB,GAAG,gBAAa;KACjB;CACF,CAAA","sourcesContent":["import { entities as InventoryEntities, resolvers as InventoryResolvers } from './inventory'\nimport { entities as InventoryChangeEntities, resolvers as InventoryChangeResolvers } from './inventory-change'\nimport { entities as InventoryHistoryEntities, resolvers as InventoryHistoryResvolers } from './inventory-history'\nimport { entities as InventoryItemEntities, resolvers as InventoryItemResolvers } from './inventory-item'\nimport {\n entities as InventoryItemChangeEntities,\n resolvers as InventoryItemChangeResolvers\n} from './inventory-item-change'\nimport { entities as LocationEntities, resolvers as LocationResolvers } from './location'\nimport { entities as MovementEntities, resolvers as MovementResolvers } from './movement'\nimport { entities as PalletEntities, resolvers as PalletResolvers } from './pallet'\nimport { entities as PalletCountEntities, resolvers as PalletCountResolvers } from './pallet-count'\nimport { entities as PalletHistoryEntities, resolvers as PalletHistoryResolvers } from './pallet-history'\nimport { entities as ReducedInventoryHistoryEntities } from './reduced-inventory-history'\nimport { entities as WarehouseEntities, resolvers as WarehouseResolvers } from './warehouse'\nimport { entities as ToteEntities, resolvers as ToteResolvers } from './tote'\n\n/* EXPORT ENTITY TYPES */\nexport * from './inventory-item-change/inventory-item-change'\nexport * from './inventory-item/inventory-item'\nexport * from './inventory-item-change/inventory-item-change'\nexport * from './inventory/inventory'\nexport * from './inventory-change/inventory-change'\nexport * from './inventory-history/inventory-history'\nexport * from './location/location'\nexport * from './movement/movement'\nexport * from './pallet/pallet'\nexport * from './pallet-count/pallet-count'\nexport * from './pallet-history/pallet-history'\nexport * from './warehouse/warehouse'\nexport * from './reduced-inventory-history/reduced-inventory-history'\nexport * from './tote/tote'\n\n/* EXPORT TYPES */\nexport * from './inventory/inventory-types'\nexport * from './inventory/inventory-types'\nexport * from './inventory-item/inventory-item'\nexport * from './inventory-item-change/inventory-item-change'\nexport * from './inventory-change/inventory-change-types'\nexport * from './inventory-history/inventory-history-types'\nexport * from './location/location-types'\nexport * from './movement/movement-types'\nexport * from './pallet/pallet-types'\nexport * from './pallet-count/pallet-count-types'\nexport * from './pallet-history/pallet-history-types'\nexport * from './warehouse/warehouse-types'\nexport * from './tote/tote-types'\n\nexport const entities = [\n ...InventoryEntities,\n ...InventoryChangeEntities,\n ...InventoryHistoryEntities,\n ...InventoryItemEntities,\n ...InventoryItemChangeEntities,\n ...LocationEntities,\n ...MovementEntities,\n ...PalletEntities,\n ...PalletCountEntities,\n ...PalletHistoryEntities,\n ...WarehouseEntities,\n ...ReducedInventoryHistoryEntities,\n ...ToteEntities\n]\n\nexport const schema = {\n resolverClasses: [\n ...InventoryResolvers,\n ...InventoryChangeResolvers,\n ...InventoryHistoryResvolers,\n ...InventoryItemResolvers,\n ...InventoryItemChangeResolvers,\n ...LocationResolvers,\n ...MovementResolvers,\n ...PalletResolvers,\n ...PalletCountResolvers,\n ...PalletHistoryResolvers,\n ...WarehouseResolvers,\n ...ToteResolvers\n ]\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/inventory/index.ts"],"names":[],"mappings":";;;AAAA,2CAAuC;AACvC,6DAAwD;AACxD,uDAAkD;AAErC,QAAA,QAAQ,GAAG,CAAC,qBAAS,CAAC,CAAA;AACtB,QAAA,SAAS,GAAG,CAAC,gCAAc,EAAE,sCAAiB,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/inventory/index.ts"],"names":[],"mappings":";;;AAAA,2CAAuC;AACvC,6DAAwD;AACxD,uDAAkD;AAErC,QAAA,QAAQ,GAAG,CAAC,qBAAS,CAAC,CAAA;AACtB,QAAA,SAAS,GAAG,CAAC,gCAAc,EAAE,sCAAiB,CAAC,CAAA","sourcesContent":["import { Inventory } from './inventory'\nimport { InventoryMutation } from './inventory-mutation'\nimport { InventoryQuery } from './inventory-query'\n\nexport const entities = [Inventory]\nexport const resolvers = [InventoryQuery, InventoryMutation]\n"]}
|
|
@@ -1,18 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
3
|
exports.InventoryMutation = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
16
5
|
const type_graphql_1 = require("type-graphql");
|
|
17
6
|
const typeorm_1 = require("typeorm");
|
|
18
7
|
const biz_base_1 = require("@things-factory/biz-base");
|
|
@@ -308,83 +297,83 @@ let InventoryMutation = class InventoryMutation {
|
|
|
308
297
|
return true;
|
|
309
298
|
}
|
|
310
299
|
};
|
|
311
|
-
__decorate([
|
|
300
|
+
tslib_1.__decorate([
|
|
312
301
|
(0, type_graphql_1.Directive)('@privilege(category: "inventory", privilege: "mutation")'),
|
|
313
302
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
314
303
|
(0, type_graphql_1.Mutation)(returns => inventory_1.Inventory),
|
|
315
|
-
__param(0, (0, type_graphql_1.Arg)('inventory')),
|
|
316
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
317
|
-
__metadata("design:type", Function),
|
|
318
|
-
__metadata("design:paramtypes", [inventory_types_1.NewInventory, Object]),
|
|
319
|
-
__metadata("design:returntype", Promise)
|
|
304
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('inventory')),
|
|
305
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
306
|
+
tslib_1.__metadata("design:type", Function),
|
|
307
|
+
tslib_1.__metadata("design:paramtypes", [inventory_types_1.NewInventory, Object]),
|
|
308
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
320
309
|
], InventoryMutation.prototype, "createInventory", null);
|
|
321
|
-
__decorate([
|
|
310
|
+
tslib_1.__decorate([
|
|
322
311
|
(0, type_graphql_1.Directive)('@privilege(category: "inventory", privilege: "mutation")'),
|
|
323
312
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
324
313
|
(0, type_graphql_1.Mutation)(returns => inventory_1.Inventory),
|
|
325
|
-
__param(0, (0, type_graphql_1.Arg)('patch')),
|
|
326
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
327
|
-
__metadata("design:type", Function),
|
|
328
|
-
__metadata("design:paramtypes", [inventory_types_1.InventoryPatch, Object]),
|
|
329
|
-
__metadata("design:returntype", Promise)
|
|
314
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('patch')),
|
|
315
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
316
|
+
tslib_1.__metadata("design:type", Function),
|
|
317
|
+
tslib_1.__metadata("design:paramtypes", [inventory_types_1.InventoryPatch, Object]),
|
|
318
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
330
319
|
], InventoryMutation.prototype, "updateInventory", null);
|
|
331
|
-
__decorate([
|
|
320
|
+
tslib_1.__decorate([
|
|
332
321
|
(0, type_graphql_1.Directive)('@privilege(category: "inventory", privilege: "mutation")'),
|
|
333
322
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
334
323
|
(0, type_graphql_1.Mutation)(returns => inventory_1.Inventory),
|
|
335
|
-
__param(0, (0, type_graphql_1.Arg)('id')),
|
|
336
|
-
__param(1, (0, type_graphql_1.Arg)('remark')),
|
|
337
|
-
__param(2, (0, type_graphql_1.Ctx)()),
|
|
338
|
-
__metadata("design:type", Function),
|
|
339
|
-
__metadata("design:paramtypes", [String, String, Object]),
|
|
340
|
-
__metadata("design:returntype", Promise)
|
|
324
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
325
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('remark')),
|
|
326
|
+
tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
|
|
327
|
+
tslib_1.__metadata("design:type", Function),
|
|
328
|
+
tslib_1.__metadata("design:paramtypes", [String, String, Object]),
|
|
329
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
341
330
|
], InventoryMutation.prototype, "updateInventoryRemark", null);
|
|
342
|
-
__decorate([
|
|
331
|
+
tslib_1.__decorate([
|
|
343
332
|
(0, type_graphql_1.Directive)('@privilege(category: "inventory", privilege: "mutation")'),
|
|
344
333
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
345
334
|
(0, type_graphql_1.Mutation)(returns => Boolean),
|
|
346
|
-
__param(0, (0, type_graphql_1.Arg)('name')),
|
|
347
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
348
|
-
__metadata("design:type", Function),
|
|
349
|
-
__metadata("design:paramtypes", [String, Object]),
|
|
350
|
-
__metadata("design:returntype", Promise)
|
|
335
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('name')),
|
|
336
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
337
|
+
tslib_1.__metadata("design:type", Function),
|
|
338
|
+
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
339
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
351
340
|
], InventoryMutation.prototype, "deleteInventory", null);
|
|
352
|
-
__decorate([
|
|
341
|
+
tslib_1.__decorate([
|
|
353
342
|
(0, type_graphql_1.Directive)('@privilege(category: "inventory", privilege: "mutation")'),
|
|
354
343
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
355
344
|
(0, type_graphql_1.Mutation)(returns => [inventory_1.Inventory]),
|
|
356
|
-
__param(0, (0, type_graphql_1.Arg)('patches', type => [inventory_types_1.InventoryPatch])),
|
|
357
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
358
|
-
__metadata("design:type", Function),
|
|
359
|
-
__metadata("design:paramtypes", [Array, Object]),
|
|
360
|
-
__metadata("design:returntype", Promise)
|
|
345
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [inventory_types_1.InventoryPatch])),
|
|
346
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
347
|
+
tslib_1.__metadata("design:type", Function),
|
|
348
|
+
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
349
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
361
350
|
], InventoryMutation.prototype, "updateMultipleInventory", null);
|
|
362
|
-
__decorate([
|
|
351
|
+
tslib_1.__decorate([
|
|
363
352
|
(0, type_graphql_1.Directive)('@privilege(category: "inventory", privilege: "mutation")'),
|
|
364
353
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
365
354
|
(0, type_graphql_1.Mutation)(returns => Boolean),
|
|
366
|
-
__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
|
|
367
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
368
|
-
__metadata("design:type", Function),
|
|
369
|
-
__metadata("design:paramtypes", [Array, Object]),
|
|
370
|
-
__metadata("design:returntype", Promise)
|
|
355
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
|
|
356
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
357
|
+
tslib_1.__metadata("design:type", Function),
|
|
358
|
+
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
359
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
371
360
|
], InventoryMutation.prototype, "deleteInventories", null);
|
|
372
|
-
__decorate([
|
|
361
|
+
tslib_1.__decorate([
|
|
373
362
|
(0, type_graphql_1.Directive)('@privilege(category: "inventory", privilege: "mutation")'),
|
|
374
363
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
375
364
|
(0, type_graphql_1.Mutation)(returns => Boolean),
|
|
376
|
-
__param(0, (0, type_graphql_1.Arg)('originPalletId')),
|
|
377
|
-
__param(1, (0, type_graphql_1.Arg)('palletId', { nullable: true })),
|
|
378
|
-
__param(2, (0, type_graphql_1.Arg)('cartonId', { nullable: true })),
|
|
379
|
-
__param(3, (0, type_graphql_1.Arg)('fromLocationName')),
|
|
380
|
-
__param(4, (0, type_graphql_1.Arg)('toLocationName')),
|
|
381
|
-
__param(5, (0, type_graphql_1.Arg)('qty')),
|
|
382
|
-
__param(6, (0, type_graphql_1.Ctx)()),
|
|
383
|
-
__metadata("design:type", Function),
|
|
384
|
-
__metadata("design:paramtypes", [String, String, String, String, String, Number, Object]),
|
|
385
|
-
__metadata("design:returntype", Promise)
|
|
365
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('originPalletId')),
|
|
366
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('palletId', { nullable: true })),
|
|
367
|
+
tslib_1.__param(2, (0, type_graphql_1.Arg)('cartonId', { nullable: true })),
|
|
368
|
+
tslib_1.__param(3, (0, type_graphql_1.Arg)('fromLocationName')),
|
|
369
|
+
tslib_1.__param(4, (0, type_graphql_1.Arg)('toLocationName')),
|
|
370
|
+
tslib_1.__param(5, (0, type_graphql_1.Arg)('qty')),
|
|
371
|
+
tslib_1.__param(6, (0, type_graphql_1.Ctx)()),
|
|
372
|
+
tslib_1.__metadata("design:type", Function),
|
|
373
|
+
tslib_1.__metadata("design:paramtypes", [String, String, String, String, String, Number, Object]),
|
|
374
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
386
375
|
], InventoryMutation.prototype, "inventoryTransfer", null);
|
|
387
|
-
InventoryMutation = __decorate([
|
|
376
|
+
InventoryMutation = tslib_1.__decorate([
|
|
388
377
|
(0, type_graphql_1.Resolver)(inventory_1.Inventory)
|
|
389
378
|
], InventoryMutation);
|
|
390
379
|
exports.InventoryMutation = InventoryMutation;
|