@nuskin/ns-product-lib 2.6.1-cx24-3608.5 → 2.6.1-cx24-3607.2
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +5 -29
- package/package.json +1 -1
- package/src/equinox-helpers/childSKU.js +31 -0
- package/src/equinox-helpers/index.js +43 -4
- package/src/productData.js +139 -138
package/CHANGELOG.md
CHANGED
@@ -1,41 +1,17 @@
|
|
1
|
-
## [2.6.1-cx24-
|
1
|
+
## [2.6.1-cx24-3607.2](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.6.1-cx24-3607.1...v2.6.1-cx24-3607.2) (2023-03-16)
|
2
2
|
|
3
3
|
|
4
4
|
### Fix
|
5
5
|
|
6
|
-
*
|
7
|
-
* imageURL issue when product is kit ([38eabd3](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/38eabd3b29d8b33462509c17e98805819781f344))
|
8
|
-
* imageURL issue when product is kit ([5eb2c04](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/5eb2c0439b6e1a456a2c9f232f3d7f502ea46e4b))
|
6
|
+
* (equinox-enabled) skip product mapping when an error occurs in PLP #CX24-3607 ([49fa749](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/49fa7499b390aa84cc887fc631037363421d252a)), closes [#CX24-3607](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-3607)
|
9
7
|
|
10
|
-
## [2.6.1-cx24-
|
8
|
+
## [2.6.1-cx24-3607.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.6.0...v2.6.1-cx24-3607.1) (2023-03-15)
|
11
9
|
|
12
10
|
|
13
11
|
### Fix
|
14
12
|
|
15
|
-
*
|
16
|
-
*
|
17
|
-
|
18
|
-
## [2.6.1-cx24-3608.3](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.6.1-cx24-3608.2...v2.6.1-cx24-3608.3) (2023-03-15)
|
19
|
-
|
20
|
-
|
21
|
-
### Fix
|
22
|
-
|
23
|
-
* imageURL issue when product is kit ([0e4281d](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/0e4281de4435d1a5749ff9b6d52a7c4a45d75d6d))
|
24
|
-
|
25
|
-
## [2.6.1-cx24-3608.2](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.6.1-cx24-3608.1...v2.6.1-cx24-3608.2) (2023-03-15)
|
26
|
-
|
27
|
-
|
28
|
-
### Fix
|
29
|
-
|
30
|
-
* imageURL issue when product is kit ([3172244](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/3172244e53c328e90d663a0989c25c25eba967d3))
|
31
|
-
|
32
|
-
## [2.6.1-cx24-3608.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.6.0...v2.6.1-cx24-3608.1) (2023-03-15)
|
33
|
-
|
34
|
-
|
35
|
-
### Fix
|
36
|
-
|
37
|
-
* imageURL issue when product is kit ([2a68af6](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/2a68af668a2ca0835a4b0d0995117ea8ab019bed))
|
38
|
-
* imageURL issue when product is kit ([656505a](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/656505a32421ae4e5d8e29dd451b68b24e72f30d))
|
13
|
+
* (equinox-enabled) skip product mapping when an error occurs in PLP #CX24-3607 ([950c165](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/950c1650115f92badc5b898b5df722568b034afe)), closes [#CX24-3607](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-3607)
|
14
|
+
* Cannot read properties of undefined (reading 'qty') in PLP #CX24-3607 ([8cde88f](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/8cde88f2f61279d20794a0e43696187c4326ca28)), closes [#CX24-3607](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-3607)
|
39
15
|
|
40
16
|
# [2.6.0](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.5.2...v2.6.0) (2023-03-13)
|
41
17
|
|
package/package.json
CHANGED
@@ -0,0 +1,31 @@
|
|
1
|
+
/**
|
2
|
+
* childSKU maps a product variant. Used mainly in subscription.
|
3
|
+
*
|
4
|
+
* @param {import('.').KitSKUQuantity[]} kits
|
5
|
+
* @param {import('.').EquinoxProduct} product
|
6
|
+
*/
|
7
|
+
function childSKU(kits, product) {
|
8
|
+
const sku = product.sku.filter(sku => sku.default)[0];
|
9
|
+
if (!sku) {
|
10
|
+
throw Error('Unable to find the default SKU.');
|
11
|
+
}
|
12
|
+
|
13
|
+
const kit = kits.filter(k => k.sku === sku.identifier)[0];
|
14
|
+
if (!kit) {
|
15
|
+
throw Error('SKU kit does not exist in the list of available variants.');
|
16
|
+
}
|
17
|
+
|
18
|
+
return {
|
19
|
+
productId: product.identifier,
|
20
|
+
skuId: sku.identifier,
|
21
|
+
type: 'MANDATORY',
|
22
|
+
skuQuantity: kit.qty,
|
23
|
+
availableChannels: sku.properties.availableChannels,
|
24
|
+
inventory: {
|
25
|
+
atpQty: sku.inventoryProperties.atpQty,
|
26
|
+
backOrdered: sku.inventoryProperties.backOrdered
|
27
|
+
}
|
28
|
+
}
|
29
|
+
}
|
30
|
+
|
31
|
+
module.exports = childSKU;
|
@@ -1,10 +1,11 @@
|
|
1
1
|
/**
|
2
|
+
* @description This model represents the mapped values of a product
|
2
3
|
* @typedef Product
|
3
4
|
* @type {object}
|
4
|
-
* @property {
|
5
|
+
* @property {ProductChildSku[]} childSkus
|
5
6
|
* @property {Inventory} [inventoryProperties]
|
6
|
-
*
|
7
|
-
* @typedef
|
7
|
+
*
|
8
|
+
* @typedef ProductChildSku
|
8
9
|
* @type {object}
|
9
10
|
* @property {string} productId
|
10
11
|
* @property {string} skuId
|
@@ -12,14 +13,52 @@
|
|
12
13
|
* @property {number} skuQuantity
|
13
14
|
* @property {string} availableChannels
|
14
15
|
* @property {Inventory} [inventory]
|
16
|
+
*
|
17
|
+
* ---
|
18
|
+
*
|
19
|
+
* @description This model represents a product within an Equinox response.
|
20
|
+
* @typedef EquinoxProduct
|
21
|
+
* @type {object}
|
22
|
+
* @property {string} identifier
|
23
|
+
* @property {EquinoxProductSKU[]} sku
|
24
|
+
* @property {"kit"|"bundle"} [type]
|
25
|
+
*
|
26
|
+
* @typedef EquinoxProductSKU
|
27
|
+
* @type {object}
|
28
|
+
* @property {boolean} default
|
29
|
+
* For multi-variant products, this indicates that this is the searched SKU
|
30
|
+
* when using catalogs/search endpoint.
|
31
|
+
* @property {string} identifier
|
32
|
+
* @property {Inventory} inventoryProperties
|
33
|
+
* @property {EquinoxProductProperties} properties
|
34
|
+
*
|
35
|
+
* @typedef EquinoxProductProperties
|
36
|
+
* @type {object}
|
37
|
+
* @property {string} availableChannels
|
38
|
+
*
|
39
|
+
* ---
|
40
|
+
*
|
41
|
+
* Types common to Product model and Equinox Product model
|
15
42
|
*
|
16
43
|
* @typedef Inventory
|
17
44
|
* @type {object}
|
18
45
|
* @property {number} atpQty
|
19
46
|
* @property {boolean} backOrdered
|
47
|
+
*
|
48
|
+
* ---
|
49
|
+
*
|
50
|
+
* Standalone types. These are types not related to Product
|
51
|
+
* and Equinox Product models.
|
52
|
+
*
|
53
|
+
* @typedef KitSKUQuantity
|
54
|
+
* @type {object}
|
55
|
+
* @property {string} sku
|
56
|
+
* @property {number} qty
|
20
57
|
*/
|
21
58
|
const availableQuantity = require('./availableQuantity');
|
59
|
+
const childSKU = require('./childSKU');
|
22
60
|
|
23
61
|
module.exports = {
|
24
|
-
mapAvailableQuantity: availableQuantity
|
62
|
+
mapAvailableQuantity: availableQuantity,
|
63
|
+
mapChildSKU: childSKU
|
25
64
|
};
|
package/src/productData.js
CHANGED
@@ -5,7 +5,7 @@ const contentstack = require('./contentstack/contentstack');
|
|
5
5
|
const Product = require("./product");
|
6
6
|
const CustomerTypes = require('./models/customerTypes');
|
7
7
|
const ProductStatus = require("./models/productStatus");
|
8
|
-
const { mapAvailableQuantity } = require('./equinox-helpers');
|
8
|
+
const { mapAvailableQuantity, mapChildSKU } = require('./equinox-helpers');
|
9
9
|
|
10
10
|
const productTypes = {
|
11
11
|
kit: 'kit'
|
@@ -129,8 +129,15 @@ const ProductData = {
|
|
129
129
|
*/
|
130
130
|
eqProductVariantMapper: function (eqVariant) {
|
131
131
|
|
132
|
-
let imageURL = eqVariant.properties.imageURL
|
133
|
-
|
132
|
+
let imageURL = eqVariant.properties.imageURL;
|
133
|
+
const regex = /\d+\.\d+/
|
134
|
+
let thumbnailImage = ''
|
135
|
+
|
136
|
+
if (imageURL.includes('contentstack')) {
|
137
|
+
thumbnailImage = imageURL + '?width=40'
|
138
|
+
} else {
|
139
|
+
thumbnailImage = imageURL.replace(regex, '40.40')
|
140
|
+
}
|
134
141
|
|
135
142
|
const { eventName, eventLabels, computedPrice, defaultProductPrice } = this.getEqProductPromotions(eqVariant);
|
136
143
|
const productPrice = eventName ? defaultProductPrice : eqVariant.priceFacets["Regular Price"];
|
@@ -337,131 +344,142 @@ const ProductData = {
|
|
337
344
|
},
|
338
345
|
|
339
346
|
eqProductMapper: async function (productDataResponse, skus) {
|
340
|
-
// console.log(productDataResponse, skus);
|
341
347
|
let count = 0;
|
342
348
|
let variants = {};
|
343
349
|
const products = [];
|
344
350
|
|
345
351
|
for (const productData of productDataResponse) {
|
346
|
-
|
347
|
-
|
348
|
-
|
352
|
+
try {
|
353
|
+
let product = (productData.type && productData.type === "kit") ? productData : productData.sku[count];
|
354
|
+
let imageURL = product.properties.imageURL;
|
355
|
+
const regex = /\d+\.\d+/
|
356
|
+
let thumbnailImage = ''
|
357
|
+
|
358
|
+
if (imageURL.includes('contentstack')) {
|
359
|
+
thumbnailImage = imageURL + '?width=40'
|
360
|
+
} else {
|
361
|
+
thumbnailImage = imageURL.replace(regex, '40.40')
|
362
|
+
}
|
349
363
|
|
364
|
+
if (productData.sku && productData.sku.length > 1) {
|
365
|
+
// exclude base product from variants
|
366
|
+
productData.sku.filter(v => v.identifier.substring(2, 4) !== "55").map(variant => {
|
367
|
+
variants[variant.identifier] = this.eqProductVariantMapper(variant);
|
368
|
+
return variant;
|
369
|
+
});
|
370
|
+
}
|
350
371
|
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
});
|
372
|
+
const {
|
373
|
+
eventName,
|
374
|
+
eventLabels,
|
375
|
+
computedPrice,
|
376
|
+
defaultProductPrice
|
377
|
+
} = this.getEqProductPromotions(product);
|
378
|
+
const productPrice = eventName ? defaultProductPrice : product.priceFacets["Regular Price"];
|
379
|
+
const discountedPrice = eventName ? computedPrice : product.priceFacets["Regular Price"];
|
380
|
+
|
381
|
+
product.childSkus = await this.fetchChildSkus(product);
|
382
|
+
product.availableQuantity = mapAvailableQuantity(product);
|
383
|
+
product = {
|
384
|
+
...product,
|
385
|
+
"sku": product.identifier,
|
386
|
+
"globalProductID": productData.identifier,
|
387
|
+
"title": productData.properties.name,
|
388
|
+
"country": product.properties.market,
|
389
|
+
"language": "en",
|
390
|
+
"shortDescr": productData.properties.description,
|
391
|
+
"longDescr": productData.properties.productDetailsDescription,
|
392
|
+
"fullImage": imageURL,
|
393
|
+
"imageAltText": productData.properties.name,
|
394
|
+
"productCarouselImages": [
|
395
|
+
{
|
396
|
+
"contentType": "img",
|
397
|
+
"src": "/content/products/24/00/35/24003529/jcr:content/fullImage.imgw.1280.1280.png",
|
398
|
+
"alt": ""
|
399
|
+
}
|
400
|
+
],
|
401
|
+
"thumbnail": thumbnailImage,
|
402
|
+
"ingredients": productData.properties.ingredients,
|
403
|
+
"benefits": productData.properties.benefits,
|
404
|
+
"usage": productData.properties.usage,
|
405
|
+
"resources": product.properties.resources,
|
406
|
+
"videos": "",
|
407
|
+
"movie": "",
|
408
|
+
"youtube": "",
|
409
|
+
"salesEventText": "",
|
410
|
+
"contentSection": [
|
411
|
+
{
|
412
|
+
"sectionContent": "<div class=\"contentSections\"></div>\n"
|
413
|
+
}
|
414
|
+
],
|
415
|
+
"scanQualified": productData.properties.scanQualifiedCount,
|
416
|
+
"maxQuantity": 999,
|
417
|
+
"points": "",
|
418
|
+
"cv": (product.priceFacets.CV) ? product.priceFacets.CV : '',
|
419
|
+
"pv": product.priceFacets.PV,
|
420
|
+
"priceType": "WRTL",
|
421
|
+
"price": discountedPrice,
|
422
|
+
"priceMap": {
|
423
|
+
"WRTL": productPrice,
|
424
|
+
"WADW-WRTL": product.priceFacets["Regular Price"],
|
425
|
+
"WADR": product.priceFacets["Regular Price"],
|
426
|
+
"RTL": product.priceFacets["Regular Price"],
|
427
|
+
"WADW": product.priceFacets["Wholesale Price"],
|
428
|
+
"WHL": product.priceFacets["Wholesale Price"],
|
429
|
+
"WWHL": product.priceFacets["Wholesale Price"]
|
430
|
+
},
|
431
|
+
"cvMap": {
|
432
|
+
"WWHL": (product.priceFacets.CV) ? product.priceFacets.CV : '',
|
433
|
+
"WADW": (product.priceFacets.CV) ? product.priceFacets.CV : '',
|
434
|
+
"WHL": (product.priceFacets.CV) ? product.priceFacets.CV : ''
|
435
|
+
},
|
436
|
+
"pvMap": {
|
437
|
+
"WWHL": product.priceFacets.PV,
|
438
|
+
"WADW": product.priceFacets.PV,
|
439
|
+
"WHL": product.priceFacets.PV
|
440
|
+
},
|
441
|
+
"orderTypes": this._setOrderType(product.properties),
|
442
|
+
"custTypes": this.switchCustType(product.properties.customerTypes),
|
443
|
+
"division": productData.properties.division,
|
444
|
+
"backOrderDate": null,
|
445
|
+
"locallyProduced": false,
|
446
|
+
"agelocme": null,
|
447
|
+
"count": "",
|
448
|
+
"flavor": "",
|
449
|
+
"size": product.properties.size,
|
450
|
+
"shade": "",
|
451
|
+
"status": this.switchStatusFromEquinox(product.properties.productStatus),
|
452
|
+
"variantType": "Other",
|
453
|
+
"variantDropdownLabel": product.properties.variantLabel || "",
|
454
|
+
"variantDropdownPlaceholder": "Select Type",
|
455
|
+
"variantsLabel": product.properties.variantLabel || "",
|
456
|
+
"groupOffer": false,
|
457
|
+
"personalOffer": false,
|
458
|
+
"savedEventName": eventName,
|
459
|
+
"salesLabel": eventLabels,
|
460
|
+
"eventName": eventName,
|
461
|
+
"sizeWeight": '',
|
462
|
+
"nettoWeight": "",
|
463
|
+
"variants": variants,
|
464
|
+
"searchScore": 0,
|
465
|
+
"isExclusive": product.properties.isExclusive || false,
|
466
|
+
"marketAttributes": {
|
467
|
+
"discount": true,
|
468
|
+
"redeem": true,
|
469
|
+
"earn": true
|
470
|
+
},
|
471
|
+
"restrictedMarkets": [],
|
472
|
+
"addOns": [],
|
473
|
+
"inventory": product.inventory || "", //inventory label
|
474
|
+
"equinoxProductId": productData.identifier
|
475
|
+
};
|
476
|
+
|
477
|
+
products.push(new Product(product));
|
478
|
+
} catch (err) {
|
479
|
+
console.error('Unable to map the product', productData.identifier, ':', err);
|
480
|
+
console.error('Product info:', productDataResponse, skus);
|
481
|
+
continue;
|
357
482
|
}
|
358
|
-
|
359
|
-
const {
|
360
|
-
eventName,
|
361
|
-
eventLabels,
|
362
|
-
computedPrice,
|
363
|
-
defaultProductPrice
|
364
|
-
} = this.getEqProductPromotions(product);
|
365
|
-
const productPrice = eventName ? defaultProductPrice : product.priceFacets["Regular Price"];
|
366
|
-
const discountedPrice = eventName ? computedPrice : product.priceFacets["Regular Price"];
|
367
|
-
|
368
|
-
product.childSkus = await this.fetchChildSkus(product);
|
369
|
-
product.availableQuantity = mapAvailableQuantity(product);
|
370
|
-
product = {
|
371
|
-
...product,
|
372
|
-
"sku": product.identifier,
|
373
|
-
"globalProductID": productData.identifier,
|
374
|
-
"title": productData.properties.name,
|
375
|
-
"country": product.properties.market,
|
376
|
-
"language": "en",
|
377
|
-
"shortDescr": productData.properties.description,
|
378
|
-
"longDescr": productData.properties.productDetailsDescription,
|
379
|
-
"fullImage": imageURL,
|
380
|
-
"imageAltText": productData.properties.name,
|
381
|
-
"productCarouselImages": [
|
382
|
-
{
|
383
|
-
"contentType": "img",
|
384
|
-
"src": "/content/products/24/00/35/24003529/jcr:content/fullImage.imgw.1280.1280.png",
|
385
|
-
"alt": ""
|
386
|
-
}
|
387
|
-
],
|
388
|
-
"thumbnail": thumbnailImage,
|
389
|
-
"ingredients": productData.properties.ingredients,
|
390
|
-
"benefits": productData.properties.benefits,
|
391
|
-
"usage": productData.properties.usage,
|
392
|
-
"resources": product.properties.resources,
|
393
|
-
"videos": "",
|
394
|
-
"movie": "",
|
395
|
-
"youtube": "",
|
396
|
-
"salesEventText": "",
|
397
|
-
"contentSection": [
|
398
|
-
{
|
399
|
-
"sectionContent": "<div class=\"contentSections\"></div>\n"
|
400
|
-
}
|
401
|
-
],
|
402
|
-
"scanQualified": productData.properties.scanQualifiedCount,
|
403
|
-
"maxQuantity": 999,
|
404
|
-
"points": "",
|
405
|
-
"cv": (product.priceFacets.CV) ? product.priceFacets.CV : '',
|
406
|
-
"pv": product.priceFacets.PV,
|
407
|
-
"priceType": "WRTL",
|
408
|
-
"price": discountedPrice,
|
409
|
-
"priceMap": {
|
410
|
-
"WRTL": productPrice,
|
411
|
-
"WADW-WRTL": product.priceFacets["Regular Price"],
|
412
|
-
"WADR": product.priceFacets["Regular Price"],
|
413
|
-
"RTL": product.priceFacets["Regular Price"],
|
414
|
-
"WADW": product.priceFacets["Wholesale Price"],
|
415
|
-
"WHL": product.priceFacets["Wholesale Price"],
|
416
|
-
"WWHL": product.priceFacets["Wholesale Price"]
|
417
|
-
},
|
418
|
-
"cvMap": {
|
419
|
-
"WWHL": (product.priceFacets.CV) ? product.priceFacets.CV : '',
|
420
|
-
"WADW": (product.priceFacets.CV) ? product.priceFacets.CV : '',
|
421
|
-
"WHL": (product.priceFacets.CV) ? product.priceFacets.CV : ''
|
422
|
-
},
|
423
|
-
"pvMap": {
|
424
|
-
"WWHL": product.priceFacets.PV,
|
425
|
-
"WADW": product.priceFacets.PV,
|
426
|
-
"WHL": product.priceFacets.PV
|
427
|
-
},
|
428
|
-
"orderTypes": this._setOrderType(product.properties),
|
429
|
-
"custTypes": this.switchCustType(product.properties.customerTypes),
|
430
|
-
"division": productData.properties.division,
|
431
|
-
"backOrderDate": null,
|
432
|
-
"locallyProduced": false,
|
433
|
-
"agelocme": null,
|
434
|
-
"count": "",
|
435
|
-
"flavor": "",
|
436
|
-
"size": product.properties.size,
|
437
|
-
"shade": "",
|
438
|
-
"status": this.switchStatusFromEquinox(product.properties.productStatus),
|
439
|
-
"variantType": "Other",
|
440
|
-
"variantDropdownLabel": product.properties.variantLabel || "",
|
441
|
-
"variantDropdownPlaceholder": "Select Type",
|
442
|
-
"variantsLabel": product.properties.variantLabel || "",
|
443
|
-
"groupOffer": false,
|
444
|
-
"personalOffer": false,
|
445
|
-
"savedEventName": eventName,
|
446
|
-
"salesLabel": eventLabels,
|
447
|
-
"eventName": eventName,
|
448
|
-
"sizeWeight": '',
|
449
|
-
"nettoWeight": "",
|
450
|
-
"variants": variants,
|
451
|
-
"searchScore": 0,
|
452
|
-
"isExclusive": product.properties.isExclusive || false,
|
453
|
-
"marketAttributes": {
|
454
|
-
"discount": true,
|
455
|
-
"redeem": true,
|
456
|
-
"earn": true
|
457
|
-
},
|
458
|
-
"restrictedMarkets": [],
|
459
|
-
"addOns": [],
|
460
|
-
"inventory": product.inventory || "", //inventory label
|
461
|
-
"equinoxProductId": productData.identifier
|
462
|
-
};
|
463
|
-
|
464
|
-
products.push(new Product(product));
|
465
483
|
}
|
466
484
|
|
467
485
|
let data = {
|
@@ -504,7 +522,7 @@ const ProductData = {
|
|
504
522
|
type: 'SKUKIT',
|
505
523
|
availableChannels: product.properties.availableChannels
|
506
524
|
},
|
507
|
-
...res.data.product.map(p =>
|
525
|
+
...res.data.product.map(p => mapChildSKU(kits, p))
|
508
526
|
];
|
509
527
|
|
510
528
|
return childSkus;
|
@@ -513,23 +531,6 @@ const ProductData = {
|
|
513
531
|
return [];
|
514
532
|
},
|
515
533
|
|
516
|
-
buildChildSkus: function (kits, product) {
|
517
|
-
const sku = product.sku[0];
|
518
|
-
const kit = kits.filter(k => k.sku === sku.identifier)[0];
|
519
|
-
|
520
|
-
return {
|
521
|
-
productId: product.identifier,
|
522
|
-
skuId: sku.identifier,
|
523
|
-
type: 'MANDATORY',
|
524
|
-
skuQuantity: kit.qty,
|
525
|
-
availableChannels: sku.properties.availableChannels,
|
526
|
-
inventory: {
|
527
|
-
atpQty: sku.inventoryProperties.atpQty,
|
528
|
-
backOrdered: sku.inventoryProperties.backOrdered
|
529
|
-
}
|
530
|
-
}
|
531
|
-
},
|
532
|
-
|
533
534
|
/**
|
534
535
|
*
|
535
536
|
* Map status from equinox to legacy
|