Aller au contenu principal

Tableau de bord

Tableau de bord principal pour gérer les Points De Livraison (PDL) et accéder aux données Enedis.

Features​

FeatureStatutMode
Liste des PDL actifs/inactifsFAITServeur+Client
Consentement EnedisFAITServeur
Synchronisation gatewayFAITClient
Drag & drop pour réorganiser les PDLFAITServeur+Client
Recherche PDL par nom ou numéroFAITServeur+Client
Tri personnalisé/date/nom/numéroFAITServeur+Client
Activation/désactivation des PDLFAITServeur+Client
Liaison PDL consommation-productionFAITServeur+Client
Sélection offre tarifaire par PDLFAITServeur+Client
Configuration heures creusesFAITServeur+Client
Mode démo avec données fictivesFAITServeur
Onboarding tour guidéFAITServeur
Raccourcis clavierFAITServeur+Client
Notifications toastFAITServeur+Client

Raccourcis clavier​

ToucheAction
CConsentement Enedis
Shift+?Afficher les raccourcis
Ctrl+K/Cmd+KRechercher un PDL
EscapeFermer les modals

Fichiers​

TypeFichier
Pageapps/web/src/pages/Dashboard.tsx
Composantsapps/web/src/components/PDLCard.tsx
apps/web/src/components/OfferSelector.tsx
apps/web/src/components/PDLDetails.tsx
APIapps/web/src/api/pdl.ts
apps/web/src/api/oauth.ts
Backendapps/api/src/routers/pdl.py
apps/api/src/routers/oauth.py

API Endpoints​

Activation/Désactivation PDL​

PATCH /api/pdl/{pdl_id}/active
Content-Type: application/json

{ "is_active": true }

Liaison PDL Production​

PATCH /api/pdl/{pdl_id}/link-production
Content-Type: application/json

{ "linked_production_pdl_id": "uuid" | null }

Validations :

  • PDL source : has_consumption = true
  • PDL cible : has_production = true
  • Même utilisateur
  • Pas d'auto-liaison

Sélection Offre Tarifaire​

PATCH /api/pdl/{pdl_id}/offer
Content-Type: application/json

{ "selected_offer_id": "uuid" | null }

Réorganisation PDL​

PATCH /api/pdl/reorder
Content-Type: application/json

{ "orders": [{ "id": "uuid", "order": 0 }, ...] }

Interface utilisateur​

Carte PDL (PDLCard)​

Chaque PDL affiche :

  • Nom personnalisé ou numéro PDL
  • Puissance souscrite (kVA)
  • Heures creuses configurées
  • Statut actif/inactif
  • Offre tarifaire sélectionnée

Actions disponibles :

ActionIcôneDescription
DétailsInfoVoir contrat et adresse
SyncRefreshSynchroniser avec Enedis
ActiverEyeActiver/désactiver le PDL
SupprimerTrashSupprimer (avec confirmation)

Sélecteur d'offre tarifaire​

3 sélecteurs en cascade :

  1. Fournisseur : EDF, Enercoop, TotalEnergies...
  2. Type : Base, HC/HP, Tempo, EJP, Weekend, Saisonnier
  3. Offre : Nom spécifique

Types d'offres et prix :

TypePrix affichés
BASEPrix kWh unique
HC_HPHeures Pleines, Heures Creuses
TEMPOBleu HP/HC, Blanc HP/HC, Rouge HP/HC
EJPJours normaux, Jours de pointe
WEEKENDSemaine HP/HC, Week-end HP/HC
SEASONALHiver HP/HC, Été HP/HC, Pointe

Liaison Consommation-Production​

Permet de lier un PDL de production (panneaux solaires) à un PDL de consommation pour :

  • Graphiques combinés consommation/production
  • Calcul d'autoconsommation
  • Bilan énergétique net

Conditions d'affichage du sélecteur :

  • PDL avec has_consumption = true
  • PDL sans production (has_production = false)
  • Au moins un PDL de production existe

Modes d'exécution​

Mode Serveur​

  • Bouton consentement Enedis (logo bleu)
  • Onboarding tour guidé pour nouveaux utilisateurs
  • Mode démo avec données fictives
  • Bouton admin "Ajouter PDL"

Mode Client​

  • Bouton "Synchroniser" pour récupérer les PDL depuis la gateway
  • Sync automatique des offres d'énergie au chargement
  • Refresh périodique des offres (24h)
  • Pas d'onboarding ni de bouton d'aide

Notes techniques​

  • Champ is_active : boolean, défaut true, NOT NULL
  • Champ linked_production_pdl_id : nullable, FK avec ON DELETE SET NULL
  • Drag & drop : mise à jour optimiste avec retour haptique
  • Cache PDL : staleTime 30s, pas de persistence IndexedDB
  • Cache offres : staleTime 5min