Commit Graph
151 Commits
Author SHA1 Message Date
Christian Vidal Wolf 4fbe7570a9 fix: resolve DataGrid product rendering failure by updating isRealSale to support CombinedKPIs and ignoring non-flat columns in filterData 2026-04-30 10:38:46 +02:00
Christian Vidal Wolf 490cb4a96b Fix: improve Vendor stock parsing robustness and ASIN extraction for B0D14YBNWB 2026-04-27 11:48:47 +02:00
Christian Vidal Wolf 550269724a Fix: export isAllowedCustomer to resolve build error 2026-04-20 13:20:17 +02:00
Christian Vidal Wolf 117aa0626f Fix: implement definitive revenue integrity filter with ASIN validation and strict marketplace whitelist 2026-04-20 13:19:14 +02:00
Christian Vidal Wolf f54aafb44c Fix: final refinement of revenue filtering to ensure Dashboard totals match Dropbox. Enforced Amazon-only marketplace check. 2026-04-20 13:07:25 +02:00
Christian Vidal Wolf f218db76ad Fix: correctly filter Dashboard revenue by enforcing Marketplace and Unit rules in filterData 2026-04-20 13:04:41 +02:00
Christian Vidal Wolf 1e7c88ffad Fix: Corrected 2026 revenue discrepancy, resolved WeeklyGrid initialization crash, and restored Week Coverage data 2026-04-20 12:54:40 +02:00
Christian Vidal Wolf 38f16aac89 feat: improve Week Coverage visibility, calculation robustness, and add aggregate WOC to grid totals and forecast view 2026-04-17 12:35:25 +02:00
Christian Vidal Wolf 348821cd49 fix: exhaustive visibility fix for Sales/Ads data including inclusive filtering and permissive header validation 2026-04-16 11:49:48 +02:00
Christian Vidal Wolf adf72f6f96 fix: restore sales visibility by normalizing marketplace names in Sales pipeline 2026-04-16 11:41:58 +02:00
Christian Vidal Wolf 8c0401f3d5 fix: relax data filters and marketplace mapping to restore sales visibility 2026-04-16 11:37:33 +02:00
Christian Vidal Wolf b304e0ddb8 fix: resolve maximum call stack size exceeded error and optimize master table 2026-03-16 13:19:21 +01:00
Christian Vidal Wolf eb20fe2878 fix: include ad rows without ASINs to match total PPC spend (Sponsored Brands fix) 2026-03-12 16:59:11 +01:00
Christian Vidal Wolf c15642d62d feat: add Detail Level BSR metric to experiments analysis 2026-03-10 13:58:44 +01:00
Christian Vidal WolfandClaude Sonnet 4.6 2363982144 feat: simplify verdict to winner/unsuccessful with >50% threshold
- winner if posterior probability > 50%, unsuccessful otherwise
- Removes inconclusive — binary outcome based on Bayesian signal
- Label "Loser" renamed to "Unsuccessful"
- Updated all stored experiment verdicts in DB

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-10 13:47:01 +01:00
Christian Vidal WolfandClaude Sonnet 4.6 1fb9956a15 fix(buybox): hardcode reason column for FR/UK/DE, remove STATUS keyword
FR/UK/DE sheets have a 'Status' column that appears before 'Reason',
causing the dynamic detector to pick the wrong column.
Use confirmed indices: FR=col S(18), UK=col J(9), DE=col N(13).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 15:47:56 +01:00
Christian Vidal WolfandClaude Sonnet 4.6 916c349126 fix(buybox): restrict sheet detection to BB_* sheets only
Inventory sheets like 'INV ITALY' were being incorrectly matched as
buybox sheets, adding all their ASINs as false BB lost entries.
Now only sheets starting with 'BB' are processed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 15:38:39 +01:00
Christian Vidal WolfandClaude Sonnet 4.6 249fba5390 fix(buybox): rewrite processBuyBoxExcel with ASIN regex detection
Replace fragile header/column-index approach with pattern-based ASIN detection:
- Scan all cells for Amazon ASIN pattern (B[0-9A-Z]{9}) to auto-detect the ASIN column regardless of headers or position
- Detect country from sheet name with flexible matching (no hardcoded sheet name list)
- Detect reason column from header keywords, no hardcoded column indices
- Remove all hardcoded fallback indices (col 13, 18, 9, etc.) that caused empty results

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 15:08:24 +01:00
Christian Vidal Wolf 036e7b9a0a fix: prioritize ASIN column detection over SKU in processBuyBoxExcel 2026-03-03 14:23:08 +01:00
Christian Vidal WolfandClaude Sonnet 4.6 93c2a699ea fix(buybox): show BB Lost badge for ES ASINs with missing or empty reason
- Force reasonIdx to column N (13) for BB_ES sheet, same as DE/FR/UK, so dynamic header detection can't override to a wrong column
- Fall back to 'BB Lost' when reason cell is empty instead of skipping the ASIN entirely
- Add B095K8948Z to debug logging alongside B0D3874WSD

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 13:39:04 +01:00
Christian Vidal WolfandClaude Sonnet 4.6 37f9ffac2f fix(dataProcessor): parse DD/M/YY correctly when day <= 12
The previous fix only handled the unambiguous case (day > 12). Dates like
"5/1/26" or "12/1/26" (Jan 5 / Jan 12, 2026) were falling through to
JS's new Date() which parsed them as US format MM/DD/YY, assigning them
to May and December instead of January.

Now any 3-part slash date with a 2-digit year in position 3 and a valid
month in position 2 is treated as DD/M/YY (Spanish/EU convention),
fixing weeks 2-3 of January (days 5-18) showing zero sell-out.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 13:14:30 +01:00
Christian Vidal WolfandClaude Sonnet 4.6 2eed94b94b fix(dataProcessor): parse DD/M/YY dates from column C in sell-out CSV
Add support for European day-first date format (e.g. "23/2/26" = 23 Feb 2026)
in the sell-out CSV pipeline so months and years are correctly extracted from
column C of Amazon Sell Out 2023-2025.csv.

- normalizeMonth: detect DD/MM/YY when first part > 12, return "Mon-YY"
- mapRowToRecord: add 'C', 'Date', 'Fecha', 'DATA' to month column aliases
- validateSellOutHeaders: accept date columns as substitute for YEAR + MONTH

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 13:07:59 +01:00
Christian Vidal Wolf 98ba0d1708 feat: sync vendor tab filters with global header filters 2026-03-03 10:52:35 +01:00
christian.vidalandClaude Sonnet 4.6 7f5aa1b812 feat(vendor): switch BSR charts to daily resolution for smoother trend lines
- Add date? field to BSRRecord (ISO string YYYY-MM-DD)
- processBSRExcel now extracts and stores the Date column as an ISO date
  (handles both Excel serial numbers and string dates)
- VendorDataView groups chart data by date (daily) when dates are available,
  falling back to weekly buckets — eliminates straight-line charts caused
  by only 2 weekly data points

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-02 18:53:45 +01:00
christian.vidalandClaude Sonnet 4.6 702bb021f8 fix(bsr): fix regex bug and expand column aliases in processBSRExcel
- Fix critical regex bug: /\\d+/ was matching literal '\d' instead of
  digits, causing all rows to be rejected (week always = 0)
- Add VendorCSV format support: 'Top Level Category (Rank)', 'Date', etc.
- Derive ISO week number from Date column when no Week column exists
- Process all sheets (not just first) to handle multi-tab workbooks
- Log column names on load to aid future debugging

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-02 18:44:12 +01:00
christian.vidalandClaude Sonnet 4.6 ce13d17eda fix(vendor): pass bsrData prop to VendorDataView - resolves black screen
VendorDataView was refactored to receive BSR data as a prop but App.tsx
was not updated to pass it, causing the component to crash on undefined
and show a blank screen. Also fixes supabase.ts type errors and removes
dead code.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-02 18:32:38 +01:00
Christian Vidal Wolf 243c44c7f7 feat: replace Vendor tab with BSR tracker 2026-03-02 15:22:12 +01:00
Christian Vidal WolfandQwen-Coder 918da227ee fix(experimentAnalysis): use ISO week start (Monday) consistently in aggregateWeeklyMetrics
- Change getWeekStartSunday to getISOWeekMonday for timestamp calculation
- Ensures week alignment between data aggregation and ISO week range calculation
- Fixes incorrect treatment_after average calculation

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-26 15:21:21 +01:00
Christian Vidal WolfandQwen-Coder d5936f1301 fix(experimentAnalysis): use ISO calendar weeks for treatment/baseline periods
- Add ISO week calculation functions (getISOWeek, getISOWeekMonday, calculateISOWeekRange)
- Expand experiment dates to full ISO weeks (Monday-Sunday) instead of exact date ranges
- Use actual data.length for averaging metrics instead of theoretical durationWeeks
- Baseline now takes same number of complete weeks immediately before experiment

Fixes incorrect units sold average calculation (was 6.5, now correctly shows 4.33 for 13 units over 3 weeks)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-26 15:00:24 +01:00
Christian Vidal Wolf adda0cd58f fix(storage): enforce Ads cached schema invalidation to clear broken numeric mapped columns 2026-02-26 10:47:36 +01:00
Christian Vidal Wolf fa588a6444 fix(dataProcessor): improve regex parsing for week number in Ads and Traffic CSV/Excel import 2026-02-26 10:37:50 +01:00
Christian Vidal Wolf 21ec5b63ab fix(parser): align ad sales and units regexes to capture standard Amazon header 'Sales within X days' 2026-02-26 08:30:23 +01:00
Christian Vidal WolfandClaude Opus 4.6 5dfcdd71c0 fix(parser): prevent regex collision where /sale/i matched ACOS column instead of attributed sales
The generic regex /sale/i in ads column detection was matching "Advertising Cost
of Sales" (the ACOS % column) before reaching "7 day total sales" (the actual
attributed sales amount). This caused attributedSales30d to receive the ACOS
percentage instead of the real sales value, making experiment ACOS = 0 or 100%.

- Replace /sale/i with specific regexes: /\d+\s*day.*sale/i, /total\s+sale/i, etc.
- Replace /cost/i with regexes that exclude "cost of sales" columns
- Replace /unit/i with specific regexes for unit columns
- Add diagnostic logging for ads Excel column headers and first-row values
- Revert ACOS 100% fallback (root cause now fixed)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 16:54:56 +01:00
Christian Vidal WolfandClaude Opus 4.6 8b774ae7ba fix(experiments): prevent NaN propagation and ACOS zero-value bug in experiment analysis
- Change ?? to || for salesAds/units/revenue in weekly aggregation to guard against NaN
- Add || 0 fallback to ads-only records in mergeSalesAndAdsData
- Fix parseCurrency to check isNaN on all EU-format return paths
- Handle ACOS edge case: cost > 0 with adRevenue = 0 now returns 100% instead of 0%
- Add diagnostic console logging to computeDiD for data flow tracing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 16:34:55 +01:00
Christian Vidal Wolf de1af7e0db fix(experiment): patch ASIN matching bug where trailing whitespaces from excel files dropped matching records from analysis leading to zeroed metrics 2026-02-25 16:16:47 +01:00
Christian Vidal Wolf 79641b793a fix(parser): implement regex matching for headers to catch prefixed metric titles like '7 day total sales' 2026-02-25 14:56:15 +01:00
Christian Vidal Wolf 13dd4b62c2 fix(parser): add alphanumeric sanitizer to excel header mapping to support characters like % and parenthesis 2026-02-25 14:22:58 +01:00
Christian Vidal WolfandClaude Opus 4.6 487b8e105e feat: bulk ASIN selection via space-separated paste in filters
Allow pasting multiple ASINs separated by spaces in any MultiSelectDropdown
search field and pressing Enter to auto-select all matching options.
Also switch ads CSV/Excel parsing to header-based column mapping for
robustness across different file formats.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 14:01:11 +01:00
Christian Vidal Wolf 69eafe8335 fix(experiments): explicitly use ad revenue (salesAds) for true ACOS and ROAS calculations instead of total sales revenue 2026-02-25 13:52:57 +01:00
Christian Vidal Wolf 30466a94ff fix(experiments): mathematically correctly aggregate ratios like ACOS and ROAS before averaging 2026-02-25 13:44:59 +01:00
Christian Vidal Wolf b39831c417 fix(experiments): change weekly boundaries to start on Sunday instead of ISO Monday 2026-02-25 13:35:10 +01:00
Christian Vidal Wolf 0fb312d537 fix(experiments): resolve bug that included adjacent week when experiment ended on midnight boundary 2026-02-25 13:32:39 +01:00
Christian Vidal Wolf 719390a5d5 refactor(experiments): change metric average calculation to strict weekly dividing rather than day fractions 2026-02-25 13:15:44 +01:00
Christian Vidal Wolf 6e94a32a47 fix(experiments): include full 24h of end_date in DiD overlap bounds 2026-02-25 13:10:00 +01:00
Christian Vidal Wolf be829c938e fix(experiments): allow decimals in formatMetricValue to show exact weekly averages 2026-02-25 13:03:45 +01:00
Christian Vidal Wolf 8ed073ff6e fix(experiments): use exact fractional proportions for overlapping weeks in DiD calculation 2026-02-25 12:59:03 +01:00
Christian Vidal Wolf aa745b4d5e feat(data): map product line from column R 2026-02-25 12:38:58 +01:00
Christian Vidal Wolf ce2241a5ec feat(data): update sell-out parser mapping and validation for new structure 2026-02-25 11:46:02 +01:00
Christian Vidal Wolf 4de9fb5b89 fix(experiments): include overlapping weeks in date range logic and use exact ISO weeks 2026-02-25 08:39:13 +01:00
Christian Vidal Wolf 4935112a55 feat: enable custom baseline periods for Experiments to solve seasonality 2026-02-23 18:34:04 +01:00