@things-factory/integration-sellercraft 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.
Files changed (41) hide show
  1. package/dist-server/constants/index.js +5 -1
  2. package/dist-server/constants/index.js.map +1 -1
  3. package/dist-server/controllers/index.js +5 -1
  4. package/dist-server/controllers/index.js.map +1 -1
  5. package/dist-server/controllers/sellercraft/apis/index.js +5 -1
  6. package/dist-server/controllers/sellercraft/apis/index.js.map +1 -1
  7. package/dist-server/controllers/sellercraft/index.js +5 -1
  8. package/dist-server/controllers/sellercraft/index.js.map +1 -1
  9. package/dist-server/controllers/sellercraft-channel-integration/apis/index.js +5 -1
  10. package/dist-server/controllers/sellercraft-channel-integration/apis/index.js.map +1 -1
  11. package/dist-server/controllers/sellercraft-channel-integration/apis/ingest-channel-categories.js +3 -2
  12. package/dist-server/controllers/sellercraft-channel-integration/apis/ingest-channel-categories.js.map +1 -1
  13. package/dist-server/controllers/sellercraft-channel-integration/apis/ingest-channel-order.js +9 -2
  14. package/dist-server/controllers/sellercraft-channel-integration/apis/ingest-channel-order.js.map +1 -1
  15. package/dist-server/controllers/sellercraft-channel-integration/apis/ingest-channel-product.js +0 -15
  16. package/dist-server/controllers/sellercraft-channel-integration/apis/ingest-channel-product.js.map +1 -1
  17. package/dist-server/controllers/sellercraft-channel-integration/index.js +5 -1
  18. package/dist-server/controllers/sellercraft-channel-integration/index.js.map +1 -1
  19. package/dist-server/controllers/sellercraft-channel-integration/sellercraft-channel-integration.js +1 -1
  20. package/dist-server/controllers/sellercraft-channel-integration/sellercraft-channel-integration.js.map +1 -1
  21. package/dist-server/index.js +5 -1
  22. package/dist-server/index.js.map +1 -1
  23. package/dist-server/routers/sellercraft-router.js +63 -6
  24. package/dist-server/routers/sellercraft-router.js.map +1 -1
  25. package/dist-server/service/index.js +5 -1
  26. package/dist-server/service/index.js.map +1 -1
  27. package/dist-server/service/marketplace-channel/marketplace-channel-order-mutation.js +8 -6
  28. package/dist-server/service/marketplace-channel/marketplace-channel-order-mutation.js.map +1 -1
  29. package/dist-server/service/marketplace-channel/marketplace-channel-product-mutation.js +27 -3
  30. package/dist-server/service/marketplace-channel/marketplace-channel-product-mutation.js.map +1 -1
  31. package/dist-server/service/marketplace-channel/marketplace-channel.js +5 -0
  32. package/dist-server/service/marketplace-channel/marketplace-channel.js.map +1 -1
  33. package/package.json +15 -15
  34. package/server/controllers/sellercraft-channel-integration/apis/ingest-channel-categories.ts +3 -2
  35. package/server/controllers/sellercraft-channel-integration/apis/ingest-channel-order.ts +9 -2
  36. package/server/controllers/sellercraft-channel-integration/apis/ingest-channel-product.ts +0 -16
  37. package/server/controllers/sellercraft-channel-integration/sellercraft-channel-integration.ts +1 -1
  38. package/server/routers/sellercraft-router.ts +71 -6
  39. package/server/service/marketplace-channel/marketplace-channel-order-mutation.ts +8 -7
  40. package/server/service/marketplace-channel/marketplace-channel-product-mutation.ts +29 -3
  41. package/server/service/marketplace-channel/marketplace-channel.ts +4 -0
@@ -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.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
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":";;;;;;;;;;;;AAAA,6CAA0B;AAC1B,yDAAsC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/constants/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA0B;AAC1B,yDAAsC"}
@@ -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.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
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":";;;;;;;;;;;;AAAA,yBAAsB;AAEtB,oDAAiC;AACjC,oEAAiD;AACjD,wEAAqD"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/controllers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yBAAsB;AAEtB,oDAAiC;AACjC,oEAAiD;AACjD,wEAAqD"}
@@ -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.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
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/sellercraft/apis/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAAsB;AACtB,sDAAmC;AACnC,yDAAsC;AACtC,4DAAyC;AACzC,4DAAyC;AACzC,2DAAwC;AACxC,6DAA0C;AAC1C,mDAAgC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/controllers/sellercraft/apis/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAsB;AACtB,sDAAmC;AACnC,yDAAsC;AACtC,4DAAyC;AACzC,4DAAyC;AACzC,2DAAwC;AACxC,6DAA0C;AAC1C,mDAAgC"}
@@ -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.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
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/sellercraft/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,wDAAmD;AACnD,6CAA8B;AAC9B,uDAA0C;AAE1C,gDAA6B;AAE7B,gCAAc,CAAC,gBAAgB,CAAC,aAAa,EAAE,wBAAM,EAAE,IAAI,CAAC,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/controllers/sellercraft/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wDAAmD;AACnD,6CAA8B;AAC9B,uDAA0C;AAE1C,gDAA6B;AAE7B,gCAAc,CAAC,gBAAgB,CAAC,aAAa,EAAE,wBAAM,EAAE,IAAI,CAAC,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.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
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/sellercraft-channel-integration/apis/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAAsB;AACtB,8DAA2C;AAC3C,uEAAoD;AACpD,iEAA8C;AAC9C,yDAAsC;AACtC,2DAAwC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/controllers/sellercraft-channel-integration/apis/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAsB;AACtB,8DAA2C;AAC3C,uEAAoD;AACpD,iEAA8C;AAC9C,yDAAsC;AACtC,2DAAwC"}
@@ -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"}
@@ -20,7 +20,13 @@ function ingestChannelOrder() {
20
20
  updated_at_time: new Date(order.updatedAt).toISOString(),
21
21
  customer_first_name: order.custFirstName,
22
22
  customer_last_name: order.custLastName,
23
- charges: [],
23
+ charges: order.charges.map(charge => {
24
+ return {
25
+ charge_type_value: charge.name,
26
+ amount_gross: parseFloat(charge.grossAmount) || 0,
27
+ amount_nett: parseFloat(charge.nettAmount) || 0
28
+ };
29
+ }),
24
30
  address_shipping: {
25
31
  first_name: order.shipFirstName,
26
32
  last_name: order.shipLastName,
@@ -68,7 +74,8 @@ function ingestChannelOrder() {
68
74
  }),
69
75
  order_status_value: constants_1.ORDER_STATUS[`${order.status}`]
70
76
  };
71
- })
77
+ }),
78
+ seller_logistics: order === null || order === void 0 ? void 0 : order.isSOF
72
79
  };
73
80
  });
74
81
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"ingest-channel-order.js","sourceRoot":"","sources":["../../../../server/controllers/sellercraft-channel-integration/apis/ingest-channel-order.ts"],"names":[],"mappings":";AAAA,4FAA4F;;;AAE5F,kDAAiD;AAEjD,SAAgB,kBAAkB;IAChC,OAAO;QACL,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,uBAAuB;QAC7B,WAAW,CAAC,GAAG;YACb,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,CAAA;YAEtB,IAAI,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;gBACjC,OAAO;oBACL,eAAe,EAAE,KAAK,CAAC,cAAc;oBACrC,eAAe,EAAE,KAAK,CAAC,aAAa;oBACpC,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE;oBACpC,eAAe,EAAE,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE;oBACxD,eAAe,EAAE,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE;oBACxD,eAAe,EAAE,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE;oBACxD,eAAe,EAAE,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE;oBACxD,mBAAmB,EAAE,KAAK,CAAC,aAAa;oBACxC,kBAAkB,EAAE,KAAK,CAAC,YAAY;oBACtC,OAAO,EAAE,EAAE;oBACX,gBAAgB,EAAE;wBAChB,UAAU,EAAE,KAAK,CAAC,aAAa;wBAC/B,SAAS,EAAE,KAAK,CAAC,YAAY;wBAC7B,MAAM,EAAE,KAAK,CAAC,YAAY;wBAC1B,MAAM,EAAE,K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,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE;4BACxD,eAAe,EAAE,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE;4BACxD,cAAc,EAAE,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,YAAY,EAAC,CAAC,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI;4BAC/F,OAAO,EAAE,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;gCACtC,OAAO;oCACL,iBAAiB,EAAE,MAAM,CAAC,IAAI;oCAC9B,YAAY,EAAE,UAAU,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC;oCACjD,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC;iCAChD,CAAA;4BACH,CAAC,CAAC;4BACF,kBAAkB,EAAE,wBAAY,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;yBACpD,CAAA;oBACH,CAAC,CAAC;iBACH,CAAA;YACH,CAAC,CAAC,CAAA;YAEF,OAAO;gBACL,OAAO,EAAE,CAAC,GAAG,SAAS,CAAC;aACxB,CAAA;QACH,CAAC;QACD,SAAS,CAAC,GAAG;YACX,OAAO,GAAG,CAAA;QACZ,CAAC;KACF,CAAA;AACH,CAAC;AA9ED,gDA8EC"}
1
+ {"version":3,"file":"ingest-channel-order.js","sourceRoot":"","sources":["../../../../server/controllers/sellercraft-channel-integration/apis/ingest-channel-order.ts"],"names":[],"mappings":";AAAA,4FAA4F;;;AAE5F,kDAAiD;AAEjD,SAAgB,kBAAkB;IAChC,OAAO;QACL,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,uBAAuB;QAC7B,WAAW,CAAC,GAAG;YACb,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,CAAA;YAEtB,IAAI,SAAS,GAAG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AE,YAAY,EAAC,CAAC,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI;4BAC/F,OAAO,EAAE,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;gCACtC,OAAO;oCACL,iBAAiB,EAAE,MAAM,CAAC,IAAI;oCAC9B,YAAY,EAAE,UAAU,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC;oCACjD,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC;iCAChD,CAAA;4BACH,CAAC,CAAC;4BACF,kBAAkB,EAAE,wBAAY,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;yBACpD,CAAA;oBACH,CAAC,CAAC;oBACF,gBAAgB,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,KAAK;iBAC/B,CAAA;YACH,CAAC,CAAC,CAAA;YAEF,OAAO;gBACL,OAAO,EAAE,CAAC,GAAG,SAAS,CAAC;aACxB,CAAA;QACH,CAAC;QACD,SAAS,CAAC,GAAG;YACX,OAAO,GAAG,CAAA;QACZ,CAAC;KACF,CAAA;AACH,CAAC;AArFD,gDAqFC"}
@@ -76,21 +76,6 @@ function ingestChannelProduct() {
76
76
  has_all_variants: product.channelCode == 'MGT' ? false : true
77
77
  };
78
78
  });
79
- if (products[0].channelCode == 'MGT') {
80
- let newList = [];
81
- for (let np of newProducts) {
82
- if (np.native_product_id == np.variants[0].native_variant_id) {
83
- let vars = newProducts
84
- .filter(e => e.native_product_id == np.native_product_id)
85
- .map(e => {
86
- return e.variants[0];
87
- });
88
- np.variants = vars;
89
- newList.push(np);
90
- }
91
- }
92
- newProducts = newList;
93
- }
94
79
  return {
95
80
  payload: [...newProducts]
96
81
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ingest-channel-product.js","sourceRoot":"","sources":["../../../../server/controllers/sellercraft-channel-integration/apis/ingest-chann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YACH,CAAC,CAAC,CAAA;YAEF,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,WAAW,IAAI,KAAK,EAAE;gBACpC,IAAI,OAAO,GAAG,EAAE,CAAA;gBAChB,KAAK,IAAI,EAAE,IAAI,WAAW,EAAE;oBAC1B,IAAI,EAAE,CAAC,iBAAiB,IAAI,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,iBAAiB,EAAE;wBAC5D,IAAI,IAAI,GAAG,WAAW;6BACnB,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,iBAAiB,IAAI,EAAE,CAAC,iBAAiB,CAAC;6BACxD,GAAG,CAAC,CAAC,CAAC,EAAE;4BACP,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;wBACtB,CAAC,CAAC,CAAA;wBACJ,EAAE,CAAC,QAAQ,GAAG,IAAI,CAAA;wBAClB,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;qBACjB;iBACF;gBACD,WAAW,GAAG,OAAO,CAAA;aACtB;YAED,OAAO;gBACL,OAAO,EAAE,CAAC,GAAG,WAAW,CAAC;aAC1B,CAAA;QACH,CAAC;QACD,SAAS,CAAC,GAAG;YACX,OAAO,GAAG,CAAA;QACZ,CAAC;KACF,CAAA;AACH,CAAC;AA5GD,oDA4GC"}
1
+ {"version":3,"file":"ingest-channel-product.js","sourceRoot":"","sources":["../../../../server/controllers/sellercraft-channel-integration/apis/ingest-channel-product.ts"],"names":[],"mappings":";AAAA,+FAA+F;;;AAE/F,SAAgB,oBAAoB;IAClC,OAAO;QACL,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,yBAAyB;QAC/B,WAAW,CAAC,GAAG;YACb,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,CAAA;YAExB,IAAI,WAAW,GAAG,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;;gBACvC,IAAI,iBAAiB,GAAU,OAAO,CAAC,UAAU,CAAC,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object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
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/sellercraft-channel-integration/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,gGAAyF;AACzF,6CAA8B;AAC9B,uDAA0C;AAE1C,oEAAiD;AAEjD,sEAAgC,CAAC,gBAAgB,CAAC,+BAA+B,EAAE,wBAAM,EAAE,IAAI,CAAC,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/controllers/sellercraft-channel-integration/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gGAAyF;AACzF,6CAA8B;AAC9B,uDAA0C;AAE1C,oEAAiD;AAEjD,sEAAgC,CAAC,gBAAgB,CAAC,+BAA+B,EAAE,wBAAM,EAAE,IAAI,CAAC,CAAA"}
@@ -38,7 +38,7 @@ class SellercraftChannelIntegration {
38
38
  }
39
39
  else {
40
40
  const result = await response.json();
41
- throw new Error(`(${response.status}) ${result.message}`);
41
+ throw new Error(`(${response.status}) ${result.detail}`);
42
42
  }
43
43
  }
44
44
  async put(path, data = {}) {
@@ -1 +1 @@
1
- {"version":3,"file":"sellercraft-channel-integration.js","sourceRoot":"","sources":["../../../server/controllers/sellercraft-channel-integration/sellercraft-channel-integration.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA8B;AAC9B,iDAA0B;AAE1B,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,oDAAoD,CAAC,CAAA;AAMpF,MAAa,6BAA6B;IAGx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AC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAA;QACnD,KAAK,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAA;QAE3B,MAAM,SAAS,GAAW,IAAI,CAAC,iBAAiB,EAAE,CAAA;QAElD,MAAM,QAAQ,GAAQ,MAAM,IAAA,oBAAK,EAAC,QAAQ,EAAE;YAC1C,MAAM,EAAE,KAAK;YACb,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,UAAU,EAAE,SAAS;gBACrB,WAAW,EAAE,MAAM;aACpB;SACF,CAAC,CAAA;QAEF,IAAI,QAAQ,CAAC,EAAE,EAAE;YACf,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAA;SAC7B;aAAM;YACL,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAA;YACpC,MAAM,IAAI,KAAK,CAAC,IAAI,QAAQ,CAAC,MAAM,KAAK,MAAM,CAAC,OAAO,EAAE,CAAC,CAAA;SAC1D;IACH,CAAC;CACF;AApGD,sEAoGC"}
1
+ {"version":3,"file":"sellercraft-channel-integration.js","sourceRoot":"","sources":["../../../server/controllers/sellercraft-channel-integration/sellercraft-channel-integration.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA8B;AAC9B,iDAA0B;AAE1B,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,oDAAoD,CAAC,CAAA;AAMpF,MAAa,6BAA6B;IAGxC,YAAY,MAAyB;QACnC,IAAI,CAAC,MAAM,qBACN,MAAM,CACV,CAAA;IACH,CAAC;IAED,UAAU;QACR,OAAO,gCAAgC,CAAA;IACzC,CAAC;IAED,iBAAiB;QACf,OAAO,IAAA,YAAI,GAAE,CAAA;IACf,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,IAAY,EAAE,OAAY,EAAE;QACrC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAA;QAE9B,KAAK,CAAC,MAAM,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AS;gBACrB,WAAW,EAAE,MAAM;aACpB;SACF,CAAC,CAAA;QAEF,IAAI,QAAQ,CAAC,EAAE,EAAE;YACf,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAA;SAC7B;aAAM;YACL,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAA;YACpC,MAAM,IAAI,KAAK,CAAC,IAAI,QAAQ,CAAC,MAAM,KAAK,MAAM,CAAC,OAAO,EAAE,CAAC,CAAA;SAC1D;IACH,CAAC;CACF;AApGD,sEAoGC"}
@@ -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.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
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/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oBAAiB;AAEjB,+CAA4B;AAC5B,gDAA6B;AAC7B,gDAA6B;AAC7B,4CAAyB;AACzB,8CAA2B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../server/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oBAAiB;AAEjB,+CAA4B;AAC5B,gDAA6B;AAC7B,gDAA6B;AAC7B,4CAAyB;AACzB,8CAA2B"}
@@ -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;
@@ -172,19 +173,75 @@ exports.sellercraftRouter.post('/sellercraft/store/update-order-status', async (
172
173
  status: requestBody.order_status,
173
174
  carrier: requestBody === null || requestBody === void 0 ? void 0 : requestBody.shipper_last_mile,
174
175
  trackingNo: requestBody === null || requestBody === void 0 ? void 0 : requestBody.tracking_number,
175
- orderItems: requestBody === null || requestBody === void 0 ? void 0 : requestBody.order_item_ids
176
+ orderItems: requestBody === null || requestBody === void 0 ? void 0 : requestBody.order_item_ids,
177
+ isSOF: requestBody === null || requestBody === void 0 ? void 0 : requestBody.seller_logistics
176
178
  };
179
+ let responseBody = { operation_id: (0, v4_1.default)() };
177
180
  try {
178
- result = await integration_marketplace_1.StoreAPI.updateOrderStatus(mappedStore, reqBody);
179
- debug(result);
181
+ try {
182
+ result = await integration_marketplace_1.StoreAPI.updateOrderStatus(mappedStore, reqBody);
183
+ debug(result);
184
+ }
185
+ catch (e) { }
186
+ if (result === null || result === void 0 ? void 0 : result.requiredDocument) {
187
+ // call document api and ingest channel order package
188
+ const order = await integration_marketplace_1.StoreAPI.getStoreOrder(mappedStore, { orderId: reqBody.orderId });
189
+ let orderPackage = order ? (((_k = order[0]) === null || _k === void 0 ? void 0 : _k.orderPackage) ? order[0].orderPackage : {}) : {};
190
+ if (orderPackage) {
191
+ const packageId = orderPackage.packageId;
192
+ let orderDocument = orderPackage.orderDocument;
193
+ if ((orderDocument === null || orderDocument === void 0 ? void 0 : orderDocument.length) == 0) {
194
+ let hasDocument = false;
195
+ while (!hasDocument) {
196
+ orderDocument = await integration_marketplace_1.StoreAPI.getStoreOrderDocument(mappedStore, { packageId, documentType: 1 });
197
+ if ((orderDocument === null || orderDocument === void 0 ? void 0 : orderDocument.length) > 0) {
198
+ hasDocument = true;
199
+ break;
200
+ }
201
+ }
202
+ }
203
+ // Order Package Payload
204
+ let newOrderPackage = {
205
+ channel_shop_id: mappedStore.channelShopId,
206
+ native_order_id: reqBody.orderId,
207
+ native_package_id: orderPackage.packageId.toString(),
208
+ shipping_tracking_code: orderPackage.trackingNumber,
209
+ shipping_type_value: (orderPackage === null || orderPackage === void 0 ? void 0 : orderPackage.shippingType) ? orderPackage.shippingType : constants_1.SHIPPING_TYPE.DROP_SHIPPING,
210
+ warehouse_code: constants_1.SHIPPING_TYPE.DROP_SHIPPING,
211
+ shipper: {
212
+ name: orderPackage.shippingProvider,
213
+ is_cod_supported: (orderPackage === null || orderPackage === void 0 ? void 0 : orderPackage.isCodSupport) ? orderPackage.isCodSupport : false
214
+ },
215
+ documents: orderDocument.map(doc => {
216
+ return {
217
+ file: doc.file,
218
+ file_type_value: doc.fileTypeValue,
219
+ mime_type: doc.mimeType
220
+ };
221
+ }) || [],
222
+ shipper_last_mile: {
223
+ name: orderPackage.shippingProvider,
224
+ is_cod_supported: (orderPackage === null || orderPackage === void 0 ? void 0 : orderPackage.isCodSupport) ? orderPackage.isCodSupport : false
225
+ },
226
+ order_item_ids: (orderPackage === null || orderPackage === void 0 ? void 0 : orderPackage.orderListIdList) ? orderPackage.orderListIdList : reqBody.orderItems
227
+ } || {};
228
+ responseBody.package = newOrderPackage;
229
+ }
230
+ responseBody.response_code = 'E0';
231
+ responseBody.message = 'Success';
232
+ }
233
+ responseBody.time = Math.floor(new Date(new Date().toUTCString()).getTime() / 1000);
180
234
  context.type = 'application/json';
181
235
  context.status = 200;
182
- context.body = 'Succeeded';
236
+ context.body = responseBody;
237
+ await next();
183
238
  }
184
239
  catch (e) {
240
+ responseBody.response_code = 'E1';
241
+ responseBody.message = e.message;
185
242
  context.type = 'application/json';
186
243
  context.status = 500;
187
- context.body = e.message;
244
+ context.body = responseBody;
188
245
  }
189
246
  }
190
247
  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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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.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
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":";;;;;;;;;;;;;AAAA,yBAAyB;AACzB,4DAAyC;AAEzC,mCAAmC;AACnC,+CAAkG;AAClG,+DAA4H;AAiBnH,gHAjBqD,+BAA+B,OAiBrD;AAf3B,QAAA,QAAQ,GAAG;IACtB,cAAc;IACf,GAAG,sBAAmB;IACrB,GAAG,8BAA0B;CAC9B,CAAA;AAGY,QAAA,MAAM,GAAG;IACpB,eAAe,EAAE;QACf,sBAAsB;QACxB,GAAG,uBAAoB;QACrB,GAAG,+BAA+B;KACnC;CACF,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yBAAyB;AACzB,4DAAyC;AAEzC,mCAAmC;AACnC,+CAAkG;AAClG,+DAA4H;AAiBnH,gHAjBqD,+BAA+B,OAiBrD;AAf3B,QAAA,QAAQ,GAAG;IACtB,cAAc;IACf,GAAG,sBAAmB;IACrB,GAAG,8BAA0B;CAC9B,CAAA;AAGY,QAAA,MAAM,GAAG;IACpB,eAAe,EAAE;QACf,sBAAsB;QACxB,GAAG,uBAAoB;QACrB,GAAG,+BAA+B;KACnC;CACF,CAAA"}
@@ -25,7 +25,7 @@ let MarketplaceChannelOrderMutation = class MarketplaceChannelOrderMutation {
25
25
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
26
26
  const sellercraftChannelIntegrationConfig = env_1.config.get('sellercraftChannelIntegrationConfig', {});
27
27
  const { tokenCraftApiKey: apiKey, getShopsTokenCraftUrl } = sellercraftChannelIntegrationConfig;
28
- const channels = await (0, typeorm_1.getRepository)(marketplace_channel_1.MarketplaceChannel).find();
28
+ const channels = await (0, typeorm_1.getRepository)(marketplace_channel_1.MarketplaceChannel).find({ where: { isActive: true } });
29
29
  for (var i = 0; i < channels.length; i++) {
30
30
  try {
31
31
  const channel = channels[i];
@@ -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;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,EAAE,CAAA;QAErF,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,M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AChE,IAAI,WAAW,EAAE;gBACf,WAAW,CAAC,WAAW,GAAG,WAAW,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW,CAAA;gBACtE,WAAW,CAAC,UAAU,GAAG,WAAW,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAA;gBACnE,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"}
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,IAA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AAC,EAAE,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC3D,IAAI,MAAM,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;YAC3C,IAAI,WAAW,GAAG,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,CAAA;YAChE,IAAI,WAAW,EAAE;gBACf,WAAW,CAAC,WAAW,GAAG,UAAU,CAAC,WAAW,CAAC,WAAW,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,WAAW,CAAC,CAAA;gBAC9F,WAAW,CAAC,UAAU,GAAG,UAAU,CAAC,WAAW,CAAC,UAAU,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,UAAU,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"}
@@ -24,7 +24,7 @@ let MarketplaceChannelProductMutation = class MarketplaceChannelProductMutation
24
24
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
25
25
  const sellercraftChannelIntegrationConfig = env_1.config.get('sellercraftChannelIntegrationConfig', {});
26
26
  const { tokenCraftApiKey: apiKey, getShopsTokenCraftUrl } = sellercraftChannelIntegrationConfig;
27
- const channels = await (0, typeorm_1.getRepository)(marketplace_channel_1.MarketplaceChannel).find();
27
+ const channels = await (0, typeorm_1.getRepository)(marketplace_channel_1.MarketplaceChannel).find({ where: { isActive: true } });
28
28
  for (var i = 0; i < channels.length; i++) {
29
29
  var channelsFullPath = getShopsTokenCraftUrl + '?channel_id=' + channels[i].channelId;
30
30
  const channelResponse = await fetch(channelsFullPath, {
@@ -137,20 +137,44 @@ 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,
144
143
  childrenCategories: []
145
144
  };
146
145
  });
146
+ if (store.platform == 'magento') {
147
+ let newList = [];
148
+ for (let np of mappedProducts) {
149
+ if (np.productId == np.variations[0].variationId) {
150
+ let vars = mappedProducts
151
+ .filter(e => e.productId == np.productId)
152
+ .map(e => {
153
+ return e.variations[0];
154
+ });
155
+ np.variations = vars;
156
+ if (np.variations.length > 1) {
157
+ np.variations = np.variations.filter(v => v.variationId != np.productId);
158
+ }
159
+ newList.push(np);
160
+ }
161
+ }
162
+ mappedProducts = newList;
163
+ }
147
164
  try {
165
+ let filterList = [];
148
166
  mappedCategories = mappedCategories.map(category => {
149
167
  if (mappedCategories.filter(e => e.parent == category.categoryId).length > 0) {
150
168
  category.childrenCategories = mappedCategories.filter(e => e.parent == category.categoryId);
169
+ filterList.push(...mappedCategories.filter(e => e.parent == category.categoryId));
151
170
  }
152
171
  return category;
153
172
  });
173
+ mappedCategories = mappedCategories.map(mc => {
174
+ if (filterList.indexOf(mc) == -1) {
175
+ return mc;
176
+ }
177
+ }).filter(e => e);
154
178
  await sellercraft_channel_integration_api_1.SellercraftChannelIntegrationAPI.ingestChannelCategories(sellercraftStore, {
155
179
  categories: mappedCategories
156
180
  });
@@ -165,8 +189,8 @@ let MarketplaceChannelProductMutation = class MarketplaceChannelProductMutation
165
189
  }
166
190
  catch (e) { }
167
191
  }
168
- return true;
169
192
  }
193
+ return true;
170
194
  }
171
195
  };
172
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,EAAE,CAAA;QAErF,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,KAAK,CAAC,MAAM,E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Q,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;yBAC9B,CAAC,CAAA;qBACH;iBACF;gBAAC,OAAO,CAAC,EAAE,GAAE;aACf;YAED,OAAO,IAAI,CAAA;SACZ;IACH,CAAC;CACF,CAAA;AAnLC;IADC,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC;IACY,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;0FAkL7C;AApLU,iCAAiC;IAD7C,IAAA,uBAAQ,GAAE;GACE,iCAAiC,CAqL7C;AArLY,8EAAiC"}
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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,sEAAgC,CAAC,uBAAuB,CAAC,gBAAgB,EAAE;wBAC/E,UAAU,EAAE,gBAAgB;qBAC7B,CAAC,CAAA;iBACH;gBAAC,OAAO,CAAC,EAAE,GAAE;gBAEd,IAAI;oBACF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;wBACrD,MAAM,sEAAgC,CAAC,oBAAoB,CAAC,gBAAgB,EAAE;4BAC5E,QAAQ,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;yBAC9B,CAAC,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"}
@@ -46,6 +46,11 @@ __decorate([
46
46
  (0, type_graphql_1.Field)(),
47
47
  __metadata("design:type", String)
48
48
  ], MarketplaceChannel.prototype, "channelId", void 0);
49
+ __decorate([
50
+ (0, typeorm_1.Column)({ default: true }),
51
+ (0, type_graphql_1.Field)(),
52
+ __metadata("design:type", Boolean)
53
+ ], MarketplaceChannel.prototype, "isActive", void 0);
49
54
  __decorate([
50
55
  (0, typeorm_1.CreateDateColumn)(),
51
56
  (0, type_graphql_1.Field)({ nullable: true }),
@@ -1 +1 @@
1
- {"version":3,"file":"marketplace-channel.js","sourceRoot":"","sources":["../../../server/service/marketplace-channel/marketplace-channel.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,+CAAoD;AACpD,qCASgB;AAEhB,yDAAgD;AAChD,iDAA8C;AAK9C,IAAa,kBAAkB,GAA/B,MAAa,kBAA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C3C,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;kDAChB,gBAAI,oBAAJ,gBAAI;mDAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,kBAAsC,EAAE,EAAE,CAAC,kBAAkB,CAAC,OAAO,CAAC;;qDACjE;AA5CP,kBAAkB;IAH9B,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,2BAA2B,EAAE,CAAC,kBAAsC,EAAE,EAAE,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE,kBAAkB,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACtJ,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;GACjD,kBAAkB,CA6C9B;AA7CY,gDAAkB"}
1
+ {"version":3,"file":"marketplace-channel.js","sourceRoot":"","sources":["../../../server/service/marketplace-channel/marketplace-channel.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,+CAAoD;AACpD,qCASgB;AAEhB,yDAAgD;AAChD,iDAA8C;AAK9C,IAAa,kBAAkB,GAA/B,MAAa,kBAAkB;CAiD9B,CAAA;AA9CC;IAFC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;8CACC;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;kDACjB,cAAM,oBAAN,cAAM;kDAAA;AAGf;IADC,IAAA,oBAAU,EAAC,CAAC,kBAAsC,EAAE,EAAE,CAAC,kBAAkB,CAAC,MAAM,CAAC;;oDACjE;AAIjB;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,GAAE;;gDACI;AAIZ;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,GAAE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,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;GACjD,kBAAkB,CAiD9B;AAjDY,gDAAkB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/integration-sellercraft",
3
- "version": "4.2.9",
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,19 +24,19 @@
24
24
  "migration:create": "node ../../node_modules/typeorm/cli.js migration:create -d ./server/migrations"
25
25
  },
26
26
  "dependencies": {
27
- "@things-factory/apptool-ui": "^4.1.40",
28
- "@things-factory/auth-ui": "^4.1.40",
29
- "@things-factory/biz-base": "^4.1.40",
30
- "@things-factory/code-ui": "^4.1.40",
31
- "@things-factory/context-ui": "^4.1.40",
32
- "@things-factory/grist-ui": "^4.1.40",
33
- "@things-factory/i18n-base": "^4.1.40",
34
- "@things-factory/integration-marketplace": "^4.2.9",
35
- "@things-factory/integration-ui": "^4.1.40",
36
- "@things-factory/more-ui": "^4.1.40",
37
- "@things-factory/resource-ui": "^4.1.40",
38
- "@things-factory/setting-ui": "^4.1.40",
39
- "@things-factory/system-ui": "^4.1.40",
27
+ "@things-factory/apptool-ui": "^4.3.0-alpha.0",
28
+ "@things-factory/auth-ui": "^4.3.0-alpha.0",
29
+ "@things-factory/biz-base": "^4.3.0-alpha.0",
30
+ "@things-factory/code-ui": "^4.3.0-alpha.0",
31
+ "@things-factory/context-ui": "^4.3.0-alpha.0",
32
+ "@things-factory/grist-ui": "^4.3.0-alpha.0",
33
+ "@things-factory/i18n-base": "^4.3.0-alpha.0",
34
+ "@things-factory/integration-marketplace": "^4.3.0-alpha.0",
35
+ "@things-factory/integration-ui": "^4.3.0-alpha.0",
36
+ "@things-factory/more-ui": "^4.3.0-alpha.0",
37
+ "@things-factory/resource-ui": "^4.3.0-alpha.0",
38
+ "@things-factory/setting-ui": "^4.3.0-alpha.0",
39
+ "@things-factory/system-ui": "^4.3.0-alpha.0",
40
40
  "debug": "^4.1.1",
41
41
  "node-fetch": "^2.6.0",
42
42
  "querystring": "^0.2.1"
@@ -51,5 +51,5 @@
51
51
  "nock": "^13.0.2",
52
52
  "should": "^13.2.3"
53
53
  },
54
- "gitHead": "1d2a0b987ce31cc207e1c70e75d53ba65acee61a"
54
+ "gitHead": "6467d1b2a5b2f8abb1bc3982e4651a5742ad4043"
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
@@ -20,7 +20,13 @@ export function ingestChannelOrder() {
20
20
  updated_at_time: new Date(order.updatedAt).toISOString(),
21
21
  customer_first_name: order.custFirstName,
22
22
  customer_last_name: order.custLastName,
23
- charges: [],
23
+ charges: order.charges.map(charge => {
24
+ return {
25
+ charge_type_value: charge.name,
26
+ amount_gross: parseFloat(charge.grossAmount) || 0,
27
+ amount_nett: parseFloat(charge.nettAmount) || 0
28
+ }
29
+ }),
24
30
  address_shipping: {
25
31
  first_name: order.shipFirstName,
26
32
  last_name: order.shipLastName,
@@ -68,7 +74,8 @@ export function ingestChannelOrder() {
68
74
  }),
69
75
  order_status_value: ORDER_STATUS[`${order.status}`]
70
76
  }
71
- })
77
+ }),
78
+ seller_logistics: order?.isSOF
72
79
  }
73
80
  })
74
81
 
@@ -84,22 +84,6 @@ export function ingestChannelProduct() {
84
84
  }
85
85
  })
86
86
 
87
- if (products[0].channelCode == 'MGT') {
88
- let newList = []
89
- for (let np of newProducts) {
90
- if (np.native_product_id == np.variants[0].native_variant_id) {
91
- let vars = newProducts
92
- .filter(e => e.native_product_id == np.native_product_id)
93
- .map(e => {
94
- return e.variants[0]
95
- })
96
- np.variants = vars
97
- newList.push(np)
98
- }
99
- }
100
- newProducts = newList
101
- }
102
-
103
87
  return {
104
88
  payload: [...newProducts]
105
89
  }
@@ -48,7 +48,7 @@ export class SellercraftChannelIntegration {
48
48
  return result
49
49
  } else {
50
50
  const result = await response.json()
51
- throw new Error(`(${response.status}) ${result.message}`)
51
+ throw new Error(`(${response.status}) ${result.detail}`)
52
52
  }
53
53
  }
54
54
 
@@ -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
 
@@ -186,20 +187,84 @@ sellercraftRouter.post('/sellercraft/store/update-order-status', async (context,
186
187
  status: requestBody.order_status,
187
188
  carrier: requestBody?.shipper_last_mile,
188
189
  trackingNo: requestBody?.tracking_number,
189
- orderItems: requestBody?.order_item_ids
190
+ orderItems: requestBody?.order_item_ids,
191
+ isSOF: requestBody?.seller_logistics
190
192
  }
191
193
 
194
+ let responseBody: any = { operation_id: uuid() }
192
195
  try {
193
- result = await StoreAPI.updateOrderStatus(mappedStore, reqBody)
194
- debug(result)
196
+ try {
197
+ result = await StoreAPI.updateOrderStatus(mappedStore, reqBody)
198
+ debug(result)
199
+ } catch (e) {}
200
+
201
+ if (result?.requiredDocument) {
202
+ // call document api and ingest channel order package
203
+ const order: any = await StoreAPI.getStoreOrder(mappedStore, { orderId: reqBody.orderId })
204
+ let orderPackage: any = order ? (order[0]?.orderPackage ? order[0].orderPackage : {}) : {}
205
+ if (orderPackage) {
206
+ const packageId: string = orderPackage.packageId
207
+
208
+ let orderDocument: any = orderPackage.orderDocument
209
+ if (orderDocument?.length == 0) {
210
+ let hasDocument: boolean = false
211
+ while (!hasDocument) {
212
+ orderDocument = await StoreAPI.getStoreOrderDocument(mappedStore, { packageId, documentType: 1 })
213
+ if (orderDocument?.length > 0) {
214
+ hasDocument = true
215
+ break
216
+ }
217
+ }
218
+ }
219
+
220
+ // Order Package Payload
221
+ let newOrderPackage: any =
222
+ {
223
+ channel_shop_id: mappedStore.channelShopId,
224
+ native_order_id: reqBody.orderId,
225
+ native_package_id: orderPackage.packageId.toString(),
226
+ shipping_tracking_code: orderPackage.trackingNumber,
227
+ shipping_type_value: orderPackage?.shippingType ? orderPackage.shippingType : SHIPPING_TYPE.DROP_SHIPPING,
228
+ warehouse_code: SHIPPING_TYPE.DROP_SHIPPING,
229
+ shipper: {
230
+ name: orderPackage.shippingProvider,
231
+ is_cod_supported: orderPackage?.isCodSupport ? orderPackage.isCodSupport : false
232
+ },
233
+ documents:
234
+ orderDocument.map(doc => {
235
+ return {
236
+ file: doc.file,
237
+ file_type_value: doc.fileTypeValue,
238
+ mime_type: doc.mimeType
239
+ }
240
+ }) || [],
241
+ shipper_last_mile: {
242
+ name: orderPackage.shippingProvider,
243
+ is_cod_supported: orderPackage?.isCodSupport ? orderPackage.isCodSupport : false
244
+ },
245
+ order_item_ids: orderPackage?.orderListIdList ? orderPackage.orderListIdList : reqBody.orderItems
246
+ } || {}
247
+
248
+ responseBody.package = newOrderPackage
249
+ }
250
+ responseBody.response_code = 'E0'
251
+ responseBody.message = 'Success'
252
+ }
253
+
254
+ responseBody.time = Math.floor(new Date(new Date().toUTCString()).getTime() / 1000)
195
255
 
196
256
  context.type = 'application/json'
197
257
  context.status = 200
198
- context.body = 'Succeeded'
258
+ context.body = responseBody
259
+
260
+ await next()
199
261
  } catch (e) {
262
+ responseBody.response_code = 'E1'
263
+ responseBody.message = e.message
264
+
200
265
  context.type = 'application/json'
201
266
  context.status = 500
202
- context.body = e.message
267
+ context.body = responseBody
203
268
  }
204
269
  } catch (e) {}
205
270
  })
@@ -19,7 +19,7 @@ export class MarketplaceChannelOrderMutation {
19
19
  const sellercraftChannelIntegrationConfig = config.get('sellercraftChannelIntegrationConfig', {})
20
20
  const { tokenCraftApiKey: apiKey, getShopsTokenCraftUrl } = sellercraftChannelIntegrationConfig
21
21
 
22
- const channels: MarketplaceChannel[] = await getRepository(MarketplaceChannel).find()
22
+ const channels: MarketplaceChannel[] = await getRepository(MarketplaceChannel).find({ where: { isActive: true } })
23
23
 
24
24
  for (var i = 0; i < channels.length; i++) {
25
25
  try {
@@ -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 = {
@@ -14,7 +14,7 @@ export class MarketplaceChannelProductMutation {
14
14
  const sellercraftChannelIntegrationConfig = config.get('sellercraftChannelIntegrationConfig', {})
15
15
  const { tokenCraftApiKey: apiKey, getShopsTokenCraftUrl } = sellercraftChannelIntegrationConfig
16
16
 
17
- const channels: MarketplaceChannel[] = await getRepository(MarketplaceChannel).find()
17
+ const channels: MarketplaceChannel[] = await getRepository(MarketplaceChannel).find({ where: { isActive: true } })
18
18
 
19
19
  for (var i = 0; i < channels.length; i++) {
20
20
  var channelsFullPath = getShopsTokenCraftUrl + '?channel_id=' + channels[i].channelId
@@ -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,
@@ -164,14 +163,41 @@ export class MarketplaceChannelProductMutation {
164
163
  }
165
164
  })
166
165
 
166
+ if (store.platform == 'magento') {
167
+ let newList = []
168
+ for (let np of mappedProducts) {
169
+ if (np.productId == np.variations[0].variationId) {
170
+ let vars = mappedProducts
171
+ .filter(e => e.productId == np.productId)
172
+ .map(e => {
173
+ return e.variations[0]
174
+ })
175
+ np.variations = vars
176
+ if (np.variations.length > 1) {
177
+ np.variations = np.variations.filter(v => v.variationId != np.productId)
178
+ }
179
+ newList.push(np)
180
+ }
181
+ }
182
+ mappedProducts = newList
183
+ }
184
+
167
185
  try {
186
+ let filterList = []
168
187
  mappedCategories = mappedCategories.map(category => {
169
188
  if (mappedCategories.filter(e => e.parent == category.categoryId).length > 0) {
170
189
  category.childrenCategories = mappedCategories.filter(e => e.parent == category.categoryId)
190
+ filterList.push(...mappedCategories.filter(e => e.parent == category.categoryId))
171
191
  }
172
192
  return category
173
193
  })
174
194
 
195
+ mappedCategories = mappedCategories.map(mc => {
196
+ if (filterList.indexOf(mc) == -1) {
197
+ return mc
198
+ }
199
+ }).filter(e => e)
200
+
175
201
  await SellercraftChannelIntegrationAPI.ingestChannelCategories(sellercraftStore, {
176
202
  categories: mappedCategories
177
203
  })
@@ -186,7 +212,7 @@ export class MarketplaceChannelProductMutation {
186
212
  } catch (e) {}
187
213
  }
188
214
 
189
- return true
190
215
  }
216
+ return true
191
217
  }
192
218
  }
@@ -40,6 +40,10 @@ export class MarketplaceChannel {
40
40
  @Field()
41
41
  channelId: string
42
42
 
43
+ @Column({ default: true })
44
+ @Field()
45
+ isActive: boolean
46
+
43
47
  @CreateDateColumn()
44
48
  @Field({ nullable: true })
45
49
  createdAt?: Date