@things-factory/warehouse-base 7.0.0-alpha.9 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/bootstrap.js +1 -1
- package/dist-server/constants/index.d.ts +5 -0
- package/dist-server/constants/inventory.d.ts +63 -0
- package/dist-server/constants/location.d.ts +13 -0
- package/dist-server/constants/pallet.d.ts +9 -0
- package/dist-server/constants/rule-type.d.ts +5 -0
- package/dist-server/constants/tote.d.ts +5 -0
- package/dist-server/controllers/ecommerce/ecommerce-controller.d.ts +6 -0
- package/dist-server/controllers/ecommerce/ecommerce-controller.js.map +1 -1
- package/dist-server/controllers/ecommerce/index.d.ts +2 -0
- package/dist-server/controllers/ecommerce/sellercraft-controller.d.ts +6 -0
- package/dist-server/controllers/ecommerce/sellercraft-controller.js.map +1 -1
- package/dist-server/controllers/index.d.ts +2 -0
- package/dist-server/controllers/warehouse-controller.d.ts +69 -0
- package/dist-server/controllers/warehouse-controller.js.map +1 -1
- package/dist-server/index.d.ts +9 -0
- package/dist-server/index.js +3 -1
- package/dist-server/index.js.map +1 -1
- package/dist-server/middlewares/index.d.ts +0 -0
- package/dist-server/migrations/index.d.ts +1 -0
- package/dist-server/service/index.d.ts +31 -0
- package/dist-server/service/inventory/index.d.ts +5 -0
- package/dist-server/service/inventory/inventory-mutation.d.ts +12 -0
- package/dist-server/service/inventory/inventory-mutation.js +141 -137
- package/dist-server/service/inventory/inventory-mutation.js.map +1 -1
- package/dist-server/service/inventory/inventory-query.d.ts +138 -0
- package/dist-server/service/inventory/inventory-query.js +23 -9
- package/dist-server/service/inventory/inventory-query.js.map +1 -1
- package/dist-server/service/inventory/inventory-types.d.ts +125 -0
- package/dist-server/service/inventory/inventory-types.js +18 -10
- package/dist-server/service/inventory/inventory-types.js.map +1 -1
- package/dist-server/service/inventory/inventory.d.ts +107 -0
- package/dist-server/service/inventory/inventory.js +27 -20
- package/dist-server/service/inventory/inventory.js.map +1 -1
- package/dist-server/service/inventory-change/index.d.ts +5 -0
- package/dist-server/service/inventory-change/inventory-change-mutation.d.ts +17 -0
- package/dist-server/service/inventory-change/inventory-change-mutation.js +17 -42
- package/dist-server/service/inventory-change/inventory-change-mutation.js.map +1 -1
- package/dist-server/service/inventory-change/inventory-change-query.d.ts +11 -0
- package/dist-server/service/inventory-change/inventory-change-query.js +3 -3
- package/dist-server/service/inventory-change/inventory-change-query.js.map +1 -1
- package/dist-server/service/inventory-change/inventory-change-types.d.ts +15 -0
- package/dist-server/service/inventory-change/inventory-change-types.js +6 -6
- package/dist-server/service/inventory-change/inventory-change-types.js.map +1 -1
- package/dist-server/service/inventory-change/inventory-change.d.ts +46 -0
- package/dist-server/service/inventory-change/inventory-change.js +11 -12
- package/dist-server/service/inventory-change/inventory-change.js.map +1 -1
- package/dist-server/service/inventory-history/index.d.ts +5 -0
- package/dist-server/service/inventory-history/inventory-history-mutation.d.ts +9 -0
- package/dist-server/service/inventory-history/inventory-history-mutation.js +2 -2
- package/dist-server/service/inventory-history/inventory-history-mutation.js.map +1 -1
- package/dist-server/service/inventory-history/inventory-history-query.d.ts +23 -0
- package/dist-server/service/inventory-history/inventory-history-query.js +10 -10
- package/dist-server/service/inventory-history/inventory-history-query.js.map +1 -1
- package/dist-server/service/inventory-history/inventory-history-types.d.ts +162 -0
- package/dist-server/service/inventory-history/inventory-history-types.js +24 -25
- package/dist-server/service/inventory-history/inventory-history-types.js.map +1 -1
- package/dist-server/service/inventory-history/inventory-history.d.ts +54 -0
- package/dist-server/service/inventory-history/inventory-history.js +23 -15
- package/dist-server/service/inventory-history/inventory-history.js.map +1 -1
- package/dist-server/service/inventory-item/index.d.ts +5 -0
- package/dist-server/service/inventory-item/inventory-item-mutation.d.ts +11 -0
- package/dist-server/service/inventory-item/inventory-item-mutation.js +2 -2
- package/dist-server/service/inventory-item/inventory-item-mutation.js.map +1 -1
- package/dist-server/service/inventory-item/inventory-item-query.d.ts +17 -0
- package/dist-server/service/inventory-item/inventory-item-query.js +7 -7
- package/dist-server/service/inventory-item/inventory-item-query.js.map +1 -1
- package/dist-server/service/inventory-item/inventory-item-type.d.ts +28 -0
- package/dist-server/service/inventory-item/inventory-item-type.js +6 -6
- package/dist-server/service/inventory-item/inventory-item-type.js.map +1 -1
- package/dist-server/service/inventory-item/inventory-item.d.ts +27 -0
- package/dist-server/service/inventory-item/inventory-item.js +6 -7
- package/dist-server/service/inventory-item/inventory-item.js.map +1 -1
- package/dist-server/service/inventory-item-change/index.d.ts +5 -0
- package/dist-server/service/inventory-item-change/inventory-item-change-mutation.d.ts +9 -0
- package/dist-server/service/inventory-item-change/inventory-item-change-mutation.js +2 -2
- 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.d.ts +11 -0
- package/dist-server/service/inventory-item-change/inventory-item-change-query.js +3 -3
- 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.d.ts +26 -0
- package/dist-server/service/inventory-item-change/inventory-item-change-type.js +6 -6
- 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.d.ts +23 -0
- package/dist-server/service/inventory-item-change/inventory-item-change.js +5 -5
- package/dist-server/service/inventory-item-change/inventory-item-change.js.map +1 -1
- package/dist-server/service/inventory-product/index.d.ts +5 -0
- package/dist-server/service/inventory-product/inventory-product-mutation.d.ts +9 -0
- package/dist-server/service/inventory-product/inventory-product-mutation.js +2 -2
- package/dist-server/service/inventory-product/inventory-product-mutation.js.map +1 -1
- package/dist-server/service/inventory-product/inventory-product-query.d.ts +11 -0
- package/dist-server/service/inventory-product/inventory-product-query.js +3 -3
- package/dist-server/service/inventory-product/inventory-product-query.js.map +1 -1
- package/dist-server/service/inventory-product/inventory-product-type.d.ts +23 -0
- package/dist-server/service/inventory-product/inventory-product-type.js +6 -6
- package/dist-server/service/inventory-product/inventory-product-type.js.map +1 -1
- package/dist-server/service/inventory-product/inventory-product.d.ts +21 -0
- package/dist-server/service/inventory-product/inventory-product.js +6 -7
- package/dist-server/service/inventory-product/inventory-product.js.map +1 -1
- package/dist-server/service/location/index.d.ts +5 -0
- package/dist-server/service/location/location-mutation.d.ts +14 -0
- package/dist-server/service/location/location-mutation.js +7 -7
- package/dist-server/service/location/location-mutation.js.map +1 -1
- package/dist-server/service/location/location-query.d.ts +24 -0
- package/dist-server/service/location/location-query.js +6 -6
- package/dist-server/service/location/location-query.js.map +1 -1
- package/dist-server/service/location/location-types.d.ts +66 -0
- package/dist-server/service/location/location-types.js +14 -15
- package/dist-server/service/location/location-types.js.map +1 -1
- package/dist-server/service/location/location.d.ts +25 -0
- package/dist-server/service/location/location.js +3 -3
- package/dist-server/service/location/location.js.map +1 -1
- package/dist-server/service/movement/index.d.ts +5 -0
- package/dist-server/service/movement/movement-mutation.d.ts +7 -0
- package/dist-server/service/movement/movement-mutation.js +2 -2
- package/dist-server/service/movement/movement-mutation.js.map +1 -1
- package/dist-server/service/movement/movement-query.d.ts +14 -0
- package/dist-server/service/movement/movement-query.js +5 -5
- package/dist-server/service/movement/movement-query.js.map +1 -1
- package/dist-server/service/movement/movement-types.d.ts +29 -0
- package/dist-server/service/movement/movement-types.js +8 -8
- package/dist-server/service/movement/movement-types.js.map +1 -1
- package/dist-server/service/movement/movement.d.ts +20 -0
- package/dist-server/service/movement/movement.js +6 -7
- package/dist-server/service/movement/movement.js.map +1 -1
- package/dist-server/service/pallet/index.d.ts +5 -0
- package/dist-server/service/pallet/pallet-mutation.d.ts +10 -0
- package/dist-server/service/pallet/pallet-mutation.js +2 -2
- package/dist-server/service/pallet/pallet-mutation.js.map +1 -1
- package/dist-server/service/pallet/pallet-query.d.ts +14 -0
- package/dist-server/service/pallet/pallet-query.js +4 -4
- package/dist-server/service/pallet/pallet-query.js.map +1 -1
- package/dist-server/service/pallet/pallet-types.d.ts +31 -0
- package/dist-server/service/pallet/pallet-types.js +16 -8
- package/dist-server/service/pallet/pallet-types.js.map +1 -1
- package/dist-server/service/pallet/pallet.d.ts +24 -0
- package/dist-server/service/pallet/pallet.js +10 -6
- package/dist-server/service/pallet/pallet.js.map +1 -1
- package/dist-server/service/pallet-count/index.d.ts +5 -0
- package/dist-server/service/pallet-count/pallet-count-mutation.d.ts +10 -0
- package/dist-server/service/pallet-count/pallet-count-mutation.js +2 -2
- package/dist-server/service/pallet-count/pallet-count-mutation.js.map +1 -1
- package/dist-server/service/pallet-count/pallet-count-query.d.ts +11 -0
- package/dist-server/service/pallet-count/pallet-count-query.js +3 -3
- package/dist-server/service/pallet-count/pallet-count-query.js.map +1 -1
- package/dist-server/service/pallet-count/pallet-count-types.d.ts +15 -0
- package/dist-server/service/pallet-count/pallet-count-types.js +6 -6
- package/dist-server/service/pallet-count/pallet-count-types.js.map +1 -1
- package/dist-server/service/pallet-count/pallet-count.d.ts +16 -0
- package/dist-server/service/pallet-count/pallet-count.js +3 -3
- package/dist-server/service/pallet-count/pallet-count.js.map +1 -1
- package/dist-server/service/pallet-history/index.d.ts +5 -0
- package/dist-server/service/pallet-history/pallet-history-mutation.d.ts +9 -0
- package/dist-server/service/pallet-history/pallet-history-mutation.js +2 -2
- package/dist-server/service/pallet-history/pallet-history-mutation.js.map +1 -1
- package/dist-server/service/pallet-history/pallet-history-query.d.ts +11 -0
- package/dist-server/service/pallet-history/pallet-history-query.js +3 -3
- package/dist-server/service/pallet-history/pallet-history-query.js.map +1 -1
- package/dist-server/service/pallet-history/pallet-history-types.d.ts +15 -0
- package/dist-server/service/pallet-history/pallet-history-types.js +6 -6
- package/dist-server/service/pallet-history/pallet-history-types.js.map +1 -1
- package/dist-server/service/pallet-history/pallet-history.d.ts +23 -0
- package/dist-server/service/pallet-history/pallet-history.js +4 -5
- package/dist-server/service/pallet-history/pallet-history.js.map +1 -1
- package/dist-server/service/reduced-inventory-history/index.d.ts +2 -0
- package/dist-server/service/reduced-inventory-history/reduced-inventory-history.d.ts +27 -0
- package/dist-server/service/reduced-inventory-history/reduced-inventory-history.js +2 -2
- package/dist-server/service/reduced-inventory-history/reduced-inventory-history.js.map +1 -1
- package/dist-server/service/tote/index.d.ts +5 -0
- package/dist-server/service/tote/tote-mutation.d.ts +11 -0
- package/dist-server/service/tote/tote-mutation.js +2 -2
- package/dist-server/service/tote/tote-mutation.js.map +1 -1
- package/dist-server/service/tote/tote-query.d.ts +14 -0
- package/dist-server/service/tote/tote-query.js +2 -2
- package/dist-server/service/tote/tote-query.js.map +1 -1
- package/dist-server/service/tote/tote-types.d.ts +18 -0
- package/dist-server/service/tote/tote-types.js +6 -6
- package/dist-server/service/tote/tote-types.js.map +1 -1
- package/dist-server/service/tote/tote.d.ts +19 -0
- package/dist-server/service/tote/tote.js +4 -5
- package/dist-server/service/tote/tote.js.map +1 -1
- package/dist-server/service/warehouse/index.d.ts +5 -0
- package/dist-server/service/warehouse/warehouse-mutation.d.ts +13 -0
- package/dist-server/service/warehouse/warehouse-mutation.js +7 -7
- package/dist-server/service/warehouse/warehouse-mutation.js.map +1 -1
- package/dist-server/service/warehouse/warehouse-query.d.ts +11 -0
- package/dist-server/service/warehouse/warehouse-query.js +3 -3
- package/dist-server/service/warehouse/warehouse-query.js.map +1 -1
- package/dist-server/service/warehouse/warehouse-types.d.ts +20 -0
- package/dist-server/service/warehouse/warehouse-types.js +6 -6
- package/dist-server/service/warehouse/warehouse-types.js.map +1 -1
- package/dist-server/service/warehouse/warehouse.d.ts +21 -0
- package/dist-server/service/warehouse/warehouse.js +4 -5
- package/dist-server/service/warehouse/warehouse.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/dist-server/utils/datetime-util.d.ts +7 -0
- package/dist-server/utils/datetime-util.js.map +1 -1
- package/dist-server/utils/index.d.ts +3 -0
- package/dist-server/utils/inventory-no-generator.d.ts +5 -0
- package/dist-server/utils/inventory-util.d.ts +111 -0
- package/dist-server/utils/inventory-util.js +7 -7
- package/dist-server/utils/inventory-util.js.map +1 -1
- package/package.json +8 -8
- package/server/index.ts +2 -7
- package/server/service/inventory/inventory-mutation.ts +222 -218
- package/server/service/inventory/inventory-query.ts +30 -8
- package/server/service/inventory/inventory-types.ts +6 -0
- package/server/service/inventory/inventory.ts +13 -9
- package/server/service/inventory-change/inventory-change-mutation.ts +23 -69
- package/server/service/inventory-change/inventory-change-query.ts +4 -1
- package/server/service/inventory-change/inventory-change.ts +7 -7
- package/server/service/inventory-history/inventory-history-query.ts +11 -8
- package/server/service/inventory-history/inventory-history.ts +14 -10
- package/server/service/inventory-item/inventory-item-query.ts +6 -3
- package/server/service/inventory-item/inventory-item.ts +3 -3
- package/server/service/inventory-item-change/inventory-item-change-query.ts +1 -1
- package/server/service/inventory-item-change/inventory-item-change.ts +3 -3
- package/server/service/inventory-product/inventory-product-query.ts +4 -1
- package/server/service/inventory-product/inventory-product.ts +3 -3
- package/server/service/location/location-mutation.ts +2 -2
- package/server/service/location/location-query.ts +10 -4
- package/server/service/location/location.ts +1 -1
- package/server/service/movement/movement-query.ts +9 -3
- package/server/service/movement/movement.ts +4 -4
- package/server/service/pallet/pallet-query.ts +2 -2
- package/server/service/pallet/pallet-types.ts +6 -0
- package/server/service/pallet/pallet.ts +6 -13
- package/server/service/pallet-count/pallet-count-query.ts +1 -1
- package/server/service/pallet-count/pallet-count.ts +1 -1
- package/server/service/pallet-history/pallet-history-query.ts +4 -1
- package/server/service/tote/tote.ts +1 -1
- package/server/service/warehouse/warehouse-mutation.ts +2 -2
- package/server/service/warehouse/warehouse-query.ts +4 -1
- package/server/service/warehouse/warehouse.ts +1 -1
package/client/bootstrap.js
CHANGED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export declare const INVENTORY_STATUS: {
|
|
2
|
+
UNLOADED: string;
|
|
3
|
+
PARTIALLY_UNLOADED: string;
|
|
4
|
+
PUTTING_AWAY: string;
|
|
5
|
+
STORED: string;
|
|
6
|
+
LOADED: string;
|
|
7
|
+
INTRANSIT: string;
|
|
8
|
+
TERMINATED: string;
|
|
9
|
+
TRANSFERED: string;
|
|
10
|
+
DELETED: string;
|
|
11
|
+
CHECKED: string;
|
|
12
|
+
PICKED: string;
|
|
13
|
+
PICKING: string;
|
|
14
|
+
SORTING: string;
|
|
15
|
+
SORTED: string;
|
|
16
|
+
};
|
|
17
|
+
export declare const INVENTORY_TYPES: {
|
|
18
|
+
BUFFER: string;
|
|
19
|
+
SHELF: string;
|
|
20
|
+
};
|
|
21
|
+
export declare const INVENTORY_TRANSACTION_TYPE: {
|
|
22
|
+
NEW: string;
|
|
23
|
+
UNLOADING: string;
|
|
24
|
+
UNDO_UNLOADING: string;
|
|
25
|
+
PUTAWAY: string;
|
|
26
|
+
UNDO_PUTAWAY: string;
|
|
27
|
+
UNDO_UNPACKING: string;
|
|
28
|
+
ADJUSTMENT: string;
|
|
29
|
+
CC_ADJUSTMENT: string;
|
|
30
|
+
SALES_ADJUSTMENT: string;
|
|
31
|
+
RELOCATE: string;
|
|
32
|
+
PICKING: string;
|
|
33
|
+
PACKING: string;
|
|
34
|
+
LOADING: string;
|
|
35
|
+
SORTING: string;
|
|
36
|
+
UNDO_LOADING: string;
|
|
37
|
+
UNDO_PICKING: string;
|
|
38
|
+
CANCEL_ORDER: string;
|
|
39
|
+
RETURN: string;
|
|
40
|
+
EXTERNAL_RETURN: string;
|
|
41
|
+
TERMINATED: string;
|
|
42
|
+
TRANSFERED_IN: string;
|
|
43
|
+
TRANSFERED_OUT: string;
|
|
44
|
+
RELABELING: string;
|
|
45
|
+
REPACKAGING: string;
|
|
46
|
+
REPACKAGING_RELABELING: string;
|
|
47
|
+
REPALLETIZING: string;
|
|
48
|
+
UNPACKING: string;
|
|
49
|
+
UNPACKED: string;
|
|
50
|
+
REVERSE_KITTING: string;
|
|
51
|
+
UNDO_REVERSE_KITTING: string;
|
|
52
|
+
DIRECT_DEDUCTION: string;
|
|
53
|
+
};
|
|
54
|
+
export declare const INVENTORY_ITEM_SOURCE: {
|
|
55
|
+
INBOUND: string;
|
|
56
|
+
OUTBOUND: string;
|
|
57
|
+
ADJUSTMENT: string;
|
|
58
|
+
};
|
|
59
|
+
export declare const INVENTORY_ITEM_CHANGE_TYPE: {
|
|
60
|
+
NEW: string;
|
|
61
|
+
MODIFIED: string;
|
|
62
|
+
REMOVED: string;
|
|
63
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MarketplaceStore } from '@things-factory/integration-marketplace';
|
|
2
|
+
import { Domain } from '@things-factory/shell';
|
|
3
|
+
import { WarehouseController } from '../warehouse-controller';
|
|
4
|
+
export declare class EcommerceController extends WarehouseController {
|
|
5
|
+
updateProductVariationStock(marketplaceStores: MarketplaceStore[], productId: string, companyDomain: Domain): Promise<void>;
|
|
6
|
+
}
|
|
@@ -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,SAAS,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,CAAA;QAC9F,IAAI,WAAW,GAAgB,MAAM,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,qBAAS,CAAC,CAAC,IAAI,CAAC;YAC7E,KAAK,EAAE;gBACL,MAAM,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE;gBAC9B,OAAO,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE;gBAC3B,MAAM,EAAE,IAAA,aAAG,EAAC,IAAA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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;YAChG,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAhGD,kDAgGC","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).findOneBy({ id: productId })\n let inventories: Inventory[] = await this.trxMgr.getRepository(Inventory).find({\n where: {\n domain: { id: this.domain.id },\n product: { id: product.id },\n status: Not(Equal(INVENTORY_STATUS.TERMINATED))\n },\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: { id: marketplaceStore.id }, category: 'stock_allocation' }\n })\n\n const marketplaceProductVariations: MarketplaceProductVariation[] = await this.trxMgr\n .getRepository(MarketplaceProductVariation)\n .find({\n where: { domain: { id: companyDomain.id }, 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"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Sellercraft } from '@things-factory/integration-sellercraft';
|
|
2
|
+
import { Inventory } from '../../service/inventory/inventory';
|
|
3
|
+
import { WarehouseController } from '../warehouse-controller';
|
|
4
|
+
export declare class SellercraftController extends WarehouseController {
|
|
5
|
+
updateSellercraftStock(sellercraft: Sellercraft, inventory: Inventory): Promise<void>;
|
|
6
|
+
}
|
|
@@ -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,IAAI,kBAAkB,GAAQ,WAAW,CAAC,kBAAkB,CAAA;QAC5D,IAAI,kBAAkB,GACpB,CAAA,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,kBAAkB,KAAI,CAAA,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,kBAAkB,KAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAA;QAEtG,IAAI,CAAC,kBAAkB,EAAE;
|
|
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,IAAI,kBAAkB,GAAQ,WAAW,CAAC,kBAAkB,CAAA;QAC5D,IAAI,kBAAkB,GACpB,CAAA,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,kBAAkB,KAAI,CAA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;gBAC5B;oBACE,GAAG,EAAE,OAAO,CAAC,GAAG;oBAChB,IAAI,EAAE,oBAAoB,CAAC,IAAI;oBAC/B,KAAK,EAAE;wBACL,cAAc,EAAE,iBAAiB;wBACjC,iBAAiB,EAAE,uBAAuB;wBAC1C,eAAe,EAAE,IAAI;qBACtB;oBACD,iBAAiB,EAAE,oBAAoB,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,UAAU;oBAC5F,kBAAkB,EAAE;wBAClB,SAAS,EAAE,oBAAoB,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,KAAK;wBAC1E,QAAQ,EAAE,oBAAoB,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,KAAK;wBACzE,SAAS,EAAE,oBAAoB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,MAAM;qBAC7E;iBACF;aACF,CAAA;YAED,MAAM,wCAAc,CAAC,aAAa,CAAC,WAAW,EAAE;gBAC9C,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;gBAC9D,SAAS,EAAE,WAAW,CAAC,SAAS;gBAChC,cAAc;aACf,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;CACF;AA3FD,sDA2FC","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 let sellercraftSetting: any = sellercraft.sellercraftSetting\n let disableUpdateStock: boolean =\n sellercraftSetting?.disableUpdateStock && sellercraftSetting?.disableUpdateStock == 1 ? true : false\n\n if (!disableUpdateStock) {\n const bizplace: Bizplace = await this.trxMgr.getRepository(Bizplace).findOneBy({ 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.STORED,\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(\n productDetails,\n defaultProductDetail,\n unmatchingProductDetail\n )\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}\n"]}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { EntityManager } from 'typeorm';
|
|
2
|
+
import { User } from '@things-factory/auth-base';
|
|
3
|
+
import { Bizplace } from '@things-factory/biz-base';
|
|
4
|
+
import { ProductDetail } from '@things-factory/product-base';
|
|
5
|
+
import { Domain } from '@things-factory/shell';
|
|
6
|
+
export interface BasicInterface {
|
|
7
|
+
domain: Domain;
|
|
8
|
+
user: User;
|
|
9
|
+
}
|
|
10
|
+
export type NotificationMsgInterface = {
|
|
11
|
+
title: string;
|
|
12
|
+
body: string;
|
|
13
|
+
url: string;
|
|
14
|
+
data: any;
|
|
15
|
+
};
|
|
16
|
+
export declare class WarehouseController {
|
|
17
|
+
readonly ERROR_MSG: {
|
|
18
|
+
FIND: {
|
|
19
|
+
NO_RESULT: (condition: any) => string;
|
|
20
|
+
NO_CHILD_RESULT: (condition: any) => string;
|
|
21
|
+
NOT_MATCH: (source: any, target: any) => string;
|
|
22
|
+
};
|
|
23
|
+
CREATE: {
|
|
24
|
+
ID_EXISTS: string;
|
|
25
|
+
EMPTY_CREATOR: string;
|
|
26
|
+
EMPTY_UPDATER: string;
|
|
27
|
+
};
|
|
28
|
+
UPDATE: {
|
|
29
|
+
ID_NOT_EXISTS: string;
|
|
30
|
+
EMPTY_UPDATER: string;
|
|
31
|
+
};
|
|
32
|
+
VALIDITY: {
|
|
33
|
+
UNEXPECTED_FIELD_VALUE: (field: string, expectedValue: any, actualValue: any) => string;
|
|
34
|
+
DUPLICATED: (field: string, value: any) => string;
|
|
35
|
+
CANT_PROCEED_STEP_BY: (step: string, reason: string) => string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
private readonly ROLE_NAMES;
|
|
39
|
+
protected trxMgr: EntityManager;
|
|
40
|
+
protected domain: Domain;
|
|
41
|
+
protected user: User;
|
|
42
|
+
constructor(trxMgr: EntityManager, domain: Domain, user: User);
|
|
43
|
+
/**
|
|
44
|
+
* @summary Notify to passed users
|
|
45
|
+
* @description Passed notification message will be sent to passed users
|
|
46
|
+
*/
|
|
47
|
+
notifyToUsers(users: User[], message: NotificationMsgInterface): Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* @summary Notify to office admin
|
|
50
|
+
* @description Passed notification message will be sent to office admin of current domain
|
|
51
|
+
* default role name is defiend as ROLE_NAME.OFFICE_ADMIn by default
|
|
52
|
+
* You can change role name by passing roleName as parameter
|
|
53
|
+
*/
|
|
54
|
+
notifyToOfficeAdmin(message: NotificationMsgInterface, roleName?: string): Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* @summary Notify to customer of passed bizplace
|
|
57
|
+
* @description Passed notification message will be sent to customer of passed bizplace
|
|
58
|
+
*/
|
|
59
|
+
notifyToCustomer(bizplace: Bizplace, message: NotificationMsgInterface): Promise<void>;
|
|
60
|
+
getChildPackingSize(productDetails: ProductDetail[], defaultProductDetail: ProductDetail, unmatchingProductDetail: ProductDetail): Promise<number>;
|
|
61
|
+
/**
|
|
62
|
+
* @summary set common stamp like domain, creator, updater
|
|
63
|
+
* @description Set common stamp to passed record
|
|
64
|
+
* If it doesn't have id it will handle it as creating one
|
|
65
|
+
* If it has id it will handle it as updating one
|
|
66
|
+
*/
|
|
67
|
+
setStamp(record: Record<string, any>): Record<string, any>;
|
|
68
|
+
tidyConditions(record: Record<string, any>): Record<string, any>;
|
|
69
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"warehouse-controller.js","sourceRoot":"","sources":["../../server/controllers/warehouse-controller.ts"],"names":[],"mappings":";;;AAEA,yDAAsD;AACtD,uDAAmE;AAiBnE,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;gBAClG,SAAS,EAAE,CAAC,MAAW,EAAE,MAAW,EAAE,EAAE,CAAC,2BAA2B,MAAM,UAAU,MAAM,EAAE;aAC7F;YACD,MAAM,EAAE;gBACN,SAAS,EAAE,uBAAuB;gBAClC,aAAa,EAAE,+BAA+B;gBAC9C,aAAa,EAAE,+BAA+B;aAC/C;YACD,MAAM,EAAE;gBACN,aAAa,EAAE,wBAAwB;gBACvC,aAAa,EAAE,+BAA+B;aAC/C;YACD,QAAQ,EAAE;gBACR,sBAAsB,EAAE,CAAC,KAAa,EAAE,aAAkB,EAAE,WAAgB,EAAE,EAAE,CAC9E,YAAY,KAAK,aAAa,aAAa,YAAY,WAAW,EAAE;gBACtE,UAAU,EAAE,CAAC,KAAa,EAAE,KAAU,EAAE,EAAE,CAAC,uBAAuB,KAAK,WAAW,KAAK,GAAG;gBAC1F,oBAAoB,EAAE,CAAC,IAAY,EAAE,MAAc,EAAE,EAAE,CAAC,oBAAoB,IAAI,eAAe,MAAM,EAAE;aACxG;SACF,CA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,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;AAhKD,kDAgKC","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\n /**\n * @notes Temporary off sendNotification due to suspect of causing wms down\n */\n\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"]}
|
|
1
|
+
{"version":3,"file":"warehouse-controller.js","sourceRoot":"","sources":["../../server/controllers/warehouse-controller.ts"],"names":[],"mappings":";;;AAEA,yDAAsD;AACtD,uD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AAM,CAAC,GAAG,CAAC,CAAA;QAC3G,CAAC,CAAC,CAAA;QAEF,OAAO,MAAM,CAAA;IACf,CAAC;CACF;AAhKD,kDAgKC","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\n /**\n * @notes Temporary off sendNotification due to suspect of causing wms down\n */\n\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"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './constants';
|
|
2
|
+
export { createLocation, deleteLocation, deleteLocations, updateLocation } from './service/location/location-mutation';
|
|
3
|
+
export { createWarehouse, deleteWarehouse, deleteWarehouses, updateWarehouse } from './service/warehouse/warehouse-mutation';
|
|
4
|
+
export * from './migrations';
|
|
5
|
+
export * from './utils';
|
|
6
|
+
export * from './service';
|
|
7
|
+
export * from './service/inventory/inventory-query';
|
|
8
|
+
export { updateMultipleInventory } from './service/inventory/inventory-mutation';
|
|
9
|
+
export { approveInventoryChanges } from './service/inventory-change/inventory-change-mutation';
|
package/dist-server/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.approveInventoryChanges = exports.updateWarehouse = exports.deleteWarehouses = exports.deleteWarehouse = exports.createWarehouse = exports.updateLocation = exports.deleteLocations = exports.deleteLocation = exports.createLocation = void 0;
|
|
3
|
+
exports.approveInventoryChanges = exports.updateMultipleInventory = exports.updateWarehouse = exports.deleteWarehouses = exports.deleteWarehouse = exports.createWarehouse = exports.updateLocation = exports.deleteLocations = exports.deleteLocation = exports.createLocation = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
tslib_1.__exportStar(require("./constants"), exports);
|
|
6
6
|
var location_mutation_1 = require("./service/location/location-mutation");
|
|
@@ -17,6 +17,8 @@ tslib_1.__exportStar(require("./migrations"), exports);
|
|
|
17
17
|
tslib_1.__exportStar(require("./utils"), exports);
|
|
18
18
|
tslib_1.__exportStar(require("./service"), exports);
|
|
19
19
|
tslib_1.__exportStar(require("./service/inventory/inventory-query"), exports);
|
|
20
|
+
var inventory_mutation_1 = require("./service/inventory/inventory-mutation");
|
|
21
|
+
Object.defineProperty(exports, "updateMultipleInventory", { enumerable: true, get: function () { return inventory_mutation_1.updateMultipleInventory; } });
|
|
20
22
|
var inventory_change_mutation_1 = require("./service/inventory-change/inventory-change-mutation");
|
|
21
23
|
Object.defineProperty(exports, "approveInventoryChanges", { enumerable: true, get: function () { return inventory_change_mutation_1.approveInventoryChanges; } });
|
|
22
24
|
//# 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":";;;;AAAA,sDAA2B;AAC3B,0EAAsH;AAA7G,mHAAA,cAAc,OAAA;AAAE,mHAAA,cAAc,OAAA;AAAE,oHAAA,eAAe,OAAA;AAAE,mHAAA,cAAc,OAAA;AACxE,
|
|
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,6EAA4H;AAAnH,qHAAA,eAAe,OAAA;AAAE,qHAAA,eAAe,OAAA;AAAE,sHAAA,gBAAgB,OAAA;AAAE,qHAAA,eAAe,OAAA;AAC5E,uDAA4B;AAC5B,kDAAuB;AACvB,oDAAyB;AACzB,8EAAmD;AACnD,6EAAgF;AAAvE,6HAAA,uBAAuB,OAAA;AAChC,kGAA8F;AAArF,oIAAA,uBAAuB,OAAA","sourcesContent":["export * from './constants'\nexport { createLocation, deleteLocation, deleteLocations, updateLocation } from './service/location/location-mutation'\nexport { createWarehouse, deleteWarehouse, deleteWarehouses, updateWarehouse } from './service/warehouse/warehouse-mutation'\nexport * from './migrations'\nexport * from './utils'\nexport * from './service'\nexport * from './service/inventory/inventory-query'\nexport { updateMultipleInventory } from './service/inventory/inventory-mutation'\nexport { approveInventoryChanges } from './service/inventory-change/inventory-change-mutation'\n"]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare var migrations: any[];
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export * from './inventory-item-change/inventory-item-change';
|
|
2
|
+
export * from './inventory-item/inventory-item';
|
|
3
|
+
export * from './inventory-item-change/inventory-item-change';
|
|
4
|
+
export * from './inventory/inventory';
|
|
5
|
+
export * from './inventory-change/inventory-change';
|
|
6
|
+
export * from './inventory-history/inventory-history';
|
|
7
|
+
export * from './location/location';
|
|
8
|
+
export * from './movement/movement';
|
|
9
|
+
export * from './pallet/pallet';
|
|
10
|
+
export * from './pallet-count/pallet-count';
|
|
11
|
+
export * from './pallet-history/pallet-history';
|
|
12
|
+
export * from './warehouse/warehouse';
|
|
13
|
+
export * from './reduced-inventory-history/reduced-inventory-history';
|
|
14
|
+
export * from './tote/tote';
|
|
15
|
+
export * from './inventory/inventory-types';
|
|
16
|
+
export * from './inventory/inventory-types';
|
|
17
|
+
export * from './inventory-item/inventory-item';
|
|
18
|
+
export * from './inventory-item-change/inventory-item-change';
|
|
19
|
+
export * from './inventory-change/inventory-change-types';
|
|
20
|
+
export * from './inventory-history/inventory-history-types';
|
|
21
|
+
export * from './location/location-types';
|
|
22
|
+
export * from './movement/movement-types';
|
|
23
|
+
export * from './pallet/pallet-types';
|
|
24
|
+
export * from './pallet-count/pallet-count-types';
|
|
25
|
+
export * from './pallet-history/pallet-history-types';
|
|
26
|
+
export * from './warehouse/warehouse-types';
|
|
27
|
+
export * from './tote/tote-types';
|
|
28
|
+
export declare const entities: (typeof import("./warehouse/warehouse").Warehouse | typeof import("./location/location").Location | typeof import("./pallet/pallet").Pallet | typeof import("./inventory/inventory").Inventory | typeof import("./inventory-history/inventory-history").InventoryHistory | typeof import("./inventory-item/inventory-item").InventoryItem | typeof import("./inventory-item-change/inventory-item-change").InventoryItemChange | typeof import("./inventory-change/inventory-change").InventoryChange | typeof import("./movement/movement").Movement | typeof import("./pallet-history/pallet-history").PalletHistory | typeof import("./pallet-count/pallet-count").PalletCount | typeof import("./reduced-inventory-history/reduced-inventory-history").ReducedInventoryHistory | typeof import("./tote/tote").Tote)[];
|
|
29
|
+
export declare const schema: {
|
|
30
|
+
resolverClasses: (typeof import("./location/location-mutation").LocationMutation | typeof import("./warehouse/warehouse-mutation").WarehouseMutation | typeof import("./inventory/inventory-mutation").InventoryMutation | typeof import("..").InventoryQuery | typeof import("./inventory-item/inventory-item-query").InventoryItemQuery | typeof import("./inventory-change/inventory-change-mutation").InventoryChangeMutation | typeof import("./inventory-change/inventory-change-query").InventoryChangeQuery | typeof import("./inventory-history/inventory-history-mutation").InventoryHistoryMutation | typeof import("./inventory-history/inventory-history-query").InventoryHistoryQuery | typeof import("./inventory-item/inventory-item-mutation").InventoryItemMutation | typeof import("./inventory-item-change/inventory-item-change-query").InventoryItemChangeQuery | typeof import("./inventory-item-change/inventory-item-change-mutation").InventoryItemChangeMutation | typeof import("./location/location-query").LocationQuery | typeof import("./movement/movement-mutation").MovementMutation | typeof import("./movement/movement-query").MovementQuery | typeof import("./pallet/pallet-mutation").PalletMutation | typeof import("./pallet/pallet-query").PalletQuery | typeof import("./pallet-count/pallet-count-mutation").PalletCountMutation | typeof import("./pallet-count/pallet-count-query").PalletCountQuery | typeof import("./pallet-history/pallet-history-mutation").PalletHistoryMutation | typeof import("./pallet-history/pallet-history-query").PalletHistoryQuery | typeof import("./warehouse/warehouse-query").WarehouseQuery | typeof import("./tote/tote-mutation").ToteMutation | typeof import("./tote/tote-query").ToteQuery)[];
|
|
31
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Inventory } from './inventory';
|
|
2
|
+
import { InventoryMutation } from './inventory-mutation';
|
|
3
|
+
import { InventoryQuery } from './inventory-query';
|
|
4
|
+
export declare const entities: (typeof Inventory)[];
|
|
5
|
+
export declare const resolvers: (typeof InventoryMutation | typeof InventoryQuery)[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Inventory } from './inventory';
|
|
2
|
+
import { InventoryPatch, NewInventory } from './inventory-types';
|
|
3
|
+
export declare class InventoryMutation {
|
|
4
|
+
createInventory(inventory: NewInventory, context: ResolverContext): Promise<Inventory>;
|
|
5
|
+
updateInventory(patch: InventoryPatch, context: ResolverContext): Promise<Inventory>;
|
|
6
|
+
updateInventoryRemark(id: string, remark: string, context: ResolverContext): Promise<Inventory>;
|
|
7
|
+
deleteInventory(name: string, context: ResolverContext): Promise<Boolean>;
|
|
8
|
+
updateMultipleInventory(patches: InventoryPatch[], context: ResolverContext): Promise<Inventory[]>;
|
|
9
|
+
deleteInventories(ids: string[], context: ResolverContext): Promise<Boolean>;
|
|
10
|
+
inventoryTransfer(originPalletId: string, palletId: string, cartonId: string, fromLocationName: string, toLocationName: string, qty: number, reason: string, context: ResolverContext): Promise<Boolean>;
|
|
11
|
+
}
|
|
12
|
+
export declare function updateMultipleInventory(patches: InventoryPatch[], context: ResolverContext): Promise<Inventory[]>;
|