@factorypure/client-helpers 1.1.20 → 1.1.21

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.
Files changed (2) hide show
  1. package/dist/index.js +3 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -667,7 +667,7 @@ class LowPriceOutlierRule {
667
667
  overridableBy = [];
668
668
  evaluate(context) {
669
669
  const multiplier = getUndercutThreshold(context.variant.price, context.globalScrapeOptions.undercut_threshold_ranges || []);
670
- const isTooCheap = context.result.extracted_price < context.variant.price * multiplier;
670
+ const isTooCheap = (context.result.extracted_total ?? context.result.extracted_price ?? 0) < context.variant.price * multiplier;
671
671
  if (isTooCheap) {
672
672
  return {
673
673
  ruleId: this.id,
@@ -675,7 +675,7 @@ class LowPriceOutlierRule {
675
675
  message: HIDE_REASONS.LOW_PRICE_OUTLIER,
676
676
  metadata: {
677
677
  variantPrice: context.variant.price,
678
- resultPrice: context.result.extracted_price,
678
+ resultPrice: context.result.extracted_total ?? context.result.extracted_price ?? 0,
679
679
  threshold: multiplier,
680
680
  },
681
681
  timestamp: new Date().toISOString(),
@@ -727,7 +727,7 @@ class CompetitorExclusionRule {
727
727
  priority = 80;
728
728
  enabled = true;
729
729
  canBeOverridden = true;
730
- overridableBy = ['sku_match', 'calculated_sku_match', 'alt_sku_match'];
730
+ overridableBy = [];
731
731
  evaluate(context) {
732
732
  const lowerSource = context.result.source.toLowerCase();
733
733
  const isExcluded = context.variantScrapeOptions.competitor_exclusions.some((exclusion) => exclusion && lowerSource === exclusion.toLowerCase());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@factorypure/client-helpers",
3
- "version": "1.1.20",
3
+ "version": "1.1.21",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",