@nuskin/ns-product-lib 2.11.0-cx24-5092.33 → 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 +14 -0
- package/package.json +1 -1
- package/src/productGraphQL.js +35 -2
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,17 @@
|
|
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
|
+
|
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)
|
9
|
+
|
10
|
+
|
11
|
+
### New
|
12
|
+
|
13
|
+
* Moving from AEM to CS for EQ markets ([9f649ff](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/9f649ff3b0e5f6e076d2bdbf429c24b45e685ff6))
|
14
|
+
|
1
15
|
# [2.11.0-cx24-5092.33](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.11.0-cx24-5092.32...v2.11.0-cx24-5092.33) (2023-09-19)
|
2
16
|
|
3
17
|
|
package/package.json
CHANGED
package/src/productGraphQL.js
CHANGED
@@ -120,7 +120,7 @@ const ProductGraphQL = {
|
|
120
120
|
|
121
121
|
mapProductRegular: async function (response, market, locale) {
|
122
122
|
let res = {
|
123
|
-
"sku": response.variants[0].
|
123
|
+
"sku": response.variants[0].sku,
|
124
124
|
"globalProductID": response.id,
|
125
125
|
"title": response.variants[0].title,
|
126
126
|
"country": market,
|
@@ -268,7 +268,40 @@ 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)
|
274
|
+
res.priceMap = {
|
275
|
+
"WRTL": (response.bundle.totalPrice) ? response.bundle.totalPrice.retail : response.bundle.price.retail,
|
276
|
+
"WADW-WRTL": (response.bundle.totalPrice) ? response.bundle.totalPrice.retailSubscription : response.bundle.price.retail,
|
277
|
+
"WADR": (response.bundle.totalPrice) ? response.bundle.totalPrice.retailSubscription : response.bundle.price.retailSubscription, //retail ADR (subscription) price
|
278
|
+
"RTL": (response.bundle.totalPrice) ? response.bundle.totalPrice.retail : response.bundle.price.retail,
|
279
|
+
"WWHL": (response.bundle.totalPrice) ? response.bundle.totalPrice.wholesale : response.bundle.price.wholesale,
|
280
|
+
"WADW": (response.bundle.totalPrice) ? response.bundle.totalPrice.wholesaleSubscription : response.bundle.price.wholesaleSubscription,//wholesale ADR (subscription price)
|
281
|
+
"WHL": (response.bundle.totalPrice) ? response.bundle.totalPrice.wholesale : response.bundle.price.wholesale
|
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
|
+
|
303
|
+
res.status = this.switchStatusFromEquinox(response.bundle.status.status)
|
304
|
+
|
272
305
|
return res;
|
273
306
|
},
|
274
307
|
/**
|