@nuskin/ns-product-lib 2.11.0-cx24-5092.34 → 2.11.0-cx24-5092.35
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/src/productGraphQL.js +23 -1
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
# [2.11.0-cx24-5092.35](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.11.0-cx24-5092.34...v2.11.0-cx24-5092.35) (2023-09-27)
|
2
|
+
|
3
|
+
|
4
|
+
### Fix
|
5
|
+
|
6
|
+
* unit testing ([5a356e9](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/5a356e964d235ec3dbe557b42a016b7cd06640b1))
|
7
|
+
|
1
8
|
# [2.11.0-cx24-5092.34](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.11.0-cx24-5092.33...v2.11.0-cx24-5092.34) (2023-09-19)
|
2
9
|
|
3
10
|
|
package/package.json
CHANGED
package/src/productGraphQL.js
CHANGED
@@ -268,7 +268,9 @@ const ProductGraphQL = {
|
|
268
268
|
},
|
269
269
|
mapProductBundle: async function (response, market, locale) {
|
270
270
|
let res;
|
271
|
-
|
271
|
+
const kitBundleProducts = response.bundle.kitProducts;
|
272
|
+
|
273
|
+
res = this.mapProductRegular(kitBundleProducts[0].product, market, locale)
|
272
274
|
res.priceMap = {
|
273
275
|
"WRTL": (response.bundle.totalPrice) ? response.bundle.totalPrice.retail : response.bundle.price.retail,
|
274
276
|
"WADW-WRTL": (response.bundle.totalPrice) ? response.bundle.totalPrice.retailSubscription : response.bundle.price.retail,
|
@@ -278,6 +280,26 @@ const ProductGraphQL = {
|
|
278
280
|
"WADW": (response.bundle.totalPrice) ? response.bundle.totalPrice.wholesaleSubscription : response.bundle.price.wholesaleSubscription,//wholesale ADR (subscription price)
|
279
281
|
"WHL": (response.bundle.totalPrice) ? response.bundle.totalPrice.wholesale : response.bundle.price.wholesale
|
280
282
|
}
|
283
|
+
res.childSkus = [{
|
284
|
+
productId: response.bundle.id,
|
285
|
+
type: response.bundle.type,
|
286
|
+
skuId: '',
|
287
|
+
availableChannels: response.bundle.availableChannels
|
288
|
+
},
|
289
|
+
...response.bundle.kitProducts(kitProduct => {
|
290
|
+
return {
|
291
|
+
productId: kitProduct.product.id,
|
292
|
+
skuId: kitProduct.product.id,
|
293
|
+
skuQuantity: kitProduct.quantity,
|
294
|
+
type: "MANDATORY",
|
295
|
+
inventory: {
|
296
|
+
atpQty: kitProduct.variants[0].availableQuantity,
|
297
|
+
backOrderDate: kitProduct.variants[0].status.backorderedAvailableDate,
|
298
|
+
backOrdered: kitProduct.variants[0].status.isBackordered
|
299
|
+
}
|
300
|
+
}
|
301
|
+
})];
|
302
|
+
|
281
303
|
res.status = this.switchStatusFromEquinox(response.bundle.status.status)
|
282
304
|
|
283
305
|
return res;
|