@things-factory/operato-hub 4.0.29 → 4.0.33
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/pages/sellercraft/sellercraft-store-setting.js +4 -1
- package/dist-server/controllers/bizplace-initializer/dataset/settings.js +5 -0
- package/dist-server/controllers/bizplace-initializer/dataset/settings.js.map +1 -1
- package/dist-server/graphql/resolvers/synchronization/sync-products-to-sellercraft.js +28 -34
- package/dist-server/graphql/resolvers/synchronization/sync-products-to-sellercraft.js.map +1 -1
- package/dist-server/routers/api/restful-apis/unstable/add-products.js +1 -1
- package/dist-server/routers/api/restful-apis/unstable/get-release-order-list.js +12 -16
- package/dist-server/routers/api/restful-apis/unstable/get-release-order-list.js.map +1 -1
- package/dist-server/routers/api/restful-apis/v1/add-products.js +1 -1
- package/dist-server/routers/api/restful-apis/v2/add-products.js +1 -1
- package/package.json +68 -68
- package/server/controllers/bizplace-initializer/dataset/settings.ts +5 -0
- package/server/graphql/resolvers/synchronization/sync-products-to-sellercraft.ts +34 -40
- package/server/routers/api/restful-apis/unstable/add-products.ts +1 -1
- package/server/routers/api/restful-apis/unstable/get-release-order-list.ts +14 -11
- package/server/routers/api/restful-apis/v1/add-products.ts +1 -1
- package/server/routers/api/restful-apis/v2/add-products.ts +1 -1
- package/dist-server/routers/api/restful-apis/unstable/add-product.js +0 -85
- package/dist-server/routers/api/restful-apis/unstable/add-product.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/add-replenishment-order.js +0 -98
- package/dist-server/routers/api/restful-apis/unstable/add-replenishment-order.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/add-transfer-order.js +0 -77
- package/dist-server/routers/api/restful-apis/unstable/add-transfer-order.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/application.js +0 -28
- package/dist-server/routers/api/restful-apis/unstable/application.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/cancel-replenishment-order.js +0 -67
- package/dist-server/routers/api/restful-apis/unstable/cancel-replenishment-order.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/cancel-transfer-order.js +0 -70
- package/dist-server/routers/api/restful-apis/unstable/cancel-transfer-order.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/confirm-inbound-order.js +0 -98
- package/dist-server/routers/api/restful-apis/unstable/confirm-inbound-order.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/delete-inbound-order.js +0 -37
- package/dist-server/routers/api/restful-apis/unstable/delete-inbound-order.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/generate-inbound-order.js +0 -206
- package/dist-server/routers/api/restful-apis/unstable/generate-inbound-order.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/get-product-detail.js +0 -78
- package/dist-server/routers/api/restful-apis/unstable/get-product-detail.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/get-product-list.js +0 -114
- package/dist-server/routers/api/restful-apis/unstable/get-product-list.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/get-transfer-order-detail.js +0 -58
- package/dist-server/routers/api/restful-apis/unstable/get-transfer-order-detail.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/get-transfer-order-list.js +0 -124
- package/dist-server/routers/api/restful-apis/unstable/get-transfer-order-list.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/update-replenishment-order-product.js +0 -76
- package/dist-server/routers/api/restful-apis/unstable/update-replenishment-order-product.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/update-replenishment-order-status.js +0 -73
- package/dist-server/routers/api/restful-apis/unstable/update-replenishment-order-status.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/update-transfer-order-status.js +0 -76
- package/dist-server/routers/api/restful-apis/unstable/update-transfer-order-status.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/utils/api-error-message.js +0 -13
- package/dist-server/routers/api/restful-apis/unstable/utils/api-error-message.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/utils/index.js +0 -14
- package/dist-server/routers/api/restful-apis/unstable/utils/index.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/application.js +0 -28
- package/dist-server/routers/api/restful-apis/v1/application.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/order.js +0 -28
- package/dist-server/routers/api/restful-apis/v1/order.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v2/application.js +0 -28
- package/dist-server/routers/api/restful-apis/v2/application.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v2/order.js +0 -28
- package/dist-server/routers/api/restful-apis/v2/order.js.map +0 -1
|
@@ -255,7 +255,10 @@ class SellercraftStoreSetting extends connect(store)(localize(i18next)(PageView)
|
|
|
255
255
|
syncProductsToSellercraft(sellercraftId: $sellercraftId, fulfillmentCenterId: $fulfillmentCenterId)
|
|
256
256
|
}
|
|
257
257
|
`,
|
|
258
|
-
variables: {
|
|
258
|
+
variables: {
|
|
259
|
+
sellercraftId: this.id,
|
|
260
|
+
fulfillmentCenterId: this.warehouseId
|
|
261
|
+
}
|
|
259
262
|
})
|
|
260
263
|
|
|
261
264
|
if (!response.errors) {
|
|
@@ -37,6 +37,11 @@ exports.SETTINGS = {
|
|
|
37
37
|
description: 'enable and disable the use of product barcode scanning',
|
|
38
38
|
category: 'id-rule'
|
|
39
39
|
},
|
|
40
|
+
{
|
|
41
|
+
name: 'batch-picking-limit',
|
|
42
|
+
description: 'maximum order per batch picking limit',
|
|
43
|
+
category: 'id-rule'
|
|
44
|
+
},
|
|
40
45
|
{
|
|
41
46
|
name: 'enable-carton-label',
|
|
42
47
|
description: 'enable and disable the use of using carton label',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../../server/controllers/bizplace-initializer/dataset/settings.ts"],"names":[],"mappings":";;;AAAa,QAAA,QAAQ,GAAG;IACtB,SAAS,EAAE;QACT,EAAE,IAAI,EAAE,gBAAgB,EAAE,WAAW,EAAE,wBAAwB,EAAE,Q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WAAW,EAAE,kCAAkC;YAC/C,QAAQ,EAAE,SAAS;SACpB;QACD;YACE,IAAI,EAAE,0CAA0C;YAChD,WAAW,EAAE,2GAA2G;YACxH,QAAQ,EAAE,SAAS;SACpB;KACF;IACD,MAAM,EAAE,EAAE;CACX,CAAA"}
|
|
@@ -5,70 +5,64 @@ const biz_base_1 = require("@things-factory/biz-base");
|
|
|
5
5
|
const integration_fulfillment_1 = require("@things-factory/integration-fulfillment");
|
|
6
6
|
const integration_sellercraft_1 = require("@things-factory/integration-sellercraft");
|
|
7
7
|
const product_base_1 = require("@things-factory/product-base");
|
|
8
|
-
const utils_1 = require("../../../utils");
|
|
9
8
|
exports.syncProductsToSellercraftResolver = {
|
|
10
9
|
async syncProductsToSellercraft(_, { sellercraftId, fulfillmentCenterId }, context) {
|
|
11
10
|
const { domain, tx } = context.state;
|
|
12
11
|
let page = 1;
|
|
13
12
|
let hasMorePage = true;
|
|
14
|
-
const limit =
|
|
13
|
+
const limit = 10;
|
|
15
14
|
const sellercraft = await tx
|
|
16
15
|
.getRepository(integration_sellercraft_1.Sellercraft)
|
|
17
16
|
.findOne({ where: { id: sellercraftId }, relations: ['domain'] });
|
|
18
17
|
const customerDomain = sellercraft.domain;
|
|
19
18
|
const fulfilmentCenter = await integration_fulfillment_1.FulfillmentAPI.getFulfillmentCenter(fulfillmentCenterId);
|
|
20
19
|
const customerBizplace = await tx.getRepository(biz_base_1.Bizplace).findOne({ where: { domain: customerDomain } });
|
|
21
|
-
let sellercraftOPs = [];
|
|
22
20
|
while (hasMorePage) {
|
|
23
21
|
const { items, total } = await integration_fulfillment_1.FulfillmentAPI.getInventoryProductGroup(fulfilmentCenter, {
|
|
24
22
|
warehouseId: customerBizplace.id,
|
|
25
23
|
paginationEntriesPerPage: limit,
|
|
26
24
|
paginationOffset: page
|
|
27
25
|
});
|
|
26
|
+
let sellercraftInv = [];
|
|
28
27
|
await Promise.all(items.map(async (item) => {
|
|
29
28
|
const product = await tx.getRepository(product_base_1.Product).findOne({
|
|
30
29
|
where: { domain, sku: item.productSKU },
|
|
31
30
|
relations: ['productDetails', 'productDetails.childProductDetail']
|
|
32
31
|
});
|
|
33
32
|
const productDetails = product.productDetails;
|
|
34
|
-
const inventoryPackingType = item.packingType
|
|
35
|
-
const defaultProductDetail =
|
|
33
|
+
// const inventoryPackingType: string = item.packingType
|
|
34
|
+
const defaultProductDetail = productDetails.find(productDetail => productDetail.isDefault);
|
|
36
35
|
let packingSize = 1;
|
|
37
|
-
if (inventoryPackingType !== defaultProductDetail.packingType) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
// if (inventoryPackingType !== defaultProductDetail.packingType) {
|
|
37
|
+
// const unmatchingProductDetail: ProductDetail = product.productDetails.find(
|
|
38
|
+
// productDetail => productDetail.packingType === inventoryPackingType
|
|
39
|
+
// )
|
|
40
|
+
// packingSize = await getChildPackingSize(productDetails, defaultProductDetail, unmatchingProductDetail)
|
|
41
|
+
// }
|
|
42
|
+
sellercraftInv.push({
|
|
42
43
|
sku: item.productSKU,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
length: defaultProductDetail.depth < 1 ? 1 : defaultProductDetail.depth,
|
|
54
|
-
width: defaultProductDetail.width < 1 ? 1 : defaultProductDetail.width,
|
|
55
|
-
height: defaultProductDetail.height < 1 ? 1 : defaultProductDetail.height
|
|
44
|
+
gtin: (defaultProductDetail === null || defaultProductDetail === void 0 ? void 0 : defaultProductDetail.gtin) ? defaultProductDetail.gtin : '',
|
|
45
|
+
stock: {
|
|
46
|
+
quantity: item.remainQty * packingSize,
|
|
47
|
+
unit_of_measure: 'EA'
|
|
48
|
+
},
|
|
49
|
+
package_weight_gm: defaultProductDetail.nettWeight < 1 ? 1 : defaultProductDetail.nettWeight,
|
|
50
|
+
package_dimensions: {
|
|
51
|
+
length_mm: defaultProductDetail.depth < 1 ? 1 : defaultProductDetail.depth,
|
|
52
|
+
width_mm: defaultProductDetail.width < 1 ? 1 : defaultProductDetail.width,
|
|
53
|
+
height_mm: defaultProductDetail.height < 1 ? 1 : defaultProductDetail.height
|
|
56
54
|
}
|
|
57
55
|
});
|
|
58
56
|
}));
|
|
59
|
-
|
|
57
|
+
const delay = (ms) => {
|
|
58
|
+
return new Promise(resolve => setTimeout(resolve, ms));
|
|
59
|
+
};
|
|
60
|
+
await delay(5000);
|
|
61
|
+
await integration_sellercraft_1.SellercraftAPI.updateProduct(sellercraft, { accountId: sellercraft.accountId, sellercraftInv });
|
|
62
|
+
if ((sellercraftInv === null || sellercraftInv === void 0 ? void 0 : sellercraftInv.length) < total)
|
|
60
63
|
page++;
|
|
61
|
-
hasMorePage = Boolean((
|
|
64
|
+
hasMorePage = Boolean((sellercraftInv === null || sellercraftInv === void 0 ? void 0 : sellercraftInv.length) < total);
|
|
62
65
|
}
|
|
63
|
-
const inboundOrder = {
|
|
64
|
-
accountId: sellercraft.accountId,
|
|
65
|
-
inboundId: utils_1.OrderNoGenerator.initialiseSynchronisation(),
|
|
66
|
-
inboundTime: Math.floor(new Date().getTime() / 1000),
|
|
67
|
-
inboundType: 'blind_receive',
|
|
68
|
-
purchaseOrderId: '',
|
|
69
|
-
sellercraftOPs
|
|
70
|
-
};
|
|
71
|
-
await integration_sellercraft_1.SellercraftAPI.addInboundOrder(sellercraft, Object.assign({}, inboundOrder));
|
|
72
66
|
}
|
|
73
67
|
};
|
|
74
68
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync-products-to-sellercraft.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/synchronization/sync-products-to-sellercraft.ts"],"names":[],"mappings":";;;AAEA,uDAAmD;AACnD,qFAA2F;AAC3F,qFAAqF;AACrF,+DAAqE;
|
|
1
|
+
{"version":3,"file":"sync-products-to-sellercraft.js","sourceRoot":"","sources":["../../../../server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 api_1.restfulApiRouter.post('/unstable/warehouse/:warehouseId/add-products', bus
|
|
|
27
27
|
context.body = {
|
|
28
28
|
result: (await client.mutate({
|
|
29
29
|
mutation: (0, graphql_tag_1.default) `
|
|
30
|
-
mutation createProducts($products: [NewProduct]!) {
|
|
30
|
+
mutation createProducts($products: [NewProduct!]!) {
|
|
31
31
|
createProducts(products: $products) {
|
|
32
32
|
id
|
|
33
33
|
}
|
|
@@ -138,23 +138,19 @@ api_1.restfulApiRouter.get('/unstable/warehouse/:warehouseId/get-release-order-l
|
|
|
138
138
|
};
|
|
139
139
|
});
|
|
140
140
|
async function validateFilters(context, filters, fromDate, toDate) {
|
|
141
|
-
if (fromDate && fromDate !== '') {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}
|
|
148
|
-
|
|
141
|
+
// if (fromDate && fromDate !== '') {
|
|
142
|
+
// fromDate = new Date(`${fromDate.split(' ').join('')} 00:00:00`)
|
|
143
|
+
// if (fromDate instanceof Date && !isNaN(fromDate.getTime())) fromDate = fromDate.toLocaleString()
|
|
144
|
+
// else context.throw(400, context.t('fromDate is invalid'))
|
|
145
|
+
// } else fromDate = ''
|
|
146
|
+
// if (toDate && toDate !== '') {
|
|
147
|
+
// toDate = new Date(`${toDate.split(' ').join('')} 23:59:59`)
|
|
148
|
+
// if (toDate instanceof Date && !isNaN(toDate.getTime())) toDate = toDate.toLocaleString()
|
|
149
|
+
// else context.throw(400, context.t('toDate is invalid'))
|
|
150
|
+
// } else toDate = ''
|
|
151
|
+
if (!fromDate)
|
|
149
152
|
fromDate = '';
|
|
150
|
-
if (toDate
|
|
151
|
-
toDate = new Date(`${toDate.split(' ').join('')} 23:59:59`);
|
|
152
|
-
if (toDate instanceof Date && !isNaN(toDate.getTime()))
|
|
153
|
-
toDate = toDate.toLocaleString();
|
|
154
|
-
else
|
|
155
|
-
context.throw(400, context.t('toDate is invalid'));
|
|
156
|
-
}
|
|
157
|
-
else
|
|
153
|
+
if (!toDate)
|
|
158
154
|
toDate = '';
|
|
159
155
|
if (fromDate !== '' && toDate !== '')
|
|
160
156
|
filters = [...filters, { name: 'createdAt', operator: 'between', value: [fromDate, toDate] }];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-release-order-list.js","sourceRoot":"","sources":["../../../../../server/routers/api/restful-apis/unstable/get-release-order-list.ts"],"names":[],"mappings":";;;;;;AAAA,8DAA6B;AAE7B,6CAAgE;AAEhE,qFAAgF;AAChF,uFAAkF;AAElF,sBAAM,CAAC,GAAG,CACR,yDAAyD,EACzD,wCAAkB,EAClB,0CAAmB,EACnB,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IACtB,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;IAC7D,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,MAAM,CAAA;IACtC,MAAM,EAAE,CAAC,EAAE,GAAG,OAAO,CAAA;IACrB,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;IAE7F,IAAI,CAAC,WAAW;QAAE,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,8BAA8B,CAAC,CAAC,CAAA;IAEvE,IAAI,OAAO,GAAQ,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,WAAW,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;IAC/F,IAAI,KAAK;QAAE,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAA;IACxE,IAAI,UAAU,GAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAA;IAC5C,OAAO,GAAG,MAAM,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAA;IACnE,UAAU,GAAG,MAAM,kBAAkB,CAAC,OAAO,EAAE,UAAU,EAAE,wBAAwB,EAAE,gBAAgB,CAAC,CAAA;IAEtG,OAAO,CAAC,IAAI,GAAG;QACb,MAAM,EAAE,CACN,MAAM,MAAM,CAAC,KAAK,CAAC;YACjB,KAAK,EAAE,IAAA,qBAAG,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAuGT;YACD,SAAS,EAAE;gBACT,OAAO;gBACP,UAAU;gBACV,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;aAC9C;YACD,OAAO,kCACF,OAAO,KACV,KAAK,kCACA,OAAO,CAAC,KAAK,KAChB,QAAQ;oBACR,MAAM,MAET;SACK,CAAC,CACV,CAAC,IAAI;KACP,CAAA;AACH,CAAC,CACF,CAAA;AAEM,KAAK,UAAU,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM;IACtE,
|
|
1
|
+
{"version":3,"file":"get-release-order-list.js","sourceRoot":"","sources":["../../../../../server/routers/api/restful-apis/unstable/get-release-order-list.ts"],"names":[],"mappings":";;;;;;AAAA,8DAA6B;AAE7B,6CAAgE;AAEhE,qFAAgF;AAChF,uFAAkF;AAElF,sBAAM,CAAC,GAAG,CACR,yDAAyD,EACzD,wCAAkB,EAClB,0CAAmB,EACnB,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IACtB,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;IAC7D,MAAM,E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CAAC,CAAC,CAAC,kDAAkD,CAAC,CAAC,CAAA;;YACpG,UAAU,mCAAQ,UAAU,KAAE,KAAK,EAAE,OAAO,GAAE,CAAA;KACpD;IAED,OAAO,UAAU,CAAA;AACnB,CAAC;AArBD,gDAqBC"}
|
|
@@ -27,7 +27,7 @@ api_1.restfulApiRouter.post('/v1/warehouse/:warehouseId/add-products', business_
|
|
|
27
27
|
context.body = {
|
|
28
28
|
result: (await client.mutate({
|
|
29
29
|
mutation: (0, graphql_tag_1.default) `
|
|
30
|
-
mutation createProducts($products: [NewProduct]!) {
|
|
30
|
+
mutation createProducts($products: [NewProduct!]!) {
|
|
31
31
|
createProducts(products: $products) {
|
|
32
32
|
id
|
|
33
33
|
}
|
|
@@ -27,7 +27,7 @@ api_1.restfulApiRouter.post('/v2/warehouse/:warehouseId/add-products', business_
|
|
|
27
27
|
context.body = {
|
|
28
28
|
result: (await client.mutate({
|
|
29
29
|
mutation: (0, graphql_tag_1.default) `
|
|
30
|
-
mutation createProducts($products: [NewProduct]!) {
|
|
30
|
+
mutation createProducts($products: [NewProduct!]!) {
|
|
31
31
|
createProducts(products: $products) {
|
|
32
32
|
id
|
|
33
33
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/operato-hub",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.33",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -41,81 +41,81 @@
|
|
|
41
41
|
"@material/mwc-formfield": "^0.25.3",
|
|
42
42
|
"@material/mwc-linear-progress": "^0.25.3",
|
|
43
43
|
"@material/mwc-radio": "^0.25.3",
|
|
44
|
-
"@operato/scene-chartjs": "^0.1.
|
|
45
|
-
"@operato/scene-clock": "^0.1.
|
|
46
|
-
"@operato/scene-clone": "^0.1.
|
|
47
|
-
"@operato/scene-compass": "^0.1.
|
|
48
|
-
"@operato/scene-gauge": "^0.1.
|
|
49
|
-
"@operato/scene-indoor-map": "^0.1.
|
|
50
|
-
"@operato/scene-legend": "^0.1.
|
|
51
|
-
"@operato/scene-progressbar": "^0.1.
|
|
52
|
-
"@operato/scene-random": "^0.1.
|
|
53
|
-
"@operato/scene-switch": "^0.1.
|
|
54
|
-
"@operato/scene-tab": "^0.1.
|
|
55
|
-
"@operato/scene-table": "^0.1.
|
|
56
|
-
"@operato/scene-wheel-sorter": "^0.1.
|
|
57
|
-
"@things-factory/api": "^4.0.
|
|
58
|
-
"@things-factory/apptool-ui": "^4.0.
|
|
59
|
-
"@things-factory/attachment-base": "^4.0.
|
|
60
|
-
"@things-factory/auth-base": "^4.0.
|
|
61
|
-
"@things-factory/auth-ui": "^4.0.
|
|
62
|
-
"@things-factory/biz-base": "^4.0.
|
|
63
|
-
"@things-factory/biz-ui": "^4.0.
|
|
64
|
-
"@things-factory/board-service": "^4.0.
|
|
65
|
-
"@things-factory/board-ui": "^4.0.
|
|
66
|
-
"@things-factory/code-ui": "^4.0.
|
|
67
|
-
"@things-factory/component-ui": "^4.0.
|
|
68
|
-
"@things-factory/context-ui": "^4.0.
|
|
69
|
-
"@things-factory/document-template-ui": "^4.0.
|
|
70
|
-
"@things-factory/export-ui": "^4.0.
|
|
71
|
-
"@things-factory/export-ui-csv": "^4.0.
|
|
72
|
-
"@things-factory/export-ui-excel": "^4.0.
|
|
73
|
-
"@things-factory/grist-ui": "^4.0.
|
|
74
|
-
"@things-factory/i18n-base": "^4.0.
|
|
75
|
-
"@things-factory/i18n-ui": "^4.0.
|
|
76
|
-
"@things-factory/import-ui": "^4.0.
|
|
77
|
-
"@things-factory/import-ui-excel": "^4.0.
|
|
78
|
-
"@things-factory/integration-accounting": "^4.0.
|
|
79
|
-
"@things-factory/integration-fulfillment": "^4.0.
|
|
80
|
-
"@things-factory/integration-lmd": "^4.0.
|
|
81
|
-
"@things-factory/integration-marketplace": "^4.0.
|
|
82
|
-
"@things-factory/integration-pos": "^4.0.
|
|
83
|
-
"@things-factory/integration-sellercraft": "^4.0.
|
|
84
|
-
"@things-factory/integration-sftp": "^4.0.
|
|
85
|
-
"@things-factory/lite-menu": "^4.0.
|
|
86
|
-
"@things-factory/more-ui": "^4.0.
|
|
87
|
-
"@things-factory/notification": "^4.0.
|
|
88
|
-
"@things-factory/pdf": "^4.0.
|
|
89
|
-
"@things-factory/product-ui": "^4.0.
|
|
90
|
-
"@things-factory/resource-ui": "^4.0.
|
|
91
|
-
"@things-factory/sales-base": "^4.0.
|
|
92
|
-
"@things-factory/scene-data-transform": "^4.0.
|
|
93
|
-
"@things-factory/scene-excel": "^4.0.
|
|
94
|
-
"@things-factory/scene-firebase": "^4.0.
|
|
95
|
-
"@things-factory/scene-form": "^4.0.
|
|
96
|
-
"@things-factory/scene-google-map": "^4.0.
|
|
97
|
-
"@things-factory/scene-graphql": "^4.0.
|
|
44
|
+
"@operato/scene-chartjs": "^0.1.2",
|
|
45
|
+
"@operato/scene-clock": "^0.1.2",
|
|
46
|
+
"@operato/scene-clone": "^0.1.2",
|
|
47
|
+
"@operato/scene-compass": "^0.1.2",
|
|
48
|
+
"@operato/scene-gauge": "^0.1.2",
|
|
49
|
+
"@operato/scene-indoor-map": "^0.1.2",
|
|
50
|
+
"@operato/scene-legend": "^0.1.2",
|
|
51
|
+
"@operato/scene-progressbar": "^0.1.2",
|
|
52
|
+
"@operato/scene-random": "^0.1.2",
|
|
53
|
+
"@operato/scene-switch": "^0.1.2",
|
|
54
|
+
"@operato/scene-tab": "^0.1.2",
|
|
55
|
+
"@operato/scene-table": "^0.1.2",
|
|
56
|
+
"@operato/scene-wheel-sorter": "^0.1.2",
|
|
57
|
+
"@things-factory/api": "^4.0.33",
|
|
58
|
+
"@things-factory/apptool-ui": "^4.0.33",
|
|
59
|
+
"@things-factory/attachment-base": "^4.0.33",
|
|
60
|
+
"@things-factory/auth-base": "^4.0.33",
|
|
61
|
+
"@things-factory/auth-ui": "^4.0.33",
|
|
62
|
+
"@things-factory/biz-base": "^4.0.33",
|
|
63
|
+
"@things-factory/biz-ui": "^4.0.33",
|
|
64
|
+
"@things-factory/board-service": "^4.0.33",
|
|
65
|
+
"@things-factory/board-ui": "^4.0.33",
|
|
66
|
+
"@things-factory/code-ui": "^4.0.33",
|
|
67
|
+
"@things-factory/component-ui": "^4.0.33",
|
|
68
|
+
"@things-factory/context-ui": "^4.0.33",
|
|
69
|
+
"@things-factory/document-template-ui": "^4.0.33",
|
|
70
|
+
"@things-factory/export-ui": "^4.0.33",
|
|
71
|
+
"@things-factory/export-ui-csv": "^4.0.33",
|
|
72
|
+
"@things-factory/export-ui-excel": "^4.0.33",
|
|
73
|
+
"@things-factory/grist-ui": "^4.0.33",
|
|
74
|
+
"@things-factory/i18n-base": "^4.0.33",
|
|
75
|
+
"@things-factory/i18n-ui": "^4.0.33",
|
|
76
|
+
"@things-factory/import-ui": "^4.0.33",
|
|
77
|
+
"@things-factory/import-ui-excel": "^4.0.33",
|
|
78
|
+
"@things-factory/integration-accounting": "^4.0.33",
|
|
79
|
+
"@things-factory/integration-fulfillment": "^4.0.33",
|
|
80
|
+
"@things-factory/integration-lmd": "^4.0.33",
|
|
81
|
+
"@things-factory/integration-marketplace": "^4.0.33",
|
|
82
|
+
"@things-factory/integration-pos": "^4.0.33",
|
|
83
|
+
"@things-factory/integration-sellercraft": "^4.0.33",
|
|
84
|
+
"@things-factory/integration-sftp": "^4.0.33",
|
|
85
|
+
"@things-factory/lite-menu": "^4.0.33",
|
|
86
|
+
"@things-factory/more-ui": "^4.0.33",
|
|
87
|
+
"@things-factory/notification": "^4.0.33",
|
|
88
|
+
"@things-factory/pdf": "^4.0.33",
|
|
89
|
+
"@things-factory/product-ui": "^4.0.33",
|
|
90
|
+
"@things-factory/resource-ui": "^4.0.33",
|
|
91
|
+
"@things-factory/sales-base": "^4.0.33",
|
|
92
|
+
"@things-factory/scene-data-transform": "^4.0.33",
|
|
93
|
+
"@things-factory/scene-excel": "^4.0.33",
|
|
94
|
+
"@things-factory/scene-firebase": "^4.0.33",
|
|
95
|
+
"@things-factory/scene-form": "^4.0.33",
|
|
96
|
+
"@things-factory/scene-google-map": "^4.0.33",
|
|
97
|
+
"@things-factory/scene-graphql": "^4.0.33",
|
|
98
98
|
"@things-factory/scene-half-roundrect": "^4.0.9",
|
|
99
|
-
"@things-factory/scene-label": "^4.0.
|
|
100
|
-
"@things-factory/scene-marker": "^4.0.
|
|
101
|
-
"@things-factory/scene-mqtt": "^4.0.
|
|
102
|
-
"@things-factory/scene-news-ticker": "^4.0.
|
|
103
|
-
"@things-factory/scene-restful": "^4.0.
|
|
104
|
-
"@things-factory/scene-visualizer": "^4.0.
|
|
105
|
-
"@things-factory/setting-ui": "^4.0.
|
|
106
|
-
"@things-factory/shell": "^4.0.
|
|
107
|
-
"@things-factory/system-ui": "^4.0.
|
|
108
|
-
"@things-factory/warehouse-base": "^4.0.
|
|
109
|
-
"@things-factory/worksheet-base": "^4.0.
|
|
99
|
+
"@things-factory/scene-label": "^4.0.33",
|
|
100
|
+
"@things-factory/scene-marker": "^4.0.33",
|
|
101
|
+
"@things-factory/scene-mqtt": "^4.0.33",
|
|
102
|
+
"@things-factory/scene-news-ticker": "^4.0.33",
|
|
103
|
+
"@things-factory/scene-restful": "^4.0.33",
|
|
104
|
+
"@things-factory/scene-visualizer": "^4.0.33",
|
|
105
|
+
"@things-factory/setting-ui": "^4.0.33",
|
|
106
|
+
"@things-factory/shell": "^4.0.33",
|
|
107
|
+
"@things-factory/system-ui": "^4.0.33",
|
|
108
|
+
"@things-factory/warehouse-base": "^4.0.33",
|
|
109
|
+
"@things-factory/worksheet-base": "^4.0.33",
|
|
110
110
|
"koa2-swagger-ui": "^5.0.2",
|
|
111
111
|
"swagger-jsdoc": "^5.0.0",
|
|
112
112
|
"yamljs": "^0.3.0"
|
|
113
113
|
},
|
|
114
114
|
"devDependencies": {
|
|
115
|
-
"@things-factory/builder": "^4.0.
|
|
115
|
+
"@things-factory/builder": "^4.0.33"
|
|
116
116
|
},
|
|
117
117
|
"resolutions": {
|
|
118
118
|
"core-js": "^3.16.0"
|
|
119
119
|
},
|
|
120
|
-
"gitHead": "
|
|
120
|
+
"gitHead": "0cd5e3b224feb8d526dd5ebc0ee838ff55e2c91c"
|
|
121
121
|
}
|
|
@@ -34,6 +34,11 @@ export const SETTINGS = {
|
|
|
34
34
|
description: 'enable and disable the use of product barcode scanning',
|
|
35
35
|
category: 'id-rule'
|
|
36
36
|
},
|
|
37
|
+
{
|
|
38
|
+
name: 'batch-picking-limit',
|
|
39
|
+
description: 'maximum order per batch picking limit',
|
|
40
|
+
category: 'id-rule'
|
|
41
|
+
},
|
|
37
42
|
{
|
|
38
43
|
name: 'enable-carton-label',
|
|
39
44
|
description: 'enable and disable the use of using carton label',
|
|
@@ -6,19 +6,20 @@ import { Sellercraft, SellercraftAPI } from '@things-factory/integration-sellerc
|
|
|
6
6
|
import { Product, ProductDetail } from '@things-factory/product-base'
|
|
7
7
|
import { Domain } from '@things-factory/shell'
|
|
8
8
|
|
|
9
|
-
import { OrderNoGenerator } from '../../../utils'
|
|
10
|
-
|
|
11
9
|
export const syncProductsToSellercraftResolver = {
|
|
12
10
|
async syncProductsToSellercraft(
|
|
13
11
|
_: void,
|
|
14
|
-
{
|
|
12
|
+
{
|
|
13
|
+
sellercraftId,
|
|
14
|
+
fulfillmentCenterId
|
|
15
|
+
}: { sellercraftId: string; fulfillmentCenterId: string; toCreateSku: boolean },
|
|
15
16
|
context: any
|
|
16
17
|
): Promise<void> {
|
|
17
18
|
const { domain, tx }: { domain: Domain; tx: EntityManager } = context.state
|
|
18
19
|
|
|
19
20
|
let page: number = 1
|
|
20
21
|
let hasMorePage: boolean = true
|
|
21
|
-
const limit: number =
|
|
22
|
+
const limit: number = 10
|
|
22
23
|
|
|
23
24
|
const sellercraft: Sellercraft = await tx
|
|
24
25
|
.getRepository(Sellercraft)
|
|
@@ -27,7 +28,6 @@ export const syncProductsToSellercraftResolver = {
|
|
|
27
28
|
const fulfilmentCenter: FulfillmentCenter = await FulfillmentAPI.getFulfillmentCenter(fulfillmentCenterId)
|
|
28
29
|
const customerBizplace: Bizplace = await tx.getRepository(Bizplace).findOne({ where: { domain: customerDomain } })
|
|
29
30
|
|
|
30
|
-
let sellercraftOPs: any[] = []
|
|
31
31
|
while (hasMorePage) {
|
|
32
32
|
const { items, total } = await FulfillmentAPI.getInventoryProductGroup(fulfilmentCenter, {
|
|
33
33
|
warehouseId: customerBizplace.id,
|
|
@@ -35,6 +35,8 @@ export const syncProductsToSellercraftResolver = {
|
|
|
35
35
|
paginationOffset: page
|
|
36
36
|
})
|
|
37
37
|
|
|
38
|
+
let sellercraftInv: any[] = []
|
|
39
|
+
|
|
38
40
|
await Promise.all(
|
|
39
41
|
items.map(async item => {
|
|
40
42
|
const product: Product = await tx.getRepository(Product).findOne({
|
|
@@ -43,53 +45,45 @@ export const syncProductsToSellercraftResolver = {
|
|
|
43
45
|
})
|
|
44
46
|
|
|
45
47
|
const productDetails: ProductDetail[] = product.productDetails
|
|
46
|
-
const inventoryPackingType: string = item.packingType
|
|
47
|
-
const defaultProductDetail: ProductDetail =
|
|
48
|
-
productDetail => productDetail.isDefault
|
|
49
|
-
)
|
|
48
|
+
// const inventoryPackingType: string = item.packingType
|
|
49
|
+
const defaultProductDetail: ProductDetail = productDetails.find(productDetail => productDetail.isDefault)
|
|
50
50
|
|
|
51
51
|
let packingSize: number = 1
|
|
52
|
-
if (inventoryPackingType !== defaultProductDetail.packingType) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
// if (inventoryPackingType !== defaultProductDetail.packingType) {
|
|
53
|
+
// const unmatchingProductDetail: ProductDetail = product.productDetails.find(
|
|
54
|
+
// productDetail => productDetail.packingType === inventoryPackingType
|
|
55
|
+
// )
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
}
|
|
57
|
+
// packingSize = await getChildPackingSize(productDetails, defaultProductDetail, unmatchingProductDetail)
|
|
58
|
+
// }
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
sellercraftInv.push({
|
|
61
61
|
sku: item.productSKU,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
length: defaultProductDetail.depth < 1 ? 1 : defaultProductDetail.depth,
|
|
73
|
-
width: defaultProductDetail.width < 1 ? 1 : defaultProductDetail.width,
|
|
74
|
-
height: defaultProductDetail.height < 1 ? 1 : defaultProductDetail.height
|
|
62
|
+
gtin: defaultProductDetail?.gtin ? defaultProductDetail.gtin : '',
|
|
63
|
+
stock: {
|
|
64
|
+
quantity: item.remainQty * packingSize,
|
|
65
|
+
unit_of_measure: 'EA'
|
|
66
|
+
},
|
|
67
|
+
package_weight_gm: defaultProductDetail.nettWeight < 1 ? 1 : defaultProductDetail.nettWeight,
|
|
68
|
+
package_dimensions: {
|
|
69
|
+
length_mm: defaultProductDetail.depth < 1 ? 1 : defaultProductDetail.depth,
|
|
70
|
+
width_mm: defaultProductDetail.width < 1 ? 1 : defaultProductDetail.width,
|
|
71
|
+
height_mm: defaultProductDetail.height < 1 ? 1 : defaultProductDetail.height
|
|
75
72
|
}
|
|
76
73
|
})
|
|
77
74
|
})
|
|
78
75
|
)
|
|
79
76
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
77
|
+
const delay = (ms: number) => {
|
|
78
|
+
return new Promise(resolve => setTimeout(resolve, ms))
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
await delay(5000)
|
|
82
|
+
await SellercraftAPI.updateProduct(sellercraft, { accountId: sellercraft.accountId, sellercraftInv })
|
|
83
83
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
inboundId: OrderNoGenerator.initialiseSynchronisation(),
|
|
87
|
-
inboundTime: Math.floor(new Date().getTime() / 1000),
|
|
88
|
-
inboundType: 'blind_receive',
|
|
89
|
-
purchaseOrderId: '',
|
|
90
|
-
sellercraftOPs
|
|
84
|
+
if (sellercraftInv?.length < total) page++
|
|
85
|
+
hasMorePage = Boolean(sellercraftInv?.length < total)
|
|
91
86
|
}
|
|
92
|
-
await SellercraftAPI.addInboundOrder(sellercraft, { ...inboundOrder })
|
|
93
87
|
}
|
|
94
88
|
}
|
|
95
89
|
|
|
@@ -150,17 +150,20 @@ router.get(
|
|
|
150
150
|
)
|
|
151
151
|
|
|
152
152
|
export async function validateFilters(context, filters, fromDate, toDate) {
|
|
153
|
-
if (fromDate && fromDate !== '') {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
} else fromDate = ''
|
|
158
|
-
|
|
159
|
-
if (toDate && toDate !== '') {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
} else toDate = ''
|
|
153
|
+
// if (fromDate && fromDate !== '') {
|
|
154
|
+
// fromDate = new Date(`${fromDate.split(' ').join('')} 00:00:00`)
|
|
155
|
+
// if (fromDate instanceof Date && !isNaN(fromDate.getTime())) fromDate = fromDate.toLocaleString()
|
|
156
|
+
// else context.throw(400, context.t('fromDate is invalid'))
|
|
157
|
+
// } else fromDate = ''
|
|
158
|
+
|
|
159
|
+
// if (toDate && toDate !== '') {
|
|
160
|
+
// toDate = new Date(`${toDate.split(' ').join('')} 23:59:59`)
|
|
161
|
+
// if (toDate instanceof Date && !isNaN(toDate.getTime())) toDate = toDate.toLocaleString()
|
|
162
|
+
// else context.throw(400, context.t('toDate is invalid'))
|
|
163
|
+
// } else toDate = ''
|
|
164
|
+
|
|
165
|
+
if (!fromDate) fromDate = ''
|
|
166
|
+
if (!toDate) toDate = ''
|
|
164
167
|
|
|
165
168
|
if (fromDate !== '' && toDate !== '')
|
|
166
169
|
filters = [...filters, { name: 'createdAt', operator: 'between', value: [fromDate, toDate] }]
|