70 Commits
Author SHA1 Message Date
Michael 371f80c844 Dashboard top10: rank per site instead of global 2026-03-21 11:50:23 +01:00
Michael 9675a243b7 feat: Implement initial API backend with a comprehensive PostgreSQL schema, Express application, and data synchronization for articles and ranking. 2026-03-21 10:01:02 +01:00
MichaelandClaude Opus 4.6 e189cc3045 fix(sync): ranking dedup + copy logs over HTTP
- ranking.js: déduplique par (gencod, site) avant batchUpsert pour éviter
  "ON CONFLICT DO UPDATE command cannot affect row a second time"
- server.js: bouton "Copier les logs" utilise execCommand fallback quand
  navigator.clipboard indisponible (accès HTTP sans HTTPS)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 12:06:27 +01:00
MichaelandClaude Opus 4.6 5ce480ade3 fix: mssql requestTimeout 5min + try/catch par étape sync
- requestTimeout 300000ms pour éviter timeout sur grosses tables (MvtArt)
- Chaque étape sync est wrappée en try/catch pour ne pas bloquer les suivantes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 11:34:36 +01:00
MichaelandClaude Opus 4.6 cf6a7aa0b2 feat: dashboard logs copiables + bouton copier + ranking dans TABLES_ORDER
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 11:16:32 +01:00
MichaelandClaude Opus 4.6 cbfaee2dfb fix: mvtart sync ON CONFLICT DO NOTHING + doc ranking API
- Add ON CONFLICT DO NOTHING to mvtart insert to work with unique index
- Document ranking endpoints in API_DOCUMENTATION.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 11:03:28 +01:00
MichaelandClaude Opus 4.6 792ddc71d2 feat: add ranking table sync and API endpoints
Sync Ranking table from SQL Server to PostgreSQL with ranking_ca,
ranking_qte, ranking_mag_* metrics. Expose via /api/ranking and
integrate into /api/articles/:id/referentiel response.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 10:54:04 +01:00
Michael 8cafc196cf feat: add API routes for sales performance metrics including turnover, hit parade, nomenclature, and product range analysis. 2026-03-19 10:30:56 +01:00
MichaelandClaude Sonnet 4.6 9bc372c959 fix: taux_marge toujours 0 - MntMvtTTC négatif pour les ventes, utiliser ABS(MntMvtHt)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 19:42:58 +01:00
MichaelandClaude Sonnet 4.6 f052529db6 fix: mouvements/types - grouper par GenreMvt uniquement (évite 28MB pour les tickets)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 16:52:45 +01:00
Michael c98f6834a8 feat: Implement article list, detail, and referential endpoints, and document the monthly article analysis endpoint. 2026-03-18 16:46:46 +01:00
Michael 2101606bb4 feat: implement stock management API endpoints and update the API documentation. 2026-03-18 12:03:18 +01:00
Michael 6dbfa2b32d Fix commandes: filter NULL artfou1_no_id, BIT->SMALLINT for recpb/recpbok 2026-03-18 11:05:22 +01:00
Michael 984ed4da5f Fix sync: null bytes, BIT→SMALLINT, DECIMAL complex types, NbJours safe int, error_msg column 2026-03-18 11:03:29 +01:00
Michael 20a1396810 Add dotenv to sync dependencies 2026-03-18 10:57:40 +01:00
Michael e66dff8420 Add sync dashboard (port 3001) with real-time progress tracking 2026-03-18 10:54:15 +01:00
Michael ab7a34253a Expose API port 3000 to host 2026-03-18 10:43:25 +01:00
Michael f1c5928152 Regenerate package-lock.json with pg dependency 2026-03-18 10:41:17 +01:00
Michael 80e8df7deb Add package-lock.json files for reproducible Docker builds 2026-03-18 10:40:35 +01:00
MichaelandClaude Sonnet 4.6 d565ed9f10 Initial commit : API Node.js + PostgreSQL + sync service Docker
- API Express/pg connectée à PostgreSQL (converti depuis mssql)
- 8 routes : articles, fournisseurs, commandes, stock, mouvements, performance, schema, sync
- Service sync nightly (mssql → pg, cron 3h00)
- Docker Compose : postgres + api + sync + frpc (tunnel sortant)
- Schéma PostgreSQL 17 tables dans postgres/init.sql

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 10:10:47 +01:00