chore: build
Backend - Build & Lint / build (push) Successful in 32m38s
Frontend Admin - EAS Build / build (push) Successful in 1h34m28s
Frontend Client - EAS Build / build (push) Successful in 1h30m42s
Frontend Web - Build & Lint / build (push) Canceled after 12m2s

This commit is contained in:
Xor290
2026-09-13 16:11:30 +02:00
parent f2f537a194
commit d7d7496a66
12 changed files with 631 additions and 52 deletions
+14
View File
@@ -140,6 +140,20 @@ func InitDB() *Database {
log.Fatalf("❌ Erreur migration command_items.reward_pool_key: %v", err)
}
// Migration: baskets.promo_discount + command_items.promo_discount —
// montant (en €) économisé par une promotion de prix sur cette ligne,
// capturé une fois pour toutes au moment de AddToBasket (voir
// db_basket.go) puis copié tel quel au checkout, pour permettre des
// statistiques historiques fiables même si la config de promo change
// ensuite (contrairement à un recalcul a posteriori sur les settings
// courants, qui donnerait un résultat faux pour les anciennes commandes).
if _, err = database.Exec(`ALTER TABLE baskets ADD COLUMN IF NOT EXISTS promo_discount NUMERIC(10,2) NOT NULL DEFAULT 0`); err != nil {
log.Fatalf("❌ Erreur migration baskets.promo_discount: %v", err)
}
if _, err = database.Exec(`ALTER TABLE command_items ADD COLUMN IF NOT EXISTS promo_discount NUMERIC(10,2) NOT NULL DEFAULT 0`); err != nil {
log.Fatalf("❌ Erreur migration command_items.promo_discount: %v", err)
}
// Migration: command_items.quantite INTEGER → NUMERIC(10,3) pour supporter les quantités fractionnaires
if _, err = database.Exec(`
DO $$