@nuskin/ns-product-lib 2.5.0-cx24-2862.1 → 2.5.0-cx24-2862.2

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [2.5.0-cx24-2862.2](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.5.0-cx24-2862.1...v2.5.0-cx24-2862.2) (2022-11-11)
2
+
3
+
4
+ ### Update
5
+
6
+ * set ADR pricing from equinox (CX24-2862) ([b64dcea](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/b64dcea4dd3374be992c667db5c0b2604aacc029))
7
+
1
8
  # [2.5.0-cx24-2862.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.4.2-cx24-2612.1.1...v2.5.0-cx24-2862.1) (2022-11-10)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "2.5.0-cx24-2862.1",
3
+ "version": "2.5.0-cx24-2862.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": {
@@ -165,19 +165,7 @@ const ProductData = {
165
165
  "WADW": eqVariant.priceFacets.PV,
166
166
  "WHL": eqVariant.priceFacets.PV
167
167
  },
168
- "orderTypes": {
169
- "adr": true,
170
- "order": true,
171
- "zpfc": false,
172
- "zadp": true,
173
- "ars": true,
174
- "kiosk": true,
175
- "mobile": true,
176
- "preferred customer": true,
177
- "retail": true,
178
- "web": true,
179
- "web display": true
180
- },
168
+ "orderTypes": this._setOrderType(eqVariant.properties),
181
169
  "division": eqVariant.properties.division,
182
170
  "backOrderDate": null,
183
171
  "locallyProduced": false,
@@ -291,19 +279,7 @@ const ProductData = {
291
279
  "WADW": data.sku[count].priceFacets.PV,
292
280
  "WHL": data.sku[count].priceFacets.PV
293
281
  },
294
- "orderTypes": {
295
- "adr": true,
296
- "order": true,
297
- "zpfc": false,
298
- "zadp": true,
299
- "ars": true,
300
- "kiosk": true,
301
- "mobile": true,
302
- "preferred customer": true,
303
- "retail": true,
304
- "web": true,
305
- "web display": true
306
- },
282
+ "orderTypes": this._setOrderType(data.sku[count].properties),
307
283
  "childSkus": [],
308
284
  "custTypes": this.switchCustType(data.properties.customerTypes),
309
285
  "division": data.properties.division,
@@ -415,6 +391,63 @@ const ProductData = {
415
391
 
416
392
  return sortedProducts
417
393
 
394
+ },
395
+
396
+ /**
397
+ *
398
+ * @param {*} availableChannels
399
+ *
400
+ * This function is use to convert arsPhone,web,kiosk,mobile,subscription
401
+ * to orderType object
402
+ * "adr”
403
+ "order"
404
+ "zpfc"
405
+ "zadp"
406
+ "ars"
407
+ "kiosk"
408
+ "mobile"
409
+ "preferred customer"
410
+ "retail"
411
+ "web"
412
+ "web display"
413
+ */
414
+ _setOrderType: function (properties) {
415
+ let orderTypeArr = {
416
+ "adr": false,
417
+ "order": false,
418
+ "zpfc": false,
419
+ "zadp": false,
420
+ "ars": false,
421
+ "kiosk": false,
422
+ "mobile": false,
423
+ "preferred customer": false,
424
+ "retail": false,
425
+ "web": false,
426
+ "web display": false
427
+ };
428
+ let availableChannelsArr = properties.availableChannels.split(',')
429
+
430
+ availableChannelsArr.forEach(channel => {
431
+ if (channel == 'arsPhone')
432
+ orderTypeArr.ars = true
433
+ if (channel == 'web') {
434
+ orderTypeArr.order = true
435
+ orderTypeArr.web = true
436
+ }
437
+ if (channel == 'kiosk')
438
+ orderTypeArr.kiosk = true
439
+ if (channel == 'mobile')
440
+ orderTypeArr.mobile = true
441
+ if (channel == 'subscription')
442
+ orderTypeArr.adr = true
443
+
444
+ });
445
+ if (properties.retail)
446
+ orderTypeArr.retail = true
447
+ if (properties.prefferredCustomer)
448
+ orderTypeArr['preferred customer'] = true
449
+
450
+ return orderTypeArr;
418
451
  }
419
452
  }
420
453