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>
This commit is contained in:
1 parent
8cafc196cf
commit
792ddc71d2
6 files changed
+174
No files matched your search
@@ -214,6 +214,35 @@ CREATE TABLE IF NOT EXISTS mvtreg (
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS idx_mvtreg_datmvt ON mvtreg (datmvt);
|
||||
|
||||
-- ============================================================
|
||||
-- Ranking réseau / magasin
|
||||
-- ============================================================
|
||||
|
||||
CREATE TABLE IF NOT EXISTS ranking (
|
||||
gencod TEXT,
|
||||
site TEXT,
|
||||
libelle TEXT,
|
||||
foucentrale TEXT,
|
||||
nomfoucentrale TEXT,
|
||||
ranking_ca NUMERIC(10,2),
|
||||
ranking_qte NUMERIC(10,2),
|
||||
ranking_mag_ca NUMERIC(10,2),
|
||||
ranking_mag_qte NUMERIC(10,2),
|
||||
ranking_mag_marge NUMERIC(10,2),
|
||||
pv_calcule NUMERIC(12,4),
|
||||
pv_mag NUMERIC(12,4),
|
||||
pv_cen NUMERIC(12,4),
|
||||
codefamille TEXT,
|
||||
libellefamille TEXT,
|
||||
fichier TEXT,
|
||||
date_maj TIMESTAMP,
|
||||
date_integration TIMESTAMP,
|
||||
date_calcul_mag TIMESTAMP,
|
||||
PRIMARY KEY (gencod, site)
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS idx_ranking_gencod ON ranking (gencod);
|
||||
CREATE INDEX IF NOT EXISTS idx_ranking_site ON ranking (site);
|
||||
|
||||
-- ============================================================
|
||||
-- Commandes fournisseurs
|
||||
-- ============================================================
|
||||
|
||||
Reference in new issue
Block a user