@things-factory/integration-sellercraft 4.2.10 → 4.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23,14 +23,15 @@ function mapCategories(categories) {
23
23
  if (!categories)
24
24
  return null;
25
25
  categories = categories.map(category => {
26
+ let children_categories = mapCategories(category.childrenCategories);
26
27
  return {
27
28
  native_category_id: category.categoryId.toString(),
28
29
  channel_code: category.channelCode,
29
30
  channel_country: category.countryCode,
30
31
  category_name: category.categoryName,
31
- is_leaf: category.isLeaf,
32
+ is_leaf: children_categories.length == 0 ? true : false,
32
33
  is_active: category.isActive,
33
- children_categories: mapCategories(category.childrenCategories)
34
+ children_categories
34
35
  };
35
36
  });
36
37
  return categories;
@@ -1 +1 @@
1
- {"version":3,"file":"ingest-channel-categories.js","sourceRoot":"","sources":["../../../../server/controllers/sellercraft-channel-integration/apis/ingest-channel-categories.ts"],"names":[],"mappings":";AAAA,+FAA+F;;;AAE/F,SAAgB,uBAAuB;IACrC,OAAO;QACL,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,0BAA0B;QAChC,WAAW,CAAC,GAAG;YACb,MAAM,EAAE,UAAU,EAAE,GAAG,GAAG,CAAA;YAE1B,IAAI,aAAa,GAAG,aAAa,CAAC,UAAU,CAAC,CAAA;YAE7C,OAAO;gBACL,OAAO,EAAE,CAAC,GAAG,aAAa,CAAC;aAC5B,CAAA;QACH,CAAC;QACD,SAAS,CAAC,GAAG;YACX,OAAO,GAAG,CAAA;QACZ,CAAC;KACF,CAAA;AACH,CAAC;AAjBD,0DAiBC;AAED,SAAS,aAAa,CAAC,UAAU;IAC/B,IAAI,CAAC,UAAU;QAAE,OAAO,IAAI,CAAA;IAC5B,UAAU,GAAG,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;QACrC,OAAO;YACL,kBAAkB,EAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,EAAE;YAClD,YAAY,EAAE,QAAQ,CAAC,WAAW;YAClC,eAAe,EAAE,QAAQ,CAAC,WAAW;YACrC,aAAa,EAAE,QAAQ,CAAC,YAAY;YACpC,OAAO,EAAE,QAAQ,CAAC,MAAM;YACxB,SAAS,EAAE,QAAQ,CAAC,QAAQ;YAC5B,mBAAmB,EAAE,aAAa,CAAC,QAAQ,CAAC,kBAAkB,CAAC;SAChE,CAAA;IACH,CAAC,CAAC,CAAA;IACF,OAAO,UAAU,CAAA;AACnB,CAAC"}
1
+ {"version":3,"file":"ingest-channel-categories.js","sourceRoot":"","sources":["../../../../server/controllers/sellercraft-channel-integration/apis/ingest-channel-categories.ts"],"names":[],"mappings":";AAAA,+FAA+F;;;AAE/F,SAAgB,uBAAuB;IACrC,OAAO;QACL,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,0BAA0B;QAChC,WAAW,CAAC,GAAG;YACb,MAAM,EAAE,UAAU,EAAE,GAAG,GAAG,CAAA;YAE1B,IAAI,aAAa,GAAG,aAAa,CAAC,UAAU,CAAC,CAAA;YAE7C,OAAO;gBACL,OAAO,EAAE,CAAC,GAAG,aAAa,CAAC;aAC5B,CAAA;QACH,CAAC;QACD,SAAS,CAAC,GAAG;YACX,OAAO,GAAG,CAAA;QACZ,CAAC;KACF,CAAA;AACH,CAAC;AAjBD,0DAiBC;AAED,SAAS,aAAa,CAAC,UAAU;IAC/B,IAAI,CAAC,UAAU;QAAE,OAAO,IAAI,CAAA;IAC5B,UAAU,GAAG,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;QACrC,IAAI,mBAAmB,GAAG,aAAa,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAA;QACpE,OAAO;YACL,kBAAkB,EAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,EAAE;YAClD,YAAY,EAAE,QAAQ,CAAC,WAAW;YAClC,eAAe,EAAE,QAAQ,CAAC,WAAW;YACrC,aAAa,EAAE,QAAQ,CAAC,YAAY;YACpC,OAAO,EAAE,mBAAmB,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK;YACvD,SAAS,EAAE,QAAQ,CAAC,QAAQ;YAC5B,mBAAmB;SACpB,CAAA;IACH,CAAC,CAAC,CAAA;IACF,OAAO,UAAU,CAAA;AACnB,CAAC"}
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.sellercraftRouter = void 0;
7
7
  const koa_router_1 = __importDefault(require("koa-router"));
8
+ const v4_1 = __importDefault(require("uuid/v4"));
8
9
  const env_1 = require("@things-factory/env");
9
10
  const integration_marketplace_1 = require("@things-factory/integration-marketplace");
10
11
  const constants_1 = require("../constants");
@@ -137,7 +138,7 @@ exports.sellercraftRouter.post('/sellercraft/store/update-product-stock', async
137
138
  }
138
139
  });
139
140
  exports.sellercraftRouter.post('/sellercraft/store/update-order-status', async (context, next) => {
140
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
141
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
141
142
  try {
142
143
  const sellercraftChannelIntegrationConfig = env_1.config.get('sellercraftChannelIntegrationConfig', {});
143
144
  const { tokenCraftApiKey: apiKey, tokenCraftUrl } = sellercraftChannelIntegrationConfig;
@@ -175,17 +176,63 @@ exports.sellercraftRouter.post('/sellercraft/store/update-order-status', async (
175
176
  orderItems: requestBody === null || requestBody === void 0 ? void 0 : requestBody.order_item_ids,
176
177
  isSOF: requestBody === null || requestBody === void 0 ? void 0 : requestBody.seller_logistics
177
178
  };
179
+ let responseBody = { operation_id: (0, v4_1.default)() };
178
180
  try {
179
181
  result = await integration_marketplace_1.StoreAPI.updateOrderStatus(mappedStore, reqBody);
180
182
  debug(result);
183
+ if (result === null || result === void 0 ? void 0 : result.requiredDocument) {
184
+ // call document api and ingest channel order package
185
+ const order = await integration_marketplace_1.StoreAPI.getStoreOrder(mappedStore, { orderId: reqBody.orderId });
186
+ let orderPackage = order ? (((_k = order[0]) === null || _k === void 0 ? void 0 : _k.orderPackage) ? order[0].orderPackage : {}) : {};
187
+ if (orderPackage) {
188
+ const packageId = orderPackage.packageId;
189
+ let orderDocument = orderPackage.orderDocument;
190
+ if ((orderDocument === null || orderDocument === void 0 ? void 0 : orderDocument.length) == 0) {
191
+ let hasDocument = false;
192
+ while (!hasDocument) {
193
+ orderDocument = await integration_marketplace_1.StoreAPI.getStoreOrderDocument(mappedStore, { packageId, documentType: 1 });
194
+ if ((orderDocument === null || orderDocument === void 0 ? void 0 : orderDocument.length) > 0) {
195
+ hasDocument = true;
196
+ break;
197
+ }
198
+ }
199
+ }
200
+ // Order Package Payload
201
+ let newOrderPackage = {
202
+ channel_shop_id: mappedStore.channelShopId,
203
+ native_order_id: reqBody.orderId,
204
+ native_package_id: orderPackage.packageId,
205
+ shipping_tracking_code: orderPackage.trackingNumber,
206
+ shipping_type_value: (orderPackage === null || orderPackage === void 0 ? void 0 : orderPackage.shippingType) ? orderPackage.shippingType : constants_1.SHIPPING_TYPE.DROP_SHIPPING,
207
+ warehouse_code: constants_1.SHIPPING_TYPE.DROP_SHIPPING,
208
+ shipper: {
209
+ name: orderPackage.shippingProvider,
210
+ is_cod_supported: (orderPackage === null || orderPackage === void 0 ? void 0 : orderPackage.isCodSupport) ? orderPackage.isCodSupport : false
211
+ },
212
+ documents: orderDocument || [],
213
+ shipper_last_mile: {
214
+ name: orderPackage.shippingProvider,
215
+ is_cod_supported: (orderPackage === null || orderPackage === void 0 ? void 0 : orderPackage.isCodSupport) ? orderPackage.isCodSupport : false
216
+ },
217
+ order_item_ids: (orderPackage === null || orderPackage === void 0 ? void 0 : orderPackage.orderListIdList) ? orderPackage.orderListIdList : reqBody.orderItems
218
+ } || {};
219
+ responseBody.package = newOrderPackage;
220
+ }
221
+ responseBody.response_code = 'E0';
222
+ responseBody.message = 'Success';
223
+ }
224
+ responseBody.time = Math.floor(new Date(new Date().toUTCString()).getTime() / 1000);
181
225
  context.type = 'application/json';
182
226
  context.status = 200;
183
- context.body = 'Succeeded';
227
+ context.body = responseBody;
228
+ await next();
184
229
  }
185
230
  catch (e) {
231
+ responseBody.response_code = 'E1';
232
+ responseBody.message = e.message;
186
233
  context.type = 'application/json';
187
234
  context.status = 500;
188
- context.body = e.message;
235
+ context.body = responseBody;
189
236
  }
190
237
  }
191
238
  catch (e) { }
@@ -1 +1 @@
1
- {"version":3,"file":"sellercraft-router.js","sourceRoot":"","sources":["../../server/routers/sellercraft-router.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA+B;AAE/B,6CAA4C;AAC5C,qFAAkE;AAElE,4CAAuC;AAEvC,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,2DAA2D,CAAC,CAAA;AAE9E,QAAA,iBAAiB,GAAG,IAAI,oBAAM,EAAE,CAAA;AAE7C,yBAAiB,CAAC,IAAI,CAAC,yCAAyC,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;;IACxF,MAAM,mCAAmC,GAAG,YAAM,CAAC,GAAG,CAAC,qCAAqC,EAAE,EAAE,CAAC,CAAA;IACjG,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,mCAAmC,CAAA;IAEvF,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;IAE5C,IAAI,MAAM,KAAK,OAAO;QAAE,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,2BAA2B,CAAC,CAAA;IAEvE,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAA;IAExC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAC3C,IAAI,KAAK,GAAQ,EAAE,CAAA,CAAC,sBAAsB;QAC1C,IAAI,MAAM,CAAA;QAEV,qJAAqJ;QACrJ,IAAI,QAAQ,GAAG,GAAG,aAAa,eAAe,WAAW,CAAC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EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,OAAO,CAAA;QAEnF,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;YACzB,IAAI,EAAE,mBAAmB,EAAE,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,GAAG,SAAS,CAAA;YAExF,OAAO;gBACL,EAAE;gBACF,IAAI;gBACJ,KAAK;aACN,CAAA;QACH,CAAC,CAAC,CAAA;QAEF,OAAO;YACL,UAAU;YACV,SAAS;YACT,UAAU;SACX,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACxC,IAAI;YACF,IAAI,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAA;YACzB,MAAM,kCAAQ,CAAC,sBAAsB,CAAC,WAAW,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAA;YACnF,OAAO,CAAC,IAAI,GAAG,kBAAkB,CAAA;YACjC,OAAO,CAAC,MAAM,GAAG,GAAG,CAAA;YACpB,OAAO,CAAC,IAAI,GAAG,WAAW,CAAA;SAC3B;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,CAAC,IAAI,GAAG,kBAAkB,CAAA;YACjC,OAAO,CAAC,MAAM,GAAG,GAAG,CAAA;YACpB,OAAO,CAAC,IAAI,GAAG,CAAC,CAAC,OAAO,CAAA;SACzB;KACF;AACH,CAAC,CAAC,CAAA"}
@@ -57,7 +57,7 @@ let MarketplaceChannelOrderMutation = class MarketplaceChannelOrderMutation {
57
57
  let organisationId = shops[j].account_id;
58
58
  let channelShopId = shops[j].channel_shop_id;
59
59
  let orderResult = [];
60
- let page = 1;
60
+ let page = store.platform == 'magento' ? 1 : 0;
61
61
  let hasMorePage = true;
62
62
  let lastOrderId;
63
63
  let cursor;
@@ -283,7 +283,9 @@ let MarketplaceChannelOrderMutation = class MarketplaceChannelOrderMutation {
283
283
  };
284
284
  });
285
285
  if (mappedOrderResult.length > 0) {
286
- await sellercraft_channel_integration_api_1.SellercraftChannelIntegrationAPI.ingestChannelOrder(sellercraftStore, { orders: mappedOrderResult });
286
+ await sellercraft_channel_integration_api_1.SellercraftChannelIntegrationAPI.ingestChannelOrder(sellercraftStore, {
287
+ orders: mappedOrderResult
288
+ });
287
289
  await Promise.all(mappedOrderResult.map(async (result) => {
288
290
  var _a;
289
291
  if (!(result === null || result === void 0 ? void 0 : result.isSOF) && ((_a = result === null || result === void 0 ? void 0 : result.orderPackage) === null || _a === void 0 ? void 0 : _a.packageId)) {
@@ -317,10 +319,10 @@ let MarketplaceChannelOrderMutation = class MarketplaceChannelOrderMutation {
317
319
  }
318
320
  catch (e) { }
319
321
  }
320
- return true;
321
322
  }
322
323
  catch (e) { }
323
324
  }
325
+ return true;
324
326
  }
325
327
  };
326
328
  __decorate([
@@ -343,8 +345,8 @@ function getOrderCharges(mappedOrderItems) {
343
345
  let charge = mappedOrderItems[i].charges[j];
344
346
  let foundCharge = chargesList.find(cl => cl.name == charge.name);
345
347
  if (foundCharge) {
346
- foundCharge.grossAmount = foundCharge.grossAmount + charge.grossAmount;
347
- foundCharge.nettAmount = foundCharge.nettAmount + charge.nettAmount;
348
+ foundCharge.grossAmount = parseFloat(foundCharge.grossAmount) + parseFloat(charge.grossAmount);
349
+ foundCharge.nettAmount = parseFloat(foundCharge.nettAmount) + parseFloat(charge.nettAmount);
348
350
  chargesList = chargesList.filter(cl => cl.name != charge.name);
349
351
  }
350
352
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"marketplace-channel-order-mutation.js","sourceRoot":"","sources":["../../../server/service/marketplace-channel/marketplace-channel-order-mutation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAA2D;AAC3D,qCAAuC;AAEvC,6CAA4C;AAC5C,qFAAkE;AAElE,+CAA+C;AAC/C,+GAAwG;AACxG,+DAA0D;A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,CAAC"}
1
+ {"version":3,"file":"marketplace-channel-order-mutation.js","sourceRoot":"","sources":["../../../server/service/marketplace-channel/marketplace-channel-order-mutation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAA2D;AAC3D,qCAAuC;AAEvC,6CAA4C;AAC5C,qFAAkE;AAElE,+CAA+C;AAC/C,+GAAwG;AACxG,+DAA0D;AAG1D,IAAa,+BAA+B,GAA5C,MAAa,+BAA+B;IAE1C,KAAK,CAAC,+BAA+B,CAClB,QAAgB,EAClB,MAAc,EACtB,OAAY;;QAEnB,MAAM,mCAAmC,GAAG,YAAM,CAAC,GAAG,CAAC,qCAAqC,EAAE,EAAE,CAAC,CAAA;QACjG,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,qBAAqB,EAAE,GAAG,mCAAmC,CAAA;QAE/F,MAAM,QAAQ,GAAyB,MAAM,IAAA,uBAAa,EAAC,wCAAkB,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,CAAC,CAAA;QAElH,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACxC,IAAI;gBACF,MAAM,OAAO,GAAuB,QAAQ,CAAC,CAAC,CAAC,CAAA;gBAC/C,IAAI,gBAAgB,GAAG,qBAAqB,GAAG,cAAc,GAAG,OAAO,CAAC,SAAS,CAAA;gBACjF,MAAM,eAAe,GAAQ,MAAM,KAAK,CAAC,gBAAgB,EAAE;oBACzD,MAAM,EAAE,KAAK;oBACb,OAAO,EAAE;wBACP,cAAc,EAAE,kBAAkB;wBAClC,WAAW,EAAE,MAAM;qBACpB;iBACF,CAAC,CAAA;gBAEF,IAAI,CAAC,eAAe,CAAC,EAAE,EAAE;oBACvB,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAA;iBACjC;gBACD,IAAI,aAAa,GAAG,MAAM,eAAe,CAAC,IA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U,CAAC,CAAA;gBAC3F,WAAW,GAAG,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,CAAA;aAC/D;iBAAM;gBACL,WAAW,GAAG;oBACZ,IAAI,EAAE,MAAM,CAAC,IAAI;oBACjB,WAAW,EAAE,MAAM,CAAC,WAAW;oBAC/B,UAAU,EAAE,MAAM,CAAC,UAAU;iBAC9B,CAAA;aACF;YACD,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;SAC9B;KACF;IACD,OAAO,WAAW,CAAA;AACpB,CAAC"}
@@ -137,7 +137,6 @@ let MarketplaceChannelProductMutation = class MarketplaceChannelProductMutation
137
137
  categoryId,
138
138
  categoryName,
139
139
  parent,
140
- isLeaf: parent == 0 ? false : true,
141
140
  isActive: isActive || true,
142
141
  channelCode,
143
142
  countryCode,
@@ -163,12 +162,19 @@ let MarketplaceChannelProductMutation = class MarketplaceChannelProductMutation
163
162
  mappedProducts = newList;
164
163
  }
165
164
  try {
165
+ let filterList = [];
166
166
  mappedCategories = mappedCategories.map(category => {
167
167
  if (mappedCategories.filter(e => e.parent == category.categoryId).length > 0) {
168
168
  category.childrenCategories = mappedCategories.filter(e => e.parent == category.categoryId);
169
+ filterList.push(...mappedCategories.filter(e => e.parent == category.categoryId));
169
170
  }
170
171
  return category;
171
172
  });
173
+ mappedCategories = mappedCategories.map(mc => {
174
+ if (filterList.indexOf(mc) == -1) {
175
+ return mc;
176
+ }
177
+ }).filter(e => e);
172
178
  await sellercraft_channel_integration_api_1.SellercraftChannelIntegrationAPI.ingestChannelCategories(sellercraftStore, {
173
179
  categories: mappedCategories
174
180
  });
@@ -183,8 +189,8 @@ let MarketplaceChannelProductMutation = class MarketplaceChannelProductMutation
183
189
  }
184
190
  catch (e) { }
185
191
  }
186
- return true;
187
192
  }
193
+ return true;
188
194
  }
189
195
  };
190
196
  __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"marketplace-channel-product-mutation.js","sourceRoot":"","sources":["../../../server/service/marketplace-channel/marketplace-channel-product-mutation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAAsD;AACtD,qCAAuC;AAEvC,6CAA4C;AAC5C,qFAAkE;AAElE,+GAAwG;AACxG,+DAA0D;AAG1D,IAAa,iCAAiC,GAA9C,MAAa,iCAAiC;IAE5C,KAAK,CAAC,iCAAiC,CAAQ,OAAY;;QACzD,MAAM,mCAAmC,GAAG,YAAM,CAAC,GAAG,CAAC,qCAAqC,EAAE,EAAE,CAAC,CAAA;QACjG,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,qBAAqB,EAAE,GAAG,mCAAmC,CAAA;QAE/F,MAAM,QAAQ,GAAyB,MAAM,IAAA,uBAAa,EAAC,wCAAkB,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,CAAC,CAAA;QAElH,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACxC,IAAI,gBAAgB,GAAG,qBAAqB,GAAG,cAAc,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;YACrF,MAAM,eAAe,GAAQ,MAAM,KAAK,CAAC,gBAAgB,EAAE;gBACzD,MAAM,EAAE,KAAK;gBACb,OAAO,EAAE;oBACP,cAAc,EAAE,kBAAkB;oBAClC,WAAW,EAAE,MAAM;iBACpB;aACF,CAAC,CAAA;YAEF,IAAI,CAAC,eAAe,CAAC,EAAE,EAAE;gBACvB,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAA;aACjC;YACD,IAAI,aAAa,GAAG,MAAM,eAAe,CAAC,IAAI,EAAE,CAAA;YAChD,IAAI,KAAK,GAAG,aAAa,CAAC,KAAK,CAAA;YAE/B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KA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,CAAA;qBACH;iBACF;gBAAC,OAAO,CAAC,EAAE,GAAE;aACf;SAEF;QACD,OAAO,IAAI,CAAA;IACb,CAAC;CACF,CAAA;AA7MC;IADC,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC;IACY,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;0FA4M7C;AA9MU,iCAAiC;IAD7C,IAAA,uBAAQ,GAAE;GACE,iCAAiC,CA+M7C;AA/MY,8EAAiC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/integration-sellercraft",
3
- "version": "4.2.10",
3
+ "version": "4.2.11",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -31,7 +31,7 @@
31
31
  "@things-factory/context-ui": "^4.1.40",
32
32
  "@things-factory/grist-ui": "^4.1.40",
33
33
  "@things-factory/i18n-base": "^4.1.40",
34
- "@things-factory/integration-marketplace": "^4.2.10",
34
+ "@things-factory/integration-marketplace": "^4.2.11",
35
35
  "@things-factory/integration-ui": "^4.1.40",
36
36
  "@things-factory/more-ui": "^4.1.40",
37
37
  "@things-factory/resource-ui": "^4.1.40",
@@ -51,5 +51,5 @@
51
51
  "nock": "^13.0.2",
52
52
  "should": "^13.2.3"
53
53
  },
54
- "gitHead": "b1d15d7774552b3f576bfeaf1c685ea67238c379"
54
+ "gitHead": "dd17e7cfd9d66ec54cc108501185557bd4bded7c"
55
55
  }
@@ -22,14 +22,15 @@ export function ingestChannelCategories() {
22
22
  function mapCategories(categories) {
23
23
  if (!categories) return null
24
24
  categories = categories.map(category => {
25
+ let children_categories = mapCategories(category.childrenCategories)
25
26
  return {
26
27
  native_category_id: category.categoryId.toString(),
27
28
  channel_code: category.channelCode,
28
29
  channel_country: category.countryCode,
29
30
  category_name: category.categoryName,
30
- is_leaf: category.isLeaf,
31
+ is_leaf: children_categories.length == 0 ? true : false,
31
32
  is_active: category.isActive,
32
- children_categories: mapCategories(category.childrenCategories)
33
+ children_categories
33
34
  }
34
35
  })
35
36
  return categories
@@ -1,9 +1,10 @@
1
1
  import Router from 'koa-router'
2
+ import uuid from 'uuid/v4'
2
3
 
3
4
  import { config } from '@things-factory/env'
4
5
  import { StoreAPI } from '@things-factory/integration-marketplace'
5
6
 
6
- import { PLATFORM } from '../constants'
7
+ import { PLATFORM, SHIPPING_TYPE } from '../constants'
7
8
 
8
9
  const debug = require('debug')('things-factory:integration-sellercraft:sellercraft-router')
9
10
 
@@ -190,17 +191,71 @@ sellercraftRouter.post('/sellercraft/store/update-order-status', async (context,
190
191
  isSOF: requestBody?.seller_logistics
191
192
  }
192
193
 
194
+ let responseBody: any = { operation_id: uuid() }
193
195
  try {
194
196
  result = await StoreAPI.updateOrderStatus(mappedStore, reqBody)
195
197
  debug(result)
196
198
 
199
+ if (result?.requiredDocument) {
200
+ // call document api and ingest channel order package
201
+ const order: any = await StoreAPI.getStoreOrder(mappedStore, { orderId: reqBody.orderId })
202
+ let orderPackage: any = order ? (order[0]?.orderPackage ? order[0].orderPackage : {}) : {}
203
+ if (orderPackage) {
204
+ const packageId: string = orderPackage.packageId
205
+
206
+ let orderDocument: any = orderPackage.orderDocument
207
+ if (orderDocument?.length == 0) {
208
+ let hasDocument: boolean = false
209
+ while (!hasDocument) {
210
+ orderDocument = await StoreAPI.getStoreOrderDocument(mappedStore, { packageId, documentType: 1 })
211
+ if (orderDocument?.length > 0) {
212
+ hasDocument = true
213
+ break
214
+ }
215
+ }
216
+ }
217
+
218
+ // Order Package Payload
219
+ let newOrderPackage: any =
220
+ {
221
+ channel_shop_id: mappedStore.channelShopId,
222
+ native_order_id: reqBody.orderId,
223
+ native_package_id: orderPackage.packageId,
224
+ shipping_tracking_code: orderPackage.trackingNumber,
225
+ shipping_type_value: orderPackage?.shippingType ? orderPackage.shippingType : SHIPPING_TYPE.DROP_SHIPPING,
226
+ warehouse_code: SHIPPING_TYPE.DROP_SHIPPING,
227
+ shipper: {
228
+ name: orderPackage.shippingProvider,
229
+ is_cod_supported: orderPackage?.isCodSupport ? orderPackage.isCodSupport : false
230
+ },
231
+ documents: orderDocument || [],
232
+ shipper_last_mile: {
233
+ name: orderPackage.shippingProvider,
234
+ is_cod_supported: orderPackage?.isCodSupport ? orderPackage.isCodSupport : false
235
+ },
236
+ order_item_ids: orderPackage?.orderListIdList ? orderPackage.orderListIdList : reqBody.orderItems
237
+ } || {}
238
+
239
+ responseBody.package = newOrderPackage
240
+ }
241
+ responseBody.response_code = 'E0'
242
+ responseBody.message = 'Success'
243
+ }
244
+
245
+ responseBody.time = Math.floor(new Date(new Date().toUTCString()).getTime() / 1000)
246
+
197
247
  context.type = 'application/json'
198
248
  context.status = 200
199
- context.body = 'Succeeded'
249
+ context.body = responseBody
250
+
251
+ await next()
200
252
  } catch (e) {
253
+ responseBody.response_code = 'E1'
254
+ responseBody.message = e.message
255
+
201
256
  context.type = 'application/json'
202
257
  context.status = 500
203
- context.body = e.message
258
+ context.body = responseBody
204
259
  }
205
260
  } catch (e) {}
206
261
  })
@@ -56,7 +56,7 @@ export class MarketplaceChannelOrderMutation {
56
56
  let channelShopId = shops[j].channel_shop_id
57
57
 
58
58
  let orderResult = []
59
- let page: number = 1
59
+ let page: number = store.platform == 'magento' ? 1 : 0
60
60
  let hasMorePage: boolean = true
61
61
  let lastOrderId: string
62
62
  let cursor: string
@@ -343,7 +343,9 @@ export class MarketplaceChannelOrderMutation {
343
343
  })
344
344
 
345
345
  if (mappedOrderResult.length > 0) {
346
- await SellercraftChannelIntegrationAPI.ingestChannelOrder(sellercraftStore, { orders: mappedOrderResult })
346
+ await SellercraftChannelIntegrationAPI.ingestChannelOrder(sellercraftStore, {
347
+ orders: mappedOrderResult
348
+ })
347
349
 
348
350
  await Promise.all(
349
351
  mappedOrderResult.map(async result => {
@@ -379,10 +381,9 @@ export class MarketplaceChannelOrderMutation {
379
381
  }
380
382
  } catch (e) {}
381
383
  }
382
-
383
- return true
384
384
  } catch (e) {}
385
385
  }
386
+ return true
386
387
  }
387
388
  }
388
389
 
@@ -394,8 +395,8 @@ function getOrderCharges(mappedOrderItems) {
394
395
  let charge = mappedOrderItems[i].charges[j]
395
396
  let foundCharge = chargesList.find(cl => cl.name == charge.name)
396
397
  if (foundCharge) {
397
- foundCharge.grossAmount = foundCharge.grossAmount + charge.grossAmount
398
- foundCharge.nettAmount = foundCharge.nettAmount + charge.nettAmount
398
+ foundCharge.grossAmount = parseFloat(foundCharge.grossAmount) + parseFloat(charge.grossAmount)
399
+ foundCharge.nettAmount = parseFloat(foundCharge.nettAmount) + parseFloat(charge.nettAmount)
399
400
  chargesList = chargesList.filter(cl => cl.name != charge.name)
400
401
  } else {
401
402
  foundCharge = {
@@ -156,7 +156,6 @@ export class MarketplaceChannelProductMutation {
156
156
  categoryId,
157
157
  categoryName,
158
158
  parent,
159
- isLeaf: parent == 0 ? false : true,
160
159
  isActive: isActive || true,
161
160
  channelCode,
162
161
  countryCode,
@@ -184,13 +183,21 @@ export class MarketplaceChannelProductMutation {
184
183
  }
185
184
 
186
185
  try {
186
+ let filterList = []
187
187
  mappedCategories = mappedCategories.map(category => {
188
188
  if (mappedCategories.filter(e => e.parent == category.categoryId).length > 0) {
189
189
  category.childrenCategories = mappedCategories.filter(e => e.parent == category.categoryId)
190
+ filterList.push(...mappedCategories.filter(e => e.parent == category.categoryId))
190
191
  }
191
192
  return category
192
193
  })
193
194
 
195
+ mappedCategories = mappedCategories.map(mc => {
196
+ if (filterList.indexOf(mc) == -1) {
197
+ return mc
198
+ }
199
+ }).filter(e => e)
200
+
194
201
  await SellercraftChannelIntegrationAPI.ingestChannelCategories(sellercraftStore, {
195
202
  categories: mappedCategories
196
203
  })
@@ -205,7 +212,7 @@ export class MarketplaceChannelProductMutation {
205
212
  } catch (e) {}
206
213
  }
207
214
 
208
- return true
209
215
  }
216
+ return true
210
217
  }
211
218
  }