@nuskin/cs-product-lib 1.0.27-cx12-8656.2 → 1.0.27

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/cs-product-lib",
3
- "version": "1.0.27-cx12-8656.2",
3
+ "version": "1.0.27",
4
4
  "description": "Library for pulling and parsing product content (and applying business logic) retrieved from Contentstack",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/csProduct.js CHANGED
@@ -132,9 +132,6 @@ const csProduct = (props) => {
132
132
  validVariants.push({
133
133
  ...variant,
134
134
  status: varStatus,
135
- backorderQuantity: varStatus?.backordered ? varStatus?.availableQuantity : 0,
136
- availableQuantity: varStatus?.backordered ? 0 : varStatus?.availableQuantity,
137
- backorderedAvailableDate: varStatus?.backorderedAvailableDate || null,
138
135
  marketData
139
136
  })
140
137
  }
@@ -546,8 +543,7 @@ const csProduct = (props) => {
546
543
  getProductTranslations,
547
544
  getBundle,
548
545
  getBundles,
549
- getCategoryPageTranslations,
550
- formatProductWithSchema
546
+ getCategoryPageTranslations
551
547
  }
552
548
  }
553
549
 
package/src/formatKit.js CHANGED
@@ -1,6 +1,71 @@
1
- const { isNullOrEmpty } = require('@nuskin/ns-common-lib')
1
+ const { isNullOrEmpty, isTrue } = require('@nuskin/ns-common-lib')
2
2
  const moment = require('moment')
3
3
 
4
+ const parseStatus = (variant) => {
5
+ const dateFormat = 'YYYY-MM-DD'
6
+
7
+ if (variant?.type !== 'bundle' && variant?.type !== 'kit') {
8
+ return {
9
+ status: variant?.status?.status,
10
+ isBackordered: variant?.status?.isBackordered,
11
+ backorderedAvailableDate: variant?.status?.backorderedAvailableDate
12
+ }
13
+ }
14
+
15
+ let isBackordered = false
16
+ let backorderedAvailableDate = null
17
+ if (variant?.type === 'kit') {
18
+ try {
19
+ /* eslint-disable no-unsafe-optional-chaining */
20
+ const latestBODate = Math.max(
21
+ ...variant?.requiredProducts?.flatMap((a) =>
22
+ a?.product?.variants?.map(
23
+ (s) =>
24
+ Number(
25
+ new Date(s?.status?.backorderedAvailableDate)
26
+ ) || 0
27
+ )
28
+ )
29
+ )
30
+ if (latestBODate) {
31
+ isBackordered = true
32
+ backorderedAvailableDate = moment(
33
+ new Date(latestBODate)
34
+ ).format(dateFormat)
35
+ }
36
+ } catch {
37
+ backorderedAvailableDate = null
38
+ }
39
+ } else if (variant?.type === 'bundle') {
40
+ try {
41
+ const latestBODate = Math.max(
42
+ ...variant?.requiredProducts?.flatMap(
43
+ (a) =>
44
+ Number(
45
+ new Date(
46
+ a?.product?.variants[0]?.status?.backorderedAvailableDate
47
+ )
48
+ ) || 0
49
+ )
50
+ )
51
+ if (latestBODate) {
52
+ isBackordered = true
53
+ backorderedAvailableDate = moment(
54
+ new Date(latestBODate)
55
+ ).format(dateFormat)
56
+ }
57
+ } catch {
58
+ backorderedAvailableDate = null
59
+ }
60
+ }
61
+ return {
62
+ // changed
63
+ status: variant?.status?.status,
64
+ isBackordered: isBackordered,
65
+ backorderedAvailableDate: backorderedAvailableDate
66
+ }
67
+ }
68
+
4
69
  const parsePrice = (product = []) => {
5
70
  const requiredProducts = !isNullOrEmpty(product)
6
71
  ? product?.map((p) => p?.requiredProducts).flat()
@@ -89,49 +154,36 @@ const parsePrice = (product = []) => {
89
154
  return sumOfPriceAndPoints
90
155
  }
91
156
 
92
- const getKitOrBundleDetails = (bundle) => {
93
- const dateFormat = 'YYYY-MM-DD'
94
- let maxQty = null;
95
- let backOrderedQty = null;
96
- let availableQty = null;
97
- let quantities = [];
98
- let availableQuantities = [];
99
- let prodQty = 0;
100
- let dates = [];
101
- let latestBackOrderedDate = null;
157
+ const parseKitAvailableQuantity = (kit) => {
102
158
  try {
103
- bundle?.requiredProducts?.flatMap(a => {
104
- prodQty = Number(a?.quantity || 1);
105
- a?.product?.variants?.map(s => {
106
- const backorderQty = s?.backorderQuantity || 0;
107
- const availableQty = s?.availableQuantity || 0;
108
- const backorderDate = s?.status?.backorderedAvailableDate || null;
109
- dates.push(moment(backorderDate))
110
- quantities.push({maxPurchasable: (backorderQty + availableQty)/prodQty});
111
- availableQuantities.push({availableQty});
112
- })
113
- })
114
- const maxQtyPurchasable = quantities && quantities.length > 0 ? Math.min(...quantities.map(obj=>obj.maxPurchasable)) : 0;
115
- const maxAvailableQty = availableQuantities && availableQuantities.length > 0 ? Math.min(...availableQuantities.map(obj=>obj.availableQty)) : 0;
116
- maxQty = Math.floor(maxQtyPurchasable);
117
- const checkIfNegative = (maxQty - maxAvailableQty) < 0;
118
- backOrderedQty = checkIfNegative ? 0 : maxQty - maxAvailableQty;
119
- availableQty = maxAvailableQty;
120
- dates = dates.filter(date => date.isValid());
121
- latestBackOrderedDate = dates && dates.length > 0 && backOrderedQty !== 0 ? moment.max(dates).format(dateFormat) : null;
122
- } catch (error) {
123
- console.error('getKitOrBundleDetails() - back order qty, available qty, max qty, latest back order date or status error', error);
124
- maxQty = 0;
125
- backOrderedQty = 0;
126
- availableQty = 0;
127
- latestBackOrderedDate = null;
159
+ return (
160
+ Math.min(
161
+ ...kit.flatMap((a) =>
162
+ a?.sku?.map((s) => s?.inventoryProperties?.atpQty)
163
+ )
164
+ ) || 0
165
+ )
166
+ } catch {
167
+ return 0
168
+ }
169
+ }
170
+
171
+ const parseBundleAvailableQuantity = (product) => {
172
+ try {
173
+ const { requiredProducts = [] } = !isNullOrEmpty(product) ? product : {}
174
+ const quantities = requiredProducts?.map((p) =>
175
+ p?.product?.variants?.map((a) => a?.availableQuantity)
176
+ )
177
+ return Math.min(...quantities) || 0
178
+ } catch {
179
+ console.log('some error in availableQuantity')
180
+ return 0
128
181
  }
129
- return {status: bundle?.status?.status, maxQty, backOrderedQty, availableQty, latestBackOrderedDate}
130
182
  }
131
183
 
132
- const parseKit = (bundle, market) => {
184
+ const parseKit = (product, market) => {
133
185
  const kits = {}
134
- const [properties] = !isNullOrEmpty(bundle) ? bundle : []
186
+ const [properties] = !isNullOrEmpty(product) ? product : []
135
187
  kits.id = properties?.id
136
188
  if (properties?.type === 'kit' && properties?.legacy_sku) {
137
189
  kits.id = properties?.legacy_sku
@@ -140,13 +192,14 @@ const parseKit = (bundle, market) => {
140
192
  kits.title = properties?.title
141
193
  kits.description = properties?.description
142
194
  kits.availableChannels = properties?.availableChannels
143
- kits.chargeShipping = properties?.chargeShipping === 'true'
195
+ kits.chargeShipping = isTrue(properties?.chargeShipping)
144
196
  kits.customerTypes = properties?.customerTypes
145
- kits.dangerousGoods = properties?.dangerousGoods === 'true'
146
- kits.excludeFromSearch = properties?.excludeFromSearch === 'true'
147
- kits.isExclusive = properties?.isExclusive === 'true'
197
+ kits.dangerousGoods = isTrue(properties?.dangerousGoods)
198
+ kits.excludeFromSearch = isTrue(properties?.excludeFromSearch)
199
+ kits.isExclusive = isTrue(properties?.isExclusive)
148
200
  kits.marketAttributes = properties?.marketAttributes
149
- const priceData = parsePrice(bundle)
201
+ kits.maxQuantity = (product?.inventoryProperties || {}).atpQty
202
+ const priceData = parsePrice(product)
150
203
  kits.points = priceData?.points
151
204
  kits.price = priceData?.price
152
205
  kits.purchaseTypes = {
@@ -161,20 +214,35 @@ const parseKit = (bundle, market) => {
161
214
  kits.grpDiscount = properties?.grpDiscount
162
215
  kits.scanQualifiedCount = properties?.scanQualifiedCount
163
216
  kits.taxClass = properties?.taxClass
217
+ // newVariant.slug = undefined
218
+ kits.status = parseStatus(properties)
219
+ if ((kits?.status || {})?.status === 'active')
220
+ kits.status.status = 'sellable'
164
221
  const kitProducts = []
165
- const type = properties.type === 'bundle' ? 'bundle' : 'kit'
166
- kits.type = type
167
- const details = getKitOrBundleDetails(properties)
168
- kits.status = { status: details.status, isBackordered: !!(details.backOrderedQty !== 0 && details.latestBackOrderedDate !== null), backorderedAvailableDate: details.latestBackOrderedDate }
169
- kits.maxQuantity = details.maxQty
170
- kits.availableQuantity = details.availableQty
171
- kits.backorderQuantity = details.backOrderedQty
172
- kits.backorderedAvailableDate = details.latestBackOrderedDate
173
- if (type === 'bundle') {
222
+ if (properties?.type === 'kit' && product?.kit) {
223
+ kits.type = 'kit'
224
+ kits.availableQuantity = parseKitAvailableQuantity(product?.kit)
225
+ for (const kit of product?.kit || []) {
226
+ const kitProduct = formatKit(kit, market)
227
+ kitProduct.id = kit?.identifier
228
+ kitProducts.push({
229
+ product: kitProduct,
230
+ quantity: (kit?.properties || {})?.quantity || 0,
231
+ isMandatory: true
232
+ })
233
+ }
234
+ } else if (
235
+ properties?.type === 'bundle' ||
236
+ (properties?.type === 'kit' && properties?.requiredProducts)
237
+ ) {
238
+ kits.type = properties?.type
239
+ kits.availableQuantity = parseBundleAvailableQuantity(properties)
174
240
  for (const kit of properties?.requiredProducts || []) {
175
241
  if (kit?.product) {
242
+ const kitProduct = formatKit(kit?.product, market)
243
+ kitProduct.id = kit?.product?.id
176
244
  kitProducts?.push({
177
- product: formatKit(kit?.product, market),
245
+ product: kitProduct,
178
246
  quantity: kit?.quantity || 0,
179
247
  isMandatory: true
180
248
  })
@@ -182,24 +250,17 @@ const parseKit = (bundle, market) => {
182
250
  }
183
251
  for (const kit of properties?.optionalProducts || []) {
184
252
  if (kit?.product) {
253
+ const kitProduct = formatKit(kit?.product, market)
254
+ kitProduct.id = kit?.product?.id
185
255
  kitProducts?.push({
186
- product: formatKit(kit?.product, market),
256
+ product: kitProduct,
187
257
  quantity: kit?.quantity || 0,
188
258
  isMandatory: false
189
259
  })
190
260
  }
191
261
  }
192
- } else if (type === 'kit') {
193
- for (const kit of properties?.requiredProducts || []) {
194
- kitProducts.push({
195
- product: formatKit(kit?.product, market),
196
- quantity: kit?.quantity || 0,
197
- isMandatory: true
198
- })
199
- }
200
262
  }
201
263
  kits.kitProducts = kitProducts
202
- if ((kits?.status || {})?.status === 'active') kits.status.status = 'sellable'
203
264
  return kits
204
265
  }
205
266
 
@@ -212,7 +273,6 @@ const formatKit = (product, market) => {
212
273
  if (['kit', 'bundle'].includes(product?.type)) {
213
274
  kit = parseKit(product?.bundle, market)
214
275
  }
215
-
216
276
  return {
217
277
  ...product,
218
278
  bundle: kit
@@ -221,5 +281,9 @@ const formatKit = (product, market) => {
221
281
 
222
282
  module.exports = {
223
283
  formatKit,
224
- parseKit
284
+ parseKit,
285
+ parseBundleAvailableQuantity,
286
+ parseKitAvailableQuantity,
287
+ parsePrice,
288
+ parseStatus
225
289
  }
@@ -2,117 +2,111 @@ const helpers = require('./helpers')
2
2
  const _ = require('lodash')
3
3
  const entities = require('entities')
4
4
 
5
- const formatVariant = (parent) => {
6
- const isBackOrdered = _.get(parent, 'defaults.status.backordered', null);
7
- const backOrderedDate = _.get(parent, 'defaults.status.backorderedAvailableDate', null);
8
- const preliminaryAvailableQty = _.get(parent, 'defaults.status.availableQuantity', 0);
9
- const availableQty = isBackOrdered ? 0 : preliminaryAvailableQty;
10
- const backOrderedQty = isBackOrdered ? availableQty : 0;
11
-
5
+ const formatVariant = (parent) => ({
12
6
  // Each value is a function with a parameter 'parent' that is the current instance of a Variant
13
7
  // ContentStack references need to be queried separately
14
- return {
15
- id: parent?.uid,
16
- globalId: parent?.sap_data?.global_id,
17
- sku: helpers?.getBestSkuData(parent)?.sku,
18
- slug: parent?.slug,
19
- size: parent?.size,
20
- variantLabel: parent?.select_label,
21
- variantColor: parent?.select_color,
22
- title: parent?.name || parent?.defaults?.name,
23
- salesLabel: parent?.sales_label,
24
- salesText: parent?.sales_text,
25
- description: entities?.decodeHTML(
26
- parent?.short_description_override || parent?.defaults?.description || ''
27
- ),
28
- salesDisclaimer: helpers?.mapSalesDisclaimer(parent?.sales_disclaimer),
29
- nettoWeight: parent?.netto_weight,
30
- productImages: helpers?.mapProductImages(parent),
31
- isExclusive: parent?.is_exclusive,
32
- pricingJson: JSON.stringify(parent?.defaults?.status?.pricing) || null,
33
- price: helpers?.mapPrice(parent),
34
- points: helpers?.mapPoints(parent),
35
- backorderedAvailableDate: backOrderedDate,
36
- backorderQuantity: backOrderedQty,
37
- availableQuantity: availableQty,
38
- maxQuantity: _.get(parent, 'defaults.status.maxQuantity', 0), // will be product status overrideMaxQty else its availableQty
39
- status: {
40
- status: _.get(parent, 'defaults.status.status.retail', null),
41
- retail: _.get(parent, 'defaults.status.status.retail', null),
42
- wholesale: _.get(parent, 'defaults.status.status.wholesale', null),
43
- isBackordered: isBackOrdered,
44
- backorderedAvailableDate: backOrderedDate
45
- },
46
- csStatus: helpers?.mapCsStatus(parent),
47
- purchaseTypes: helpers?.mapPurchaseTypes(parent),
48
- features: helpers?.mapFeatures(parent),
49
- productDetails: helpers?.mapProductDetails(parent),
50
- ingredients: helpers?.mapIngredients(
51
- parent.ingredients_override,
52
- parent.legacy_ingredients
8
+ id: parent?.uid,
9
+ globalId: parent?.sap_data?.global_id,
10
+ sku: helpers?.getBestSkuData(parent)?.sku,
11
+ slug: parent?.slug,
12
+ size: parent?.size,
13
+ variantLabel: parent?.select_label,
14
+ variantColor: parent?.select_color,
15
+ title: parent?.name || parent?.defaults?.name,
16
+ salesLabel: parent?.sales_label,
17
+ salesText: parent?.sales_text,
18
+ description: entities?.decodeHTML(
19
+ parent?.short_description_override || parent?.defaults?.description || ''
20
+ ),
21
+ salesDisclaimer: helpers?.mapSalesDisclaimer(parent?.sales_disclaimer),
22
+ nettoWeight: parent?.netto_weight,
23
+ productImages: helpers?.mapProductImages(parent),
24
+ isExclusive: parent?.is_exclusive,
25
+ pricingJson: JSON.stringify(parent?.defaults?.status?.pricing) || null,
26
+ price: helpers?.mapPrice(parent),
27
+ points: helpers?.mapPoints(parent),
28
+ availableQuantity: _.get(parent, 'defaults.status.availableQuantity', 0),
29
+ maxQuantity: _.get(parent, 'defaults.status.maxQuantity', 0),
30
+ status: {
31
+ status: _.get(parent, 'defaults.status.status.retail', null),
32
+ retail: _.get(parent, 'defaults.status.status.retail', null),
33
+ wholesale: _.get(parent, 'defaults.status.status.wholesale', null),
34
+ isBackordered: _.get(parent, 'defaults.status.backordered', null),
35
+ backorderedAvailableDate: _.get(
36
+ parent,
37
+ 'defaults.status.backorderedAvailableDate',
38
+ ''
39
+ )
40
+ },
41
+ csStatus: helpers?.mapCsStatus(parent),
42
+ purchaseTypes: helpers?.mapPurchaseTypes(parent),
43
+ features: helpers?.mapFeatures(parent),
44
+ productDetails: helpers?.mapProductDetails(parent),
45
+ ingredients: helpers?.mapIngredients(
46
+ parent.ingredients_override,
47
+ parent.legacy_ingredients
48
+ ),
49
+ benefitsAndFeatures: helpers?.mapBenefitsAndFeatures(parent),
50
+ results: helpers?.mapResults(parent),
51
+ usage: helpers?.mapUsage(parent, parent.legacy_usage),
52
+ resources: helpers?.mapResources(parent),
53
+ faqs: helpers?.mapFaqs(parent),
54
+ disclaimers: parent?.disclaimers || [],
55
+ disclaimerWarnings: helpers?.mapDisclaimerWarnings(
56
+ parent.disclaimer_warnings
57
+ ),
58
+ matchingVariant:
59
+ parent.sap_data?.sku_data?.findIndex((s) =>
60
+ parent.searchedSkus.includes(s.sku)
61
+ ) > -1,
62
+ shadeable: parent?.shadeable || false,
63
+ restrictedMarkets: parent?.restricted_markets || [],
64
+ productType: parent?.sap_data?.product_type,
65
+ primaryBrand: parent.sap_data?.primary_brand,
66
+ brandFamily: parent?.sap_data?.brand_family,
67
+ marketAttributes: {
68
+ discount: _.get(
69
+ parent,
70
+ 'defaults.status.marketAttributes.discount',
71
+ null
53
72
  ),
54
- benefitsAndFeatures: helpers?.mapBenefitsAndFeatures(parent),
55
- results: helpers?.mapResults(parent),
56
- usage: helpers?.mapUsage(parent, parent.legacy_usage),
57
- resources: helpers?.mapResources(parent),
58
- faqs: helpers?.mapFaqs(parent),
59
- disclaimers: parent?.disclaimers || [],
60
- disclaimerWarnings: helpers?.mapDisclaimerWarnings(
61
- parent.disclaimer_warnings
62
- ),
63
- matchingVariant:
64
- parent.sap_data?.sku_data?.findIndex((s) =>
65
- parent.searchedSkus.includes(s.sku)
66
- ) > -1,
67
- shadeable: parent?.shadeable || false,
68
- restrictedMarkets: parent?.restricted_markets || [],
69
- productType: parent?.sap_data?.product_type,
70
- primaryBrand: parent.sap_data?.primary_brand,
71
- brandFamily: parent?.sap_data?.brand_family,
72
- marketAttributes: {
73
- discount: _.get(
74
- parent,
75
- 'defaults.status.marketAttributes.discount',
76
- null
77
- ),
78
- redeem: _.get(parent, 'defaults.status.marketAttributes.redeem', null),
79
- earn: _.get(parent, 'defaults.status.marketAttributes.earn', null)
80
- },
81
- legacyBenefits: parent.legacy_benefits,
82
- legacyLongDescription: parent.legacy_long_description,
83
- legacyResources: parent.legacy_resources,
84
- legacyUsage: parent.legacy_usage,
85
- legacyIngredients: parent.legacy_ingredients,
86
- legacyImages: parent.legacy_images || [],
87
- legacyYouTube: parent.legacy_youtube_video,
88
- csAtts: {
89
- version: parent._version || 0,
90
- updatedAt: parent.updated_at || '',
91
- updatedBy: parent.updated_by || '',
92
- createdAt: parent.created_at || '',
93
- createdBy: parent.created_by || '',
94
- locale: parent.locale || ''
95
- },
96
- searchKeywords: parent?.search_keywords,
97
- excludeFromSearch: parent?.exclude_from_search || helpers?.mapCsStatus(parent).status === 'discontinued' || _.get(parent, 'defaults.status.status.retail', null) === 'DISCONTINUED',
98
- customerTypes: helpers?.getBestSkuData(parent)?.status_selections
99
- ?.customer_types,
100
- availableChannels: helpers?.getBestSkuData(parent)?.status_selections
101
- ?.display_channels,
102
- displayChannels: helpers?.getBestSkuData(parent)?.status_selections
103
- ?.display_channels,
104
- scanQualifiedCount: helpers?.getBestSkuData(parent)?.status_selections
105
- ?.scan_qualify_count,
106
- scanQualifyCount: helpers?.getBestSkuData(parent)?.status_selections
107
- ?.scan_qualify_count,
108
- chargeShipping: helpers?.getBestSkuData(parent)?.charge_shipping,
109
- dangerousGoods: helpers?.getBestSkuData(parent)?.dangerous_goods,
110
- channels: helpers?.getBestSkuData(parent)?.channels,
111
- foreignLimit: helpers?.getBestSkuData(parent)?.foreign_limit,
112
- foreignOrderLimit: helpers?.getBestSkuData(parent)?.foreign_limit,
113
- orderType: parent.sap_data?.order_type
114
- }
115
- }
73
+ redeem: _.get(parent, 'defaults.status.marketAttributes.redeem', null),
74
+ earn: _.get(parent, 'defaults.status.marketAttributes.earn', null)
75
+ },
76
+ legacyBenefits: parent.legacy_benefits,
77
+ legacyLongDescription: parent.legacy_long_description,
78
+ legacyResources: parent.legacy_resources,
79
+ legacyUsage: parent.legacy_usage,
80
+ legacyIngredients: parent.legacy_ingredients,
81
+ legacyImages: parent.legacy_images || [],
82
+ legacyYouTube: parent.legacy_youtube_video,
83
+ csAtts: {
84
+ version: parent._version || 0,
85
+ updatedAt: parent.updated_at || '',
86
+ updatedBy: parent.updated_by || '',
87
+ createdAt: parent.created_at || '',
88
+ createdBy: parent.created_by || '',
89
+ locale: parent.locale || ''
90
+ },
91
+ searchKeywords: parent?.search_keywords,
92
+ excludeFromSearch: parent?.exclude_from_search || helpers?.mapCsStatus(parent).status === 'discontinued' || _.get(parent, 'defaults.status.status.retail', null) === 'DISCONTINUED',
93
+ customerTypes: helpers?.getBestSkuData(parent)?.status_selections
94
+ ?.customer_types,
95
+ availableChannels: helpers?.getBestSkuData(parent)?.status_selections
96
+ ?.display_channels,
97
+ displayChannels: helpers?.getBestSkuData(parent)?.status_selections
98
+ ?.display_channels,
99
+ scanQualifiedCount: helpers?.getBestSkuData(parent)?.status_selections
100
+ ?.scan_qualify_count,
101
+ scanQualifyCount: helpers?.getBestSkuData(parent)?.status_selections
102
+ ?.scan_qualify_count,
103
+ chargeShipping: helpers?.getBestSkuData(parent)?.charge_shipping,
104
+ dangerousGoods: helpers?.getBestSkuData(parent)?.dangerous_goods,
105
+ channels: helpers?.getBestSkuData(parent)?.channels,
106
+ foreignLimit: helpers?.getBestSkuData(parent)?.foreign_limit,
107
+ foreignOrderLimit: helpers?.getBestSkuData(parent)?.foreign_limit,
108
+ orderType: parent.sap_data?.order_type
109
+ })
116
110
 
117
111
  module.exports = {
118
112
  formatVariant
@@ -45,7 +45,6 @@ async function getProductStatus(skus, locale, homeUrl, awsBase, clientId) {
45
45
  const overrideMaxQuantity = marketConfig.skuMaxQty
46
46
  ? marketConfig.skuMaxQty[skus[i]]
47
47
  : undefined
48
- // @TODO - Update this code when we update our config for minimum availableQuantity in CS
49
48
  const availableQuantity =
50
49
  productStatus.availableQuantity < 999
51
50
  ? productStatus.availableQuantity