Commit Graph
289 Commits
Author SHA1 Message Date
Michael 53b85381fa feat: add server-side API for fetching and processing comprehensive product data for the grid. 2026-03-23 14:00:27 +01:00
Michael 99954fb001 feat: Add AI Copilot Zustand store for managing and persisting product insights. 2026-03-23 13:34:36 +01:00
Michael 86df5d6f29 feat: introduce BulkAiAnalyzer component for bulk product classification and AI context profiling. 2026-03-23 12:43:02 +01:00
Michael c63a60c0cf feat: implement PostgreSQL client for FF Nancy API data with bulk SQL queries, replacing per-article HTTP calls. 2026-03-23 11:58:50 +01:00
Michael 2eb196861b feat: Implement initial dashboard page displaying network-level KPIs and individual store statistics. 2026-03-22 10:41:32 +01:00
Michael 38979debb8 feat: implement dashboard page with network KPIs and store statistics. 2026-03-21 19:41:59 +01:00
Michael 33deb033b5 feat: implement dashboard page with network-wide and site-specific KPIs, and top 10 items display. 2026-03-21 19:36:02 +01:00
Michael f24da605af feat: Implement direct PostgreSQL client for FF Nancy data, replacing per-article HTTP API calls. 2026-03-21 19:24:51 +01:00
Michael 46c799bd60 feat: Add dashboard page displaying network KPIs and store statistics, along with a new PostgreSQL data client. 2026-03-21 19:18:41 +01:00
Michael a705d0043d feat: Add dashboard page displaying network KPIs, site statistics, and top-selling items. 2026-03-21 18:55:33 +01:00
Michael 3a74689f31 feat: Add PostgreSQL client for bulk fetching FF Nancy data, replacing per-article HTTP API calls. 2026-03-21 17:11:54 +01:00
Michael 6ee0e3294d feat: Introduce direct PostgreSQL client for FF Nancy data to replace HTTP API calls and add a new dashboard page. 2026-03-21 14:37:02 +01:00
Michael d1bbe290da feat: Implement dashboard layout and a new PostgreSQL client for optimized FF Nancy data fetching via bulk SQL queries. 2026-03-21 13:07:59 +01:00
Michael e3d241a5ff feat: add PostgreSQL client for FF Nancy to replace per-article HTTP API calls with bulk SQL queries. 2026-03-21 11:59:36 +01:00
Michael 1664aaf4cc feat: Implement initial dashboard page displaying key performance indicators, site statistics, top items, and monthly evolution. 2026-03-21 08:54:52 +01:00
Michael 1e393753fa feat: Implement PostgreSQL client for FF Nancy to replace per-article HTTP calls with bulk SQL queries. 2026-03-21 08:37:33 +01:00
Michael eb8ca92847 feat: Add PostgreSQL client for FF Nancy to replace per-article HTTP calls with bulk SQL queries. 2026-03-21 00:56:36 +01:00
Michael 966b13cdf0 feat: implement dashboard page displaying KPIs, site statistics, top items, and monthly evolution using a new PostgreSQL client. 2026-03-21 00:22:14 +01:00
Michael 7cb96966aa feat: implement PostgreSQL client for FF Nancy data, replacing per-article HTTP calls with bulk SQL queries. 2026-03-20 16:09:22 +01:00
Michael d5a422e738 feat: Implement dashboard page, its data fetching client, and shared sidebar component. 2026-03-20 14:43:19 +01:00
Michael e391550a30 feat: Introduce product assortment grid client and direct PostgreSQL data access for FF Nancy. 2026-03-20 14:25:30 +01:00
Michael 2e1988a6f5 feat: Implement PostgreSQL client for FF Nancy, replacing per-article HTTP API calls with bulk SQL queries. 2026-03-20 14:18:22 +01:00
Michael 8c5f1c16be feat: add PostgreSQL client for FF Nancy data, replacing per-article HTTP calls with bulk SQL queries. 2026-03-20 14:07:53 +01:00
Michael 1aed954606 feat: Replace per-article HTTP calls with direct bulk SQL queries via new PostgreSQL client for FF Nancy data. 2026-03-20 13:59:30 +01:00
Michael 4996e126b3 feat: implement PostgreSQL client to replace per-article HTTP API calls with bulk SQL queries for FF Nancy data. 2026-03-20 13:31:19 +01:00
Michael dd846247c9 feat: add PostgreSQL client to fetch FF Nancy data via bulk SQL queries, replacing per-article HTTP requests. 2026-03-20 13:23:07 +01:00
Michael 6827257f95 feat: Add PostgreSQL client for FF Nancy data, replacing HTTP API calls with efficient bulk SQL queries. 2026-03-20 13:07:09 +01:00
Michael b4f583415b feat: Add PostgreSQL client for FF Nancy data, replacing HTTP API calls with bulk SQL queries for improved performance. 2026-03-20 11:39:40 +01:00
Michael d5b518477a feat: Add PostgreSQL client for FF Nancy data, replacing per-article HTTP calls with bulk SQL queries for improved performance. 2026-03-20 11:30:54 +01:00
Michael 750017de14 feat: Add PostgreSQL client for FF Nancy data, replacing per-article HTTP API calls with bulk SQL queries for improved performance. 2026-03-20 11:17:24 +01:00
Michael 4b84b56aa6 feat: Introduce a PostgreSQL client for direct FF Nancy data access, replacing per-article HTTP API calls with bulk SQL queries. 2026-03-20 10:57:21 +01:00
Michael eb0fb14021 feat: Add PostgreSQL client for direct FF Nancy database access, replacing per-article HTTP API calls with bulk SQL queries. 2026-03-20 10:44:49 +01:00
Michael a875dbda86 feat: Add PostgreSQL client for FF Nancy to replace per-article HTTP calls with bulk SQL queries. 2026-03-20 10:37:47 +01:00
Michael 70b49c5c56 feat: Introduce getProductRows server action for fetching and processing comprehensive product data from PostgreSQL. 2026-03-20 10:25:24 +01:00
Michael f94d7753b4 feat: Implement direct PostgreSQL client for FF Nancy data, replacing HTTP API calls with bulk SQL queries for improved performance. 2026-03-20 10:12:39 +01:00
Michael 4dd1b5f7c7 feat: Introduce PostgreSQL client for bulk data retrieval and integrate it into product grid data fetching actions. 2026-03-20 10:05:30 +01:00
Michael 58d467a7ea feat: implement product row data retrieval and processing logic for the grid. 2026-03-20 09:58:32 +01:00
MichaelandClaude Sonnet 4.6 65f455b4e2 perf: referentiel+ranking only for articles with sales, per-article ranking
The ranking bulk endpoint is capped at 500 by the API server, making
it useless for full supplier matching. Per-article ranking (codein filter)
works correctly and is now called only for articles WITH sales data.

getProductRows restructured:
- Phase 2A: mensuel + commandes in parallel (all articles)
- Phase 2B: referentiel + ranking in parallel, only for articlesWithData
  (articles that appear in mensuelMap)

For a 45060-article supplier with 5446 with sales:
- Referentiel: 45060 → 5446 calls (88% reduction)
- Ranking: 45060 → 5446 calls (88% reduction)

totalRankedProducts fetched from GET /api/ranking?limit=500 count.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-19 22:02:12 +01:00
MichaelandClaude Sonnet 4.6 383b8ccac7 fix: ranking bulk match by codein AND gencod/gtin, add entry key logging
The bulk ranking response (GET /api/ranking?limit=30000) may use
'gencod' instead of 'codein' as the article identifier. Added:
- gtin→codein lookup map built from article gtin fields
- Match entries by entry.codein first, then by entry.gencod→article.gtin
- Diagnostic logging of the first entry's keys and values to identify
  the correct identifier field in the API response
- Increased fallback per-article batchSize from 20 to 50

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-19 21:51:42 +01:00
MichaelandClaude Sonnet 4.6 1cd3ade77e perf: remove actif filter, increase batchSize, exclude Y articles without sales
- Remove actif/suspendu filter that caused wrong stats (893€ CA, 249 units)
  by incorrectly excluding products with sales. The parallel pagination
  and bulk ranking fixes are sufficient to handle large suppliers.
- Increase getMensuelByArticles and getReferentielByArticles batchSize
  from 20 to 50, reducing sequential batch iterations by ~2.5x.
- Filter gamme Y products with zero 12-month sales from returned rows.
  Reduces grid size (e.g. S053: 14775→fewer rows) without affecting
  products that actually sold. Y products with sales are preserved.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-19 21:23:34 +01:00
MichaelandClaude Sonnet 4.6 be3a196744 perf: parallel article pagination + single-call full ranking fetch
Article pagination:
- fetchAllPages fallback now fetches 10 pages in parallel instead of
  sequentially. Stops as soon as any page returns < pageSize items.
  For S053 (30 pages), reduces sequential time by ~10x.

Ranking:
- getRankingByArticles now fetches the entire network ranking in one
  call (GET /api/ranking?limit=30000) and matches by codein.
  Replaces foucentrale bulk (which returned 0) and per-article fallback
  (which would be 8889 calls for S053).
- totalRankedProducts = actual number of entries returned by the API.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-19 20:58:03 +01:00
MichaelandClaude Sonnet 4.6 a16ec24cd7 perf+fix: parallelize article pagination, filter inactive articles, add gamme Y
Performance fixes for large suppliers (14k+ articles):
- fetchAllPages now fetches page 1, reads total count from response,
  then fetches remaining pages in parallel (10 at a time) instead of
  sequentially. Falls back to sequential if no count in response.
- getProductRows filters out suspended/inactive articles before calling
  getMensuelByArticles and getReferentielByArticles, reducing API calls
  from N_total to N_active (e.g. 14775→~2500 for S053).
- getRankingByArticles receives only active articles for bulk fetch.
- FfArticle now exposes actif and suspendu fields.

Gamme Y support:
- GammeSelect: add Y option with violet color
- GridFilterBar: add Y filter button with violet color
- BulkActionToolbar: add Y bulk assignment button

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-19 20:23:38 +01:00
Michael 69c7d65482 feat: Add Claude settings to allow specific Git and Next.js Bash commands. 2026-03-19 20:06:11 +01:00
MichaelandClaude Sonnet 4.6 dcebf74f31 perf: replace N ranking API calls with 1 bulk fetch per supplier
getRankingByArticles now uses GET /api/ranking?foucentrale=<code>
to fetch all rankings for a supplier in a single request instead of
making one request per article. For a 500-article supplier this goes
from ~500 HTTP calls to 2 (count + bulk), eliminating the timeout
that caused the client-side crash on large suppliers.

Falls back to per-article requests if no codeFournisseur is provided
or if the bulk endpoint fails.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-19 18:53:49 +01:00
MichaelandClaude Opus 4.6 414bf6133d fix: correct snapshot save to detect all gamme changes (drafts + validated)
handleSnapshot was only looking at active draftChanges to build the
snapshot. After validation (Valider), drafts are cleared but changes
are applied to row.codeGamme via applyDraftsToRows. This caused
handleSnapshot (Camera/Export) to save an empty snapshot that
overwrote the real one, losing all gamme changes on page reload.

Now handleSnapshot compares (draftChanges[codein] ?? row.codeGamme)
vs row.codeGammeInit to detect ALL changes, whether drafted or
already validated. Uses codeGammeInit as "before" reference (API
value, never modified).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 17:13:49 +01:00
Michael 01d2dc8b34 feat: add BulkAiAnalyzer component for automatic product classification and AI context profiling. 2026-03-19 15:52:48 +01:00
Michael 41a8b32aff feat: Add API route to export modified gammes data to an Excel file. 2026-03-19 15:28:16 +01:00
Michael 7cdbe8ec21 feat: add Zustand store for grid state and a hook to save draft modifications 2026-03-19 15:17:28 +01:00
Michael aa69637f98 feat: Introduce bulk AI analyzer component to pre-classify products and prepare data for AI analysis, including context profiling. 2026-03-19 13:19:49 +01:00
Michael a4528c6d14 feat: Add HeatmapGrid component for visualizing product data with TanStack Table, virtualization, and performance optimizations. 2026-03-19 13:02:16 +01:00