@factorypure/client-helpers 1.1.7 → 1.1.8
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/dist/index.d.ts +1 -0
- package/dist/index.js +5 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -387,6 +387,7 @@ export declare const HIDE_OVERRIDE_REASONS: {
|
|
|
387
387
|
ALT_SKU_MATCH: string;
|
|
388
388
|
CALCULATED_SKU_MATCH: string;
|
|
389
389
|
CALCULATED_SKU_PARTIAL_MATCH: string;
|
|
390
|
+
CALCULATED_ALT_SKU_MATCH: string;
|
|
390
391
|
};
|
|
391
392
|
export declare const TOO_CHEAP_MULTIPLIER = 0.75;
|
|
392
393
|
export declare const TOO_EXPENSIVE_MULTIPLIER = 1.15;
|
package/dist/index.js
CHANGED
|
@@ -187,6 +187,7 @@ export const HIDE_OVERRIDE_REASONS = {
|
|
|
187
187
|
ALT_SKU_MATCH: 'Alt SKU Match',
|
|
188
188
|
CALCULATED_SKU_MATCH: 'Calculated SKU Match',
|
|
189
189
|
CALCULATED_SKU_PARTIAL_MATCH: 'Calculated SKU Partial Match',
|
|
190
|
+
CALCULATED_ALT_SKU_MATCH: 'Calc. Alt SKU Match',
|
|
190
191
|
};
|
|
191
192
|
const HIDE_ALWAYS_MAP = {
|
|
192
193
|
[HIDE_REASONS.HIGH_PRICE_OUTLIER]: true,
|
|
@@ -558,9 +559,12 @@ export const calculateHideOverrideReasons = (result, variant, sku_alternates) =>
|
|
|
558
559
|
// TODO ALEX - Does this work? Is it doing anything?
|
|
559
560
|
hide_override_reasons.push('Product Id Linked');
|
|
560
561
|
}
|
|
561
|
-
if (sku_alternates.some((alt) => result
|
|
562
|
+
if (sku_alternates.some((alt) => result?.title?.toLowerCase().includes(alt.toLowerCase()))) {
|
|
562
563
|
hide_override_reasons.push(HIDE_OVERRIDE_REASONS.ALT_SKU_MATCH);
|
|
563
564
|
}
|
|
565
|
+
if (sku_alternates.some((alt) => result?.calculated_sku?.toLowerCase() === alt.toLowerCase())) {
|
|
566
|
+
hide_override_reasons.push(HIDE_OVERRIDE_REASONS.CALCULATED_ALT_SKU_MATCH);
|
|
567
|
+
}
|
|
564
568
|
return hide_override_reasons;
|
|
565
569
|
};
|
|
566
570
|
function getRegexUnitResultsIgnore(resultRegexResults, variantRegexResults, criticalUnits = ['ton', 'cc', 'hp']) {
|