Commit Graph
123 Commits
Author SHA1 Message Date
MichaelandClaude Opus 4.8 1281b0e21f fix(qlik): send Origin/User-Agent on engine ws + verbose 403 diagnostics
Qlik proxy validates the WebSocket Origin header (whitelist) — a browser
always sends it. Add Origin + User-Agent to the engine ws. Also surface the
403 response (server/www-authenticate/body) for diagnosis.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-20 23:35:09 +02:00
MichaelandClaude Opus 4.8 abed369bfb feat(settings): configure Qlik credentials in the UI
Add a "Qlik Sense — Données réseau" section in Paramètres (host/user/password
+ Save & Test buttons), stored in data/.db-config.json. qlik-client reads this
file first (env fallback), so no env vars needed for the sync.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-20 23:28:55 +02:00
MichaelandClaude Opus 4.8 aee968d30f feat(grid): replace ranking/AI/score with Qlik network data
Remove ranking, AI analysis (routes + ai-copilot module), and score-engine
from the grid. Add Qlik Sense network metrics (CA, Qte, nb magasins per
product) joined by code centrale (articles.artcentrale).

- qlik-client.ts: NTLM + ticket SSO auth, QIX hypercube extraction (master items)
- qlik-network-cache.ts + qlik_network_metrics table (db-init): cache layer
- POST /api/qlik/sync?fournisseur=: per-supplier sync into cache
- SyncQlikButton: per-supplier sync, grid reload, last-update date display
- get-product-rows Phase 8: enrich rows with cached network metrics
- heatmap-grid: CA reseau / Qte reseau / Magasins (/270) / % presence columns
- discovery: app 9872ee6e, master items CA N / Quantite N / Magasin Ventes Nb N
- deps: httpntlm, ws

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-20 22:52:39 +02:00
Claude ae0d8d3a4c feat(commandes-auto): cadencier d'alertes de commande par fournisseur et magasin
Ajoute un onglet "Cadencier / Alertes" dans la page Commandes auto.
Depuis la liste des fournisseurs, on active un fournisseur en alerte de
commande sur un magasin (292/579) avec une fréquence en X semaines,
gérée indépendamment par magasin.

L'échéance est calculée à partir de la dernière réception réelle
(mvtart, genremvt 1/2, fournisseur principal artfou1.preference=1) +
X semaines. Statut: à commander / bientôt / OK, avec temps restant.

- Table commande_cadences (schema + db-init)
- pgGetDerniereReceptionParFournisseur (mvtart par fournisseur/site)
- Server actions CRUD (list/upsert/toggle/remove)
- UI à onglets + cadencier (ajout, édition intervalle, activer/supprimer)
2026-06-03 08:19:50 +00:00
Michael 422d4108ae feat: implement admin AI chat interface with markdown support and token cost tracking 2026-04-29 11:44:17 +02:00
Michael 26ba285c0e feat: implement bulk PostgreSQL client for FF Nancy data retrieval and configure local environment permissions 2026-04-24 12:09:17 +02:00
Michael 0ad403651d feat: implement pg-ff-client for direct SQL bulk data retrieval and add .claude permission settings 2026-04-24 11:57:26 +02:00
Michael a1579de6d7 feat: implement direct PostgreSQL bulk queries for FF Nancy data fetching to replace per-article HTTP requests 2026-04-24 11:25:42 +02:00
Michael f448f4f624 feat: implement PostgreSQL FF Nancy client to replace per-article HTTP API calls with bulk SQL queries 2026-04-24 11:10:19 +02:00
Michael df1d059952 feat: implement API clients for Nancy FF data sync and add local configuration settings 2026-04-24 10:43:32 +02:00
Michael a06d7cd7e8 feat: create API client for FF Nancy REST API to synchronize supplier, article, and movement data 2026-04-24 10:22:05 +02:00
Michael 5a3ac3ed7f feat: implement high-performance PostgreSQL bulk fetchers to replace per-article HTTP API calls 2026-04-23 11:26:15 +02:00
Michael 038e87f554 feat: introduce PostgreSQL client module to replace per-article HTTP requests with bulk SQL queries 2026-04-23 11:11:23 +02:00
Michael c7d5bbe3b1 feat: implement PostgreSQL client for bulk data retrieval to replace HTTP per-article requests 2026-04-23 10:56:45 +02:00
Michael b337d1ff10 feat: add pg-ff-client to replace HTTP API calls with direct PostgreSQL bulk queries 2026-04-23 10:51:43 +02:00
Michael 79bc66f4d5 Please provide the list of changes or file diffs so I can generate the commit message for you. 2026-04-23 10:48:09 +02:00
Michael db90ed6e41 feat: implement PostgreSQL FF Nancy client to replace per-article HTTP API calls with bulk SQL queries 2026-04-23 10:43:30 +02:00
Michael 94018fa885 feat: implement bulk PostgreSQL data fetching client to replace per-article HTTP requests 2026-04-23 10:38:47 +02:00
Michael bd8339b27d feat: add pg-ff-client to replace HTTP API calls with bulk PostgreSQL queries 2026-04-23 10:36:37 +02:00
Michael 32c1e06782 feat: implement PostgreSQL-based bulk fetching for article and sales data to replace HTTP API calls 2026-04-23 10:32:29 +02:00
MichaelandClaude Opus 4.7 64da878abb fix: remove deprecated eslint config and make dashboard DB enrichment optional
- Remove unsupported `eslint` key from next.config.ts (Next.js 16)
- Wrap dashboard DB enrichment in try/catch so the dashboard renders
  even when PostgreSQL is unavailable, preventing the
  "Impossible de charger le tableau de bord" error

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-23 10:25:45 +02:00
MichaelandClaude Opus 4.7 42e39a1c2b feat: add stock and supplier info to dashboard top 10 cards
Enrich DashboardTopItem with stock and fournisseur fields via PostgreSQL,
then display them under each article in the dashboard top CA/Qte/Marge tables.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-23 10:10:52 +02:00
MichaelandClaude Sonnet 4.6 9a9b881d19 feat: add derniere_entree column and filter recent stock entries on 6-month tab
- Exclude products with a stock entry in the last 6 months (NOT EXISTS subquery)
- Add derniere_entree subquery to SQL (last genremvt 1/2 movement date)
- Display derniere_entree column in table and Excel export

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 13:25:17 +02:00
MichaelandClaude Sonnet 4.6 71241fe0e6 feat: add "Sans vente 6 mois" tab to Gestion de Stock page
New SQL query pgGetSansVente6Mois returns products with available
stock (qte > 0) whose last sale was over 6 months ago or never.
Third tab added with filtering by supplier, search, sort, and Excel export.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 13:17:56 +02:00
Michael 462eef182e feat: enhance FrancoCell logic and add mapping function for PgCommandeAutoRow 2026-04-13 15:31:25 +02:00
Michael 910b0c96ef feat: add PostgreSQL client for bulk data retrieval and configure Claude permissions 2026-04-08 16:41:28 +02:00
Michael 638c4b5f3b feat: implement direct PostgreSQL data access and API proxy for automated orders 2026-04-08 16:37:42 +02:00
Michael 70c425befb feat: implement sidebar navigation and automated order management module with PostgreSQL client integration 2026-04-08 15:53:59 +02:00
Michael d25ffdb3e7 feat: implement pg-ff-client to replace per-article HTTP calls with bulk PostgreSQL queries 2026-04-08 12:14:18 +02:00
Michael 5a13640884 feat: implement pg-ff-client to replace per-article HTTP calls with bulk PostgreSQL queries 2026-04-07 17:36:27 +02:00
Michael ac1c9a5522 feat: implement collapsible sidebar, PostgreSQL client for bulk data fetching, and stock-negatif page 2026-04-07 16:51:52 +02:00
Michael d96995fce9 feat: implement PostgreSQL bulk data client to replace per-article HTTP requests 2026-04-07 16:15:19 +02:00
Michael a378bff7e2 feat: implement pg-ff-client to replace HTTP per-article requests with bulk SQL queries 2026-04-07 15:37:01 +02:00
Michael 7bf42dfc01 feat: implement direct PostgreSQL bulk querying for FF Nancy data to replace per-article HTTP requests 2026-04-07 15:33:01 +02:00
Michael 9469738ef0 feat: implement hit-parade dashboard with interactive filtering, sorting, and data visualization components 2026-04-07 08:49:38 +02:00
Michael 2c02807493 feat: implement Hit Parade dashboard with PostgreSQL-backed data aggregation and pivot logic 2026-04-07 08:38:25 +02:00
MichaelandClaude Sonnet 4.6 de46e056d2 fix: robustify suspended product filter using ::text cast
The previous ::boolean cast caused query failure when suspendu column
is not a native boolean type. Casting to ::text first handles all
column types (char, varchar, int, boolean).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 12:07:07 +02:00
MichaelandClaude Sonnet 4.6 a60e21eb04 fix: exclude suspended products from supplier grid
Add WHERE NOT COALESCE(af.suspendu::boolean, false) AND NOT COALESCE(a.suspendu::boolean, false)
to pgGetArticlesByFournisseur — products flagged as suspended in artfou1
or articles table are no longer shown in the grid.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 12:04:08 +02:00
MichaelandClaude Sonnet 4.6 6b26676836 feat: flag products whose last registered supplier differs from current view
Instead of unreliable preference=1, use artfou1.no_id DESC (most recently
added artfou1 entry) to identify the last supplier for each product.
Shows an amber warning icon in the Désignation column when the last
supplier ≠ current supplier view, with tooltip showing who to attribute
the sales to.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 11:55:42 +02:00
Michael bd21f07c8e feat: implement bulk PostgreSQL client to replace per-article HTTP API calls 2026-04-03 11:21:38 +02:00
Michael e90a567446 feat: implement bulk PostgreSQL data fetching client to replace per-article HTTP requests 2026-04-03 11:17:04 +02:00
Michael ebd819bfa4 feat: implement PostgreSQL bulk data access client to replace per-article HTTP requests 2026-04-03 10:58:43 +02:00
Michael e9e1fdd246 feat: implement PostgreSQL client for bulk data retrieval to replace per-article HTTP requests 2026-04-03 07:40:05 +02:00
Michael 5a506c750c feat: add pg-ff-client to replace per-article HTTP requests with bulk SQL queries 2026-04-03 07:19:45 +02:00
Michael 659019e722 feat: implement PostgreSQL-based bulk data retrieval client for FF Nancy to replace HTTP API calls 2026-04-03 07:14:56 +02:00
MichaelandClaude Sonnet 4.6 868886db87 feat: hit-parade date range + fournisseur filter; fix create user button layout
- Replace month dropdown with date picker (Du/Au) + Appliquer button
- Add fournisseur filter dropdown (client-side, all suppliers from current data)
- Totals update live when fournisseur filter changes
- SQL: use BETWEEN date range instead of TO_CHAR month match
- Create user button: proper 3-col form layout so button stays on one line

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 13:42:25 +02:00
MichaelandClaude Sonnet 4.6 7923861947 feat: add Hit Parade page — monthly product sales by store with sort by CA/qty
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 11:22:08 +02:00
MichaelandClaude Sonnet 4.6 c5fbc85c6c fix: artfou1.preference is integer, use = 1 not = true
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 09:12:11 +02:00
MichaelandClaude Sonnet 4.6 79aadf62eb fix: use artfou1.preference=true and ABS(SUM(mntmvtttc)) for correct CA TTC in analytics
Replace last_reception CTE with direct LEFT JOIN artfou1 WHERE preference=true (fournisseur
principal de l'article). Use ABS(SUM(mntmvtttc)) instead of SUM(-mntmvtttc). Both fournisseur
and nomenclature queries now use LEFT JOIN to include all sold articles.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 09:07:43 +02:00
MichaelandClaude Sonnet 4.6 65b55b1343 fix: use fouident.nom instead of fouadr1.raisonsociale for supplier names
fouident is the canonical supplier identity table with correct names:
- D005 = 'DEPOT' (not 'BAZAR 5000' which was a historical fouadr1 alias)
- B0071 = 'BAZAR 5000' (suspended, actif=false)
- M0341 = 'MOREL' (not 'MOREL LORY')

Updated: pgGetFournisseurs, pgGetArticlesByFournisseur, pgGetCaByFournisseur
Removed the D005 CASE WHEN hardcode override (no longer needed).
Also remove fouadr1 JOIN from analytics query (replaced by fouident).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-31 17:40:40 +02:00