@devx-commerce/plugin-gati 0.0.31-beta.4 → 0.0.31-beta.5

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.
@@ -226,7 +226,7 @@ async function processVariantOptionSync(container) {
226
226
  productOptionMap.get("Size").add(sizeTitle);
227
227
  }
228
228
  }
229
- // Process party_style_details for metals, metal colors, diamond qualities, shapes and solitaire caret
229
+ // Process party_style_details for metals, metal colors, diamond qualities, shapes and solitaire carat
230
230
  if (extendedVariant.party_style_details) {
231
231
  for (const detail of extendedVariant.party_style_details) {
232
232
  // Metal options
@@ -296,7 +296,7 @@ async function processVariantOptionSync(container) {
296
296
  productOptionMap.get("Diamond Quality").add(diamondValue);
297
297
  }
298
298
  }
299
- // Shape and Caret logic
299
+ // Shape and Carat logic
300
300
  if (isSolitaire &&
301
301
  detail.raw_type === "Diamond" &&
302
302
  detail.raw_code === "LGS" &&
@@ -314,14 +314,14 @@ async function processVariantOptionSync(container) {
314
314
  productOptionMap.get("Shape").add(shapeTitle);
315
315
  }
316
316
  }
317
- // Caret from detail weight
317
+ // Carat from detail weight
318
318
  const weightStr = String(detail?.weight || "").trim();
319
319
  if (weightStr) {
320
- variantOptions["Caret"] = weightStr;
321
- if (!productOptionMap.has("Caret")) {
322
- productOptionMap.set("Caret", new Set());
320
+ variantOptions["Carat"] = weightStr;
321
+ if (!productOptionMap.has("Carat")) {
322
+ productOptionMap.set("Carat", new Set());
323
323
  }
324
- productOptionMap.get("Caret").add(weightStr);
324
+ productOptionMap.get("Carat").add(weightStr);
325
325
  }
326
326
  }
327
327
  }
@@ -398,7 +398,7 @@ const createProductOptionsStepFromData = async (partyStyles, { rawMasterMap, qua
398
398
  diamondQualities: new Set(),
399
399
  sizes: new Set(),
400
400
  shapes: new Set(),
401
- caret: new Set(),
401
+ carat: new Set(),
402
402
  };
403
403
  // Track if all styles in the group have each option type
404
404
  const optionAvailability = {
@@ -494,7 +494,7 @@ const createProductOptionsStepFromData = async (partyStyles, { rawMasterMap, qua
494
494
  if (shapeTitle) {
495
495
  options.shapes.add(shapeTitle);
496
496
  }
497
- options.caret.add(String(detail.Weight || 0));
497
+ options.carat.add(String(detail.Weight || 0));
498
498
  }
499
499
  });
500
500
  });
@@ -521,9 +521,9 @@ const createProductOptionsStepFromData = async (partyStyles, { rawMasterMap, qua
521
521
  if (optionAvailability.shapes && options.shapes.size > 0) {
522
522
  optionsArray.push({ title: "Shape", values: Array.from(options.shapes) });
523
523
  }
524
- // Add Caret only for solitaire groups when we collected values
525
- if (options.caret.size > 0) {
526
- optionsArray.push({ title: "Caret", values: Array.from(options.caret) });
524
+ // Add Carat only for solitaire groups when we collected values
525
+ if (options.carat.size > 0) {
526
+ optionsArray.push({ title: "Carat", values: Array.from(options.carat) });
527
527
  }
528
528
  // Sort values alphabetically within each option and sort option titles
529
529
  const sortedOptions = optionsArray
@@ -546,7 +546,7 @@ const createProductOptionsForPartyStyleId = (partyStyle, existingProduct, master
546
546
  diamondQualities: new Set(),
547
547
  sizes: new Set(),
548
548
  shapes: new Set(),
549
- caret: new Set(),
549
+ carat: new Set(),
550
550
  };
551
551
  // Size
552
552
  if (partyStyle.ItemSize) {
@@ -598,7 +598,7 @@ const createProductOptionsForPartyStyleId = (partyStyle, existingProduct, master
598
598
  const qualityTitle = masterMaps.qualityMasterMap.get(detail.QlyCode) || detail.QlyCode;
599
599
  options.diamondQualities.add(`${toneTitle} ${qualityTitle}`);
600
600
  }
601
- // Handle solitaire shapes and caret
601
+ // Handle solitaire shapes and carat
602
602
  if (isSolitaireStyle &&
603
603
  detail.RawType === "Diamond" &&
604
604
  detail.RawCode === "LGS" &&
@@ -608,7 +608,7 @@ const createProductOptionsForPartyStyleId = (partyStyle, existingProduct, master
608
608
  if (shapeTitle) {
609
609
  options.shapes.add(shapeTitle);
610
610
  }
611
- options.caret.add(String(detail.Weight || 0));
611
+ options.carat.add(String(detail.Weight || 0));
612
612
  }
613
613
  });
614
614
  // Prepare result object with only options that exist
@@ -640,11 +640,11 @@ const createProductOptionsForPartyStyleId = (partyStyle, existingProduct, master
640
640
  existingProduct.options.find((option) => option.title === "Shape")) {
641
641
  result["Shape"] = Array.from(options.shapes).sort((a, b) => a.localeCompare(b))[0];
642
642
  }
643
- // Add Caret only if solitaire and product has Caret option
643
+ // Add Carat only if solitaire and product has Carat option
644
644
  if (isSolitaireStyle &&
645
- options.caret.size > 0 &&
646
- existingProduct.options.find((option) => option.title === "Caret")) {
647
- result["Caret"] = Array.from(options.caret).sort((a, b) => a.localeCompare(b))[0];
645
+ options.carat.size > 0 &&
646
+ existingProduct.options.find((option) => option.title === "Carat")) {
647
+ result["Carat"] = Array.from(options.carat).sort((a, b) => a.localeCompare(b))[0];
648
648
  }
649
649
  // Sort result keys alphabetically for consistent ordering
650
650
  const sortedResult = {};
@@ -153,7 +153,7 @@ exports.updateProductOptionsAfterDeletionStep = (0, workflows_sdk_1.createStep)(
153
153
  productOptionMap.get("Size").add(sizeTitle);
154
154
  }
155
155
  }
156
- // Process party_style_details for metals, metal colors, diamond qualities, shapes and solitaire caret
156
+ // Process party_style_details for metals, metal colors, diamond qualities, shapes and solitaire carat
157
157
  if (extendedVariant.party_style_details) {
158
158
  for (const detail of extendedVariant.party_style_details) {
159
159
  // Metal options
@@ -223,7 +223,7 @@ exports.updateProductOptionsAfterDeletionStep = (0, workflows_sdk_1.createStep)(
223
223
  productOptionMap.get("Diamond Quality").add(diamondValue);
224
224
  }
225
225
  }
226
- // Shape and Caret logic aligned with helper
226
+ // Shape and Carat logic aligned with helper
227
227
  if (isSolitaire &&
228
228
  detail.raw_type === "Diamond" &&
229
229
  detail.raw_code === "LGS" &&
@@ -242,11 +242,11 @@ exports.updateProductOptionsAfterDeletionStep = (0, workflows_sdk_1.createStep)(
242
242
  }
243
243
  const weightStr = String(detail?.weight || "").trim();
244
244
  if (weightStr) {
245
- variantOptions["Caret"] = weightStr;
246
- if (!productOptionMap.has("Caret")) {
247
- productOptionMap.set("Caret", new Set());
245
+ variantOptions["Carat"] = weightStr;
246
+ if (!productOptionMap.has("Carat")) {
247
+ productOptionMap.set("Carat", new Set());
248
248
  }
249
- productOptionMap.get("Caret").add(weightStr);
249
+ productOptionMap.get("Carat").add(weightStr);
250
250
  }
251
251
  }
252
252
  }
@@ -114,7 +114,7 @@ exports.updateProductOptionsAfterVariantUpdateStep = (0, workflows_sdk_1.createS
114
114
  productOptionMap.get("Size").add(sizeTitle);
115
115
  }
116
116
  }
117
- // Process party_style_details for metals, metal colors, diamond qualities, shapes and solitaire caret
117
+ // Process party_style_details for metals, metal colors, diamond qualities, shapes and solitaire carat
118
118
  if (extendedVariant.party_style_details) {
119
119
  for (const detail of extendedVariant.party_style_details) {
120
120
  // Metal options
@@ -184,7 +184,7 @@ exports.updateProductOptionsAfterVariantUpdateStep = (0, workflows_sdk_1.createS
184
184
  productOptionMap.get("Diamond Quality").add(diamondValue);
185
185
  }
186
186
  }
187
- // Shape and Caret logic aligned with helper
187
+ // Shape and Carat logic aligned with helper
188
188
  if (isSolitaire &&
189
189
  detail.raw_type === "Diamond" &&
190
190
  detail.raw_code === "LGS" &&
@@ -203,11 +203,11 @@ exports.updateProductOptionsAfterVariantUpdateStep = (0, workflows_sdk_1.createS
203
203
  }
204
204
  const weightStr = String(detail?.weight || "").trim();
205
205
  if (weightStr) {
206
- variantOptions["Caret"] = weightStr;
207
- if (!productOptionMap.has("Caret")) {
208
- productOptionMap.set("Caret", new Set());
206
+ variantOptions["Carat"] = weightStr;
207
+ if (!productOptionMap.has("Carat")) {
208
+ productOptionMap.set("Carat", new Set());
209
209
  }
210
- productOptionMap.get("Caret").add(weightStr);
210
+ productOptionMap.get("Carat").add(weightStr);
211
211
  }
212
212
  }
213
213
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devx-commerce/plugin-gati",
3
- "version": "0.0.31-beta.4",
3
+ "version": "0.0.31-beta.5",
4
4
  "description": "Gati ERP integration for Medusa",
5
5
  "author": "devx commerce",
6
6
  "license": "MIT",