diff --git a/services/dataProcessor.ts b/services/dataProcessor.ts index b09c0ff..b2ed8bd 100644 --- a/services/dataProcessor.ts +++ b/services/dataProcessor.ts @@ -2232,14 +2232,19 @@ export const processBuyBoxExcel = async (fileOrBuffer: File | ArrayBuffer): Prom const rawReason = String(row[reasonIdx] || '').trim(); // Debug specific ASIN reported by user - if (rawAsin === 'B0D3874WSD' || rawAsin.includes('B0D3874WSD')) { - console.log(`[BuyBox Debug] ASIN ${rawAsin} found in ${config.country}. Headers:`, headers); - console.log(`[BuyBox Debug] Reason at index ${reasonIdx}: "${rawReason}" (Length: ${rawReason.length})`); + const isTargetAsin = rawAsin === 'B0D3874WSD' || rawAsin.includes('B0D3874WSD'); + if (isTargetAsin) { + console.log(`[BuyBox Debug] Found ASIN ${rawAsin} in ${config.country}. Row data at reasonIdx (${reasonIdx}): "${row[reasonIdx]}", Processed Reason: "${rawReason}"`); } // Only consider as BB lost if there is an Issue Type / Reason specified const lowReason = rawReason.toLowerCase(); - if (!rawReason || lowReason === 'fixed' || lowReason === 'ok' || lowReason === 'hecho' || lowReason === 'solucionado' || lowReason === 'corrected') continue; + if (!rawReason || lowReason === 'fixed' || lowReason === 'ok' || lowReason === 'hecho' || lowReason === 'solucionado' || lowReason === 'corrected') { + if (isTargetAsin) { + console.log(`[BuyBox Debug] SKIPPING ASIN ${rawAsin} in ${config.country} because reason is empty or matches positive status list ("${rawReason}")`); + } + continue; + } let entry = buyBoxMap.get(rawAsin); if (!entry) {