[object Object]

← back to Vendor Discount Agent

fix: populate discount_found field in check record when discount is calculated

59c40d4cbd272509761553d33e450adab6ba29ba · 2026-05-30 21:22:43 -0700 · Steve Abrams

checkRecord.discount_found was never assigned, always writing NULL to the
vendor_discount_checks.discount_found column even when a discount was
successfully parsed. Now mirrors calculated_discount at the point of success.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Files touched

Diff

commit 59c40d4cbd272509761553d33e450adab6ba29ba
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Sat May 30 21:22:43 2026 -0700

    fix: populate discount_found field in check record when discount is calculated
    
    checkRecord.discount_found was never assigned, always writing NULL to the
    vendor_discount_checks.discount_found column even when a discount was
    successfully parsed. Now mirrors calculated_discount at the point of success.
    
    Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---
 discount-checker.js | 1 +
 1 file changed, 1 insertion(+)

diff --git a/discount-checker.js b/discount-checker.js
index 54468fc..f4139e3 100644
--- a/discount-checker.js
+++ b/discount-checker.js
@@ -219,6 +219,7 @@ async function checkVendorDiscount(vendor, pool) {
           checkRecord.sample_list_price = parsed.listPrice;
           checkRecord.sample_net_price = parsed.netPrice;
           checkRecord.calculated_discount = parsed.discount;
+          checkRecord.discount_found = parsed.discount;
           checkRecord.price_type = parsed.priceType;
           checkRecord.status = 'discount_calculated';
 

← 73ea192 security: strip hardcoded dw_admin DSN password -> env-first  ·  back to Vendor Discount Agent  ·  Strip hardcoded Shopify API tokens from source (env-first); d104f24 →