@things-factory/integration-sellercraft 4.3.15 → 4.3.19

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/integration-sellercraft",
3
- "version": "4.3.15",
3
+ "version": "4.3.19",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -51,5 +51,5 @@
51
51
  "nock": "^13.0.2",
52
52
  "should": "^13.2.3"
53
53
  },
54
- "gitHead": "df335351b9bbb891dc6c4eb81dc9cafecc9c39bb"
54
+ "gitHead": "2dddec18e371e5714d9f7a6bd0412741064af1d2"
55
55
  }
@@ -49,19 +49,19 @@ sellercraftRouter.post('/sellercraft/store/update-product-price', async (context
49
49
  try {
50
50
  if (requestBody[i].native_variant_id != requestBody[i].native_product_id) {
51
51
  const req = {
52
- costPrice: requestBody[i].full_price,
53
- sellPrice: requestBody[i].sale_price,
52
+ costPrice: requestBody[i].variant.full_price,
53
+ sellPrice: requestBody[i].variant.sale_price,
54
54
  productId: requestBody[i].native_product_id,
55
- variationId: requestBody[i].native_variant_id,
56
- variationSku: requestBody[i].sku
55
+ variationId: requestBody[i].variant.native_variant_id,
56
+ variationSku: requestBody[i].variant.sku
57
57
  }
58
58
  result = await StoreAPI.updateStoreProductVariationPrice(mappedStore, req)
59
59
  } else {
60
60
  const req = {
61
- costPrice: requestBody[i].full_price,
62
- sellPrice: requestBody[i].sale_price,
61
+ costPrice: requestBody[i].variant.full_price,
62
+ sellPrice: requestBody[i].variant.sale_price,
63
63
  productId: requestBody[i].native_product_id,
64
- variationSku: requestBody[i].sku
64
+ variationSku: requestBody[i].variant.sku
65
65
  }
66
66
  result = await StoreAPI.updateStoreProductPrice(mappedStore, req)
67
67
  }
@@ -117,19 +117,19 @@ sellercraftRouter.post('/sellercraft/store/update-product-stock', async (context
117
117
  try {
118
118
  if (requestBody[i].native_variant_id != requestBody[i].native_product_id) {
119
119
  const req = {
120
- qty: requestBody[i].stock,
120
+ qty: requestBody[i].variant.stock,
121
121
  itemId: requestBody[i].native_product_id,
122
- variationId: requestBody[i].native_variant_id,
122
+ variationId: requestBody[i].variant.native_variant_id,
123
123
  distributors: requestBody[i].distributors || [], // for Magento
124
- variationSku: requestBody[i].sku
124
+ variationSku: requestBody[i].variant.sku
125
125
  }
126
126
  result = await StoreAPI.updateStoreProductVariationStock(mappedStore, req)
127
127
  } else {
128
128
  const req = {
129
- qty: requestBody[i].stock,
129
+ qty: requestBody[i].variant.stock,
130
130
  itemId: requestBody[i].native_product_id,
131
131
  distributors: requestBody[i].distributors || [], // for Magento
132
- variationSku: requestBody[i].sku
132
+ variationSku: requestBody[i].variant.sku
133
133
  }
134
134
  result = await StoreAPI.updateStoreProductStock(mappedStore, req)
135
135
  }
@@ -187,7 +187,7 @@ sellercraftRouter.post('/sellercraft/store/update-order-status', async (context,
187
187
  status: requestBody.order_status,
188
188
  carrier: requestBody?.shipper_last_mile,
189
189
  trackingNo: requestBody?.tracking_number,
190
- orderItems: requestBody?.order_item_ids,
190
+ orderItems: requestBody?.order_items,
191
191
  isSOF: requestBody?.seller_logistics
192
192
  }
193
193
 
@@ -244,7 +244,11 @@ sellercraftRouter.post('/sellercraft/store/update-order-status', async (context,
244
244
  name: orderPackage.shippingProvider,
245
245
  is_cod_supported: orderPackage?.isCodSupport ? orderPackage.isCodSupport : false
246
246
  },
247
- order_item_ids: orderPackage?.orderListIdList ? orderPackage.orderListIdList : reqBody.orderItems
247
+ order_item_ids: orderPackage?.orderListIdList
248
+ ? orderPackage.orderListIdList
249
+ : reqBody.orderItems.map(oi => {
250
+ return oi.native_order_item_id
251
+ })
248
252
  } || {}
249
253
 
250
254
  responseBody.package = newOrderPackage