@nuskin/ns-product-lib 1.3.7 → 1.4.2-cx15-4839.1

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/CHANGELOG.md CHANGED
@@ -1,3 +1,26 @@
1
+ ## [1.4.2-cx15-4839.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v1.4.1...v1.4.2-cx15-4839.1) (2022-04-07)
2
+
3
+
4
+ ### Fix
5
+
6
+ * added support for restrictedMarkets and addOns fields to product data response (#CX15-4839) ([43c0346](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/43c03462950d655aa1dab096143b2e1d909bc6f6)), closes [#CX15-4839](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX15-4839)
7
+
8
+ ## [1.4.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v1.4.0...v1.4.1) (2022-03-31)
9
+
10
+
11
+ ### Fix
12
+
13
+ * adding locallyProduced flag to mapper (#CX16-5842) ([b5a31ca](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/b5a31cab7cbaaba51af23f29bd70d8b0b495af44)), closes [#CX16-5842](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX16-5842)
14
+ * adding locallyProduced flag to mapper (#CX16-5842) ([c50407d](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/c50407d90270e017a37d3427e43752da34002c11)), closes [#CX16-5842](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX16-5842)
15
+
16
+ # [1.4.0](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v1.3.7...v1.4.0) (2022-03-31)
17
+
18
+
19
+ ### Update
20
+
21
+ * adding locallyProduced flag (#CX16-5842) ([9213365](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/92133654db85e4af7f46a2223a5d999f75dbc9a5)), closes [#CX16-5842](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX16-5842)
22
+ * adding locallyProduced flag (#CX16-5842) ([7e303af](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/7e303af1f14fd870ef571376e1960eb40fb7bd12)), closes [#CX16-5842](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX16-5842)
23
+
1
24
  ## [1.3.7](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v1.3.6...v1.3.7) (2021-09-17)
2
25
 
3
26
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "1.3.7",
3
+ "version": "1.4.2-cx15-4839.1",
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": {
package/src/product.js CHANGED
@@ -17,6 +17,7 @@ const Product = function(productData) {
17
17
  this.custTypes = [];
18
18
  this.addOns = [];
19
19
  this.productCarouselImages = [];
20
+ this.locallyProduced = false;
20
21
 
21
22
  //class variables to be used instead of getters/setters
22
23
  this.globalProductID = "";
@@ -349,7 +350,7 @@ const Product = function(productData) {
349
350
  }
350
351
  return retVal;
351
352
  };
352
-
353
+
353
354
  this.getEventPriceTypes = () => {
354
355
  const eventPriceTypes = [];
355
356
 
@@ -490,6 +491,7 @@ const Product = function(productData) {
490
491
  retData.custTypes = this.custTypes;
491
492
  retData.division = this.division;
492
493
  retData.backOrderDate = this.backOrderDate;
494
+ retData.locallyProduced = this.locallyProduced;
493
495
  retData.agelocme = this.agelocme ? this.agelocme.toJSON() : null;
494
496
  retData.count = this.count;
495
497
  retData.flavor = this.flavor;
@@ -512,6 +514,8 @@ const Product = function(productData) {
512
514
  retData.searchScore = this.searchScore;
513
515
  retData.isExclusive = this.isExclusive;
514
516
  retData.marketAttributes = this.marketAttributes;
517
+ retData.restrictedMarkets = this.restrictedMarkets;
518
+ retData.addOns = this.addOns;
515
519
 
516
520
  return retData;
517
521
  };
@@ -597,6 +601,7 @@ const Product = function(productData) {
597
601
  if (data.priceType) {
598
602
  this.priceType = data.priceType;
599
603
  }
604
+ this.locallyProduced = data.locallyProduced;
600
605
  this.count = productData.count;
601
606
  this.flavor = productData.flavor;
602
607
  this.size = productData.size;
@@ -51,6 +51,10 @@ const ProductContentMapper = {
51
51
  if (restrictedMarkets) {
52
52
  product.restrictedMarkets = restrictedMarkets;
53
53
  }
54
+
55
+ if (marketData.addOns) {
56
+ product.addOns = marketData.addOns;
57
+ }
54
58
  }
55
59
 
56
60
  // set product values
@@ -36,6 +36,7 @@ const ProductStatusMapper = {
36
36
  globalProductID: productStatusV2.globalProductID,
37
37
  backordered: productStatusV2.backordered,
38
38
  backorderedAvailableDate: productStatusV2.backorderedAvailableDate,
39
+ locallyProduced: productStatusV2.locallyProduced,
39
40
  availableQuantity: productStatusV2.availableQuantity,
40
41
  webEnabled: productStatusV2.webEnabled,
41
42
  status: getStatusPartFromV2(productStatusV2),