@things-factory/warehouse-base 4.2.9 → 4.3.0-alpha.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/dist-server/constants/index.js +5 -1
- package/dist-server/constants/index.js.map +1 -1
- package/dist-server/controllers/ecommerce/index.js +5 -1
- package/dist-server/controllers/ecommerce/index.js.map +1 -1
- package/dist-server/controllers/ecommerce/sellercraft-controller.js +9 -3
- package/dist-server/controllers/ecommerce/sellercraft-controller.js.map +1 -1
- package/dist-server/controllers/index.js +5 -1
- package/dist-server/controllers/index.js.map +1 -1
- package/dist-server/index.js +5 -1
- package/dist-server/index.js.map +1 -1
- package/dist-server/service/index.js +5 -1
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/utils/index.js +5 -1
- package/dist-server/utils/index.js.map +1 -1
- package/package.json +8 -8
- package/server/controllers/ecommerce/sellercraft-controller.ts +10 -3
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -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,8CAA2B;AAC3B,6CAA0B;AAC1B,2CAAwB;AACxB,8CAA2B"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -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,yDAAsC;AACtC,2DAAwC"}
|
|
@@ -24,6 +24,7 @@ class SellercraftController extends warehouse_controller_1.WarehouseController {
|
|
|
24
24
|
let inventories = await qb.getMany();
|
|
25
25
|
let defaultProductDetail = product.productDetails.find(productDetail => productDetail.isDefault);
|
|
26
26
|
let inventoryTotalQty = 0;
|
|
27
|
+
let inventoryTotalLockedQty = 0;
|
|
27
28
|
if ((inventories === null || inventories === void 0 ? void 0 : inventories.length) > 0) {
|
|
28
29
|
const sellercraftInvs = await Promise.all(inventories.map(async (inventory) => {
|
|
29
30
|
const inventoryPackingType = inventory.packingType;
|
|
@@ -32,10 +33,14 @@ class SellercraftController extends warehouse_controller_1.WarehouseController {
|
|
|
32
33
|
const unmatchingProductDetail = product.productDetails.find(productDetail => productDetail.packingType === inventoryPackingType);
|
|
33
34
|
packingSize = await this.getChildPackingSize(productDetails, defaultProductDetail, unmatchingProductDetail);
|
|
34
35
|
}
|
|
35
|
-
return {
|
|
36
|
+
return { totalQty: inventory.qty * packingSize, totalLockedQty: inventory.lockedQty * packingSize };
|
|
36
37
|
}));
|
|
37
38
|
inventoryTotalQty = sellercraftInvs.reduce((total, currentValue) => {
|
|
38
|
-
total += currentValue.
|
|
39
|
+
total += currentValue.totalQty;
|
|
40
|
+
return total;
|
|
41
|
+
}, 0);
|
|
42
|
+
inventoryTotalLockedQty = sellercraftInvs.reduce((total, currentValue) => {
|
|
43
|
+
total += currentValue.totalLockedQty;
|
|
39
44
|
return total;
|
|
40
45
|
}, 0);
|
|
41
46
|
}
|
|
@@ -44,7 +49,8 @@ class SellercraftController extends warehouse_controller_1.WarehouseController {
|
|
|
44
49
|
sku: product.sku,
|
|
45
50
|
gtin: defaultProductDetail.gtin,
|
|
46
51
|
stock: {
|
|
47
|
-
|
|
52
|
+
quantity_total: inventoryTotalQty,
|
|
53
|
+
quantity_reserved: inventoryTotalLockedQty,
|
|
48
54
|
unit_of_measure: 'EA'
|
|
49
55
|
},
|
|
50
56
|
package_weight_gm: defaultProductDetail.nettWeight < 1 ? 1 : defaultProductDetail.nettWeight,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sellercraft-controller.js","sourceRoot":"","sources":["../../../server/controllers/ecommerce/sellercraft-controller.ts"],"names":[],"mappings":";;;AAAA,qFAAqF;AAGrF,+CAAiE;AACjE,iEAA6D;AAC7D,kEAA6D;AAE7D,MAAa,qBAAsB,SAAQ,0CAAmB;IAC5D,KAAK,CAAC,sBAAsB,CAAC,WAAwB,EAAE,SAAoB;QACzE,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,CAAC,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAA;QAC7E,EAAE,CAAC,i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AS,EAAE,cAAc,EAAE,CAAC,CAAA;IACvG,CAAC;CACF;AAzED,sDAyEC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -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,8CAA2B;AAC3B,yDAAsC"}
|
package/dist-server/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
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,8CAA2B;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,+CAA4B;AAC5B,0CAAuB;AACvB,4CAAyB"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -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;AAE5F,yBAAyB;AACzB,gFAA6D;AAC7D,kEAA+C;AAC/C,gFAA6D;AAC7D,wDAAqC;AACrC,sEAAmD;AACnD,wEAAqD;AACrD,sDAAmC;AACnC,sDAAmC;AACnC,kDAA+B;AAC/B,8DAA2C;AAC3C,kEAA+C;AAC/C,wDAAqC;AACrC,wFAAqE;AAErE,kBAAkB;AAClB,8DAA2C;AAC3C,8DAA2C;AAC3C,kEAA+C;AAC/C,gFAA6D;AAC7D,4EAAyD;AACzD,8EAA2D;AAC3D,4DAAyC;AACzC,4DAAyC;AACzC,wDAAqC;AACrC,oEAAiD;AACjD,wEAAqD;AACrD,8DAA2C;AAE9B,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;CACnC,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;KACtB;CACF,CAAA"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/utils/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAwC;AACxC,mDAAgC;AAChC,kDAA+B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/warehouse-base",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0-alpha.0",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
"migration:create": "node ../../node_modules/typeorm/cli.js migration:create -d ./server/migrations"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@things-factory/biz-base": "^4.
|
|
28
|
-
"@things-factory/id-rule-base": "^4.
|
|
29
|
-
"@things-factory/integration-sellercraft": "^4.
|
|
30
|
-
"@things-factory/marketplace-base": "^4.
|
|
31
|
-
"@things-factory/product-base": "^4.
|
|
32
|
-
"@things-factory/setting-base": "^4.
|
|
27
|
+
"@things-factory/biz-base": "^4.3.0-alpha.0",
|
|
28
|
+
"@things-factory/id-rule-base": "^4.3.0-alpha.0",
|
|
29
|
+
"@things-factory/integration-sellercraft": "^4.3.0-alpha.0",
|
|
30
|
+
"@things-factory/marketplace-base": "^4.3.0-alpha.0",
|
|
31
|
+
"@things-factory/product-base": "^4.3.0-alpha.0",
|
|
32
|
+
"@things-factory/setting-base": "^4.3.0-alpha.0"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "6467d1b2a5b2f8abb1bc3982e4651a5742ad4043"
|
|
35
35
|
}
|
|
@@ -27,6 +27,7 @@ export class SellercraftController extends WarehouseController {
|
|
|
27
27
|
|
|
28
28
|
let defaultProductDetail: ProductDetail = product.productDetails.find(productDetail => productDetail.isDefault)
|
|
29
29
|
let inventoryTotalQty: number = 0
|
|
30
|
+
let inventoryTotalLockedQty: number = 0
|
|
30
31
|
|
|
31
32
|
if (inventories?.length > 0) {
|
|
32
33
|
const sellercraftInvs: any[] = await Promise.all(
|
|
@@ -42,12 +43,17 @@ export class SellercraftController extends WarehouseController {
|
|
|
42
43
|
packingSize = await this.getChildPackingSize(productDetails, defaultProductDetail, unmatchingProductDetail)
|
|
43
44
|
}
|
|
44
45
|
|
|
45
|
-
return {
|
|
46
|
+
return { totalQty: inventory.qty * packingSize, totalLockedQty: inventory.lockedQty * packingSize }
|
|
46
47
|
})
|
|
47
48
|
)
|
|
48
49
|
|
|
49
50
|
inventoryTotalQty = sellercraftInvs.reduce((total, currentValue) => {
|
|
50
|
-
total += currentValue.
|
|
51
|
+
total += currentValue.totalQty
|
|
52
|
+
return total
|
|
53
|
+
}, 0)
|
|
54
|
+
|
|
55
|
+
inventoryTotalLockedQty = sellercraftInvs.reduce((total, currentValue) => {
|
|
56
|
+
total += currentValue.totalLockedQty
|
|
51
57
|
return total
|
|
52
58
|
}, 0)
|
|
53
59
|
}
|
|
@@ -57,7 +63,8 @@ export class SellercraftController extends WarehouseController {
|
|
|
57
63
|
sku: product.sku,
|
|
58
64
|
gtin: defaultProductDetail.gtin,
|
|
59
65
|
stock: {
|
|
60
|
-
|
|
66
|
+
quantity_total: inventoryTotalQty,
|
|
67
|
+
quantity_reserved: inventoryTotalLockedQty,
|
|
61
68
|
unit_of_measure: 'EA'
|
|
62
69
|
},
|
|
63
70
|
package_weight_gm: defaultProductDetail.nettWeight < 1 ? 1 : defaultProductDetail.nettWeight,
|