Commit Graph
14 Commits
Author SHA1 Message Date
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 WolfandClaude Sonnet 4.6 845a8e0ae6 fix: resolve black screen caused by React hooks violation in WaterfallModal
Move useMemo before early return in WaterfallModal to comply with Rules of Hooks.
Wrap App with ErrorBoundary so future render crashes show an error panel instead of a silent black screen.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 13:04:42 +01:00
Christian Vidal Wolf 753b312412 fix(mkt): ensure all ad spend is aggregated correctly in MKT tab including unassigned spend 2026-03-12 17:07:13 +01:00
Christian Vidal WolfandClaude Sonnet 4.6 910e6d2a4d fix: include empty-ASIN ad records so MKT total matches ADs Weekly
Removed the `if (asin)` guard so records without a product ASIN
(e.g. campaign-level rows) accumulate in adsSpendMap and appear as
an 'Unassigned Ad Spend' row, ensuring the total PPC spend is the
same as in the ADs Weekly tab.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-12 16:44:36 +01:00
Christian Vidal WolfandClaude Sonnet 4.6 36fa63b6c1 fix: zero out deals/promos/chargebacks when 2025 is not in filtered scope
These Excel files only contain 2025 data. When the top filter excludes
2025 (e.g. year=2024), the maps are ignored so columns show 0 instead
of stale 2025 figures.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-12 16:26:52 +01:00
Christian Vidal WolfandClaude Sonnet 4.6 0eda5551d8 fix: include all ad-spend ASINs in MKT tab to match ADs Weekly total
Two bugs fixed:
1. Removed hardcoded year===2025 filter (data is already pre-filtered)
2. ASINs with ad spend but no sales records were silently dropped —
   now appended as extra rows so the total PPC spend matches ADs Weekly

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-12 16:18:46 +01:00
Christian Vidal WolfandClaude Sonnet 4.6 657009a7ba feat: wire MKT tab to top-level filters and remove internal category filter
MktDataView now receives filteredData/filteredAdsData so the global
FilterBar controls the tab's data. Removed the local "All Categories"
dropdown that previously sat next to the Include COGS toggle.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-12 14:35:37 +01:00
Christian Vidal Wolf 9c55d132dd feat(mkt): filter sales and ads to 2025 only and show full product catalog 2026-03-11 13:06:06 +01:00
Christian Vidal Wolf 7240c9998c style: fix mkt tab columns visibility by wrapping product names 2026-03-11 13:00:19 +01:00
Christian Vidal WolfandClaude Sonnet 4.6 6a1cb0e8dd refactor: consolidate 3 MKT fetch routes into fetch-mkt-data to stay within Vercel 12-function limit
Replace fetch-deals, fetch-promos, fetch-chargebacks with a single
/api/fetch-mkt-data?file=deals|promos|chargebacks endpoint.
Update MktDataView fetch calls accordingly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 12:36:45 +01:00
Christian Vidal WolfandClaude Sonnet 4.6 49498c5c51 feat: wire MKT tab to real data sources
Replace all mock data in the Profitability Dashboard with live data:
- Add 3 new API routes (fetch-deals, fetch-promos, fetch-chargebacks) proxying Dropbox Excel files
- MktDataView now accepts rawData/adsData props and fetches+parses the 3 new files on mount
- SELL OUT and units aggregated globally across all marketplaces from rawData
- PPC Spend aggregated globally from adsData; ACoS calculated as spend/sales
- Deals (col A→C), Promos (col E→K), Chargebacks (col AN→B) parsed and summed per ASIN
- Category filter populated from product line metadata
- Loading skeleton shown while files are fetching

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 12:34:07 +01:00
Christian Vidal WolfandQwen-Coder 5d0edfba5f ui: rename Gross Sales to SELL OUT in MKT table
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-11 10:34:17 +01:00
Christian Vidal Wolf f323e2a96e feat: split Incentives into Deals and Promos in MKT tab 2026-03-11 09:31:39 +01:00
Christian Vidal Wolf 455cd8ed08 feat: add MKT tab and integrate profitability dashboard 2026-03-11 09:27:57 +01:00