Commit Graph
57 Commits
Author SHA1 Message Date
MichaelandClaude Sonnet 4.6 3e4b320cbe chore: add diag-mvtart to inspect columns and CA totals
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 09:28:53 +02:00
MichaelandClaude Sonnet 4.6 bc76237f48 feat: sort analytics by name (fournisseur) or code asc (nomenclature); show code in nomenclature label; remove diag-fournisseurs endpoint
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 08:42:21 +02:00
Michael f0a360115f chore: inspect fouident table for correct supplier names 2026-03-31 17:32:54 +02:00
Michael 67b0c8c74f chore: inspect v_ca_fournisseur view structure 2026-03-31 13:52:22 +02:00
Michael 072479b30f chore: fix diag-fournisseurs to inspect real fouadr1 column structure 2026-03-31 13:44:19 +02:00
Michael 09f80b35cb chore: add diag-fournisseurs endpoint to investigate fouadr1 sit_code and naming 2026-03-31 13:40:08 +02:00
MichaelandClaude Sonnet 4.6 cfd3a7e601 chore: remove temporary diag-supplier investigation endpoint
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-31 12:08:15 +02:00
MichaelandClaude Sonnet 4.6 51adac0349 fix: attribute CA to supplier of last stock entry (dernière entrée en stock)
Previous approach (artfou1 DISTINCT ON no_id DESC) picked the most recent
artfou1 record, but artfou1 is a commercial reference table that may not
reflect actual current sourcing.

New approach: for each article, find the most recent reception movement
(genremvt IN (1,2)) in mvtart — this is the actual last delivery. Join
artfou1 to get the supplier code (ORDER BY datmvt DESC, af.no_id DESC to
break ties). This correctly attributes CA to whoever last physically
delivered the goods, not to a historical commercial reference.

Articles with no reception history are excluded (no INNER JOIN fallback
needed as all sold articles must have been received at least once).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-31 12:05:38 +02:00
MichaelandClaude Sonnet 4.6 3d77f6b879 chore: add diag-supplier endpoint for artfou1 supplier attribution investigation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-31 11:08:23 +02: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 aa02d019bd feat: Implement AI Copilot for product analysis and add comprehensive product grid data fetching. 2026-03-18 21:25:53 +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
MichaelandClaude Sonnet 4.6 ca467c73f6 chore: probe /api/articles/:no_id/referentiel in diag
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 19:24:09 +01:00
MichaelandClaude Sonnet 4.6 06e1b1a238 chore: add ventesProduits diagnostic to diag endpoint
Shows row counts, gamme/code3 fill rates, and sample rows
for AUXENCE/A025 to diagnose missing classification data.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 19:17:22 +01:00
MichaelandClaude Sonnet 4.6 2d37a134d4 chore: update diag to probe new mensuel, stock/periode, and mouvements/types endpoints
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 16:44:01 +01:00
MichaelandClaude Sonnet 4.6 c33e22f7eb fix: extractList includes API-specific wrapper keys, diag uses real codefou
- extractList now explicitly checks "mouvements", "articles", "fournisseurs",
  "ventes", "stocks", "commandes" wrapper keys before generic array fallback
- Diag endpoint auto-fetches first real codefou from fournisseurs instead
  of hardcoded "AUXENCE" (which was supplier nom, not actual codefou)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 14:57:49 +01:00
MichaelandClaude Sonnet 4.6 9e500b6650 feat: enhance diag endpoint to probe mouvements API with multiple date param variants
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 14:50:32 +01:00
Michael c056750ea7 feat: implement FF Nancy API client including data models and functions for suppliers, articles, movements, and stock. 2026-03-18 14:44:44 +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 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 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 02fdd18a52 feat: implement AI product analysis endpoint using OpenRouter with optimized timeout handling and N+1 query prevention. 2026-02-27 10:36:34 +01:00
Michael c95eb0ecb6 feat: Add new settings page with Apple-style UI, OpenRouter AI integration, and Mary v4 analysis. 2026-02-27 10:02:23 +01:00
Michael 3438d1b35d feat: add HeatmapCell component and Apple-inspired global design system with dark/light mode support. 2026-02-26 15:54:47 +01:00
Michael 1c03403e9a feat: implement AI Copilot for product analysis, featuring dedicated API, business logic, UI components, and comprehensive documentation. 2026-02-25 10:58:12 +01:00
Michael 359d196c4d feat: implement user authentication and authorization with NextAuth, including user schema, password hashing, and role-based access control. 2026-02-22 14:11:36 +01:00
Michael c23f74d32d feat: Add Excel export for modified gammes via a new API route and a button in the floating summary bar. 2026-02-22 13:10:10 +01:00
Michael 3de16d15d7 feat: Introduce bulk AI product analysis, integrating with OpenRouter via a new API and UI. 2026-02-22 11:59:15 +01:00
Michael 04e6ed70f6 feat: Implement bulk AI product analysis functionality with a new UI component and API route. 2026-02-22 11:19:54 +01:00
Michael 7f9c07b58e feat: Add bulk AI product analysis feature with a new UI component and API route. 2026-02-22 11:00:44 +01:00
Michael 4b3672e65a feat: Add AI product analysis endpoint supporting individual and batch processing modes. 2026-02-22 09:42:51 +01:00
Michael 9744502788 feat: add AI product analysis API route supporting individual and batch modes 2026-02-22 09:23:04 +01:00
Michael ce0085a5c7 feat: Implement bulk AI product categorization through a new UI component and API route. 2026-02-22 09:17:52 +01:00
Michael 9c79b631cb feat: implement batch AI product analysis API route and UI component for product categorization. 2026-02-22 09:10:19 +01:00
Michael d644043aa5 feat: Add batch AI product categorization API and a bulk analyzer UI component. 2026-02-22 01:07:17 +01:00
Michael 259fb60638 feat(ai): performance-first logic with store awareness extrapolation and change count fix 2026-02-22 00:21:53 +01:00
Michael c5cacd9b5a fix(ai): final overhaul to performance-first, supplier-agnostic logic 2026-02-22 00:12:14 +01:00
Michael 0bb73ebcca feat(ai): update batch analysis to use global supplier weight (CA/Margin) 2026-02-21 23:27:54 +01:00
Michael c89e046dee feat(ai): synchronize analysis quality, optimize batch performance and implement context-aware weighting 2026-02-21 23:14:12 +01:00
Michael e8cc89cb2f feat(ai): synchronize batch and individual analysis payloads and models, optimize concurrency 2026-02-21 22:48:16 +01:00
Michael 66f28956ce fix(ai): fix syntax error in batch prompt and update types for score support 2026-02-21 22:41:48 +01:00
Michael 5c8910825b feat(ai): integrate performance score for smarter analysis and parallelize batch processing 2026-02-21 22:41:10 +01:00
Michael fe8d0f1b32 fix(ai): improved seasonality detection in batch by sending detailed month-by-month history 2026-02-21 22:28:41 +01:00
Michael 4f7701fa14 fix(ai): simplified categories to A (Permanent), C (Seasonal), Z (Exit) and removed B 2026-02-21 22:24:58 +01:00
Michael a186bb1989 fix(ai): prevent AI from using placeholder justification string in batch analysis 2026-02-21 22:20:07 +01:00
Michael 1ec8ae3f02 fix(ai): aligned batch system prompt with successful individual analysis prompt 2026-02-21 22:17:21 +01:00
Michael 816ec6e483 feat(ai): smarter batch analysis with revenue, history, nomenclature and strict retail rules 2026-02-21 22:09:28 +01:00
Michael 8ad2894301 fix(ai): batch-analyze uses user-configured model (Gemini 2.5) instead of hardcoded Llama 3.3 2026-02-21 22:05:18 +01:00
Michael 3d26dc0b9b fix(ai): client-side retry on 429, server returns retryAfter, hardcoded llama-3.3 free model 2026-02-21 22:04:08 +01:00
Michael 41c3ab34b6 fix(ai): server-side retry-with-backoff on 429, reads Retry-After header, up to 3 attempts 2026-02-21 21:58:25 +01:00