Commit Graph
124 Commits
Author SHA1 Message Date
Michael aa02d019bd feat: Implement AI Copilot for product analysis and add comprehensive product grid data fetching. 2026-03-18 21:25:53 +01:00
Michael cefe6060d0 feat: implement virtualized heatmap grid component using TanStack Table and Virtual for product data display. 2026-03-18 20:52:13 +01:00
Michael aa77025d14 feat: introduce virtualized heatmap grid component with client-side filtering, sorting, and optimized Zustand state management. 2026-03-18 20:49:57 +01:00
Michael 9aca3b8ead feat: Add virtualized heatmap grid component with dynamic columns, filtering, and row selection. 2026-03-18 20:34:23 +01:00
Michael 8bd7ae8c45 feat: implement server action to fetch and process product rows with sales, stock, and classification data. 2026-03-18 20:08:15 +01:00
Michael ab603e3a6f feat: Add a diagnostic API route and implement server-side logic for fetching and scoring product grid data. 2026-03-18 19:54:44 +01:00
Michael d616da8b91 feat: Introduce getProductRows API and related types for fetching and processing comprehensive product data, incorporating sales, stock, and classification. 2026-03-18 19:31:16 +01:00
MichaelandClaude Sonnet 4.6 8986f7d001 feat: integrate /referentiel endpoint for nomenclature, gamme, stock, PA
Replaces ventesProduits DB query with API call to /articles/:no_id/referentiel.
Called in parallel with mensuel and commandes.

Extracts:
- article.nom_code/nom_libelle → code3/libelle3 (nomenclature)
- gammes[0].gamme_code → codeGamme + codeGammeInit (frozen initial)
- prix.achat + fournisseurs[0].pcb → pa/prixAchat/pcb
- stock[] → stockActuel/stockTotal/stockValeur (real-time)
- performance.derniere_vente/derniere_entree → derniereVente/derniereLivraison

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 19:26:47 +01:00
MichaelandClaude Sonnet 4.6 84aa84cf41 fix: use Drizzle inArray() for ventesProduits classification query
Replaces raw sql ANY() template (which had array type issues) with
proper Drizzle inArray(), deduplicating by codein in JS.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 19:15:24 +01:00
MichaelandClaude Sonnet 4.6 09be89b557 fix: query ventesProduits by codein array instead of code_fournisseur
The old fournisseur code stored in ventesProduits may differ from the
new API codefou (e.g. "AUXENCE" vs "A025"), causing zero results.
Querying by codein = ANY(...) finds the classification data regardless
of how the supplier was previously keyed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 19:05:58 +01:00
Michael 518838c01e feat: introduce getProductRows API to fetch, process, and score product data from multiple sources. 2026-03-18 18:11:08 +01:00
MichaelandClaude Sonnet 4.6 47e617afd3 feat: restore reference, gtin, gamme initiale and nomenclature
api-ff-client.ts:
- FfArticle: add reference (ref_fou_principale) and gtin fields
- getArticlesByFournisseur: map ref_fou_principale → reference, gtin → gtin

get-product-rows.ts:
- ProductRow seeded with reference and gtin from API articles
- Phase 6: read codeGamme, codeGammeInit, code3, libelle3 from ventesProduits
  (read-only, DISTINCT ON codein ordered by updated_at DESC)
- Phase 7 snapshot still overrides DB gammes when a snapshot exists

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 18:08:21 +01:00
MichaelandClaude Sonnet 4.6 58f17152a1 feat: switch to /articles/:no_id/mensuel endpoint for sales & stock data
Replaces bulk mouvements pagination + per-article stock N+1 with a single
batched call to the new mensuel endpoint (confirmed working via diag).

api-ff-client.ts:
- Remove getStockByFournisseur (no longer needed)
- Add FfMensuelEntry/Ventes/Receptions interfaces
- Add getMensuelByArticles(articles, dateDebut, dateFin, batchSize=20)
  → Map<codein, FfMensuelEntry[]> using no_id as API identifier

get-product-rows.ts:
- Phase 2: getMensuelByArticles + getCommandesByFournisseur in parallel
- Phase 5: aggregate mois×site entries → sales12m, stock12m, workingStores
  - qte_vendue / ca_ht are negative → Math.abs()
  - stock carry-forward for months with no data
  - pa from prmp_fin_mois

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 18:00:55 +01:00
Michael 7b209292b9 feat: introduce GridClient component to manage grid state, scoring, and UI orchestration. 2026-03-18 14:35:24 +01:00
Michael 1035489db1 feat: Add FF Nancy API client and status endpoint, implement grid product fetching and draft change saving, and introduce AI Copilot core logic. 2026-03-18 14:31:29 +01:00
Michael 2d3a90d6c7 feat: add floating summary bar component with grid statistics, draft management, snapshot, and export functionality. 2026-03-12 14:25:39 +01:00
Michael 12809b9924 Merge branch 'main' of https://github.com/R0m1k3/CollectFlow 2026-03-11 14:45:49 +01:00
Michael 6529b2fe15 feat: Add saveDraftChanges API endpoint to update product drafts and correctly set codeGammeInit using COALESCE. 2026-03-11 14:45:47 +01:00
Michael 8237cf2d9f fix: snapshot deletion, restore grid logic and add diagnostic API 2026-03-10 16:07:24 +01:00
Michael 5eb3f6732e feat: Add Drizzle ORM database setup, product data fetching and processing with scoring, and a diagnostic API endpoint. 2026-03-10 16:04:55 +01:00
Michael 1e5bb74344 feat: implement getProductRows API to fetch, filter, and aggregate product sales data for the grid, including schema initialization and scoring. 2026-03-10 15:59:44 +01:00
Michael 10cea8c528 feat: Implement product grid with a new API for fetching and processing product sales data, including schema initialization and score computation, and a dashboard page for display. 2026-03-10 15:52:29 +01:00
Michael 5009bd7612 feat: Implement getProductRows API to fetch, aggregate, and score product sales data, including a self-healing schema initialization for code_gamme_init. 2026-03-10 15:30:43 +01:00
Michael 1b09994087 feat: implement product grid data fetching with schema self-healing and add a database verification script. 2026-03-10 13:53:33 +01:00
Michael f15fbe69ec feat: Implement core grid state management with Zustand, define grid data types, and introduce a heatmap cell component. 2026-03-10 12:56:37 +01:00
Michael b408de4c9c feat: Implement API to fetch and process product sales data for grid display, including schema initialization, sales aggregation, and score calculation. 2026-03-10 12:47:13 +01:00
Michael 3ce22defa7 feat: Introduce product scoring based on weighted sales metrics and store participation, integrated into the product grid API, and add a performance test script. 2026-03-10 11:29:39 +01:00
Michael 54a4e7f4d1 feat: add bulk AI analyzer component for product scoring and context profiling. 2026-03-06 16:00:42 +01:00
Michael 34e8f4a767 feat: add bulk action toolbar component for applying gamme codes to selected items. 2026-03-06 15:53:24 +01:00
Michael cdc310223c feat: implement virtualized heatmap grid component using TanStack Table and a new Zustand store for product data. 2026-03-06 15:27:18 +01:00
Michael 1ba507da94 feat: implement virtualized heatmap grid component with a Zustand store for managing grid data, filters, and draft product gamme changes. 2026-03-06 15:15:11 +01:00
Michael 38955ab02a feat: introduce HeatmapGrid component for virtualized product data display with gamme selection and performance optimizations. 2026-03-06 15:08:35 +01:00
Michael d75454dd56 feat: Implement virtualized product heatmap grid with data fetching and client integration. 2026-03-06 15:03:25 +01:00
Michael 57449ec603 feat: introduce heatmap grid component for displaying and managing product data with virtualization and performance optimizations. 2026-03-06 11:18:35 +01:00
Michael eb5bceb5bf feat: introduce DropdownMenu UI component and create HeatmapGrid file. 2026-03-06 11:14:56 +01:00
Michael baebf50d7a feat: implement new DropdownMenu UI component and create tsc-errors.txt to log existing TypeScript compilation issues. 2026-03-06 11:04:14 +01:00
Michael 02a382e815 feat: implement virtualized HeatmapGrid component for efficient product data display and management. 2026-03-06 10:41:35 +01:00
Michael 8902b535a8 feat: Add ExportDropdown component with Excel and PDF export functionalities for grid data. 2026-03-05 16:18:03 +01:00
Michael 02079423c3 feat: Introduce HeatmapGrid component, a virtualized table for product data with heatmap visualization, gamme selection, and performance optimizations. 2026-03-05 16:13:43 +01:00
Michael 287da96f09 feat: Add grid data export functionality to Excel and PDF. 2026-03-05 16:05:40 +01:00
Michael 4de420cd48 feat: implement HeatmapGrid component using TanStack Table and Virtual for efficient product data visualization with state management and performance optimizations. 2026-03-05 15:56:06 +01:00
Michael c7fa25a5d1 feat: Implement an Apple-inspired design system with dark/light modes and introduce the initial dashboard layout including a heatmap grid component. 2026-03-05 14:08:29 +01:00
Michael a008b40a59 feat: implement AI copilot scoring engine for product analysis and recommendations, including a verification script for recent product logic. 2026-03-05 10:58:29 +01:00
Michael 56b09a438d feat: implement client-side grid with heatmap and associated components for product assortment revision. 2026-03-05 10:23:39 +01:00
Michael 4716659c29 feat(grid): optimize global search to filter strictly by product name (libelle1) and codein 2026-02-27 15:00:57 +01:00
Michael b921f5ad40 fix(ai): implement automatic network retry for OpenRouter 502/503/529 overloads in Bulk Analyzer 2026-02-27 14:57:14 +01:00
Michael 81fbe35e55 feat: Introduce product grid page with server-side data fetching for suppliers, stores, and nomenclature, supporting initial selection. 2026-02-27 13:37:18 +01:00
Michael d86eacaef7 feat: implement HeatmapGrid component for product data visualization with virtualized rows and performance optimizations. 2026-02-27 13:23:47 +01:00
Michael a053556a64 feat: add BulkAiAnalyzer component for AI-driven product scoring and gamme suggestions. 2026-02-27 10:49:58 +01:00
Michael b0bb8cc09a feat: Implement bulk AI product analysis, including algorithmic scoring and context profiling, with a new OpenRouter client. 2026-02-27 10:44:02 +01:00