Michael
8b7d81b20c
feat: implement product grid with comprehensive product data fetching, processing, and heatmap display.
2026-03-19 12:41:03 +01:00
Michael
2b7e7bc1f4
feat: Introduce AI analysis engine with detailed system prompt and user message generation for product recommendations, and add an OpenRouter client.
2026-03-19 09:50:28 +01:00
Michael
d8a9329075
feat: Introduce AI Copilot feature with product analysis engine, state management, and UI components for insights.
2026-03-19 07:53:56 +01:00
Michael
95795ce7e3
feat: Introduce AI analysis engine for product A/Z recommendations based on detailed business rules.
2026-03-18 22:15:14 +01:00
Michael
de768128e3
feat: implement AI copilot analysis engine with v5 simplified system prompt and product recommendation rules.
2026-03-18 21:34:31 +01:00
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
Michael and Claude 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
Michael and Claude 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
Michael and Claude 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
Michael and Claude 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
Michael and Claude 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
22aa6f101a
feat: Implement AI-powered product analysis engine with rules for manager directives, dead stock, and relative supplier performance, supported by a new score engine.
2026-03-13 10:52:40 +01:00
Michael
38e8fc1eac
feat: implement AI analysis engine for generating retail product recommendation prompts.
2026-03-13 08:55:30 +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
9faea9df07
feat: Implement AI analysis engine with simplified v5 logic for product recommendations based on relative supplier performance.
2026-03-12 13:38:23 +01:00
Michael
1f38f487b1
feat: implement AI copilot analysis engine with detailed product recommendation logic and system prompt generation.
2026-03-12 13:00:51 +01:00
Michael
97ed6dd829
feat: Add AI copilot analysis engine to generate system and contextual user prompts for product recommendations.
2026-03-12 12:42:19 +01:00
Michael
1a01e084a5
feat: Implement AI copilot analysis engine (v4) with comprehensive product recommendation logic and contextual data generation.
2026-03-12 12:26:54 +01:00
Michael
b66867429b
feat: implement v4 AI analysis engine with comprehensive product recommendation rules and contextual data for prompt generation.
2026-03-12 12:09:41 +01:00
Michael
12c4e0ce95
feat: add server action to fetch, process, and score product sales data, including schema initialization for code_gamme_init.
2026-03-12 11:10:47 +01:00
Michael
1458700cb7
feat: Implement 'dead stock' detection and override inter-product consistency rules in the AI analysis engine.
2026-03-11 17:00:46 +01:00
Michael
49e1dd9d9b
feat: Implement v3 context profiler for multi-store product normalization and an AI analysis engine.
2026-03-11 16:41:01 +01:00
Michael
cfbf293104
feat: Implement a composite weighted score engine and update the task markdown with a master plan and progress log.
2026-03-11 16:25:22 +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
05549fbde5
fix: add cache revalidation to snapshot APIs and fix imports
2026-03-10 16:29:45 +01:00
Michael
85972b287d
fix: restore anonymous snapshot visibility and deletion
2026-03-10 16:16:23 +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
69e2f9c325
feat: Implement NextAuth authentication with credentials, database and JSON fallback, including admin seeding and password management.
2026-03-10 12:24:30 +01:00
Michael
4e80f228fe
feat: Seed default admin user and ensure users table existence.
2026-03-10 12:13:57 +01:00
Michael
4819ad7743
feat: Introduce ensureAdminExists function to seed a default admin user and create the users table if needed.
2026-03-10 12:03:18 +01:00
Michael
086da9dfde
feat: Add database initialization script and default admin user seeding.
2026-03-10 11:41:44 +01:00
Michael
47872a994f
feat: Introduce NextAuth.js for authentication, including default admin seeding and user table auto-creation.
2026-03-10 11:38:12 +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