@nuskin/ns-product-lib 2.19.7-mdigi-326.1 → 2.19.7-td-1017.2
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +2 -2
- package/src/graph-ql/product.js +20 -19
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nuskin/ns-product-lib",
|
3
|
-
"version": "2.19.7-
|
3
|
+
"version": "2.19.7-td-1017.2",
|
4
4
|
"description": "This project contains shared Product models and code between the backend and frontend.",
|
5
5
|
"main": "src/index.js",
|
6
6
|
"scripts": {
|
@@ -22,7 +22,7 @@
|
|
22
22
|
"@nuskin/configuration-sdk": "3.0.0",
|
23
23
|
"@nuskin/ns-common-lib": "1.4.7",
|
24
24
|
"@nuskin/ns-util": "4.5.4",
|
25
|
-
"@nuskin/product-lib": "2.
|
25
|
+
"@nuskin/product-lib": "2.3.1-td-1017.1",
|
26
26
|
"axios": "1.6.7",
|
27
27
|
"axios-mock-adapter": "1.21.2",
|
28
28
|
"eslint": "^8.56.0",
|
package/src/graph-ql/product.js
CHANGED
@@ -72,8 +72,8 @@ async function getProducts(ids, market, locale, config) {
|
|
72
72
|
|
73
73
|
try {
|
74
74
|
const data = await productLib.getProductsById(
|
75
|
-
ids, market, locale,
|
76
|
-
null, 1, okta,
|
75
|
+
ids, market, locale,
|
76
|
+
null, 1, okta,
|
77
77
|
config.graphqlUrl.includes('test') ? 'test' : config.graphqlUrl.includes('dev') ? 'dev' : 'prod'
|
78
78
|
);
|
79
79
|
if (data && data.products) {
|
@@ -276,8 +276,8 @@ function mapProduct(product, market, locale, config) {
|
|
276
276
|
"availableQuantity": isBackOrdered ? kitOrVariant.backorderQuantity : kitOrVariant.atpQuantity,
|
277
277
|
"maxQuantity": kitOrVariant.maxQuantity,
|
278
278
|
"points": "",
|
279
|
-
"cv": points
|
280
|
-
"pv": points
|
279
|
+
"cv": points.wholesale ? points.wholesale.cv : 0,
|
280
|
+
"pv": points.wholesale ? points.wholesale.pv : 0,
|
281
281
|
"priceType": "WRTL",
|
282
282
|
"price": pricing.retail,
|
283
283
|
"priceMap": {
|
@@ -294,15 +294,15 @@ function mapProduct(product, market, locale, config) {
|
|
294
294
|
},
|
295
295
|
"cvMap": {
|
296
296
|
...promoData.cvMap,
|
297
|
-
"WWHL": points
|
298
|
-
"WADW": points
|
299
|
-
"WHL": points
|
297
|
+
"WWHL": points.wholesale ? points.wholesale.cv : 0,
|
298
|
+
"WADW": points.subscription ? points.subscription.cv : 0,
|
299
|
+
"WHL": points.wholesale ? points.wholesale.cv : 0
|
300
300
|
},
|
301
301
|
"pvMap": {
|
302
302
|
...promoData.pvMap,
|
303
|
-
"WWHL": points
|
304
|
-
"WADW": points
|
305
|
-
"WHL": points
|
303
|
+
"WWHL": points.wholesale ? points.wholesale.pv : 0,
|
304
|
+
"WADW": points.subscription ? points.subscription.pv : 0,
|
305
|
+
"WHL": points.wholesale ? points.wholesale.pv : 0
|
306
306
|
},
|
307
307
|
"orderTypes": mapOrderTypes(kitOrVariant.availableChannels, kitOrVariant.purchaseTypes),
|
308
308
|
"custTypes": mapCustomerTypes(kitOrVariant.customerTypes),
|
@@ -327,7 +327,8 @@ function mapProduct(product, market, locale, config) {
|
|
327
327
|
"properties": {
|
328
328
|
isBackOrdered: isBackOrdered,
|
329
329
|
inventoryStatus: isBackOrdered ? 'BACKORDER' : 'IN STOCK',
|
330
|
-
productStatus: mapProductStatus(kitOrVariant.status.status)
|
330
|
+
productStatus: mapProductStatus(kitOrVariant.status.status),
|
331
|
+
productionBom: !kitBundleProducts ? false : true
|
331
332
|
}
|
332
333
|
}
|
333
334
|
|
@@ -398,8 +399,8 @@ function mapVariants(product, isContentStack) {
|
|
398
399
|
"availableQuantity": variant.availableQuantity,
|
399
400
|
"maxQuantity": variant.maxQuantity,
|
400
401
|
"points": "",
|
401
|
-
"cv": points
|
402
|
-
"pv": points
|
402
|
+
"cv": points.wholesale ? points.wholesale.cv : 0,
|
403
|
+
"pv": points.wholesale ? points.wholesale.pv : 0,
|
403
404
|
"priceType": "WRTL",
|
404
405
|
"price": pricing.retail,
|
405
406
|
"priceMap": {
|
@@ -416,15 +417,15 @@ function mapVariants(product, isContentStack) {
|
|
416
417
|
},
|
417
418
|
"cvMap": {
|
418
419
|
...promoData.cvMap,
|
419
|
-
"WWHL": points
|
420
|
-
"WADW": points
|
421
|
-
"WHL": points
|
420
|
+
"WWHL": points.wholesale ? points.wholesale.cv : 0,
|
421
|
+
"WADW": points.subscription ? points.subscription.cv : 0,
|
422
|
+
"WHL": points.wholesale ? points.wholesale.cv : 0
|
422
423
|
},
|
423
424
|
"pvMap": {
|
424
425
|
...promoData.pvMap,
|
425
|
-
"WWHL": points
|
426
|
-
"WADW": points
|
427
|
-
"WHL": points
|
426
|
+
"WWHL": points.wholesale ? points.wholesale.pv : 0,
|
427
|
+
"WADW": points.subscription ? points.subscription.pv : 0,
|
428
|
+
"WHL": points.wholesale ? points.wholesale.pv : 0
|
428
429
|
},
|
429
430
|
"orderTypes": mapOrderTypes(variant.availableChannels, variant.purchaseTypes),
|
430
431
|
"custTypes": mapCustomerTypes(variant.customerTypes),
|