Application : Suivi FTI EMGI
Projet : Suivi facturation / échéancier / paiement (EMGI)
Date : 2026-02-09
Public : Client (ampleur du travail), équipes techniques (chiffrage, lots, complexité)
Ce document fusionne et remplace :
schema-chiffrage-projet.mdgrille-complexite-chiffrage.mdObjectif : cadrer le périmètre et fournir un référentiel unique pour structurer le backlog et chiffrer.
Objectif : découper le projet en lots livrables et chiffrables.
Livrable : backlog structuré par module + dépendances.
| Module | Fonctionnalités | Règles métier principales | Dépendances | Priorité |
|---|---|---|---|---|
| Config / Fondations | Base de données, config (.env, PDO), mode mock vs DB |
Mock et DB doivent rester cohérents (mêmes règles métier) | — | P0 |
| Clients | Liste, détail client (en-tête + encours), ajout, suppression | Encours = somme factures − somme paiements (via Calculs) | Calculs | P0 |
| Factures | Liste par client, ajout, modification, suppression | Facturation source Pennylane (ici : suivi) ; pas de contrainte d’unicité n_facture en MVP |
Clients | P0 |
| Paiements | Liste par client, enregistrement, suppression | montant > 0 ; recalcul encours après ajout/suppression | Factures, Calculs | P0 |
| Écheanciers | Liste, création, suppression ; affichage par client/facture | 1 écheancier max par facture ; échéances dérivées (ex. mensuelles) | Factures | P0 |
| Calculs financiers | Encours par client, encours total, échéances à venir | Encours client = Σ montant_ht − Σ paiements ; état facture dérivé (payée / en attente) | Factures, Paiements | P0 |
| Reporting | Tableau de bord, export encours CSV, export factures CSV, Top clients, Quantités par client | Agrégations par client/type/cycle ; exports compatibles Excel (UTF‑8, séparateur ;) |
Calculs, Factures | P0 |
| Accès (optionnel selon hébergement) | Login Livinweb ModX (identifiant/mot de passe), SSO en option | Accès restreint ; pas de RBAC multi-profils en MVP (option post‑MVP) | Config | P1 |
Objectif : éviter l’oubli fréquent du chiffrage (droits, écrans, actions par profil).
Livrable : matrice rôles × ressources/actions.
Contexte projet (aligné) :
| Ressource / Action | Commercial / Admin | Lecteur (Tréso / Direction) |
|---|---|---|
| Clients | CRUD | R |
| Factures | CRUD | R |
| Paiements | CRD | R |
| Écheanciers | CRD | R |
| Calculs / Encours | R | R |
| Reporting / Export | R + Export | R + Export |
Notes :
Références : app/ROLES-PERMISSIONS-RBAC.md, app/ACTEURS-UTILISATEURS.md.
Objectif : chiffrer le back (tables, règles, index).
Livrable : schéma relationnel + description des champs.
Entités (simplifié) :
Règles métier données (résumé) :
Document détaillé : schema-relationnel-et-tables-donnees.md.
Schéma SQL : app/sql/schema.sql (+ app/sql/migration-*.sql).
Objectif : chiffrer validations, statuts, automatisations (léger sur ce projet).
Livrable : diagramme d’états + règles.
Résumé (aligné) :
Document détaillé : schema-workflows.md.
Objectif : lister les APIs et points techniques complexes pour un chiffrage réaliste.
Livrable : liste des endpoints + points complexes.
| Méthode | Endpoint | Utilité |
|---|---|---|
| GET | /api/clients.php?id= |
Détail d’un client (page client) |
| GET | /api/clients.php |
Liste des clients |
| POST | /api/clients.php |
Création d’un client |
| DELETE | /api/clients.php?id= |
Suppression d’un client (cascade) |
| GET | /api/factures.php?client_id= |
Liste des factures d’un client (avec encours/état) |
| POST | /api/factures.php |
Ajout d’une facture |
| PUT | /api/factures.php |
Modification d’une facture |
| DELETE | /api/factures.php?id= |
Suppression d’une facture (cascade) |
| GET | /api/paiements.php?client_id= |
Liste des paiements d’un client |
| POST | /api/paiements.php |
Enregistrement d’un paiement |
| DELETE | /api/paiements.php?id= |
Suppression d’un paiement |
| GET | /api/echeanciers.php?client_id= ou ?facture_id= |
Liste des écheanciers (client ou facture) |
| POST | /api/echeanciers.php |
Création d’un écheancier |
| DELETE | /api/echeanciers.php?id= |
Suppression d’un écheancier |
| GET | /api/calculs.php?client_id= |
Encours d’un client |
| GET | /api/calculs.php |
Encours global + échéances à venir (dashboard) |
| GET | /api/reporting.php?format=csv |
Export encours CSV |
| GET | /api/reporting.php?format=factures_csv |
Export factures CSV |
| GET | /api/top-clients.php?type=&cycle= |
Top clients (type/cycle) |
| GET | /api/quantites-clients.php?type= |
Quantités facturées/livrées par client |
| Point | Description | Complexité |
|---|---|---|
| Encours + état facture | Encours = montant_ht − Σ paiements ; état dérivé ; cohérence après chaque mutation paiement | Moyenne |
| Échéances à venir | Dériver dates/montants à partir de l’écheancier ; filtrer date ≥ aujourd’hui ; tri | Faible → Moyenne |
| Export CSV (Excel) | UTF‑8 (BOM si nécessaire), séparateur ;, échappement, formats dates/nombres |
Faible |
| Agrégations Top clients | Agrégations type_produit/cycle ; totaux et pourcentages | Moyenne |
| Mode mock vs DB | Même comportement métier entre JSON et PDO ; éviter divergence | À ne pas surchiffrer (discipline) |
Objectif : visualiser les blocs du système pour répartir le travail.
Livrable : diagramme composants.
Résumé :
clients, factures, paiements, echeanciers, calculs, reporting, top-clients, quantites-clients)Document étendu : architecture-generale-fonctionnelle-et-interfaces.md et architecture.md.
Usage : barème d’estimation (ordre de grandeur) pour les lots/modules ci‑dessus.
| Type d’écran | Complexité | Estimation (ordre de grandeur) | Détail |
|---|---|---|---|
| CRUD simple | Faible | 1–2 j | Liste + formulaire, sans calculs complexes |
| Avec agrégations/calculs | Moyenne | 2–3 j | Plusieurs sources + calculs (fiche client, dashboard) |
| Reporting avancé | Élevée | 3–4 j | Filtres, agrégations, export (Top clients) |
| Auth (si applicable) | Faible | 0,5–1 j | Page login + session (si intégration existante) |
| Type d’API | Complexité | Estimation (ordre de grandeur) | Détail |
|---|---|---|---|
| CRUD simple (GET/POST) | Faible | ~0,5 j | Une table, validation simple |
| Calculs / agrégations | Moyenne | 1–2 j | Logique métier, agrégations |
| Règles métier avancées | Élevée | 2–3 j | Contraintes multiples, transactions |
| Export CSV/JSON | Faible | 0,5–1 j | Génération fichier, encodage, téléchargement |
| Type | Estimation (ordre de grandeur) | Détail |
|---|---|---|
| Tests manuels par écran | 0,25–0,5 j | Cas nominaux + limites |
| Tests API par endpoint | ~0,25 j | Postman/curl + erreurs |
| Recette complète (cahier) | 2–3 j | Exécution critères + corrections mineures |
Cette estimation est un point de départ (à ajuster selon les décisions finales et le niveau d’exigence). Elle n’inclut pas les options hors périmètre listées en section 8.
| Module | Écrans | API | Tests | Total indicatif |
|---|---|---|---|---|
| Config / Fondations | — | 1 j | 0,25 j | 1,25 j |
| Accès (login ModX / restriction) (optionnel) | 1 j | 0,5 j | 0,25 j | 1,75 j |
| Clients | 1,5 j | 0,5 j | 0,5 j | 2,5 j |
| Factures | 2 j | 1,5 j | 0,5 j | 4 j |
| Paiements | 1,5 j | 1 j | 0,5 j | 3 j |
| Écheanciers | 1,5 j | 1,5 j | 0,5 j | 3,5 j |
| Calculs financiers | — | 2 j | 0,5 j | 2,5 j |
| Reporting / Dashboard + exports CSV | 2,5 j | 1,5 j | 0,5 j | 4,5 j |
| Top clients | 2 j | 1 j | 0,5 j | 3,5 j |
| Quantités clients | 1,5 j | 1 j | 0,5 j | 3 j |
| Intégration / Recette | — | — | 2 j | 2 j |
| Documentation technique | — | — | 0,5 j | 0,5 j |
Notes :
Cette section est la consolidation des décisions de périmètre pour éviter de chiffrer du hors‑scope.
n_facture non prévue| Domaine | Fonctionnalité | Fichiers / API concernés |
|---|---|---|
| Clients | Liste, détail, ajout, suppression | app/api/clients.php, app/index.html, app/client.html, app/js/client-detail.js |
| Factures | Liste par client, ajout, modification, suppression | app/api/factures.php, app/client.html, app/js/facture-form.js, app/js/client-detail.js |
| Paiements | Liste par client, enregistrement, suppression | app/api/paiements.php, app/client.html, app/js/paiements.js |
| Écheanciers | Liste, création, suppression ; répartition encours | app/api/echeanciers.php, app/client.html, app/js/echeancier-form.js, app/js/client-detail.js |
| Calculs | Encours par client, encours total, échéances à venir | app/api/calculs.php, app/dashboard.html, app/js/dashboard.js |
| Reporting | Tableau de bord, export encours CSV, export factures CSV | app/api/reporting.php, app/dashboard.html |
| Meilleurs clients | Top clients par type (alevins/larves), cycle | app/api/top-clients.php, app/top-clients.html, app/js/top-clients.js |
| Quantités | Quantités facturées / livrées par client, filtre type | app/api/quantites-clients.php, app/quantites-clients.html, app/js/quantites-clients.js |
| Accès | Login Livinweb ModX (identifiant / mot de passe), SSO en option | Côté hébergement / MODX |
| Rôles | Un seul rôle : Commercial / Admin (tous droits) ; Lecteur en option | app/ROLES-PERMISSIONS-RBAC.md, app/ACTEURS-UTILISATEURS.md |