@nuskin/ns-product-lib 1.5.0-cx24-2103.1 → 1.5.0-cx24-2103.4

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,24 @@
1
+ # [1.5.0-cx24-2103.4](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v1.5.0-cx24-2103.3...v1.5.0-cx24-2103.4) (2022-09-09)
2
+
3
+
4
+ ### Update
5
+
6
+ * updating the product data map (#CX24-2103) ([b754f14](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/b754f14359efeceb7c744b33fb00e93d94c4c040)), closes [#CX24-2103](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-2103)
7
+
8
+ # [1.5.0-cx24-2103.3](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v1.5.0-cx24-2103.2...v1.5.0-cx24-2103.3) (2022-09-08)
9
+
10
+
11
+ ### Update
12
+
13
+ * updating the product data map (#CX24-2103) ([680a718](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/680a7188c3ba1a9073f513277f14c1abb3356184)), closes [#CX24-2103](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-2103)
14
+
15
+ # [1.5.0-cx24-2103.2](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v1.5.0-cx24-2103.1...v1.5.0-cx24-2103.2) (2022-09-07)
16
+
17
+
18
+ ### Update
19
+
20
+ * updating the product data map (#CX24-2103) ([1d30f74](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/1d30f74bcca16de1440013c2a00048cace61bfc9)), closes [#CX24-2103](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-2103)
21
+
1
22
  # [1.5.0-cx24-2103.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v1.4.5...v1.5.0-cx24-2103.1) (2022-09-06)
2
23
 
3
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "1.5.0-cx24-2103.1",
3
+ "version": "1.5.0-cx24-2103.4",
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": {
@@ -30,7 +30,7 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@nuskin/ns-common-lib": "1.3.0",
33
- "@nuskin/ns-util": "3.104.0",
33
+ "@nuskin/ns-util": "3.105.0-CX24.1",
34
34
  "axios": "0.27.2",
35
35
  "qs": "6.11.0"
36
36
  },
@@ -11,7 +11,6 @@ const ProductData = {
11
11
  */
12
12
  getProductData: async function (skus, runConfig, marketConfig, equinoxOptions) {
13
13
  const locale = `${runConfig.language}_${runConfig.country}`;
14
- console.log(equinoxOptions)
15
14
  if (equinoxOptions !== undefined && equinoxOptions.isEnabled === true) {
16
15
  return await this.getProductFromEquinox(skus, locale, marketConfig, equinoxOptions.storeID);
17
16
  }
@@ -131,12 +130,12 @@ const ProductData = {
131
130
  "cv": data.sku[count].priceFacets.CV,
132
131
  "pv": data.sku[count].priceFacets.PV,
133
132
  "priceType": "WRTL",
134
- "price": data.sku[count].defaultprices[0].price,
133
+ "price": data.sku[count].priceFacets["Regular Price"],
135
134
  "priceMap": {
136
- "WRTL": 9999.11,
137
- "WADW-WRTL": 9999.11,
135
+ "WRTL": data.sku[count].priceFacets["Regular Price"],
136
+ "WADW-WRTL": data.sku[count].priceFacets["Regular Price"],
138
137
  "WADR": 9999.01,
139
- "RTL": 9999.11,
138
+ "RTL": data.sku[count].priceFacets["Regular Price"],
140
139
  "WWHL": 9998.01,
141
140
  "WADW": 9998.01,
142
141
  "WHL": 9998.01
@@ -165,9 +164,7 @@ const ProductData = {
165
164
  "web display": true
166
165
  },
167
166
  "childSkus": [],
168
- "custTypes": [
169
- "10","20"
170
- ],
167
+ "custTypes": this.switchCustType(data.properties.customerTypes),
171
168
  "division": data.properties.division,
172
169
  "backOrderDate": null,
173
170
  "locallyProduced": false,
@@ -212,14 +209,6 @@ const ProductData = {
212
209
  },
213
210
 
214
211
  switchStatusFromEquinox: function (status) {
215
- /**
216
- * Discontinued: 'DISCONTINUED',
217
- NotReleasedForSale: 'NOT_RELEASED_FOR_SALE',
218
- ReleasedForSale: 'RELEASED_FOR_SALE',
219
- NotFound: 'NOT_FOUND',
220
- StopStatus: 'STOP_STATUS',
221
-
222
- */
223
212
  let newStatus = '';
224
213
  switch (status) {
225
214
  case 'Sellable':
@@ -242,7 +231,24 @@ const ProductData = {
242
231
  break;
243
232
  }
244
233
  return newStatus;
234
+ },
235
+
236
+ /**
237
+ *
238
+ * @param {*} custType
239
+ *
240
+ */
241
+ switchCustType: function (custType) {
242
+ let newCustType = [];
243
+ if (custType.includes('Brand Affiliate - Business Entity') || custType.includes('Brand Affiliate - Individual'))
244
+ newCustType.push(10)
245
+ if (custType.includes('Retail Customer'))
246
+ newCustType.push(20)
247
+ if (custType.includes('Preferred Customer/Member'))
248
+ newCustType.push(30)
249
+ return newCustType.toString()
245
250
  }
251
+
246
252
  }
247
253
 
248
254
  module.exports = ProductData;