ソースを参照

PDF planning-artifacts + maquettes app

augustin.podvin 9 ヶ月 前
親
コミット
dfc4087e2c
62 ファイル変更、5832 行追加、736 行削除
  1. 11 13
      .gitignore
  2. 276 0
      _bmad-output/planning-artifacts/architecture.md
  3. 274 0
      _bmad-output/planning-artifacts/cahier-recettes-livraison.md
  4. 246 0
      _bmad-output/planning-artifacts/chiffrage-schema-et-grille.md
  5. 43 0
      _bmad-output/planning-artifacts/decisions-client-chiffrage.md
  6. 345 0
      _bmad-output/planning-artifacts/général et regles-metier-a-clarifier.md
  7. 129 0
      _bmad-output/planning-artifacts/implementation-readiness-report-2026-02-09.md
  8. 399 0
      _bmad-output/planning-artifacts/listing-complet-ecrans-pages.md
  9. 288 0
      _bmad-output/planning-artifacts/logique-paiements-echeanciers.md
  10. 33 0
      _bmad-output/planning-artifacts/pdfGenerator/README-PDF.md
  11. 38 0
      _bmad-output/planning-artifacts/pdfGenerator/build-all.bat
  12. 131 0
      _bmad-output/planning-artifacts/pdfGenerator/generate-pdfs.js
  13. 19 0
      _bmad-output/planning-artifacts/pdfGenerator/merge-order.json
  14. 71 0
      _bmad-output/planning-artifacts/pdfGenerator/merge-pdfs.js
  15. 2542 0
      _bmad-output/planning-artifacts/pdfGenerator/package-lock.json
  16. 16 0
      _bmad-output/planning-artifacts/pdfGenerator/package.json
  17. 149 0
      _bmad-output/planning-artifacts/pdfGenerator/pdf-style.css
  18. BIN
      _bmad-output/planning-artifacts/pdfGenerator/pdf/architecture.pdf
  19. BIN
      _bmad-output/planning-artifacts/pdfGenerator/pdf/cahier-recettes-livraison.pdf
  20. BIN
      _bmad-output/planning-artifacts/pdfGenerator/pdf/chiffrage-schema-et-grille.pdf
  21. BIN
      _bmad-output/planning-artifacts/pdfGenerator/pdf/decisions-client-chiffrage.pdf
  22. BIN
      _bmad-output/planning-artifacts/pdfGenerator/pdf/général et regles-metier-a-clarifier.pdf
  23. BIN
      _bmad-output/planning-artifacts/pdfGenerator/pdf/implementation-readiness-report-2026-02-09.pdf
  24. BIN
      _bmad-output/planning-artifacts/pdfGenerator/pdf/listing-complet-ecrans-pages.pdf
  25. BIN
      _bmad-output/planning-artifacts/pdfGenerator/pdf/logique-paiements-echeanciers.pdf
  26. BIN
      _bmad-output/planning-artifacts/pdfGenerator/pdf/prd.pdf
  27. BIN
      _bmad-output/planning-artifacts/pdfGenerator/pdf/product-brief-bmad-2026-02-09.pdf
  28. BIN
      _bmad-output/planning-artifacts/pdfGenerator/pdf/questions-en-suspens.pdf
  29. BIN
      _bmad-output/planning-artifacts/pdfGenerator/pdf/schema-relationnel-et-tables-donnees.pdf
  30. BIN
      _bmad-output/planning-artifacts/pdfGenerator/pdf/schema-workflows.pdf
  31. BIN
      _bmad-output/planning-artifacts/pdfGenerator/pdf/synthèse-projet-lecture-client.pdf
  32. BIN
      _bmad-output/planning-artifacts/planning-artifacts-complet.pdf
  33. 202 0
      _bmad-output/planning-artifacts/prd.md
  34. 115 0
      _bmad-output/planning-artifacts/product-brief-bmad-2026-02-09.md
  35. 25 0
      _bmad-output/planning-artifacts/questions-en-suspens.md
  36. 169 0
      _bmad-output/planning-artifacts/schema-relationnel-et-tables-donnees.md
  37. 137 0
      _bmad-output/planning-artifacts/schema-workflows.md
  38. 89 0
      _bmad-output/planning-artifacts/synthèse-projet-lecture-client.md
  39. 0 6
      app/.env.example
  40. 0 4
      app/.gitignore
  41. 0 133
      app/INSTALL.md
  42. 0 120
      app/ONBOARDING-STAGIAIRE.md
  43. 0 60
      app/README.md
  44. 1 1
      app/api/clients.php
  45. 2 2
      app/api/config.php
  46. 6 6
      app/api/reporting.php
  47. 1 1
      app/api/top-clients.php
  48. 0 102
      app/client.html
  49. 0 43
      app/dashboard.html
  50. 0 128
      app/index.html
  51. 3 3
      app/js/client-detail.js
  52. 2 2
      app/js/dashboard.js
  53. 1 1
      app/js/quantites-clients.js
  54. 2 2
      app/js/top-clients.js
  55. 4 4
      app/js/utils.js
  56. 9 4
      app/mock/clients.json
  57. 8 0
      app/mock/echeanciers.json
  58. 31 5
      app/mock/factures.json
  59. 14 0
      app/mock/paiements.json
  60. 0 43
      app/quantites-clients.html
  61. 1 1
      app/sql/schema.sql
  62. 0 52
      app/top-clients.html

+ 11 - 13
.gitignore

@@ -1,22 +1,20 @@
-# ===== BMAD : tout ignorer =====
-_bmad/
-_bmad-output/
+# ===== Ne versionner que app/ et _bmad-output/ (PDF + maquettes) =====
+# Ignorer tout à la racine sauf app et _bmad-output
+/*
+!/.gitignore
+!/app
+!/app/**
+!/_bmad-output
+!/_bmad-output/**
 
-# ===== PDF : outil et sortie dans pdfGenerator =====
-# (pdfGenerator/ et pdfGenerator/pdf/ sont versionnés ; node_modules non)
-pdfGenerator/node_modules/
-
-# ===== Fichiers / dossiers à ne pas versionner =====
-.cursor/
+# ===== Exceptions dans les dossiers versionnés =====
 node_modules/
+.env
+.cursor/
 *.log
 .DS_Store
-.env
 vendor/
 ~$*
 *.tmp
 *.docx
 Thumbs.db
-
-# ===== Optionnel : décommenter pour ignorer aussi l'app (si vous ne versionnez que PDF + maquettes) =====
-# app/

+ 276 - 0
_bmad-output/planning-artifacts/architecture.md

@@ -0,0 +1,276 @@
+---
+stepsCompleted: [1, 2, 3, 4, 5, 6, 7, 8]
+inputDocuments: ['prd.md', 'product-brief-bmad-2026-02-09.md']
+workflowType: 'architecture'
+project_name: 'dircops'
+user_name: 'Livinweb'
+date: '2026-02-09'
+lastStep: 8
+status: 'complete'
+completedAt: '2026-02-09'
+---
+
+# Architecture — dirCops
+
+**Application :** dirCops — suivi facturation / échéancier / paiement  
+**Mode :** POC puis migration vers MODX en production
+
+---
+
+## 1. Contexte et périmètre
+
+**Exigences fonctionnelles :** 13 FR en 6 catégories (Client Management, Invoice Tracking, Payment Management, Financial Calculations, Reporting & Analytics, Data Management). Application web MPA, calculs automatiques (encours, échéances), export CSV.
+
+**Exigences non fonctionnelles :** Sécurité (accès restreint), Performance (< 3s chargement, < 1s interactions).
+
+**Contraintes :** Facturation gérée dans Pennylane ; l’appli assure uniquement le suivi (saisie manuelle des factures). Budget restreint → architecture minimale. Stack : PHP (API REST) + JavaScript + Tailwind + HTML + MariaDB/MySQL. Application interne uniquement.
+
+**Périmètre utilisateurs :** Un seul type traité : **commercial / admin** (accès complet). Les autres rôles (lecteur, stagiaire, etc.) sont en option.
+
+---
+
+## 2. Vue d’ensemble et architecture fonctionnelle
+
+### 2.1 Schéma de contexte
+
+```
+                    ┌─────────────────────────────────────────────────────────────────┐
+                    │                        EXTERNE                                    │
+                    │  • Pennylane (facturation document) — pas d'échange technique   │
+                    │  • Hébergeur / réseau (accès, firewall, SSL)                      │
+                    │  • Navigateur (Chrome, Firefox, Edge)                            │
+                    └─────────────────────────────────────────────────────────────────┘
+                                              │
+                    Entrées :                 │                  Sorties :
+                    • Saisies utilisateur     │                  • Pages HTML (écrans)
+                    • Clics, navigation       │                  • Export CSV (téléchargement)
+                    • Paramètres de requête   │                  • Réponses JSON (données)
+                                              ▼
+                    ┌─────────────────────────────────────────────────────────────────┐
+                    │              APPLICATION (dirCops)                         │
+                    │  Frontend (HTML / JS / Tailwind)  +  API REST (PHP)               │
+                    │  + Base de données (MariaDB/MySQL)                                │
+                    └─────────────────────────────────────────────────────────────────┘
+                                              │
+                    Sorties techniques :     │  Entrées techniques :
+                    • Fichiers CSV générés   │  • Connexion DB (PDO)
+                    • Réponses HTTP/JSON     │  • Variables .env (config)
+                    • Pages servies (HTML)   │
+```
+
+### 2.2 Acteurs
+
+| Acteur | Rôle | Entrées fournies | Sorties reçues |
+|--------|------|-----------------|----------------|
+| **Commercial (équipe EMGI)** | Utilisateur principal | Recherche client, saisie facture/paiement/écheancier, filtres (type, cycle), demande d’export | Liste clients, fiche client, tableau de bord, Top clients, Quantités, fichier CSV |
+| **Trésorerie / Direction** (si accès) | Consultation | Consultation écrans, export | Mêmes sorties en lecture |
+| **Système (automatique)** | — | — | Calculs encours, état facture (payé/en attente), échéances |
+
+### 2.3 Vue par couches
+
+```
+┌─────────────────────────────────────────────────────────────────────────────┐
+│  COUCHE PRÉSENTATION (Frontend)                                              │
+│  index.html, client.html, dashboard.html, top-clients.html, quantites-clients.html
+└─────────────────────────────────────────────────────────────────────────────┘
+                    │  HTTP (GET/POST) – JSON
+                    ▼
+┌─────────────────────────────────────────────────────────────────────────────┐
+│  COUCHE API (Backend PHP)                                                    │
+│  clients.php, factures.php, paiements.php, echeanciers.php, calculs.php,     │
+│  reporting.php, top-clients.php, quantites-clients.php, config.php           │
+└─────────────────────────────────────────────────────────────────────────────┘
+                    │  PDO
+                    ▼
+┌─────────────────────────────────────────────────────────────────────────────┐
+│  COUCHE DONNÉES                                                              │
+│  MariaDB/MySQL (tables clients, factures, paiements, echeanciers)            │
+└─────────────────────────────────────────────────────────────────────────────┘
+```
+
+### 2.4 Modules fonctionnels
+
+| Module | Responsabilité | Fichiers principaux |
+|--------|----------------|---------------------|
+| **Config** | Connexion DB, .env, helpers (sendJson, sendError) | `api/config.php`, `.env` |
+| **Clients** | Liste, recherche, détail, création, suppression | `api/clients.php`, `index.html`, `client.html`, `js/client-detail.js` |
+| **Factures** | Liste par client, ajout/modification/suppression (suivi) | `api/factures.php`, `client.html`, `js/facture-form.js` |
+| **Paiements** | Liste, enregistrement, suppression | `api/paiements.php`, `client.html`, `js/paiements.js` |
+| **Écheanciers** | Liste, création, suppression | `api/echeanciers.php`, `client.html`, `js/echeancier-form.js` |
+| **Calculs** | Encours, échéances à venir | `api/calculs.php`, `api/reporting.php`, `dashboard.html`, `js/dashboard.js` |
+| **Reporting** | Tableau de bord, export CSV (encours, factures PJ) | `api/reporting.php`, `dashboard.html` |
+| **Top clients** | Agrégation type/cycle, quantités, CA | `api/top-clients.php`, `top-clients.html`, `js/top-clients.js` |
+| **Quantités par client** | Synthèse quantités facturées/livrées | `api/quantites-clients.php`, `quantites-clients.html`, `js/quantites-clients.js` |
+
+**Dépendances :** Clients indépendant ; Factures → Clients ; Paiements → Factures ; Écheanciers → Factures ; Calculs → Clients, Factures, Paiements ; Reporting → Calculs ; Top clients, Quantités → Factures, Clients.
+
+---
+
+## 3. Décisions techniques
+
+### 3.1 Stack POC
+
+- **Backend :** PHP (API REST)
+- **Frontend :** JavaScript vanilla + Tailwind CSS + HTML (MPA)
+- **Base de données :** MariaDB/MySQL
+- **Authentification :** Sessions PHP simples ou auth basique ; pas de JWT/OAuth
+
+### 3.2 Base de données
+
+**Tables :** `clients`, `factures`, `paiements`, `echeanciers`  
+**Relations :** factures → client, paiements → facture, echeanciers → facture  
+**Champs factures :** n_facture, n_vente, date_facture, type_produit (alevins/larves), cycle, quantites, qte_livree, montant_ht  
+**Champs écheanciers :** facture_id, nb_echeances, date_debut_echeancier  
+**État payé/en attente :** dérivé des paiements
+
+### 3.3 API REST
+
+**Endpoints :** `/api/clients`, `/api/factures`, `/api/paiements`, `/api/echeanciers`, `/api/calculs`, `/api/reporting`, `/api/top-clients`, `/api/quantites-clients`  
+**Format :** JSON ; erreurs `{error: "message"}` avec codes HTTP 200, 400, 404, 500
+
+### 3.4 Frontend
+
+**Pages :** `index.html`, `client.html`, `dashboard.html`, `top-clients.html`, `quantites-clients.html`  
+**State :** JavaScript vanilla, variables globales ou localStorage  
+**Pas de SPA :** rechargement de page après certaines actions
+
+### 3.5 Infra
+
+**Dev :** `php -S` ou Apache/Nginx  
+**Déploiement :** Hébergement PHP + MariaDB ; `sql/schema.sql` une fois ; `.env` en production
+
+---
+
+## 4. Patterns et conventions
+
+### 4.1 Nommage
+
+| Contexte | Convention | Exemple |
+|----------|------------|---------|
+| Tables et colonnes | snake_case, pluriel tables | `clients`, `client_id`, `n_facture` |
+| API (endpoints, params, JSON) | snake_case | `?client_id=1`, `{client_id: 1}` |
+| Code PHP/JS | camelCase | `getClientData()`, `$clientId` |
+| Fichiers | minuscules, tirets | `client-detail.js` |
+
+### 4.2 Formats API
+
+- **Succès :** réponse directe `{...}` (pas de wrapper `data`)
+- **Erreur :** `{error: "message"}` + code HTTP approprié
+- **Dates :** ISO (`2026-02-09T10:00:00Z`)
+
+### 4.3 Règles agents IA
+
+- snake_case en DB et JSON API ; camelCase en PHP/JS
+- Respecter la structure des endpoints et du projet
+- Retourner les erreurs au format `{error: "message"}`
+- **Anti-patterns :** pas de wrapper `{data: ...}` ; pas de mélange camelCase/snake_case dans le même contexte
+
+---
+
+## 5. Interfaces logicielles
+
+### 5.1 I1 — Utilisateur ↔ Application
+
+**Points d’entrée :** `index.html` (liste clients), `client.html?id=` (fiche client), `dashboard.html`, `top-clients.html`, `quantites-clients.html`, lien « Exporter CSV » → `api/reporting.php?format=csv`.
+
+### 5.2 I2 — Frontend ↔ API
+
+**Protocole :** GET (lecture), POST (création), PUT (modification), DELETE (suppression). Body JSON pour POST/PUT.  
+**Erreurs :** 4xx/5xx avec `{error: "message"}` ; front : `apiGet`, `apiPost`, etc. dans utils.js.
+
+**Appels principaux :**
+
+| Appelant | Méthode | Endpoint | Rôle |
+|----------|---------|----------|------|
+| index.html | GET/POST/DELETE | `/api/clients.php` | Liste, recherche, création, suppression client |
+| client.html | GET | `/api/clients`, `/api/factures`, `/api/paiements`, `/api/calculs`, `/api/echeanciers` | Détail client |
+| client.html | POST/PUT/DELETE | `/api/factures.php`, `/api/paiements.php`, `/api/echeanciers.php` | Création, modification, suppression |
+| dashboard.html | GET | `/api/reporting.php` | Tableau de bord ; `format=csv` ou `format=factures_csv` pour export |
+| top-clients.html | GET | `/api/top-clients.php` | Données Top clients (params type, cycle) |
+| quantites-clients.html | GET | `/api/quantites-clients.php` | Quantités par client (param type) |
+
+### 5.3 I3 — API ↔ Base de données
+
+**Protocole :** PDO, pilote pdo_mysql. Connexion dans `config.php` (getPdo()).  
+**Opérations :** SELECT, INSERT, UPDATE, DELETE ; requêtes préparées. Charset utf8mb4.
+
+### 5.4 I4 — Export CSV
+
+**Endpoint :** `api/reporting.php` avec `format=csv` (encours par client) ou `format=factures_csv` (ensemble factures PJ). En-têtes Content-Type text/csv, Content-Disposition attachment.
+
+### 5.5 I5 — Pennylane (hors MVP)
+
+Non réalisé en MVP. Facturation dans Pennylane ; saisie manuelle dans l’appli. Évolution possible : import ou sync factures/paiements.
+
+### 5.6 Récapitulatif
+
+| Id | Interface | Sens | Protocole |
+|----|-----------|------|-----------|
+| I1 | Utilisateur ↔ Application | Bidirectionnel | HTTP, navigateur, HTML/CSV |
+| I2 | Frontend ↔ API | Front ↔ API | HTTP, JSON |
+| I3 | API ↔ Base de données | API ↔ DB | PDO, MySQL/MariaDB |
+| I4 | Application → Utilisateur (export) | API → navigateur | HTTP, CSV |
+| I5 | Application ↔ Pennylane | — (hors MVP) | À définir |
+
+---
+
+## 6. Structure projet et validation
+
+### 6.1 Arborescence
+
+```
+dircops/
+├── README.md
+├── .env.example
+├── .env
+├── index.html
+├── client.html
+├── dashboard.html
+├── top-clients.html
+├── quantites-clients.html
+├── api/
+│   ├── config.php
+│   ├── clients.php
+│   ├── factures.php
+│   ├── paiements.php
+│   ├── calculs.php
+│   ├── reporting.php
+│   ├── top-clients.php
+│   └── quantites-clients.php
+├── js/
+│   ├── utils.js
+│   ├── client-detail.js
+│   ├── paiements.js
+│   ├── dashboard.js
+│   ├── facture-form.js
+│   ├── top-clients.js
+│   └── quantites-clients.js
+├── css/
+└── sql/
+    └── schema.sql
+```
+
+### 6.2 Flux de données
+
+- Liste clients : `index.html` → `api/clients.php` → DB
+- Détail client : `client.html` → API (clients, factures, paiements, calculs, écheanciers) → DB
+- Dashboard : `dashboard.html` → `api/calculs.php`, `api/reporting.php` → DB
+- Paiement : `client.html` + `js/paiements.js` → `api/paiements.php` → DB → recalcul API
+
+### 6.3 Validation
+
+**Statut :** READY FOR IMPLEMENTATION
+
+**Points forts :** Stack simple ; séparation nette API / frontend / DB ; patterns explicites.  
+**À préciser en implémentation :** Schéma SQL détaillé, format export CSV.  
+**Évolutions futures :** Auth détaillée, migration MODX.
+
+### 6.4 Priorité d’implémentation
+
+1. `sql/schema.sql`  
+2. `api/config.php`  
+3. Endpoints de base : `clients.php`, `factures.php`, `paiements.php`, `echeanciers.php`
+
+---
+
+*Document de référence pour toute question d’architecture. À mettre à jour en cas d’ajout d’écrans, d’endpoints ou d’intégrations externes.*

+ 274 - 0
_bmad-output/planning-artifacts/cahier-recettes-livraison.md

@@ -0,0 +1,274 @@
+# Cahier des recettes – Livraison application dirCops
+
+**Application :** dirCops  
+**Projet :** Suivi facturation / échéancier / paiement — Écloserie marine (remplacement du fichier Excel)  
+**Version :** 1.0  
+**Date :** 2026-02-10  
+
+**Usage :** cocher chaque critère après test de recette et indiquer **O (OK)** / **N (Non conforme)** / **NA (Non applicable)** + commentaire si nécessaire.
+
+---
+
+## 0. Périmètre et règles d’alignement (références)
+
+### Écrans/pages (MVP)
+
+- **Clients** : `app/index.html`
+- **Fiche client** : `app/client.html?id=...`
+- **Tableau de bord** : `app/dashboard.html`
+- **Meilleurs clients** : `app/top-clients.html` (**Top 15**)
+- **Quantités** : `app/quantites-clients.html`
+
+Référence : `app/LISTING-ECRANS-PAGES.md`.
+
+### Accès / rôles
+
+- L’authentification est **Livinweb ModX** (identifiant/mot de passe). Le contrôle d’accès est **hors scope applicatif** si géré par l’environnement de déploiement.
+- Rôle MVP : **Commercial / Admin** (lecture/écriture). Autres rôles éventuels = options.
+
+Références : `app/README.md`, `app/ROLES-PERMISSIONS-RBAC.md`, `app/ACTEURS-UTILISATEURS.md`.
+
+### Règles métier clés (à respecter en recette)
+
+- **Encours facture** = `montant_ht − somme(paiements)` ; si encours < 0, afficher **0** (pas de crédit client affiché).
+- **Paiement > montant facture** : autorisé ; encours affiché = **0**.
+- **Unicité `n_facture`** : pas de contrainte en périmètre actuel.
+- **Clients en doublon** : non gérés (pas de détection/fusion).
+- **Navigateurs** : **Safari non supporté** (ne pas exiger de recette Safari).
+
+Références : `app/REGLES-METIER.md`, `app/LOGIQUE-PAIEMENTS-ECHEANCIERS.md`, `app/QUESTIONS-A-TRANCHER.md`.
+
+### Modes de test (au choix)
+
+- **Mode simulation** : données depuis `app/mock/*.json` (pas de MySQL).
+- **Mode base** : MySQL/MariaDB + `MOCK_MODE=0` + schéma `app/sql/schema.sql`.
+
+Référence : `app/README.md`.
+
+---
+
+## 1. Gestion clients
+
+| # | Critère de recette | O/N/NA | Commentaires |
+|---:|---|:---:|---|
+| 1.1 | Depuis l’accueil **Clients**, la liste des clients s’affiche. |  |  |
+| 1.2 | La recherche par nom de client filtre correctement la liste (saisie partielle). |  |  |
+| 1.3 | Depuis l’accueil, on peut **ajouter un client** ; le nouveau client apparaît dans la liste. |  |  |
+| 1.4 | Depuis l’accueil, on peut **supprimer un client** ; une confirmation est demandée ; la liste est mise à jour (et les données associées sont gérées selon la règle d’implémentation). |  |  |
+| 1.5 | Les **doublons de clients** (même nom) sont acceptés et affichés tels quels (pas de blocage). |  |  |
+
+---
+
+## 2. Fiche client (affichage)
+
+| # | Critère de recette | O/N/NA | Commentaires |
+|---:|---|:---:|---|
+| 2.1 | En cliquant sur un client, la **fiche client** s’ouvre avec le bon `id` et le bon nom. |  |  |
+| 2.2 | La fiche client affiche : **nom**, **encours client**, **liste des factures**, **liste des paiements**, et la zone **échéancier** par facture (si présent). |  |  |
+| 2.3 | Après une action (ajout/modif/suppression facture/paiement/échéancier), la fiche se met à jour et reste cohérente (montants/états). |  |  |
+
+---
+
+## 3. Factures (suivi)
+
+| # | Critère de recette | O/N/NA | Commentaires |
+|---:|---|:---:|---|
+| 3.1 | Pour un client, la liste des factures affiche au minimum : **n° facture**, **n° vente**, **date facture**, **type produit**, **cycle**, **quantités**, **montant HT**, **total payé**, **encours**, **état** (Payée / En attente). |  |  |
+| 3.2 | Le formulaire **Ajouter une facture (suivi)** est accessible et compréhensible. |  |  |
+| 3.3 | L’ajout d’une facture avec les champs obligatoires (ex. n° facture, date, montant HT) enregistre la facture et l’affiche dans la liste. |  |  |
+| 3.4 | L’ajout/modification d’une facture avec type (alevins/larves), cycle, quantités et quantité livrée enregistre et ré-affiche correctement ces champs (cas “quantité livrée vide” géré sans erreur). |  |  |
+| 3.5 | On peut **modifier** une facture : le formulaire se remplit ; après validation, les données sont mises à jour et l’encours/état se recalculent. |  |  |
+
+---
+
+## 4. Paiements
+
+| # | Critère de recette | O/N/NA | Commentaires |
+|---:|---|:---:|---|
+| 4.1 | Sur la fiche client, la **liste des paiements** s’affiche (facture concernée, date, montant). |  |  |
+| 4.2 | Le formulaire **Enregistrer un paiement** propose uniquement des factures **en attente** (encours > 0). |  |  |
+| 4.3 | La saisie d’un montant et d’une date enregistre le paiement et met à jour l’encours/état de la facture (sans incohérence). |  |  |
+| 4.4 | Un paiement supérieur au montant restant dû est **accepté** ; l’**encours affiché** de la facture (et du client) reste à **0** (pas de crédit affiché). |  |  |
+
+---
+
+## 5. Échéancier de paiement
+
+| # | Critère de recette | O/N/NA | Commentaires |
+|---:|---|:---:|---|
+| 5.1 | Depuis la fiche client, on peut **ajouter un échéancier** à une facture (facture, nb échéances, date de début). |  |  |
+| 5.2 | Après ajout, l’échéancier apparaît pour la facture concernée (nb échéances, date de début, montant par échéance si affiché). |  |  |
+| 5.3 | Une facture ne peut avoir **qu’un seul échéancier** ; une tentative de doublon est empêchée (message ou blocage). |  |  |
+| 5.4 | Une facture **soldée** (encours ≤ 0) ne permet pas de créer un échéancier (blocage + message). |  |  |
+
+---
+
+## 6. Calculs financiers (encours, états, échéances)
+
+| # | Critère de recette | O/N/NA | Commentaires |
+|---:|---|:---:|---|
+| 6.1 | L’encours **par facture** correspond à `montant_ht − somme(paiements)` et est plafonné à **0** si négatif. |  |  |
+| 6.2 | L’encours **par client** correspond à la somme des encours factures du client (après plafonnement à 0). |  |  |
+| 6.3 | L’état facture est **Payée** si encours ≤ 0, **En attente** sinon, et se met à jour après ajout/suppression de paiement. |  |  |
+| 6.4 | Le bloc **échéances à venir** (tableau de bord) liste des échéances cohérentes : avec échéancier (date début + N mois, montant par échéance), sans échéancier (date facture + encours). |  |  |
+
+---
+
+## 7. Tableau de bord / Top clients / Quantités (pages analytiques)
+
+| # | Critère de recette | O/N/NA | Commentaires |
+|---:|---|:---:|---|
+| 7.1 | Le **tableau de bord** affiche : encours par client, synthèse (dont encours total), échéances à venir, et les liens d’exports. |  |  |
+| 7.2 | La page **Meilleurs clients** permet de choisir le type (Alevins/Larves) et optionnellement un cycle, et affiche un **Top 15** cohérent (totaux/% cohérents). |  |  |
+| 7.3 | La page **Quantités** affiche des quantités par client et le filtre type (Alevins/Larves) restreint correctement les lignes. |  |  |
+| 7.4 | Les liens vers la **fiche client** depuis les pages (dashboard/top/quantités) ouvrent le bon client. |  |  |
+
+---
+
+## 8. Exports CSV
+
+> Référence : `app/EXPORT-CSV-SPEC.md` (colonnes “retenues” + options à trancher).
+
+| # | Critère de recette | O/N/NA | Commentaires |
+|---:|---|:---:|---|
+| 8.1 | Export **Encours par client** : téléchargement d’un fichier `reporting-encours-YYYY-MM-DD.csv` ; séparateur cohérent (ex. `;`), encodage OK (accents), au minimum colonnes **Nom client** et **Encours**. |  |  |
+| 8.2 | Export **Ensemble des factures** : téléchargement d’un fichier `suivi-factures-YYYY-MM-DD.csv` ; en-têtes/colonnes conformes à la spécification retenue (client, n° facture, dates, type, cycle, quantités, montant, total payé, encours, état). |  |  |
+| 8.3 | Les formats **dates** (jj/mm/aaaa ou ISO selon décision) et **montants** (virgule/points, symbole € ou non) sont cohérents et documentés. |  |  |
+
+---
+
+## 9. Navigation, erreurs, non-fonctionnel
+
+| # | Critère de recette | O/N/NA | Commentaires |
+|---:|---|:---:|---|
+| 9.1 | Depuis chaque page, l’en-tête propose la navigation : **Clients**, **Tableau de bord**, **Meilleurs clients**, **Quantités**. |  |  |
+| 9.2 | Les montants sont affichés en **euros** et les dates dans un format cohérent sur l’ensemble des pages. |  |  |
+| 9.3 | En cas d’erreur (champ obligatoire, API indisponible, erreur serveur), un message **compréhensible** s’affiche (sans écran blanc). |  |  |
+| 9.4 | Temps de réponse acceptable en conditions normales (ordre de grandeur : affichage initial < 3s, actions usuelles ~< 1s) et accès restreint aux personnes autorisées (selon déploiement ModX). |  |  |
+
+# Cahier des recettes – Livraison application dirCops
+
+**Application :** dirCops  
+**Projet :** Suivi facturation / échéancier / paiement (EMGI)  
+**Version :** 1.0  
+**Date :** 2026-02-09  
+
+**Usage :** Cocher chaque ligne après test de recette. Indiquer O (OK) / N (Non conforme) / NA (non applicable) si besoin.
+
+---
+
+## 1. Gestion clients (FR1, FR2)
+
+| # | Critère de recette | O/N |
+|---|--------------------|-----|
+| 1.1 | Depuis l’accueil, la liste des clients s’affiche. | |
+| 1.2 | La recherche par nom de client filtre bien la liste (saisie partielle). | |
+| 1.3 | En cliquant sur un client, la page détail client s’ouvre avec le bon client. | |
+| 1.4 | La page détail affiche : nom du client, encours, liste des factures, liste des paiements. | |
+| 1.5 | Depuis l’accueil, on peut ajouter un client (formulaire « Ajouter un client ») ; le nouveau client apparaît dans la liste. | |
+| 1.6 | Depuis l’accueil, on peut supprimer un client (icône/bouton supprimer) ; une confirmation est demandée ; la suppression supprime aussi factures, paiements et écheanciers associés (ou un message d’erreur si factures existantes selon règle métier). | |
+
+---
+
+## 2. Factures (FR3, FR3b)
+
+| # | Critère de recette | O/N |
+|---|--------------------|-----|
+| 2.1 | Pour un client, la liste des factures affiche : n° facture, n° vente, date, type produit, cycle, quantité facturée, quantité livrée, montant HT, encours facture, état (Payé / En attente). | |
+| 2.2 | Depuis la page détail client, le formulaire « Ajouter une facture (suivi) » est accessible et compréhensible. | |
+| 2.3 | L’ajout d’une facture avec n° facture, date, montant HT obligatoires enregistre bien la facture et la fait apparaître dans la liste du client. | |
+| 2.4 | L’ajout d’une facture avec type (alevins/larves), cycle, quantités et quantité livrée enregistre correctement ces champs et les affiche dans la liste. | |
+| 2.5 | Une facture sans quantité livrée affiche « - » ou 0 selon le cas, sans erreur. | |
+| 2.6 | On peut modifier une facture existante (bouton/icône Modifier) : le formulaire se remplit avec les données de la facture ; après envoi, les données sont mises à jour. | |
+| 2.7 | On peut supprimer une facture (bouton/icône Supprimer) ; une confirmation est demandée ; la facture et ses paiements/écheancier associés sont supprimés. | |
+
+---
+
+## 3. Écheancier de paiement (FR4b, FR5b)
+
+| # | Critère de recette | O/N |
+|---|--------------------|-----|
+| 3.0.1 | Depuis la page détail client, on peut ajouter un écheancier à une facture (facture associée, nombre d’échéances, date de début d’écheancier). | |
+| 3.0.2 | Après ajout, l’écheancier apparaît pour la facture concernée (nombre d’échéances, date de début). | |
+| 3.0.3 | Une facture ne peut avoir qu’un seul écheancier (ou pas d’écheancier). | |
+| 3.0.4 | On peut supprimer un écheancier (bouton/icône Supprimer) ; une confirmation est demandée ; l’écheancier disparaît de la liste. | |
+
+---
+
+## 4. Paiements (FR4, FR5)
+
+| # | Critère de recette | O/N |
+|---|--------------------|-----|
+| 3.1 | Sur la page client, la liste des paiements du client s’affiche (facture concernée, date, montant). | |
+| 3.2 | Le formulaire « Enregistrer un paiement » propose uniquement les factures en attente (encours > 0). | |
+| 3.3 | La saisie d’un montant et d’une date puis la soumission enregistre le paiement et met à jour l’encours de la facture. | |
+| 3.4 | Après enregistrement d’un paiement, la page se recharge et les montants (encours client, encours par facture) sont cohérents. | |
+| 3.5 | On peut supprimer un paiement (bouton/icône Supprimer) ; une confirmation est demandée ; le paiement disparaît et l’encours de la facture se met à jour. | |
+
+---
+
+## 5. Calculs financiers (FR6, FR7, FR8, FR9)
+
+| # | Critère de recette | O/N |
+|---|--------------------|-----|
+| 4.1 | L’encours affiché par client correspond à la somme des montants HT des factures moins la somme des paiements de ce client. | |
+| 4.2 | Le tableau de bord affiche un encours total cohérent avec la somme des encours par client. | |
+| 4.3 | Les échéances à venir listent les échéances prévues (date ≥ aujourd’hui) : pour les factures avec écheancier, les dates et montants sont calculés à partir de l’écheancier (date début + N mois, montant par échéance) ; pour les factures sans écheancier, la date de facture et l’encours sont affichés. Colonnes : client, n° facture (éventuellement numéro d’échéance), date échéance, montant. | |
+| 4.4 | Après ajout d’un paiement, l’encours du client et l’état des factures (Payé / En attente) se mettent à jour sans re-saisie. | |
+
+---
+
+## 6. Reporting et tableaux de bord (FR10, FR10b, FR10c, FR11)
+
+| # | Critère de recette | O/N |
+|---|--------------------|-----|
+| 5.1 | Le tableau de bord affiche : encours par client (tri croissant), synthèse (encours total en k€, délai moyen de paiement en j), échéances à venir, liens export encours CSV et export ensemble des factures (PJ). | |
+| 5.1b | Les clients affichés sont des noms de clients (pas des lieux de départ ; EMGI = lieu de départ, pas un client). | |
+| 5.2 | La page « Top clients » permet de choisir le type (Alevins / Larves) et optionnellement le cycle (24-25, 25-26). | |
+| 5.3 | La page « Top clients » affiche pour le type et cycle choisis : client, quantités, % qté, CA HT, % CA, lien vers fiche client. Les totaux sont cohérents. | |
+| 5.4 | La page « Quantités » affiche par client : quantité facturée, quantité livrée, lien vers fiche client. | |
+| 5.5 | Le filtre par type (Alevins / Larves) sur la page « Quantités » restreint correctement les lignes affichées. | |
+| 5.6 | L’export encours CSV (reporting?format=csv) télécharge un fichier avec encours par client (séparateur cohérent, caractères accentués corrects). | |
+| 5.7 | L’export « ensemble des factures (PJ) » (reporting?format=factures_csv) télécharge un CSV calqué sur l’onglet Factures Excel (EMGI_FTI_Suivi des Ventes) : en-têtes EXO, Mois, CLIENT, PAYS, DEPART DEM, NEG., TYPE, CYCLE, produc, PAI, DATE FACTUR, N° DE VENTE, N° FACTURE, QTE FACT, QTE LIVREE, % GT, CA FACTURE HT, PU, Total payé, Encours ; colonnes renseignées selon les données appli, format français (dates jj/mm/aaaa, nombres virgule/espaces). | |
+
+---
+
+## 7. Navigation et ergonomie
+
+| # | Critère de recette | O/N |
+|---|--------------------|-----|
+| 6.1 | Depuis chaque page, l’en-tête affiche le nom de l’application (dirCops) et les liens vers Clients, Tableau de bord, Top clients, Quantités. | |
+| 6.2 | Les montants sont affichés en euros (format français). Les dates sont au format français. | |
+| 6.3 | En cas d’erreur (ex. champ obligatoire manquant, API indisponible), un message d’erreur compréhensible s’affiche. | |
+
+---
+
+## 8. Non fonctionnel (NFR1, performance)
+
+| # | Critère de recette | O/N |
+|---|--------------------|-----|
+| 7.1 | L’application est accessible uniquement aux personnes autorisées (contrôle d’accès selon environnement de déploiement). | |
+| 7.2 | Le chargement initial de la liste des clients ou du tableau de bord reste acceptable (< 3 s dans des conditions normales). | |
+| 7.3 | Les actions (recherche, clic, enregistrement) répondent en moins d’environ 1 s. | |
+
+---
+
+## 9. Synthèse
+
+| Section | Nombre de critères | Validés (O) | Non conformes (N) | NA |
+|---------|--------------------|-------------|-------------------|-----|
+| 1. Gestion clients | 6 | | | |
+| 2. Factures | 7 | | | |
+| 3. Écheancier | 4 | | | |
+| 4. Paiements | 5 | | | |
+| 5. Calculs financiers | 4 | | | |
+| 6. Reporting | 9 | | | |
+| 7. Navigation | 3 | | | |
+| 8. Non fonctionnel | 3 | | | |
+| **Total** | **41** | | | |
+
+**Livraison acceptée si :** tous les critères bloquants sont à O (ou NA documenté). Les critères N doivent être listés et traités (correctif ou décision d’acceptation sous réserve).
+
+---
+
+*Document généré à partir du PRD et des fonctionnalités livrées. À compléter par le client ou la maîtrise d’ouvrage lors de la recette.*

+ 246 - 0
_bmad-output/planning-artifacts/chiffrage-schema-et-grille.md

@@ -0,0 +1,246 @@
+# Schéma de chiffrage & grille de complexité — dirCops (EMGI)
+
+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.md`
+> - `grille-complexite-chiffrage.md`
+>
+> Objectif : cadrer le périmètre et fournir un référentiel unique pour structurer le backlog et chiffrer.
+
+---
+
+## 1) Schéma fonctionnel par modules (WBS / lots chiffrables)
+
+Objectif : découper le projet en lots livrables et chiffrables.  
+Livrable : backlog structuré par module + dépendances.
+
+### Modules identifiés (périmètre aligné)
+
+| 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 |
+
+### Lots recommandés (périmètre actuel)
+
+- **Lot 1 — Fondations & données** : schéma DB, config, mode mock, CRUD clients, liste + détail client.
+- **Lot 2 — Factures & paiements** : APIs factures/paiements, recalcul encours, intégration page client.
+- **Lot 3 — Écheanciers** : API écheanciers, formulaire + affichage, règle 1 écheancier / facture.
+- **Lot 4 — Reporting** : dashboard, exports CSV, Top clients, Quantités clients.
+- **Lot 5 — Accès (si requis)** : intégration login ModX / restriction d’accès (et SSO si demandé).
+
+---
+
+## 2) Schéma des rôles et permissions (matrice RBAC)
+
+Objectif : éviter l’oubli fréquent du chiffrage (droits, écrans, actions par profil).  
+Livrable : matrice rôles × ressources/actions.
+
+Contexte projet (aligné) :
+- **MVP** : un seul profil (**Commercial / Admin**) avec tous les droits.
+- **Option** : ajouter un profil **Lecture seule** (Trésorerie / Direction).
+
+### Matrice RBAC (cible)
+
+| 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 :
+- **Pas de** délégation/héritage en MVP.
+- **Pas de** multi-tenant (une seule entité EMGI).
+- **Audit log** (qui a fait quoi) : hors MVP.
+
+Références : `app/ROLES-PERMISSIONS-RBAC.md`, `app/ACTEURS-UTILISATEURS.md`.
+
+---
+
+## 3) Schéma de données (référence)
+
+Objectif : chiffrer le back (tables, règles, index).  
+Livrable : schéma relationnel + description des champs.
+
+Entités (simplifié) :
+- **clients** \(1\) → \(N\) **factures**
+- **factures** \(1\) → \(N\) **paiements**
+- **factures** \(0..1\) → \(1\) **echeanciers**
+
+Règles métier données (résumé) :
+- Client : nom obligatoire ; suppression en cascade des factures (et donc paiements, écheanciers).
+- Paiement : lié à une facture ; montant > 0 ; somme paiements vs montant facture = règle à préciser (bloquer/alerter).
+- Écheancier : au plus un par facture ; dates d’échéance dérivées (règle : mensuelle, etc.).
+
+Document détaillé : `schema-relationnel-et-tables-donnees.md`.  
+Schéma SQL : `app/sql/schema.sql` (+ `app/sql/migration-*.sql`).
+
+---
+
+## 4) Schéma des workflows métier (états et transitions)
+
+Objectif : chiffrer validations, statuts, automatisations (léger sur ce projet).  
+Livrable : diagramme d’états + règles.
+
+Résumé (aligné) :
+- **Facture** : 2 états **dérivés** (En attente / Payée), **non stockés** ; Payée si encours ≤ 0 après paiement(s).
+- **Paiement, écheancier, client** : pas de workflow (création directe).
+- **Hors MVP** : SLA/relances/escalades, validations multi-étapes, audit log.
+
+Document détaillé : `schema-workflows.md`.
+
+---
+
+## 5) Schéma des intégrations et flux (endpoints + points complexes)
+
+Objectif : lister les APIs et points techniques complexes pour un chiffrage réaliste.  
+Livrable : liste des endpoints + points complexes.
+
+### Endpoints (API REST)
+
+| 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 |
+
+### Points complexes à chiffrer spécifiquement (alignés)
+
+| 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) |
+
+---
+
+## 6) Schéma d’architecture applicative (rappel)
+
+Objectif : visualiser les blocs du système pour répartir le travail.  
+Livrable : diagramme composants.
+
+Résumé :
+- **Frontend** : HTML + JS vanilla + Tailwind (MPA : une page = un écran)
+- **API** : PHP, un script par ressource (`clients`, `factures`, `paiements`, `echeanciers`, `calculs`, `reporting`, `top-clients`, `quantites-clients`)
+- **Données** : soit mock (JSON), soit DB (PDO)
+
+Document étendu : `architecture-generale-fonctionnelle-et-interfaces.md` et `architecture.md`.
+
+---
+
+## 7) Grille de complexité (référentiel — version épurée)
+
+Usage : barème d’estimation (ordre de grandeur) pour les lots/modules ci‑dessus.
+
+### 7.1 Écrans / Pages
+
+| 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) |
+
+### 7.2 API / Backend
+
+| 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 |
+
+### 7.3 Tests & qualité (si chiffrés)
+
+| 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 |
+
+### 7.4 Estimation indicative par module (ordre de grandeur)
+
+> 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 :
+- Total indicatif **avec** accès ModX : ~32 j (ordre de grandeur).
+- Total indicatif **sans** accès ModX : ~30 j (ordre de grandeur).
+
+---
+
+## 8) Alignement périmètre (ce qu’on garde / ce qu’on retire)
+
+Cette section est la consolidation des décisions de périmètre pour éviter de chiffrer du hors‑scope.
+
+### À retirer / hors périmètre (MVP)
+
+- Recherche client par nom (FR1) **retirée**
+- Contrainte d’unicité `n_facture` **non prévue**
+- Cibles de performance (NFR) « < 3 s / < 1 s » **non contractualisées ici**
+- Infra/CI-CD/monitoring **hors doc de chiffrage MVP**
+- Workflows/statuts avancés (multi-étapes, SLA, relances, escalades, audit log) **hors MVP**
+- Multi-tenant, délégation/héritage **hors MVP**
+
+### Fonctionnalités à conserver (périmètre à chiffrer)
+
+| 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` |
+

+ 43 - 0
_bmad-output/planning-artifacts/decisions-client-chiffrage.md

@@ -0,0 +1,43 @@
+# Décisions client — Chiffrage MVP
+
+**Application :** dirCops (facturation / échéancier / paiement)
+
+---
+
+## Décisions actées
+
+| Décision | Périmètre MVP | Impact |
+|----------|---------------|--------|
+| **Authentification** | Login MODX Livinweb (id/mot de passe) — écran login, session, protection API/pages, déconnexion | ~1-2 jours |
+| **Pennylane** | Saisie manuelle uniquement (suivi comme Excel). Facturation document reste dans Pennylane. Import = option post-MVP | 0 jour |
+| **Rôles** | Un seul rôle : tous les utilisateurs ont les mêmes droits (CRUD complet). Pas de distinction Commercial/Lecteur | 0 jour |
+
+---
+
+## Questions à trancher
+
+| Question | Impact estimé |
+|----------|---------------|
+| Export : format CSV (champs, encodage, séparateur) | 0,5-1 j |
+| Hébergement (où, déploiement, sauvegardes) | 0,5-2 j |
+| Migration MODX : confirmée, quand ? | Architecture |
+| Indicateurs Excel (couverture, % GTT) : MVP ou après ? | 1-2 j si MVP |
+| Top clients : limite (10/15) ou pas ? | Minime |
+| Safari requis ? | ~0,25 j |
+| Accessibilité WCAG A vs AA | 0,5-1 j si AA |
+| Échéances mensuelles ou personnalisables ? | +0,5 j si personnalisable |
+| Suivi paiement ↔ échéance ? | +1 j si requis |
+
+---
+
+## Règles métier (recommandations internes)
+
+- **Paiement > montant facture** : autoriser ; encours = 0 (pas de crédit client)
+- **Unicité n° facture** : par client (UNIQUE client_id, n_facture)
+- **Suppression** : cascade avec message de confirmation
+- **Export CSV** : séparateur `;`, UTF-8 BOM (Excel FR)
+- **Échéances** : mensuelles (date_debut + N mois)
+
+---
+
+*Référence pour le chiffrage. Mise à jour au fil des décisions.*

+ 345 - 0
_bmad-output/planning-artifacts/général et regles-metier-a-clarifier.md

@@ -0,0 +1,345 @@
+# Règles métier à clarifier
+
+**Application :** dirCops  
+**Projet :** Suivi facturation / échéancier / paiement (EMGI)  
+**Date :** 2026-02-09  
+**Usage :** Liste des ambiguïtés métier à trancher avant développement ou chiffrage final
+
+---
+
+## Règles déjà clarifiées ✅
+
+| Règle | Décision | Impact développement |
+|-------|----------|----------------------|
+| **Authentification** | Login MODX Livinweb (identifiant/mot de passe) | Écran login + session PHP |
+| **Rôles** | Un seul rôle en MVP (multi-rôles en option) | Pas de gestion de permissions |
+| **Import Pennylane** | EN OPTION (MVP = saisie manuelle) | Aucun en MVP |
+| **Modification/suppression** | Autorisé (facture, paiement, écheancier, client) avec confirmation | CRUD complet |
+| **Suppression client** | Cascade (factures → paiements/écheanciers) | Confirmation + message avertissement |
+
+---
+
+## Règles à clarifier avec le client
+
+### 1. Factures
+
+#### 1.1 Unicité du numéro de facture ⚠️ PRIORITÉ HAUTE
+
+**Question :** Un client peut-il avoir deux factures avec le même numéro de facture ?
+
+**Options :**
+- **A) Unicité globale** : un n° facture ne peut exister qu'une seule fois dans toute la base
+  - Contrainte DB : `UNIQUE(n_facture)`
+  - Validation API : vérifier unicité avant INSERT
+- **B) Unicité par client** : un client ne peut pas avoir deux factures avec le même n°, mais deux clients différents peuvent
+  - Contrainte DB : `UNIQUE(client_id, n_facture)`
+  - Validation API : vérifier unicité par client
+
+**Recommandation technique :** Option B (unicité par client) — plus souple et évite blocages si deux clients ont un n° similaire
+
+**Impact :**
+- Option A : contrainte globale simple
+- Option B : contrainte composite, requête légèrement plus complexe
+
+**Décision client :** _À trancher_
+
+---
+
+#### 1.2 Champs facture obligatoires ou optionnels ⚠️ PRIORITÉ MOYENNE
+
+**Question :** Tous les champs facture sont-ils requis ou certains peuvent être laissés vides ?
+
+**Champs actuels :**
+| Champ | Obligatoire actuel | À confirmer |
+|-------|-------------------|-------------|
+| n_facture | Oui (NOT NULL) | ✅ Confirmé |
+| n_vente | Non (NULL) | À confirmer |
+| date_facture | Oui (NOT NULL) | ✅ Confirmé |
+| type_produit | Non (NULL) | **À clarifier** : si vide, impact reporting Top clients ? |
+| cycle | Non (NULL) | **À clarifier** : si vide, impact reporting par cycle ? |
+| quantites | Non (NULL) | **À clarifier** : si vide, impact reporting Quantités clients ? |
+| qte_livree | Non (NULL) | **À clarifier** : si vide, OK ou bloquer ? |
+| montant_ht | Oui (NOT NULL) | ✅ Confirmé |
+
+**Recommandation :**
+- Si un champ est **utilisé dans un reporting obligatoire**, le rendre **obligatoire** à la saisie (validation front + back)
+- Exemple : si "Top clients par type" est essentiel, alors `type_produit` devrait être obligatoire
+
+**Décision client :** _À trancher (valider si type_produit, cycle, quantites obligatoires ou pas)_
+
+---
+
+#### 1.3 TVA et devise ⚠️ PRIORITÉ BASSE
+
+**Question :** Faut-il ajouter des champs TVA et devise ?
+
+**Contexte :** Actuellement seul le montant HT est stocké. Pas de gestion de TVA, TTC, ou devise.
+
+**Options :**
+- **MVP actuel** : montant HT uniquement (€ implicite)
+- **Option évoluée** : ajouter champs `tva` (%), `montant_ttc`, `devise` (EUR, USD, etc.)
+
+**Recommandation :** Garder MVP simple (HT uniquement, € implicite) sauf besoin explicite client
+
+**Décision client :** _À trancher_
+
+---
+
+### 2. Paiements
+
+#### 2.1 Paiement supérieur au montant de la facture ⚠️ PRIORITÉ HAUTE
+
+**Question :** Que se passe-t-il si un utilisateur enregistre un paiement > montant HT de la facture ?
+
+**Options :**
+- **A) Autoriser et encours = 0** : le paiement est enregistré, l'encours de la facture = 0 (pas de crédit client)
+  - Avantage : souplesse (erreur client, arrondi, geste commercial)
+  - Inconvénient : "trop-perçu" non suivi
+- **B) Bloquer** : validation API refuse le paiement si somme des paiements (+ nouveau paiement) > montant HT
+  - Avantage : cohérence stricte
+  - Inconvénient : blocage si arrondi ou erreur de saisie facture
+
+**Recommandation technique :** Option A (autoriser, encours = 0) avec avertissement visuel dans l'interface ("Paiement supérieur au montant, facture soldée")
+
+**Décision client :** _À trancher_
+
+---
+
+#### 2.2 Date de paiement dans le futur ⚠️ PRIORITÉ MOYENNE
+
+**Question :** Peut-on enregistrer un paiement avec une date future (paiement "prévu") ?
+
+**Options :**
+- **A) Autoriser** : date libre (passé ou futur)
+  - Utile pour anticiper des paiements prévus
+  - Risque : confusion entre "reçu" et "prévu"
+- **B) Bloquer date future** : validation API refuse si date > aujourd'hui
+  - Plus strict : paiement = réellement reçu
+
+**Recommandation :** Option B (bloquer date future) — si besoin de "paiement prévu", utiliser les écheanciers
+
+**Décision client :** _À trancher_
+
+---
+
+### 3. Écheanciers
+
+#### 3.1 Fréquence des échéances ⚠️ PRIORITÉ MOYENNE
+
+**Question :** Les échéances sont-elles toujours **mensuelles** ou faut-il permettre d'autres fréquences ?
+
+**Options :**
+- **A) Mensuel uniquement** (actuel) : date_debut + N mois
+  - Simple à implémenter
+  - Couvre la majorité des cas
+- **B) Fréquence paramétrable** : mensuel, trimestriel, annuel, personnalisé
+  - Plus flexible
+  - +0,5-1 jour de développement (champ `frequence`, calcul dates adapté)
+
+**Recommandation :** Option A (mensuel) pour MVP, option B en post-MVP si besoin réel
+
+**Décision client :** _À trancher (mensuel suffit-il ?)_
+
+---
+
+#### 3.2 Lien paiement ↔ échéance ⚠️ PRIORITÉ BASSE
+
+**Question :** Faut-il lier un paiement à une échéance spécifique (suivi par échéance : à venir / payée / partielle / en retard) ?
+
+**Options :**
+- **A) Pas de lien** (actuel) : les paiements sont rattachés à la facture globalement, l'encours diminue
+  - Simple : pas de table de liaison
+- **B) Avec lien** : chaque paiement peut être affecté à une échéance
+  - Plus précis : suivi échéance par échéance
+  - +1-2 jours de développement (table liaison, interface)
+
+**Recommandation :** Option A pour MVP (suivi global facture suffit), option B en post-MVP si demandé
+
+**Décision client :** _À trancher_
+
+---
+
+### 4. Clients
+
+#### 4.1 Clients en doublon ⚠️ PRIORITÉ MOYENNE
+
+**Question :** Comment gérer les clients avec des noms similaires (doublons potentiels) ?
+
+**Exemples :**
+- "AQUANARIA" vs "Aquanaria" vs "AQUANARIA SAS"
+- "AQN" vs "AQN (Aqua Nord)"
+
+**Options :**
+- **A) Pas de vérification** : l'utilisateur peut créer "AQUANARIA" et "Aquanaria" comme deux clients distincts
+  - Risque : doublons non détectés
+- **B) Vérification suggérée** : lors de l'ajout, si un client avec un nom proche existe, afficher avertissement "Un client similaire existe : [Nom]"
+  - +0,5 jour de développement (recherche floue, UI avertissement)
+- **C) Contrainte stricte** : unicité du nom (insensible à la casse)
+  - Contrainte DB : `UNIQUE(LOWER(nom))`
+
+**Recommandation :** Option B (avertissement) — souple mais évite doublons accidentels
+
+**Décision client :** _À trancher_
+
+---
+
+### 5. Exports
+
+#### 5.1 Format et encodage des exports CSV ⚠️ PRIORITÉ HAUTE
+
+**Question :** Quel séparateur, encodage et format pour les exports CSV ?
+
+**Options :**
+
+| Paramètre | Option A (Excel FR) | Option B (Standard) |
+|-----------|---------------------|---------------------|
+| Séparateur | `;` (point-virgule) | `,` (virgule) |
+| Encodage | UTF-8 **avec BOM** | UTF-8 sans BOM |
+| Décimale | `,` (virgule) | `.` (point) |
+| Format date | `DD/MM/YYYY` | `YYYY-MM-DD` |
+
+**Recommandation :** Option A (Excel FR) si le client utilise Excel sur Windows en français  
+**Recommandation alternative :** Option B si interopérabilité avec outils internationaux
+
+**Décision client :** _À trancher (test avec un export pour valider)_
+
+---
+
+#### 5.2 Contenu de l'export "Encours par client" ⚠️ PRIORITÉ MOYENNE
+
+**Question :** Quelles colonnes exactement dans l'export CSV "encours par client" ?
+
+**Colonnes actuelles (proposées) :**
+- Nom client
+- Encours (€)
+- (Optionnel) Accord
+- (Optionnel) J out
+- (Optionnel) Situation
+
+**À clarifier :**
+- Inclure aussi : nombre de factures en attente ? montant total facturé ? total payé ?
+- Format montants : avec symbole € ou sans ?
+
+**Décision client :** _À trancher (liste exacte des colonnes souhaitées)_
+
+---
+
+#### 5.3 Export "Ensemble des factures (PJ)" ⚠️ PRIORITÉ MOYENNE
+
+**Question :** Quelles colonnes et quel format pour l'export factures (suivi-factures-YYYY-MM-DD.csv) ?
+
+**Colonnes proposées (à valider) :**
+- Client
+- N° facture
+- N° vente
+- Date facture
+- Type produit
+- Cycle
+- Quantités facturées
+- Quantités livrées
+- Montant HT
+- Total payé
+- Encours
+- État (Payé/En attente)
+
+**Colonnes supplémentaires possibles :**
+- EXO (exercice comptable, dérivé de la date facture)
+- Mois de facturation
+- Délai de paiement (date facture → date dernier paiement)
+
+**Décision client :** _À trancher (colonnes exactes + format)_
+
+---
+
+### 6. Reporting et indicateurs
+
+#### 6.1 Top clients : limite ou pas ? ⚠️ PRIORITÉ BASSE
+
+**Question :** Faut-il limiter l'affichage aux "Top 10" ou "Top 15" clients, ou afficher tous les clients selon le filtre ?
+
+**Options :**
+- **A) Limite (Top 10/15)** : affichage des N meilleurs clients seulement
+  - Plus lisible si beaucoup de clients
+- **B) Pas de limite** : afficher tous les clients du filtre, triés par quantités/CA décroissant
+  - Plus complet, filtrage côté client (Excel) si besoin
+
+**Recommandation :** Option B (pas de limite) pour MVP — le client peut exporter et filtrer dans Excel si besoin
+
+**Décision client :** _À trancher_
+
+---
+
+#### 6.2 Indicateurs "type Excel" (couverture, % GTT) ⚠️ PRIORITÉ MOYENNE
+
+**Question :** Les indicateurs suivants sont-ils requis en MVP ou en post-MVP ?
+
+| Indicateur | Calcul | MVP ou post-MVP ? |
+|------------|--------|-------------------|
+| **Couverture livraison** | (Qté livrée / Qté facturée) × 100 | _À trancher_ |
+| **% GTT (écart livraison)** | Dérivé de couverture | _À trancher_ |
+| **Délai moyen de paiement** | (Somme des délais par facture payée) / Nb factures payées | _À trancher_ |
+
+**Recommandation :** Post-MVP (priorité au suivi encours + paiements en MVP)
+
+**Décision client :** _À trancher_
+
+---
+
+### 7. Tableau de bord
+
+#### 7.1 Colonnes optionnelles (Accord, J out, Situation) ⚠️ PRIORITÉ BASSE
+
+**Question :** Les colonnes "Accord", "J out", "Situation" doivent-elles être affichées sur le dashboard ?
+
+**Contexte :** Ces colonnes sont mentionnées dans les captures Excel "COMEX", mais les données ne sont pas dans la base actuelle.
+
+**Options :**
+- **A) Afficher avec valeurs vides ("—")** : colonnes présentes mais non alimentées
+  - Prépare l'évolution future
+  - Risque : confusion utilisateur ("pourquoi vide ?")
+- **B) Masquer pour MVP** : ne pas afficher ces colonnes
+  - Plus propre
+  - À ajouter en post-MVP si les données sont disponibles
+
+**Recommandation :** Option B (masquer) pour MVP
+
+**Décision client :** _À trancher_
+
+---
+
+## Récapitulatif des priorités
+
+| Priorité | Règle à clarifier | Impact chiffrage |
+|----------|-------------------|------------------|
+| 🔴 **HAUTE** | 1.1 Unicité n° facture | Contrainte DB + validation |
+| 🔴 **HAUTE** | 2.1 Paiement > montant facture | Logique métier |
+| 🔴 **HAUTE** | 5.1 Format export CSV | Développement export |
+| 🟠 **MOYENNE** | 1.2 Champs facture obligatoires | Validation front/back |
+| 🟠 **MOYENNE** | 2.2 Date paiement future | Validation |
+| 🟠 **MOYENNE** | 3.1 Fréquence échéances | Calcul dates |
+| 🟠 **MOYENNE** | 4.1 Clients en doublon | Vérification suggérée |
+| 🟠 **MOYENNE** | 5.2 Colonnes export encours | Contenu export |
+| 🟠 **MOYENNE** | 5.3 Colonnes export factures PJ | Contenu export |
+| 🟠 **MOYENNE** | 6.2 Indicateurs type Excel | Scope MVP |
+| 🟢 **BASSE** | 1.3 TVA et devise | Champs supplémentaires |
+| 🟢 **BASSE** | 3.2 Lien paiement ↔ échéance | Table liaison |
+| 🟢 **BASSE** | 6.1 Top clients limite | Affichage |
+| 🟢 **BASSE** | 7.1 Colonnes optionnelles dashboard | Affichage |
+
+---
+
+## Recommandations pour l'atelier client
+
+**Objectif :** Trancher les règles 🔴 HAUTE et 🟠 MOYENNE avant chiffrage final
+
+**Méthode :**
+1. Présenter chaque règle avec les options A/B/C
+2. Expliquer l'impact technique et métier
+3. Faire choisir le client (décision actée dans le compte-rendu)
+4. Mettre à jour ce document avec les décisions
+
+**Durée estimée :** 1h d'atelier
+
+---
+
+*Document à compléter au fur et à mesure des décisions client. Référence pour développement et tests.*

+ 129 - 0
_bmad-output/planning-artifacts/implementation-readiness-report-2026-02-09.md

@@ -0,0 +1,129 @@
+---
+stepsCompleted: ['step-01-document-discovery', 'step-02-prd-analysis', 'step-03-epic-coverage-validation', 'step-04-ux-alignment', 'step-05-epic-quality-review', 'step-06-final-assessment']
+workflowType: 'check-implementation-readiness'
+project_name: 'dircops'
+user_name: 'Livinweb'
+date: '2026-02-09'
+documentsIncluded:
+  product_brief: 'product-brief-bmad-2026-02-09.md'
+  prd: 'prd.md'
+  architecture: 'architecture.md'
+  listing_ecrans_pages: 'listing-complet-ecrans-pages.md'
+  logique_paiements_echeanciers: 'logique-paiements-echeanciers.md'
+  cahier_recettes_livraison: 'cahier-recettes-livraison.md'
+  decisions_client_chiffrage: 'decisions-client-chiffrage.md'
+  grille_complexite_chiffrage: 'chiffrage-schema-et-grille.md'
+  schema_relationnel_et_tables: 'schema-relationnel-et-tables-donnees.md'
+  schema_workflows: 'schema-workflows.md'
+  questions_en_suspens: 'questions-en-suspens.md'
+  regles_metier_a_trancher: 'général et regles-metier-a-clarifier.md'
+  epics_stories: null
+  ux: null
+---
+
+# Rapport d’aptitude à l’implémentation — dirCops
+
+**Date:** 2026-02-09  
+**Projet / application :** dirCops (suivi facturation / échéancier / paiement — EMGI)
+
+## 1) Inventaire des documents (Step 1)
+
+**Product brief :** `product-brief-bmad-2026-02-09.md`  
+**PRD :** `prd.md`  
+**Architecture :** `architecture.md`  
+**Listing des écrans/pages (spéc UI) :** `listing-complet-ecrans-pages.md`  
+**Logique paiements/écheanciers :** `logique-paiements-echeanciers.md`  
+**Cahier de recette :** `cahier-recettes-livraison.md`  
+**Décisions client (chiffrage) :** `decisions-client-chiffrage.md`  
+**Chiffrage (schéma + grille) :** `chiffrage-schema-et-grille.md`  
+**Schéma relationnel & tables :** `schema-relationnel-et-tables-donnees.md`  
+**Workflows métier :** `schema-workflows.md`  
+**Règles métier à clarifier :** `général et regles-metier-a-clarifier.md`  
+**Questions en suspens :** `questions-en-suspens.md`  
+**Epics & Stories :** non trouvé  
+**UX design (wireframes/maquettes) :** non trouvé (le listing écran est une spéc UI textuelle, sans maquettes)
+
+Évaluation réalisée sur l’ensemble des documents disponibles ci-dessus.
+
+## 2) Analyse du PRD
+
+### 2.1 Exigences fonctionnelles
+
+Le PRD liste :
+- **13 FR “principales”** (FR1 → FR13)
+- **11 sous-FR** (CRUD + reporting) : FR2b–FR2c, FR3b–FR3d, FR4b, FR5b–FR5d, FR10b–FR10c
+
+**Total exigences fonctionnelles (PRD) :** 24 items (13 + 11)
+
+### 2.2 Exigences non fonctionnelles
+
+NFR1: Accès restreint à l'équipe commerciale autorisée uniquement  
+
+**Performance (web app) :** Temps de chargement initial < 3 s, temps de réponse aux interactions < 1 s  
+**Accessibilité :** WCAG A (usage interne)  
+**Navigateurs :** Chrome / Firefox / Edge (dernières 2 versions). Safari non prioritaire (support best-effort si besoin).  
+**Responsive :** desktop prioritaire, support tablette basique
+
+**Total NFRs :** 1 explicite (sécurité) + contraintes performance/accessibilité/navigateurs.
+
+### 2.3 Contraintes / périmètre
+
+- Contraintes : Budget ~20 k€, application interne, MPA, stack simple et maintenable.
+- Hors périmètre MVP : création/édition de factures (gérée par Pennylane), trésorerie complète, parcours dédiés trésorerie/direction.
+- Critères de succès mesurables : adoption par les commerciaux, fin de la dépendance à une seule personne, réduction des erreurs/incohérences.
+
+### 2.4 Évaluation de complétude
+
+Le PRD est globalement complet pour cadrer un MVP : exigences regroupées en 6 catégories, contraintes et hors-scope explicités, user journeys utiles. Les ambiguïtés restantes sont davantage des **décisions de règles métier** (exports, unicités, fréquences, etc.) que des trous majeurs de périmètre.
+
+## 3) Couverture “exigences → architecture”
+
+**Epics & Stories :** non trouvé. La validation de couverture via epics n’est donc pas possible.
+
+En revanche, l’architecture fournit un mapping “exigences → composants” (modules + pages + endpoints). À noter : la logique métier paiements/écheanciers est également détaillée dans `logique-paiements-echeanciers.md`, ce qui renforce la readiness sur cette partie.
+
+**Couverture (niveau FR principales) :** 13/13 couvertes (100 %) via les modules décrits.
+
+**Couverture (sous-FR CRUD/reporting du PRD) :** couverte “par conception” (endpoints CRUD et écrans prévus), mais nécessite de **valider quelques règles** (ex. contraintes d’unicité, champs obligatoires, formats export) avant finalisation.
+
+## 4) Alignement UX / écrans (Step 4)
+
+**Statut :** pas de wireframes/maquettes. En revanche, un document de spécification UI textuelle existe : `listing-complet-ecrans-pages.md`.
+
+**Alignement :** globalement cohérent avec le PRD et l’architecture (liste clients, fiche client, dashboard, top clients, quantités). Le listing ajoute une **page login** et des états UI (vides/erreur/chargement) utiles.
+
+**Authentification :** une décision “Login MODX Livinweb (id/mot de passe)” est mentionnée dans `decisions-client-chiffrage.md`. Il reste à préciser l’implémentation (intégration MODX, protection des pages/API, logout, environnements).
+
+## 5) Qualité des epics / stories (Step 5)
+
+**Document Epics & Stories :** non trouvé → revue non applicable.
+
+## 6) Synthèse, risques et recommandations
+
+### 6.1 Statut global de readiness
+
+**READY (avec décisions à cadrer)** — L’implémentation peut démarrer sur la base PRD + Architecture + specs UI + logique paiements/écheanciers. Les documents manquants (epics/stories, maquettes) ne bloquent pas un POC, mais certaines **décisions** doivent être prises rapidement pour éviter des retours arrière.
+
+### 6.2 Points critiques à trancher (avant “finir” le MVP)
+
+1. **Exports CSV** : séparateur/encodage/format date + colonnes exactes. Le cahier de recette attend un export “factures PJ” **calqué sur l’onglet Excel** (en-têtes/format FR) → à valider très tôt avec un export réel.
+2. **Hébergement / déploiement / sauvegardes** : à cadrer (impact planning et “definition of done”).
+3. **Règles métier structurantes** (cf. `général et regles-metier-a-clarifier.md`) :
+   - Unicité n° facture (globale vs par client)
+   - Champs facture obligatoires (impact reporting)
+   - Paiement > montant facture (autoriser vs bloquer)
+   - Date de paiement future (autoriser vs bloquer)
+   - Fréquence des échéances (mensuel uniquement vs paramétrable)
+4. **Authentification MODX** : déjà actée “côté chiffrage”, mais à détailler techniquement (mécanisme exact, endpoints, protections, environnements).
+
+### 6.3 Prochaines étapes recommandées
+
+1. **Atelier de décision (≈ 1h)** pour trancher les items 🔴/🟠 de `général et regles-metier-a-clarifier.md` + valider le format CSV (test sur Excel Windows FR si cible).
+2. **Démarrer l’implémentation socle** en suivant l’architecture (schéma SQL, config, endpoints CRUD, calcul encours).
+3. **Formaliser un backlog minimal** (epics/stories) pour sécuriser le planning et la recette (même si “light”).
+4. **Produire 4 wireframes rapides** (login, liste clients, fiche client, dashboard) pour sécuriser l’ergonomie et les états UI.
+
+### 6.4 Note finale
+
+Les exigences sont suffisamment cadrées pour démarrer. La couverture “exigences → architecture” est bonne (13/13 FR principales), et les sous-FR (CRUD/reporting) sont anticipées dans l’architecture + les specs d’écrans. Pour éviter les retours arrière, prioriser les décisions liées à l’authentification et aux exports.
+

+ 399 - 0
_bmad-output/planning-artifacts/listing-complet-ecrans-pages.md

@@ -0,0 +1,399 @@
+# Listing complet des écrans et pages
+
+**Application :** dirCops  
+**Projet :** Suivi facturation / échéancier / paiement (EMGI)  
+**Date :** 2026-02-09  
+**Usage :** Liste exhaustive de toutes les pages/écrans pour le chiffrage et la conception
+
+---
+
+## Vue d'ensemble
+
+**Type d'application :** Multi-Page Application (MPA)  
+**Architecture :** HTML + JS vanilla + Tailwind CSS + API REST PHP  
+**Nombre total de pages MVP complet :** 7 pages principales + 1 page login + états variés
+
+---
+
+## 1. Authentification
+
+### 1.1 Page de login
+
+**Fichier :** `login.html`  
+**Route :** `/login.html` ou `/` (si non authentifié)  
+**Objectif :** Authentification utilisateur via MODX Livinweb
+
+**Contenu :**
+- Formulaire login (identifiant + mot de passe)
+- Bouton "Se connecter"
+- Message d'erreur si échec
+- Redirection vers `/index.html` si succès
+
+**États :**
+- État nominal : formulaire vide
+- État en cours : bouton disabled, loader
+- État erreur : message "Identifiant ou mot de passe incorrect"
+- État succès : redirection automatique
+
+**Interactions :**
+- POST `/api/auth.php` (login)
+- Stockage session PHP
+- Redirection si déjà authentifié
+
+**Wireframe/Maquette :** Page simple centrée, logo EMGI, champs texte, bouton
+
+---
+
+## 2. Pages principales (après authentification)
+
+### 2.1 Liste des clients (accueil)
+
+**Fichier :** `index.html`  
+**Route :** `/` ou `/index.html`  
+**Objectif :** Liste et recherche des clients
+
+**Contenu :**
+- Barre de navigation (menu principal + bouton "Déconnexion")
+- Champ de recherche (nom client)
+- Liste des clients (nom, bouton "Voir détail")
+- Bouton "Ajouter un client" (formulaire modal ou nouvelle page)
+- Bouton "Supprimer" (confirmation)
+
+**États :**
+- État nominal : liste de tous les clients
+- État recherche : liste filtrée
+- État vide : message "Aucun client trouvé" + bouton "Ajouter un client"
+- État chargement : skeleton ou loader
+- État erreur : message "Erreur de chargement" + bouton "Réessayer"
+
+**Interactions :**
+- GET `/api/clients.php` (liste)
+- GET `/api/clients.php?q=nom` (recherche)
+- POST `/api/clients.php` (ajout client)
+- DELETE `/api/clients.php?id=` (suppression)
+- Clic client → navigation vers `/client.html?id=`
+
+**Formulaire "Ajouter un client" (modal ou section) :**
+- Champ : Nom du client (obligatoire)
+- Bouton "Enregistrer" + "Annuler"
+- Validation : nom non vide
+
+---
+
+### 2.2 Fiche client (détail)
+
+**Fichier :** `client.html`  
+**Route :** `/client.html?id={client_id}`  
+**Objectif :** Vue complète d'un client (factures, paiements, écheanciers, encours)
+
+**Contenu (page longue, plusieurs sections) :**
+
+#### En-tête client
+- Nom du client
+- Encours total (calculé dynamique)
+- Bouton "Retour à la liste"
+
+#### Section "Factures"
+- Tableau des factures :
+  - Colonnes : N° facture, N° vente, Date, Type produit, Cycle, Quantités, Qté livrée, Montant HT, Encours, État (Payé/En attente)
+  - Boutons par ligne : "Modifier", "Supprimer"
+- Bouton "Ajouter une facture" → formulaire
+
+**Formulaire "Ajouter/Modifier une facture" :**
+- Champs :
+  - N° facture (obligatoire)
+  - N° vente (optionnel)
+  - Date facture (obligatoire, date picker)
+  - Type produit (select : alevins, larves, vide)
+  - Cycle (texte libre, ex: 24-25, 25-26)
+  - Quantités facturées (nombre décimal)
+  - Quantité livrée (nombre décimal)
+  - Montant HT (obligatoire, nombre décimal, €)
+- Boutons : "Enregistrer", "Annuler"
+- Validation : champs obligatoires, montant > 0
+
+#### Section "Paiements"
+- Tableau des paiements :
+  - Colonnes : Date paiement, Montant, Facture associée, Bouton "Supprimer"
+- Bouton "Enregistrer un paiement" → formulaire
+
+**Formulaire "Enregistrer un paiement" :**
+- Champs :
+  - Facture (select : liste des factures du client avec n° et encours)
+  - Montant (obligatoire, nombre décimal, €)
+  - Date paiement (obligatoire, date picker)
+- Boutons : "Enregistrer", "Annuler"
+- Validation : facture sélectionnée, montant > 0, date valide
+
+#### Section "Écheanciers"
+- Tableau des écheanciers :
+  - Colonnes : Facture associée, Nb échéances, Date début, Montant par échéance, Bouton "Supprimer"
+  - (Optionnel) Détail échéances (dates calculées + montants)
+- Bouton "Ajouter un écheancier" → formulaire
+
+**Formulaire "Ajouter un écheancier" :**
+- Champs :
+  - Facture (select : factures avec encours > 0 et sans écheancier)
+  - Nombre d'échéances (obligatoire, entier > 0)
+  - Date de début (obligatoire, date picker)
+- Montant par échéance : calculé et affiché (encours / nb échéances)
+- Boutons : "Enregistrer", "Annuler"
+- Validation : facture éligible, nb échéances > 0, date valide
+
+**États :**
+- État nominal : sections remplies avec données
+- État vide (aucune facture) : message "Aucune facture pour ce client" + bouton "Ajouter une facture"
+- État vide (aucun paiement) : message "Aucun paiement enregistré"
+- État vide (aucun écheancier) : message "Aucun écheancier"
+- État chargement : skeleton
+- État erreur : message d'erreur + bouton "Réessayer"
+- État après action (ajout/modification/suppression) : rechargement de la page ou mise à jour dynamique + message succès
+
+**Interactions :**
+- GET `/api/clients.php?id=` (détail client)
+- GET `/api/factures.php?client_id=` (factures + encours)
+- GET `/api/paiements.php?client_id=` (paiements)
+- GET `/api/echeanciers.php?client_id=` (écheanciers)
+- GET `/api/calculs.php?client_id=` (encours client)
+- POST/PUT/DELETE `/api/factures.php`
+- POST/DELETE `/api/paiements.php`
+- POST/DELETE `/api/echeanciers.php`
+
+---
+
+### 2.3 Tableau de bord
+
+**Fichier :** `dashboard.html`  
+**Route :** `/dashboard.html`  
+**Objectif :** Vue synthétique des encours et échéances
+
+**Contenu :**
+
+#### Indicateurs en haut (cards)
+- Encours total (k€)
+- Délai moyen de paiement (jours) — optionnel MVP
+- Nombre de factures en attente
+
+#### Tableau "Encours par client"
+- Colonnes : Client, Encours (€), (Optionnel : Accord, J out, Situation)
+- Tri : par encours croissant (ou boutons tri)
+- Filtres : (optionnel) afficher uniquement encours > 0
+
+#### Tableau "Échéances à venir"
+- Colonnes : Client, N° facture, Date échéance, Montant échéance
+- Filtre : date ≥ aujourd'hui
+- Tri : par date croissante
+
+#### Boutons d'export
+- "Exporter encours CSV" → téléchargement `encours-clients-YYYY-MM-DD.csv`
+- "Exporter l'ensemble des factures (PJ)" → téléchargement `suivi-factures-YYYY-MM-DD.csv`
+
+**États :**
+- État nominal : données affichées
+- État vide (aucun encours) : message "Aucun encours en attente"
+- État vide (aucune échéance) : message "Aucune échéance à venir"
+- État chargement : skeleton
+- État erreur : message d'erreur
+
+**Interactions :**
+- GET `/api/reporting.php` (données tableau de bord)
+- GET `/api/reporting.php?format=csv` (export encours)
+- GET `/api/reporting.php?format=factures_csv` (export factures PJ)
+
+---
+
+### 2.4 Top clients
+
+**Fichier :** `top-clients.html`  
+**Route :** `/top-clients.html`  
+**Objectif :** Classement des clients par type de produit et cycle
+
+**Contenu :**
+
+#### Filtres en haut
+- Type de produit (select : Tous, Alevins, Larves)
+- Cycle (select : Tous, 24-25, 25-26, etc.)
+- Bouton "Filtrer" ou filtrage automatique
+
+#### Tableau "Top clients"
+- Colonnes : Client, Type, Cycle, Quantités facturées, CA HT (€), % Quantités, % CA
+- Tri : par quantités ou CA décroissant
+- (Optionnel) Limite Top 10/15 ou affichage complet selon décision client
+
+**États :**
+- État nominal : tableau avec données
+- État après filtre : tableau mis à jour
+- État vide (aucun résultat) : message "Aucun client pour ces critères"
+- État chargement : skeleton
+- État erreur : message d'erreur
+
+**Interactions :**
+- GET `/api/top-clients.php?type=&cycle=` (données filtrées)
+
+---
+
+### 2.5 Quantités par client
+
+**Fichier :** `quantites-clients.html`  
+**Route :** `/quantites-clients.html`  
+**Objectif :** Synthèse des quantités facturées et livrées par client
+
+**Contenu :**
+
+#### Filtre en haut
+- Type de produit (select : Tous, Alevins, Larves)
+- Bouton "Filtrer" ou filtrage automatique
+
+#### Tableau "Quantités par client"
+- Colonnes : Client, Type (si filtre "Tous"), Quantités facturées, Quantités livrées, Écart (qté facturée - qté livrée), % Livré
+- Tri : par client ou quantités
+
+**États :**
+- État nominal : tableau avec données
+- État après filtre : tableau mis à jour
+- État vide (aucun résultat) : message "Aucune donnée pour ces critères"
+- État chargement : skeleton
+- État erreur : message d'erreur
+
+**Interactions :**
+- GET `/api/quantites-clients.php?type=` (données filtrées)
+
+---
+
+## 3. Navigation / Menu principal
+
+**Présent sur toutes les pages après authentification :**
+
+**Menu horizontal (barre de navigation) :**
+- Logo / Titre : "dirCops"
+- Liens de navigation :
+  - "Clients" → `/index.html`
+  - "Tableau de bord" → `/dashboard.html`
+  - "Top clients" → `/top-clients.html`
+  - "Quantités" → `/quantites-clients.html`
+- Bouton "Déconnexion" (à droite) → POST `/api/auth.php?logout=1` → redirection `/login.html`
+
+---
+
+## 4. Pages d'erreur / états spéciaux
+
+### 4.1 Page 404 (non trouvé)
+
+**Fichier :** `404.html` (optionnel, ou gestion navigateur)  
+**Contenu :** Message "Page non trouvée" + lien "Retour à l'accueil"
+
+### 4.2 Page 403 (non autorisé)
+
+**Cas :** Tentative d'accès à une page sans authentification  
+**Comportement :** Redirection automatique vers `/login.html`
+
+### 4.3 Page erreur serveur (500)
+
+**Comportement :** Message "Erreur serveur, veuillez réessayer plus tard" + bouton "Retour"
+
+---
+
+## 5. Modals / Composants réutilisables
+
+### 5.1 Modal de confirmation (suppression)
+
+**Déclencheurs :** Suppression client, facture, paiement, écheancier
+
+**Contenu :**
+- Titre : "Confirmer la suppression"
+- Message : détail de ce qui sera supprimé (+ cascade si applicable)
+  - Ex : "Supprimer le client [Nom] ? Cela supprimera aussi toutes ses factures, paiements et écheanciers."
+- Boutons : "Confirmer" (rouge/danger), "Annuler"
+
+### 5.2 Toast / Message de succès
+
+**Déclencheurs :** Action réussie (ajout, modification, suppression)
+
+**Contenu :**
+- Message court : "Client ajouté avec succès", "Paiement enregistré", etc.
+- Fermeture automatique après 3-5 secondes ou bouton "×"
+- Couleur : vert (succès), rouge (erreur), orange (avertissement)
+
+### 5.3 Loader / Skeleton
+
+**Déclencheurs :** Chargement de données (GET API)
+
+**Contenu :**
+- Spinner ou skeleton screen (simulation structure du contenu)
+- Texte : "Chargement..." (optionnel)
+
+---
+
+## 6. Récapitulatif des pages
+
+| # | Page | Fichier | Route | Authentification requise |
+|---|------|---------|-------|--------------------------|
+| 1 | Login | `login.html` | `/login.html` | Non |
+| 2 | Liste clients | `index.html` | `/` ou `/index.html` | Oui |
+| 3 | Fiche client | `client.html` | `/client.html?id=` | Oui |
+| 4 | Tableau de bord | `dashboard.html` | `/dashboard.html` | Oui |
+| 5 | Top clients | `top-clients.html` | `/top-clients.html` | Oui |
+| 6 | Quantités clients | `quantites-clients.html` | `/quantites-clients.html` | Oui |
+| 7 | Page 404 | `404.html` | (erreur) | Non |
+
+**Total MVP complet :** 7 pages + navigation + modals
+
+---
+
+## 7. Variantes par package (selon options-reduction-perimetre-chiffrage.md)
+
+### Package A – MVP minimal
+
+**Pages incluses :**
+- Login (1)
+- Liste clients (2)
+- Fiche client (3) — version simplifiée : factures (lecture seule), paiements (ajout uniquement), pas d'écheanciers
+- Tableau de bord (4) — version simplifiée : encours par client, export CSV encours uniquement
+
+**Pages exclues :**
+- Top clients (5)
+- Quantités clients (6)
+
+**Total : 4 pages + navigation**
+
+### Package B – MVP sans écheancier ni pages reporting
+
+**Pages incluses :**
+- Login (1)
+- Liste clients (2) — avec ajout/suppression client
+- Fiche client (3) — factures (ajout/modification/suppression), paiements (ajout/suppression), pas d'écheanciers
+- Tableau de bord (4) — complet avec export
+
+**Pages exclues :**
+- Top clients (5)
+- Quantités clients (6)
+
+**Total : 4 pages + navigation**
+
+### Package C – MVP complet
+
+**Pages incluses :** Toutes (1-6) + navigation + modals
+
+**Total : 7 pages + navigation**
+
+---
+
+## 8. Wireframes / Maquettes recommandés
+
+**Priorité haute (à créer pour validation client) :**
+1. Page login
+2. Liste clients (états : vide, rempli, recherche)
+3. Fiche client (sections factures, paiements, écheanciers)
+4. Tableau de bord (encours, échéances)
+
+**Priorité moyenne :**
+5. Top clients (filtres + tableau)
+6. Quantités clients
+
+**Priorité basse :**
+7. Pages d'erreur (404, 500)
+8. Modals (confirmation, succès)
+
+---
+
+*Document de référence pour la conception et le développement. À compléter avec wireframes/maquettes si disponibles.*

+ 288 - 0
_bmad-output/planning-artifacts/logique-paiements-echeanciers.md

@@ -0,0 +1,288 @@
+# Logique paiements et écheanciers - Spécifications techniques
+
+**Application :** dirCops  
+**Date :** 2026-02-09  
+**Objectif :** Définir la logique métier et technique pour les paiements et écheanciers, inspirée des bonnes pratiques ERP tout en restant simple.
+
+---
+
+## 1. Principes généraux
+
+### 1.1 Source de vérité
+
+- **Facture** : montant HT fixe (ne change pas après création).
+- **Paiements** : liste des paiements enregistrés (un paiement = un enregistrement).
+- **Encours** : calculé à la volée = `montant_ht - SUM(paiements.montant)`.
+- **État facture** : dérivé de l'encours (`encours <= 0` → Payée, sinon → En attente).
+
+### 1.2 Règles métier
+
+1. **Un paiement est toujours positif** : `montant > 0`.
+2. **Un paiement est lié à une facture** : `facture_id` obligatoire.
+3. **L'encours ne peut pas être négatif** : si `SUM(paiements) > montant_ht`, l'encours = 0 (pas de crédit client géré).
+4. **Un écheancier = un plan de paiement** : une facture peut avoir au plus un écheancier.
+5. **Montant par échéance** : calculé au moment de la création de l'écheancier = `encours_actuel / nb_echeances`.
+
+---
+
+## 2. Calcul de l'encours
+
+### 2.1 Formule standardisée
+
+```sql
+encours_facture = GREATEST(0, montant_ht - COALESCE(SUM(paiements.montant), 0))
+```
+
+**Explication :**
+- `GREATEST(0, ...)` : garantit que l'encours ne soit jamais négatif.
+- `COALESCE(..., 0)` : si aucun paiement, somme = 0.
+- Arrondi à 2 décimales pour éviter les problèmes de précision.
+
+### 2.2 Encours par client
+
+```sql
+encours_client = SUM(encours_facture) pour toutes les factures du client
+```
+
+### 2.3 Cas limites gérés
+
+| Cas | Comportement |
+|-----|--------------|
+| Paiement supérieur au montant HT | Encours = 0 (pas de crédit) |
+| Plusieurs paiements partiels | Encours = montant_ht - somme des paiements |
+| Aucun paiement | Encours = montant_ht |
+| Arrondis décimaux | Utilisation de ROUND() pour éviter les écarts |
+
+---
+
+## 3. Écheancier de paiement
+
+### 3.1 Structure
+
+- **Une facture = un écheancier maximum** (contrainte d'unicité).
+- **Champs** : `facture_id`, `nb_echeances`, `date_debut_echeancier`, `montant_par_echeance` (calculé et stocké).
+
+### 3.2 Calcul du montant par échéance
+
+**Au moment de la création de l'écheancier :**
+```
+montant_par_echeance = ROUND(encours_actuel / nb_echeances, 2)
+```
+
+**Exemple :**
+- Facture : 1000 € HT
+- Paiements déjà reçus : 200 €
+- Encours actuel : 800 €
+- Nombre d'échéances : 3
+- Montant par échéance : 800 / 3 = 266.67 €
+
+### 3.3 Dates d'échéances (calculées, non stockées)
+
+Les dates sont calculées à l'affichage :
+- Échéance 1 : `date_debut_echeancier`
+- Échéance 2 : `date_debut_echeancier + 1 mois`
+- Échéance 3 : `date_debut_echeancier + 2 mois`
+- etc.
+
+**Fréquence :** mensuelle (toujours).
+
+### 3.4 Règles de création
+
+1. **Un écheancier ne peut être créé que si** :
+   - La facture existe.
+   - La facture n'a pas déjà d'écheancier.
+   - La facture a un encours > 0 (sinon pas besoin d'écheancier).
+
+2. **Le montant par échéance est calculé au moment de la création** :
+   - Basé sur l'encours actuel (montant_ht - paiements déjà reçus).
+   - Stocké dans `echeanciers.montant_par_echeance` pour éviter de recalculer.
+
+---
+
+## 4. Base de données
+
+### 4.1 Contraintes
+
+| Table | Contrainte | Détail |
+|-------|------------|--------|
+| `paiements` | `montant > 0` | Un paiement doit être positif |
+| `paiements` | `facture_id` FK | Référence facture obligatoire |
+| `echeanciers` | `facture_id` UNIQUE | Une facture = un écheancier max |
+| `echeanciers` | `nb_echeances > 0` | Au moins une échéance |
+| `echeanciers` | `montant_par_echeance > 0` | Montant positif |
+
+### 4.2 Index recommandés
+
+```sql
+CREATE INDEX idx_paiements_facture_id ON paiements(facture_id);
+CREATE INDEX idx_paiements_date ON paiements(date_paiement);
+CREATE UNIQUE INDEX idx_echeanciers_facture_id ON echeanciers(facture_id);
+```
+
+### 4.3 Champs ajoutés (amélioration)
+
+**Table `echeanciers` :**
+- `montant_par_echeance DECIMAL(12,2)` : montant calculé au moment de la création.
+
+---
+
+## 5. Logique applicative
+
+### 5.1 Enregistrement d'un paiement
+
+**Avant insertion :**
+1. Vérifier que la facture existe.
+2. Vérifier que `montant > 0`.
+3. Vérifier que `date_paiement` est valide.
+
+**Après insertion :**
+- L'encours est recalculé automatiquement lors des prochaines requêtes.
+- Pas de mise à jour explicite nécessaire (calcul à la volée).
+
+### 5.2 Création d'un écheancier
+
+**Avant insertion :**
+1. Vérifier que la facture existe.
+2. Vérifier que la facture n'a pas déjà d'écheancier.
+3. Calculer l'encours actuel de la facture.
+4. Vérifier que `encours > 0`.
+5. Calculer `montant_par_echeance = ROUND(encours / nb_echeances, 2)`.
+
+**Insertion :**
+```sql
+INSERT INTO echeanciers (facture_id, nb_echeances, date_debut_echeancier, montant_par_echeance)
+VALUES (?, ?, ?, ?)
+```
+
+### 5.3 Calcul de l'encours (fonction réutilisable)
+
+**En SQL :**
+```sql
+SELECT 
+    f.id,
+    f.montant_ht,
+    COALESCE(SUM(p.montant), 0) AS total_paye,
+    GREATEST(0, f.montant_ht - COALESCE(SUM(p.montant), 0)) AS encours_facture,
+    CASE 
+        WHEN GREATEST(0, f.montant_ht - COALESCE(SUM(p.montant), 0)) <= 0 THEN 'paye'
+        ELSE 'en_attente'
+    END AS etat
+FROM factures f
+LEFT JOIN paiements p ON p.facture_id = f.id
+WHERE f.id = ?
+GROUP BY f.id, f.montant_ht
+```
+
+**En PHP (mock) :**
+```php
+function calculerEncoursFacture($factureId, $factures, $paiements) {
+    $f = array_filter($factures, fn($x) => $x['id'] == $factureId)[0] ?? null;
+    if (!$f) return null;
+    
+    $totalPaye = array_sum(array_map(
+        fn($p) => (float)$p['montant'],
+        array_filter($paiements, fn($p) => $p['facture_id'] == $factureId)
+    ));
+    
+    $encours = max(0, (float)$f['montant_ht'] - $totalPaye);
+    return [
+        'montant_ht' => (float)$f['montant_ht'],
+        'total_paye' => $totalPaye,
+        'encours_facture' => $encours,
+        'etat' => $encours <= 0 ? 'paye' : 'en_attente'
+    ];
+}
+```
+
+---
+
+## 6. Cohérence des données
+
+### 6.1 Vérifications à faire
+
+| Vérification | Quand | Action si échec |
+|--------------|-------|------------------|
+| Facture existe | Avant paiement/écheancier | Erreur 404 |
+| Montant paiement > 0 | Avant insertion paiement | Erreur 400 |
+| Encours > 0 | Avant création écheancier | Erreur 400 "Facture déjà soldée" |
+| Pas d'écheancier existant | Avant création écheancier | Erreur 400 "Écheancier déjà existant" |
+
+### 6.2 Normalisation des montants
+
+- **Stockage** : `DECIMAL(12,2)` (2 décimales).
+- **Calculs** : utiliser `ROUND()` pour éviter les écarts.
+- **Comparaisons** : utiliser `<= 0.01` pour considérer comme nul (tolérance d'arrondi).
+
+---
+
+## 7. Échéances à venir (tableau de bord)
+
+Les « échéances à venir » affichées sur le tableau de bord sont calculées à partir des **écheanciers** lorsque la facture en possède un, sinon à partir de la date de facture.
+
+### 7.1 Règles de calcul
+
+- **Facture avec écheancier :** pour chaque échéance prévue (i = 0 à nb_echeances − 1), on crée une ligne avec :
+  - **date_echeance** = `date_debut_echeancier + i mois`
+  - **montant_echeance** = `montant_par_echeance` (stocké dans l’écheancier)
+  - Seules les échéances dont la date est **≥ aujourd’hui** sont conservées (échéances à venir).
+- **Facture sans écheancier :** une seule ligne avec **date_echeance** = date de facture, **montant_echeance** = encours de la facture (si date_facture ≥ aujourd’hui).
+
+### 7.2 Tri et affichage
+
+- Les lignes sont triées par **date_echeance** croissante.
+- L’affichage peut indiquer le numéro d’échéance (ex. « Éch. 1/3 ») pour les factures avec écheancier.
+
+---
+
+## 8. Exemples de requêtes SQL
+
+### 8.1 Liste des factures avec encours
+
+```sql
+SELECT 
+    f.*,
+    COALESCE(SUM(p.montant), 0) AS total_paye,
+    GREATEST(0, f.montant_ht - COALESCE(SUM(p.montant), 0)) AS encours_facture,
+    CASE 
+        WHEN GREATEST(0, f.montant_ht - COALESCE(SUM(p.montant), 0)) <= 0 THEN 'paye'
+        ELSE 'en_attente'
+    END AS etat
+FROM factures f
+LEFT JOIN paiements p ON p.facture_id = f.id
+WHERE f.client_id = ?
+GROUP BY f.id
+ORDER BY f.date_facture DESC
+```
+
+### 8.2 Encours par client
+
+```sql
+SELECT 
+    c.id AS client_id,
+    c.nom,
+    COALESCE(SUM(GREATEST(0, f.montant_ht - COALESCE(sp.total_paye, 0))), 0) AS encours
+FROM clients c
+LEFT JOIN factures f ON f.client_id = c.id
+LEFT JOIN (
+    SELECT facture_id, SUM(montant) AS total_paye
+    FROM paiements
+    GROUP BY facture_id
+) sp ON sp.facture_id = f.id
+GROUP BY c.id, c.nom
+HAVING encours > 0
+ORDER BY encours ASC
+```
+
+---
+
+## 9. Évolutions possibles (post-MVP)
+
+- **Rapprochement paiements/échéances** : lier un paiement à une échéance spécifique.
+- **Statut par échéance** : à venir / payée / partielle / en retard.
+- **Gestion des crédits** : permettre encours négatif (avoir client).
+- **Modification/suppression paiements** : avec historique.
+- **Échéances non mensuelles** : trimestrielles, annuelles, etc.
+
+---
+
+*Document de référence pour l'implémentation. À mettre à jour si la logique métier évolue.*

+ 33 - 0
_bmad-output/planning-artifacts/pdfGenerator/README-PDF.md

@@ -0,0 +1,33 @@
+# Génération PDF — planning-artifacts
+
+Génère les PDF individuels et le **PDF complet** regroupant tous les artefacts de planification BMAD.
+
+## Prérequis
+
+- **Node.js** (v14+)
+
+## Utilisation
+
+```bash
+cd pdfGenerator
+npm install
+npm run build
+```
+
+Ou étape par étape :
+- `npm run pdf` — convertit les `.md` du dossier parent en PDF (dans `pdf/`)
+- `npm run merge` — fusionne tous les PDF en **`planning-artifacts-complet.pdf`** (à la racine de planning-artifacts)
+
+## Fichiers
+
+| Fichier | Rôle |
+|---------|------|
+| `generate-pdfs.js` | Conversion Markdown → PDF (blocs Mermaid convertis en SVG) |
+| `merge-pdfs.js` | Fusion des PDF selon `merge-order.json` |
+| `merge-order.json` | Ordre des documents dans le PDF complet |
+| `pdf-style.css` | Styles (titres, tableaux, marges) |
+| `build-all.bat` | Script Windows : install + pdf + merge |
+
+## Modifier l'ordre
+
+Éditez `merge-order.json` : le tableau `order` contient les noms des fichiers (sans `.md`).

+ 38 - 0
_bmad-output/planning-artifacts/pdfGenerator/build-all.bat

@@ -0,0 +1,38 @@
+@echo off
+chcp 65001 >nul
+cd /d "%~dp0"
+
+echo.
+echo ============================================
+echo   PDF Generator - Generation complete
+echo ============================================
+echo.
+
+echo [1/3] Installation des dependances...
+call npm install
+if errorlevel 1 (
+    echo ERREUR: npm install a echoue
+    exit /b 1
+)
+
+echo.
+echo [2/3] Generation des PDF (Markdown -^> pdf/)...
+call npm run pdf
+if errorlevel 1 (
+    echo ERREUR: generation des PDF a echoue
+    exit /b 1
+)
+
+echo.
+echo [3/3] Fusion des PDF dans planning-artifacts-complet.pdf...
+call npm run merge
+if errorlevel 1 (
+    echo ERREUR: fusion des PDF a echoue
+    exit /b 1
+)
+
+echo.
+echo ============================================
+echo   Termine : planning-artifacts-complet.pdf
+echo ============================================
+echo.

+ 131 - 0
_bmad-output/planning-artifacts/pdfGenerator/generate-pdfs.js

@@ -0,0 +1,131 @@
+/**
+ * Génère des PDF à partir des fichiers .md du dossier planning-artifacts (parent).
+ * Les blocs ```mermaid sont convertis en SVG puis insérés comme images pour apparaître dans le PDF.
+ * Usage : node generate-pdfs.js  (depuis pdfGenerator)
+ * Prérequis : npm install (dans ce dossier)
+ */
+
+const fs = require('fs');
+const path = require('path');
+
+const dir = __dirname;
+const sourceDir = path.join(dir, '..');
+const pdfDir = path.join(dir, 'pdf');
+const cssPath = path.join(dir, 'pdf-style.css');
+
+/** Extrait les blocs ```mermaid ... ``` et les remplace par des images SVG (générées via Puppeteer). */
+async function preprocessMermaidToSvg(mdContent, sourceDirPath, baseName) {
+  const regex = /```mermaid\n([\s\S]*?)```/g;
+  const blocks = [];
+  let match;
+  while ((match = regex.exec(mdContent)) !== null) {
+    blocks.push({ full: match[0], code: match[1].trim(), index: match.index });
+  }
+  if (blocks.length === 0) return mdContent;
+
+  let puppeteer;
+  try {
+    puppeteer = require('puppeteer');
+  } catch (e) {
+    console.warn('  (Puppeteer non disponible pour Mermaid : les blocs restent en code)');
+    return mdContent;
+  }
+
+  const browser = await puppeteer.launch({ headless: 'new' });
+  try {
+    const replacements = [];
+    for (let i = 0; i < blocks.length; i++) {
+      const { code } = blocks[i];
+      const page = await browser.newPage();
+      const safeCode = code.replace(/<\/script>/gi, '</scr\' + \'ipt>');
+      await page.setContent(
+        `<!DOCTYPE html><html><body><script type="text/mermaid">${safeCode}</script>
+<script src="https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.min.js"></script>
+<script>mermaid.initialize({startOnLoad:true});</script></body></html>`,
+        { waitUntil: 'networkidle0', timeout: 15000 }
+      );
+      await page.waitForSelector('svg', { timeout: 10000 }).catch(() => null);
+      await new Promise((r) => setTimeout(r, 300));
+      const svg = await page.evaluate(() => {
+        const el = document.querySelector('body svg');
+        return el ? el.outerHTML : '';
+      });
+      await page.close();
+      if (svg) {
+        const svgFile = path.join(sourceDirPath, `${baseName}-mermaid-${i + 1}.svg`);
+        fs.writeFileSync(svgFile, svg, 'utf8');
+        replacements.push({ full: blocks[i].full, img: `\n![Diagramme workflow](${path.basename(svgFile)})\n` });
+      }
+    }
+    await browser.close();
+    let out = mdContent;
+    for (const r of replacements.reverse()) out = out.replace(r.full, r.img);
+    return out;
+  } catch (err) {
+    await browser.close().catch(() => {});
+    console.warn('  (Mermaid preprocess erreur:', err.message, ')');
+    return mdContent;
+  }
+}
+
+async function main() {
+  let mdToPdf;
+  try {
+    ({ mdToPdf } = require('md-to-pdf'));
+  } catch (e) {
+    console.error('Erreur : installez les dépendances avec : npm install');
+    process.exit(1);
+  }
+
+  if (!fs.existsSync(sourceDir)) {
+    console.error('Dossier source introuvable :', sourceDir);
+    process.exit(1);
+  }
+
+  const files = fs.readdirSync(sourceDir).filter(
+    (f) => f.endsWith('.md') && !/^README(-.*)?\.md$/i.test(f)
+  );
+  if (!fs.existsSync(pdfDir)) {
+    fs.mkdirSync(pdfDir, { recursive: true });
+  }
+
+  const hasNonAscii = (s) => /[^\x00-\x7F]/.test(s);
+
+  const baseConfig = {
+    pdf_options: {
+      format: 'A4',
+      margin: '20mm',
+      printBackground: true,
+    },
+    stylesheet: fs.existsSync(cssPath) ? cssPath : undefined,
+    body_class: 'markdown-body',
+    basedir: sourceDir,
+  };
+
+  console.log('Conversion des fichiers Markdown -> PDF...\n');
+  console.log('  Source :', sourceDir);
+  console.log('  Sortie :', pdfDir, '\n');
+
+  for (const file of files) {
+    const mdPath = path.join(sourceDir, file);
+    const base = path.basename(file, '.md');
+    const pdfPath = path.join(pdfDir, base + '.pdf');
+    let content = fs.readFileSync(mdPath, 'utf8');
+    const hadMermaid = /```mermaid/.test(content);
+    if (hadMermaid) {
+      content = await preprocessMermaidToSvg(content, sourceDir, base);
+    }
+    const input = hasNonAscii(file) || hadMermaid ? { content } : { path: mdPath };
+    try {
+      await mdToPdf(input, { ...baseConfig, basedir: sourceDir, dest: pdfPath });
+      console.log('  OK :', file, '-> pdf/' + base + '.pdf');
+    } catch (err) {
+      console.error('  ERREUR pour', file, ':', err.message);
+    }
+  }
+
+  console.log('\nTerminé. PDF dans : pdfGenerator/pdf/');
+  console.log('Puis lancez : npm run merge  pour générer le PDF complet.');
+}
+
+main();

+ 19 - 0
_bmad-output/planning-artifacts/pdfGenerator/merge-order.json

@@ -0,0 +1,19 @@
+{
+  "description": "Ordre des PDF selon la logique BMAD (1-analysis → 2-plan → 3-solutioning → 4-implementation)",
+  "order": [
+    "product-brief-bmad-2026-02-09",
+    "synthèse-projet-lecture-client",
+    "prd",
+    "architecture",
+    "schema-relationnel-et-tables-donnees",
+    "schema-workflows",
+    "chiffrage-schema-et-grille",
+    "général et regles-metier-a-clarifier",
+    "decisions-client-chiffrage",
+    "logique-paiements-echeanciers",
+    "cahier-recettes-livraison",
+    "implementation-readiness-report-2026-02-09",
+    "listing-complet-ecrans-pages",
+    "questions-en-suspens"
+  ]
+}

+ 71 - 0
_bmad-output/planning-artifacts/pdfGenerator/merge-pdfs.js

@@ -0,0 +1,71 @@
+/**
+ * Fusionne tous les PDF du dossier pdf/ en un seul document,
+ * dans l'ordre défini par merge-order.json (logique BMAD).
+ * Usage : node merge-pdfs.js  (depuis pdfGenerator)
+ * Prérequis : npm install (pdf-lib)
+ */
+
+const fs = require('fs');
+const path = require('path');
+const { PDFDocument } = require('pdf-lib');
+
+const dir = __dirname;
+const pdfDir = path.join(dir, 'pdf');
+const orderPath = path.join(dir, 'merge-order.json');
+const outputPath = path.join(dir, '..', 'planning-artifacts-complet.pdf');
+
+async function main() {
+  let order;
+  try {
+    order = JSON.parse(fs.readFileSync(orderPath, 'utf8')).order;
+  } catch (e) {
+    console.error('Erreur : fichier merge-order.json introuvable ou invalide.');
+    process.exit(1);
+  }
+
+  if (!fs.existsSync(pdfDir)) {
+    console.error('Erreur : le dossier pdf/ n\'existe pas. Lancez d\'abord : npm run pdf');
+    process.exit(1);
+  }
+
+  const mergedPdf = await PDFDocument.create();
+  let added = 0;
+  const missing = [];
+
+  for (const base of order) {
+    const pdfPath = path.join(pdfDir, base + '.pdf');
+    if (!fs.existsSync(pdfPath)) {
+      missing.push(base + '.pdf');
+      continue;
+    }
+    try {
+      const bytes = fs.readFileSync(pdfPath);
+      const doc = await PDFDocument.load(bytes);
+      const indices = doc.getPageIndices();
+      const copied = await mergedPdf.copyPages(doc, indices);
+      copied.forEach((p) => mergedPdf.addPage(p));
+      added += indices.length;
+      console.log('  +', base + '.pdf', `(${indices.length} page(s))`);
+    } catch (err) {
+      console.error('  ERREUR', base + '.pdf', ':', err.message);
+    }
+  }
+
+  if (added === 0) {
+    console.error('Aucun PDF fusionné. Vérifiez que pdf/ contient des fichiers.');
+    process.exit(1);
+  }
+
+  const outBytes = await mergedPdf.save();
+  fs.writeFileSync(outputPath, outBytes);
+
+  console.log('\nTerminé :', added, 'pages → planning-artifacts-complet.pdf');
+  if (missing.length) {
+    console.log('Non inclus (fichier absent) :', missing.join(', '));
+  }
+}
+
+main().catch((err) => {
+  console.error(err);
+  process.exit(1);
+});

+ 2542 - 0
_bmad-output/planning-artifacts/pdfGenerator/package-lock.json

@@ -0,0 +1,2542 @@
+{
+  "name": "pdfGenerator",
+  "version": "1.0.0",
+  "lockfileVersion": 3,
+  "requires": true,
+  "packages": {
+    "": {
+      "name": "pdfGenerator",
+      "version": "1.0.0",
+      "devDependencies": {
+        "md-to-pdf": "^5.2.4",
+        "pdf-lib": "^1.17.1"
+      }
+    },
+    "node_modules/@babel/code-frame": {
+      "version": "7.29.0",
+      "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.0.tgz",
+      "integrity": "sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "@babel/helper-validator-identifier": "^7.28.5",
+        "js-tokens": "^4.0.0",
+        "picocolors": "^1.1.1"
+      },
+      "engines": {
+        "node": ">=6.9.0"
+      }
+    },
+    "node_modules/@babel/helper-validator-identifier": {
+      "version": "7.28.5",
+      "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz",
+      "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=6.9.0"
+      }
+    },
+    "node_modules/@pdf-lib/standard-fonts": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/@pdf-lib/standard-fonts/-/standard-fonts-1.0.0.tgz",
+      "integrity": "sha512-hU30BK9IUN/su0Mn9VdlVKsWBS6GyhVfqjwl1FjZN4TxP6cCw0jP2w7V3Hf5uX7M0AZJ16vey9yE0ny7Sa59ZA==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "pako": "^1.0.6"
+      }
+    },
+    "node_modules/@pdf-lib/upng": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/@pdf-lib/upng/-/upng-1.0.1.tgz",
+      "integrity": "sha512-dQK2FUMQtowVP00mtIksrlZhdFXQZPC+taih1q4CvPZ5vqdxR/LKBaFg0oAfzd1GlHZXXSPdQfzQnt+ViGvEIQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "pako": "^1.0.10"
+      }
+    },
+    "node_modules/@puppeteer/browsers": {
+      "version": "2.12.0",
+      "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-2.12.0.tgz",
+      "integrity": "sha512-Xuq42yxcQJ54ti8ZHNzF5snFvtpgXzNToJ1bXUGQRaiO8t+B6UM8sTUJfvV+AJnqtkJU/7hdy6nbKyA12aHtRw==",
+      "dev": true,
+      "license": "Apache-2.0",
+      "dependencies": {
+        "debug": "^4.4.3",
+        "extract-zip": "^2.0.1",
+        "progress": "^2.0.3",
+        "proxy-agent": "^6.5.0",
+        "semver": "^7.7.3",
+        "tar-fs": "^3.1.1",
+        "yargs": "^17.7.2"
+      },
+      "bin": {
+        "browsers": "lib/cjs/main-cli.js"
+      },
+      "engines": {
+        "node": ">=18"
+      }
+    },
+    "node_modules/@samverschueren/stream-to-observable": {
+      "version": "0.3.1",
+      "resolved": "https://registry.npmjs.org/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.1.tgz",
+      "integrity": "sha512-c/qwwcHyafOQuVQJj0IlBjf5yYgBI7YPJ77k4fOJYesb41jio65eaJODRUmfYKhTOFBrIZ66kgvGPlNbjuoRdQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "any-observable": "^0.3.0"
+      },
+      "engines": {
+        "node": ">=6"
+      },
+      "peerDependenciesMeta": {
+        "rxjs": {
+          "optional": true
+        },
+        "zen-observable": {
+          "optional": true
+        }
+      }
+    },
+    "node_modules/@tootallnate/quickjs-emscripten": {
+      "version": "0.23.0",
+      "resolved": "https://registry.npmjs.org/@tootallnate/quickjs-emscripten/-/quickjs-emscripten-0.23.0.tgz",
+      "integrity": "sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA==",
+      "dev": true,
+      "license": "MIT"
+    },
+    "node_modules/@types/node": {
+      "version": "25.2.2",
+      "resolved": "https://registry.npmjs.org/@types/node/-/node-25.2.2.tgz",
+      "integrity": "sha512-BkmoP5/FhRYek5izySdkOneRyXYN35I860MFAGupTdebyE66uZaR+bXLHq8k4DirE5DwQi3NuhvRU1jqTVwUrQ==",
+      "dev": true,
+      "license": "MIT",
+      "optional": true,
+      "dependencies": {
+        "undici-types": "~7.16.0"
+      }
+    },
+    "node_modules/@types/yauzl": {
+      "version": "2.10.3",
+      "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.3.tgz",
+      "integrity": "sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==",
+      "dev": true,
+      "license": "MIT",
+      "optional": true,
+      "dependencies": {
+        "@types/node": "*"
+      }
+    },
+    "node_modules/agent-base": {
+      "version": "7.1.4",
+      "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz",
+      "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">= 14"
+      }
+    },
+    "node_modules/ansi-escapes": {
+      "version": "3.2.0",
+      "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz",
+      "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/ansi-regex": {
+      "version": "2.1.1",
+      "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
+      "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/ansi-styles": {
+      "version": "4.3.0",
+      "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+      "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "color-convert": "^2.0.1"
+      },
+      "engines": {
+        "node": ">=8"
+      },
+      "funding": {
+        "url": "https://github.com/chalk/ansi-styles?sponsor=1"
+      }
+    },
+    "node_modules/any-observable": {
+      "version": "0.3.0",
+      "resolved": "https://registry.npmjs.org/any-observable/-/any-observable-0.3.0.tgz",
+      "integrity": "sha512-/FQM1EDkTsf63Ub2C6O7GuYFDsSXUwsaZDurV0np41ocwq0jthUAYCmhBX9f+KwlaCgIuWyr/4WlUQUBfKfZog==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/anymatch": {
+      "version": "3.1.3",
+      "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz",
+      "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==",
+      "dev": true,
+      "license": "ISC",
+      "dependencies": {
+        "normalize-path": "^3.0.0",
+        "picomatch": "^2.0.4"
+      },
+      "engines": {
+        "node": ">= 8"
+      }
+    },
+    "node_modules/arg": {
+      "version": "5.0.2",
+      "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz",
+      "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==",
+      "dev": true,
+      "license": "MIT"
+    },
+    "node_modules/argparse": {
+      "version": "1.0.10",
+      "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
+      "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "sprintf-js": "~1.0.2"
+      }
+    },
+    "node_modules/ast-types": {
+      "version": "0.13.4",
+      "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.13.4.tgz",
+      "integrity": "sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "tslib": "^2.0.1"
+      },
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/b4a": {
+      "version": "1.7.3",
+      "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.7.3.tgz",
+      "integrity": "sha512-5Q2mfq2WfGuFp3uS//0s6baOJLMoVduPYVeNmDYxu5OUA1/cBfvr2RIS7vi62LdNj/urk1hfmj867I3qt6uZ7Q==",
+      "dev": true,
+      "license": "Apache-2.0",
+      "peerDependencies": {
+        "react-native-b4a": "*"
+      },
+      "peerDependenciesMeta": {
+        "react-native-b4a": {
+          "optional": true
+        }
+      }
+    },
+    "node_modules/balanced-match": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
+      "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
+      "dev": true,
+      "license": "MIT"
+    },
+    "node_modules/bare-events": {
+      "version": "2.8.2",
+      "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.8.2.tgz",
+      "integrity": "sha512-riJjyv1/mHLIPX4RwiK+oW9/4c3TEUeORHKefKAKnZ5kyslbN+HXowtbaVEqt4IMUB7OXlfixcs6gsFeo/jhiQ==",
+      "dev": true,
+      "license": "Apache-2.0",
+      "peerDependencies": {
+        "bare-abort-controller": "*"
+      },
+      "peerDependenciesMeta": {
+        "bare-abort-controller": {
+          "optional": true
+        }
+      }
+    },
+    "node_modules/bare-fs": {
+      "version": "4.5.3",
+      "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-4.5.3.tgz",
+      "integrity": "sha512-9+kwVx8QYvt3hPWnmb19tPnh38c6Nihz8Lx3t0g9+4GoIf3/fTgYwM4Z6NxgI+B9elLQA7mLE9PpqcWtOMRDiQ==",
+      "dev": true,
+      "license": "Apache-2.0",
+      "optional": true,
+      "dependencies": {
+        "bare-events": "^2.5.4",
+        "bare-path": "^3.0.0",
+        "bare-stream": "^2.6.4",
+        "bare-url": "^2.2.2",
+        "fast-fifo": "^1.3.2"
+      },
+      "engines": {
+        "bare": ">=1.16.0"
+      },
+      "peerDependencies": {
+        "bare-buffer": "*"
+      },
+      "peerDependenciesMeta": {
+        "bare-buffer": {
+          "optional": true
+        }
+      }
+    },
+    "node_modules/bare-os": {
+      "version": "3.6.2",
+      "resolved": "https://registry.npmjs.org/bare-os/-/bare-os-3.6.2.tgz",
+      "integrity": "sha512-T+V1+1srU2qYNBmJCXZkUY5vQ0B4FSlL3QDROnKQYOqeiQR8UbjNHlPa+TIbM4cuidiN9GaTaOZgSEgsvPbh5A==",
+      "dev": true,
+      "license": "Apache-2.0",
+      "optional": true,
+      "engines": {
+        "bare": ">=1.14.0"
+      }
+    },
+    "node_modules/bare-path": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/bare-path/-/bare-path-3.0.0.tgz",
+      "integrity": "sha512-tyfW2cQcB5NN8Saijrhqn0Zh7AnFNsnczRcuWODH0eYAXBsJ5gVxAUuNr7tsHSC6IZ77cA0SitzT+s47kot8Mw==",
+      "dev": true,
+      "license": "Apache-2.0",
+      "optional": true,
+      "dependencies": {
+        "bare-os": "^3.0.1"
+      }
+    },
+    "node_modules/bare-stream": {
+      "version": "2.7.0",
+      "resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.7.0.tgz",
+      "integrity": "sha512-oyXQNicV1y8nc2aKffH+BUHFRXmx6VrPzlnaEvMhram0nPBrKcEdcyBg5r08D0i8VxngHFAiVyn1QKXpSG0B8A==",
+      "dev": true,
+      "license": "Apache-2.0",
+      "optional": true,
+      "dependencies": {
+        "streamx": "^2.21.0"
+      },
+      "peerDependencies": {
+        "bare-buffer": "*",
+        "bare-events": "*"
+      },
+      "peerDependenciesMeta": {
+        "bare-buffer": {
+          "optional": true
+        },
+        "bare-events": {
+          "optional": true
+        }
+      }
+    },
+    "node_modules/bare-url": {
+      "version": "2.3.2",
+      "resolved": "https://registry.npmjs.org/bare-url/-/bare-url-2.3.2.tgz",
+      "integrity": "sha512-ZMq4gd9ngV5aTMa5p9+UfY0b3skwhHELaDkhEHetMdX0LRkW9kzaym4oo/Eh+Ghm0CCDuMTsRIGM/ytUc1ZYmw==",
+      "dev": true,
+      "license": "Apache-2.0",
+      "optional": true,
+      "dependencies": {
+        "bare-path": "^3.0.0"
+      }
+    },
+    "node_modules/basic-ftp": {
+      "version": "5.1.0",
+      "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.1.0.tgz",
+      "integrity": "sha512-RkaJzeJKDbaDWTIPiJwubyljaEPwpVWkm9Rt5h9Nd6h7tEXTJ3VB4qxdZBioV7JO5yLUaOKwz7vDOzlncUsegw==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=10.0.0"
+      }
+    },
+    "node_modules/binary-extensions": {
+      "version": "2.3.0",
+      "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz",
+      "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=8"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/sindresorhus"
+      }
+    },
+    "node_modules/brace-expansion": {
+      "version": "1.1.12",
+      "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz",
+      "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "balanced-match": "^1.0.0",
+        "concat-map": "0.0.1"
+      }
+    },
+    "node_modules/braces": {
+      "version": "3.0.3",
+      "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
+      "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "fill-range": "^7.1.1"
+      },
+      "engines": {
+        "node": ">=8"
+      }
+    },
+    "node_modules/buffer-crc32": {
+      "version": "0.2.13",
+      "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz",
+      "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": "*"
+      }
+    },
+    "node_modules/bytes": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz",
+      "integrity": "sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">= 0.8"
+      }
+    },
+    "node_modules/callsites": {
+      "version": "3.1.0",
+      "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
+      "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/chalk": {
+      "version": "4.1.2",
+      "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+      "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "ansi-styles": "^4.1.0",
+        "supports-color": "^7.1.0"
+      },
+      "engines": {
+        "node": ">=10"
+      },
+      "funding": {
+        "url": "https://github.com/chalk/chalk?sponsor=1"
+      }
+    },
+    "node_modules/chokidar": {
+      "version": "3.6.0",
+      "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz",
+      "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "anymatch": "~3.1.2",
+        "braces": "~3.0.2",
+        "glob-parent": "~5.1.2",
+        "is-binary-path": "~2.1.0",
+        "is-glob": "~4.0.1",
+        "normalize-path": "~3.0.0",
+        "readdirp": "~3.6.0"
+      },
+      "engines": {
+        "node": ">= 8.10.0"
+      },
+      "funding": {
+        "url": "https://paulmillr.com/funding/"
+      },
+      "optionalDependencies": {
+        "fsevents": "~2.3.2"
+      }
+    },
+    "node_modules/chromium-bidi": {
+      "version": "13.1.1",
+      "resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-13.1.1.tgz",
+      "integrity": "sha512-zB9MpoPd7VJwjowQqiW3FKOvQwffFMjQ8Iejp5ZW+sJaKLRhZX1sTxzl3Zt22TDB4zP0OOqs8lRoY7eAW5geyQ==",
+      "dev": true,
+      "license": "Apache-2.0",
+      "dependencies": {
+        "mitt": "^3.0.1",
+        "zod": "^3.24.1"
+      },
+      "peerDependencies": {
+        "devtools-protocol": "*"
+      }
+    },
+    "node_modules/cli-cursor": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz",
+      "integrity": "sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "restore-cursor": "^2.0.0"
+      },
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/cli-truncate": {
+      "version": "0.2.1",
+      "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-0.2.1.tgz",
+      "integrity": "sha512-f4r4yJnbT++qUPI9NR4XLDLq41gQ+uqnPItWG0F5ZkehuNiTTa3EY0S4AqTSUOeJ7/zU41oWPQSNkW5BqPL9bg==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "slice-ansi": "0.0.4",
+        "string-width": "^1.0.1"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/cliui": {
+      "version": "8.0.1",
+      "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz",
+      "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==",
+      "dev": true,
+      "license": "ISC",
+      "dependencies": {
+        "string-width": "^4.2.0",
+        "strip-ansi": "^6.0.1",
+        "wrap-ansi": "^7.0.0"
+      },
+      "engines": {
+        "node": ">=12"
+      }
+    },
+    "node_modules/cliui/node_modules/ansi-regex": {
+      "version": "5.0.1",
+      "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
+      "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=8"
+      }
+    },
+    "node_modules/cliui/node_modules/is-fullwidth-code-point": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
+      "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=8"
+      }
+    },
+    "node_modules/cliui/node_modules/string-width": {
+      "version": "4.2.3",
+      "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
+      "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "emoji-regex": "^8.0.0",
+        "is-fullwidth-code-point": "^3.0.0",
+        "strip-ansi": "^6.0.1"
+      },
+      "engines": {
+        "node": ">=8"
+      }
+    },
+    "node_modules/cliui/node_modules/strip-ansi": {
+      "version": "6.0.1",
+      "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
+      "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "ansi-regex": "^5.0.1"
+      },
+      "engines": {
+        "node": ">=8"
+      }
+    },
+    "node_modules/cliui/node_modules/wrap-ansi": {
+      "version": "7.0.0",
+      "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
+      "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "ansi-styles": "^4.0.0",
+        "string-width": "^4.1.0",
+        "strip-ansi": "^6.0.0"
+      },
+      "engines": {
+        "node": ">=10"
+      },
+      "funding": {
+        "url": "https://github.com/chalk/wrap-ansi?sponsor=1"
+      }
+    },
+    "node_modules/code-point-at": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
+      "integrity": "sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/color-convert": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+      "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "color-name": "~1.1.4"
+      },
+      "engines": {
+        "node": ">=7.0.0"
+      }
+    },
+    "node_modules/color-name": {
+      "version": "1.1.4",
+      "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+      "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+      "dev": true,
+      "license": "MIT"
+    },
+    "node_modules/concat-map": {
+      "version": "0.0.1",
+      "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
+      "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",
+      "dev": true,
+      "license": "MIT"
+    },
+    "node_modules/content-disposition": {
+      "version": "0.5.2",
+      "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz",
+      "integrity": "sha512-kRGRZw3bLlFISDBgwTSA1TMBFN6J6GWDeubmDE3AF+3+yXL8hTWv8r5rkLbqYXY4RjPk/EzHnClI3zQf1cFmHA==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">= 0.6"
+      }
+    },
+    "node_modules/cosmiconfig": {
+      "version": "9.0.0",
+      "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-9.0.0.tgz",
+      "integrity": "sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "env-paths": "^2.2.1",
+        "import-fresh": "^3.3.0",
+        "js-yaml": "^4.1.0",
+        "parse-json": "^5.2.0"
+      },
+      "engines": {
+        "node": ">=14"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/d-fischer"
+      },
+      "peerDependencies": {
+        "typescript": ">=4.9.5"
+      },
+      "peerDependenciesMeta": {
+        "typescript": {
+          "optional": true
+        }
+      }
+    },
+    "node_modules/cosmiconfig/node_modules/argparse": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
+      "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
+      "dev": true,
+      "license": "Python-2.0"
+    },
+    "node_modules/cosmiconfig/node_modules/js-yaml": {
+      "version": "4.1.1",
+      "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz",
+      "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "argparse": "^2.0.1"
+      },
+      "bin": {
+        "js-yaml": "bin/js-yaml.js"
+      }
+    },
+    "node_modules/data-uri-to-buffer": {
+      "version": "6.0.2",
+      "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-6.0.2.tgz",
+      "integrity": "sha512-7hvf7/GW8e86rW0ptuwS3OcBGDjIi6SZva7hCyWC0yYry2cOPmLIjXAUHI6DK2HsnwJd9ifmt57i8eV2n4YNpw==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">= 14"
+      }
+    },
+    "node_modules/date-fns": {
+      "version": "1.30.1",
+      "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-1.30.1.tgz",
+      "integrity": "sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw==",
+      "dev": true,
+      "license": "MIT"
+    },
+    "node_modules/debug": {
+      "version": "4.4.3",
+      "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
+      "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "ms": "^2.1.3"
+      },
+      "engines": {
+        "node": ">=6.0"
+      },
+      "peerDependenciesMeta": {
+        "supports-color": {
+          "optional": true
+        }
+      }
+    },
+    "node_modules/degenerator": {
+      "version": "5.0.1",
+      "resolved": "https://registry.npmjs.org/degenerator/-/degenerator-5.0.1.tgz",
+      "integrity": "sha512-TllpMR/t0M5sqCXfj85i4XaAzxmS5tVA16dqvdkMwGmzI+dXLXnw3J+3Vdv7VKw+ThlTMboK6i9rnZ6Nntj5CQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "ast-types": "^0.13.4",
+        "escodegen": "^2.1.0",
+        "esprima": "^4.0.1"
+      },
+      "engines": {
+        "node": ">= 14"
+      }
+    },
+    "node_modules/devtools-protocol": {
+      "version": "0.0.1566079",
+      "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1566079.tgz",
+      "integrity": "sha512-MJfAEA1UfVhSs7fbSQOG4czavUp1ajfg6prlAN0+cmfa2zNjaIbvq8VneP7do1WAQQIvgNJWSMeP6UyI90gIlQ==",
+      "dev": true,
+      "license": "BSD-3-Clause"
+    },
+    "node_modules/elegant-spinner": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/elegant-spinner/-/elegant-spinner-1.0.1.tgz",
+      "integrity": "sha512-B+ZM+RXvRqQaAmkMlO/oSe5nMUOaUnyfGYCEHoR8wrXsZR2mA0XVibsxV1bvTwxdRWah1PkQqso2EzhILGHtEQ==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/emoji-regex": {
+      "version": "8.0.0",
+      "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
+      "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
+      "dev": true,
+      "license": "MIT"
+    },
+    "node_modules/end-of-stream": {
+      "version": "1.4.5",
+      "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz",
+      "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "once": "^1.4.0"
+      }
+    },
+    "node_modules/env-paths": {
+      "version": "2.2.1",
+      "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz",
+      "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/error-ex": {
+      "version": "1.3.4",
+      "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.4.tgz",
+      "integrity": "sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "is-arrayish": "^0.2.1"
+      }
+    },
+    "node_modules/escalade": {
+      "version": "3.2.0",
+      "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz",
+      "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/escape-string-regexp": {
+      "version": "1.0.5",
+      "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
+      "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=0.8.0"
+      }
+    },
+    "node_modules/escodegen": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz",
+      "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==",
+      "dev": true,
+      "license": "BSD-2-Clause",
+      "dependencies": {
+        "esprima": "^4.0.1",
+        "estraverse": "^5.2.0",
+        "esutils": "^2.0.2"
+      },
+      "bin": {
+        "escodegen": "bin/escodegen.js",
+        "esgenerate": "bin/esgenerate.js"
+      },
+      "engines": {
+        "node": ">=6.0"
+      },
+      "optionalDependencies": {
+        "source-map": "~0.6.1"
+      }
+    },
+    "node_modules/esprima": {
+      "version": "4.0.1",
+      "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
+      "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
+      "dev": true,
+      "license": "BSD-2-Clause",
+      "bin": {
+        "esparse": "bin/esparse.js",
+        "esvalidate": "bin/esvalidate.js"
+      },
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/estraverse": {
+      "version": "5.3.0",
+      "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz",
+      "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",
+      "dev": true,
+      "license": "BSD-2-Clause",
+      "engines": {
+        "node": ">=4.0"
+      }
+    },
+    "node_modules/esutils": {
+      "version": "2.0.3",
+      "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
+      "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
+      "dev": true,
+      "license": "BSD-2-Clause",
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/events-universal": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/events-universal/-/events-universal-1.0.1.tgz",
+      "integrity": "sha512-LUd5euvbMLpwOF8m6ivPCbhQeSiYVNb8Vs0fQ8QjXo0JTkEHpz8pxdQf0gStltaPpw0Cca8b39KxvK9cfKRiAw==",
+      "dev": true,
+      "license": "Apache-2.0",
+      "dependencies": {
+        "bare-events": "^2.7.0"
+      }
+    },
+    "node_modules/extend-shallow": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+      "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "is-extendable": "^0.1.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/extract-zip": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz",
+      "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==",
+      "dev": true,
+      "license": "BSD-2-Clause",
+      "dependencies": {
+        "debug": "^4.1.1",
+        "get-stream": "^5.1.0",
+        "yauzl": "^2.10.0"
+      },
+      "bin": {
+        "extract-zip": "cli.js"
+      },
+      "engines": {
+        "node": ">= 10.17.0"
+      },
+      "optionalDependencies": {
+        "@types/yauzl": "^2.9.1"
+      }
+    },
+    "node_modules/fast-fifo": {
+      "version": "1.3.2",
+      "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz",
+      "integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==",
+      "dev": true,
+      "license": "MIT"
+    },
+    "node_modules/fd-slicer": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz",
+      "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "pend": "~1.2.0"
+      }
+    },
+    "node_modules/figures": {
+      "version": "1.7.0",
+      "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz",
+      "integrity": "sha512-UxKlfCRuCBxSXU4C6t9scbDyWZ4VlaFFdojKtzJuSkuOBQ5CNFum+zZXFwHjo+CxBC1t6zlYPgHIgFjL8ggoEQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "escape-string-regexp": "^1.0.5",
+        "object-assign": "^4.1.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/fill-range": {
+      "version": "7.1.1",
+      "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
+      "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "to-regex-range": "^5.0.1"
+      },
+      "engines": {
+        "node": ">=8"
+      }
+    },
+    "node_modules/fsevents": {
+      "version": "2.3.3",
+      "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
+      "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
+      "dev": true,
+      "hasInstallScript": true,
+      "license": "MIT",
+      "optional": true,
+      "os": [
+        "darwin"
+      ],
+      "engines": {
+        "node": "^8.16.0 || ^10.6.0 || >=11.0.0"
+      }
+    },
+    "node_modules/get-caller-file": {
+      "version": "2.0.5",
+      "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
+      "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
+      "dev": true,
+      "license": "ISC",
+      "engines": {
+        "node": "6.* || 8.* || >= 10.*"
+      }
+    },
+    "node_modules/get-port": {
+      "version": "5.1.1",
+      "resolved": "https://registry.npmjs.org/get-port/-/get-port-5.1.1.tgz",
+      "integrity": "sha512-g/Q1aTSDOxFpchXC4i8ZWvxA1lnPqx/JHqcpIw0/LX9T8x/GBbi6YnlN5nhaKIFkT8oFsscUKgDJYxfwfS6QsQ==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=8"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/sindresorhus"
+      }
+    },
+    "node_modules/get-stdin": {
+      "version": "8.0.0",
+      "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-8.0.0.tgz",
+      "integrity": "sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=10"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/sindresorhus"
+      }
+    },
+    "node_modules/get-stream": {
+      "version": "5.2.0",
+      "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz",
+      "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "pump": "^3.0.0"
+      },
+      "engines": {
+        "node": ">=8"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/sindresorhus"
+      }
+    },
+    "node_modules/get-uri": {
+      "version": "6.0.5",
+      "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-6.0.5.tgz",
+      "integrity": "sha512-b1O07XYq8eRuVzBNgJLstU6FYc1tS6wnMtF1I1D9lE8LxZSOGZ7LhxN54yPP6mGw5f2CkXY2BQUL9Fx41qvcIg==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "basic-ftp": "^5.0.2",
+        "data-uri-to-buffer": "^6.0.2",
+        "debug": "^4.3.4"
+      },
+      "engines": {
+        "node": ">= 14"
+      }
+    },
+    "node_modules/glob-parent": {
+      "version": "5.1.2",
+      "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
+      "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
+      "dev": true,
+      "license": "ISC",
+      "dependencies": {
+        "is-glob": "^4.0.1"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/gray-matter": {
+      "version": "4.0.3",
+      "resolved": "https://registry.npmjs.org/gray-matter/-/gray-matter-4.0.3.tgz",
+      "integrity": "sha512-5v6yZd4JK3eMI3FqqCouswVqwugaA9r4dNZB1wwcmrD02QkV5H0y7XBQW8QwQqEaZY1pM9aqORSORhJRdNK44Q==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "js-yaml": "^3.13.1",
+        "kind-of": "^6.0.2",
+        "section-matter": "^1.0.0",
+        "strip-bom-string": "^1.0.0"
+      },
+      "engines": {
+        "node": ">=6.0"
+      }
+    },
+    "node_modules/has-ansi": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz",
+      "integrity": "sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "ansi-regex": "^2.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/has-flag": {
+      "version": "4.0.0",
+      "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
+      "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=8"
+      }
+    },
+    "node_modules/highlight.js": {
+      "version": "11.11.1",
+      "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-11.11.1.tgz",
+      "integrity": "sha512-Xwwo44whKBVCYoliBQwaPvtd/2tYFkRQtXDWj1nackaV2JPXx3L0+Jvd8/qCJ2p+ML0/XVkJ2q+Mr+UVdpJK5w==",
+      "dev": true,
+      "license": "BSD-3-Clause",
+      "engines": {
+        "node": ">=12.0.0"
+      }
+    },
+    "node_modules/http-proxy-agent": {
+      "version": "7.0.2",
+      "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz",
+      "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "agent-base": "^7.1.0",
+        "debug": "^4.3.4"
+      },
+      "engines": {
+        "node": ">= 14"
+      }
+    },
+    "node_modules/https-proxy-agent": {
+      "version": "7.0.6",
+      "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz",
+      "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "agent-base": "^7.1.2",
+        "debug": "4"
+      },
+      "engines": {
+        "node": ">= 14"
+      }
+    },
+    "node_modules/iconv-lite": {
+      "version": "0.6.3",
+      "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
+      "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "safer-buffer": ">= 2.1.2 < 3.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/import-fresh": {
+      "version": "3.3.1",
+      "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz",
+      "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "parent-module": "^1.0.0",
+        "resolve-from": "^4.0.0"
+      },
+      "engines": {
+        "node": ">=6"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/sindresorhus"
+      }
+    },
+    "node_modules/indent-string": {
+      "version": "3.2.0",
+      "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz",
+      "integrity": "sha512-BYqTHXTGUIvg7t1r4sJNKcbDZkL92nkXA8YtRpbjFHRHGDL/NtUeiBJMeE60kIFN/Mg8ESaWQvftaYMGJzQZCQ==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/ip-address": {
+      "version": "10.1.0",
+      "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.1.0.tgz",
+      "integrity": "sha512-XXADHxXmvT9+CRxhXg56LJovE+bmWnEWB78LB83VZTprKTmaC5QfruXocxzTZ2Kl0DNwKuBdlIhjL8LeY8Sf8Q==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">= 12"
+      }
+    },
+    "node_modules/is-arrayish": {
+      "version": "0.2.1",
+      "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
+      "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==",
+      "dev": true,
+      "license": "MIT"
+    },
+    "node_modules/is-binary-path": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz",
+      "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "binary-extensions": "^2.0.0"
+      },
+      "engines": {
+        "node": ">=8"
+      }
+    },
+    "node_modules/is-extendable": {
+      "version": "0.1.1",
+      "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz",
+      "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/is-extglob": {
+      "version": "2.1.1",
+      "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
+      "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/is-fullwidth-code-point": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
+      "integrity": "sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "number-is-nan": "^1.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/is-glob": {
+      "version": "4.0.3",
+      "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
+      "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "is-extglob": "^2.1.1"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/is-number": {
+      "version": "7.0.0",
+      "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
+      "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=0.12.0"
+      }
+    },
+    "node_modules/is-observable": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/is-observable/-/is-observable-1.1.0.tgz",
+      "integrity": "sha512-NqCa4Sa2d+u7BWc6CukaObG3Fh+CU9bvixbpcXYhy2VvYS7vVGIdAgnIS5Ks3A/cqk4rebLJ9s8zBstT2aKnIA==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "symbol-observable": "^1.1.0"
+      },
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/is-promise": {
+      "version": "2.2.2",
+      "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz",
+      "integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==",
+      "dev": true,
+      "license": "MIT"
+    },
+    "node_modules/is-stream": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
+      "integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/js-tokens": {
+      "version": "4.0.0",
+      "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
+      "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
+      "dev": true,
+      "license": "MIT"
+    },
+    "node_modules/js-yaml": {
+      "version": "3.14.2",
+      "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.2.tgz",
+      "integrity": "sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "argparse": "^1.0.7",
+        "esprima": "^4.0.0"
+      },
+      "bin": {
+        "js-yaml": "bin/js-yaml.js"
+      }
+    },
+    "node_modules/json-parse-even-better-errors": {
+      "version": "2.3.1",
+      "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz",
+      "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==",
+      "dev": true,
+      "license": "MIT"
+    },
+    "node_modules/kind-of": {
+      "version": "6.0.3",
+      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
+      "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/lines-and-columns": {
+      "version": "1.2.4",
+      "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz",
+      "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==",
+      "dev": true,
+      "license": "MIT"
+    },
+    "node_modules/listr": {
+      "version": "0.14.3",
+      "resolved": "https://registry.npmjs.org/listr/-/listr-0.14.3.tgz",
+      "integrity": "sha512-RmAl7su35BFd/xoMamRjpIE4j3v+L28o8CT5YhAXQJm1fD+1l9ngXY8JAQRJ+tFK2i5njvi0iRUKV09vPwA0iA==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "@samverschueren/stream-to-observable": "^0.3.0",
+        "is-observable": "^1.1.0",
+        "is-promise": "^2.1.0",
+        "is-stream": "^1.1.0",
+        "listr-silent-renderer": "^1.1.1",
+        "listr-update-renderer": "^0.5.0",
+        "listr-verbose-renderer": "^0.5.0",
+        "p-map": "^2.0.0",
+        "rxjs": "^6.3.3"
+      },
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/listr-silent-renderer": {
+      "version": "1.1.1",
+      "resolved": "https://registry.npmjs.org/listr-silent-renderer/-/listr-silent-renderer-1.1.1.tgz",
+      "integrity": "sha512-L26cIFm7/oZeSNVhWB6faeorXhMg4HNlb/dS/7jHhr708jxlXrtrBWo4YUxZQkc6dGoxEAe6J/D3juTRBUzjtA==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/listr-update-renderer": {
+      "version": "0.5.0",
+      "resolved": "https://registry.npmjs.org/listr-update-renderer/-/listr-update-renderer-0.5.0.tgz",
+      "integrity": "sha512-tKRsZpKz8GSGqoI/+caPmfrypiaq+OQCbd+CovEC24uk1h952lVj5sC7SqyFUm+OaJ5HN/a1YLt5cit2FMNsFA==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "chalk": "^1.1.3",
+        "cli-truncate": "^0.2.1",
+        "elegant-spinner": "^1.0.1",
+        "figures": "^1.7.0",
+        "indent-string": "^3.0.0",
+        "log-symbols": "^1.0.2",
+        "log-update": "^2.3.0",
+        "strip-ansi": "^3.0.1"
+      },
+      "engines": {
+        "node": ">=6"
+      },
+      "peerDependencies": {
+        "listr": "^0.14.2"
+      }
+    },
+    "node_modules/listr-update-renderer/node_modules/ansi-styles": {
+      "version": "2.2.1",
+      "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
+      "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/listr-update-renderer/node_modules/chalk": {
+      "version": "1.1.3",
+      "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
+      "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "ansi-styles": "^2.2.1",
+        "escape-string-regexp": "^1.0.2",
+        "has-ansi": "^2.0.0",
+        "strip-ansi": "^3.0.0",
+        "supports-color": "^2.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/listr-update-renderer/node_modules/supports-color": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
+      "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=0.8.0"
+      }
+    },
+    "node_modules/listr-verbose-renderer": {
+      "version": "0.5.0",
+      "resolved": "https://registry.npmjs.org/listr-verbose-renderer/-/listr-verbose-renderer-0.5.0.tgz",
+      "integrity": "sha512-04PDPqSlsqIOaaaGZ+41vq5FejI9auqTInicFRndCBgE3bXG8D6W1I+mWhk+1nqbHmyhla/6BUrd5OSiHwKRXw==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "chalk": "^2.4.1",
+        "cli-cursor": "^2.1.0",
+        "date-fns": "^1.27.2",
+        "figures": "^2.0.0"
+      },
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/listr-verbose-renderer/node_modules/ansi-styles": {
+      "version": "3.2.1",
+      "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
+      "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "color-convert": "^1.9.0"
+      },
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/listr-verbose-renderer/node_modules/chalk": {
+      "version": "2.4.2",
+      "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
+      "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "ansi-styles": "^3.2.1",
+        "escape-string-regexp": "^1.0.5",
+        "supports-color": "^5.3.0"
+      },
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/listr-verbose-renderer/node_modules/color-convert": {
+      "version": "1.9.3",
+      "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
+      "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "color-name": "1.1.3"
+      }
+    },
+    "node_modules/listr-verbose-renderer/node_modules/color-name": {
+      "version": "1.1.3",
+      "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
+      "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
+      "dev": true,
+      "license": "MIT"
+    },
+    "node_modules/listr-verbose-renderer/node_modules/figures": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz",
+      "integrity": "sha512-Oa2M9atig69ZkfwiApY8F2Yy+tzMbazyvqv21R0NsSC8floSOC09BbT1ITWAdoMGQvJ/aZnR1KMwdx9tvHnTNA==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "escape-string-regexp": "^1.0.5"
+      },
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/listr-verbose-renderer/node_modules/has-flag": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
+      "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/listr-verbose-renderer/node_modules/supports-color": {
+      "version": "5.5.0",
+      "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
+      "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "has-flag": "^3.0.0"
+      },
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/log-symbols": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-1.0.2.tgz",
+      "integrity": "sha512-mmPrW0Fh2fxOzdBbFv4g1m6pR72haFLPJ2G5SJEELf1y+iaQrDG6cWCPjy54RHYbZAt7X+ls690Kw62AdWXBzQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "chalk": "^1.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/log-symbols/node_modules/ansi-styles": {
+      "version": "2.2.1",
+      "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
+      "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/log-symbols/node_modules/chalk": {
+      "version": "1.1.3",
+      "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
+      "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "ansi-styles": "^2.2.1",
+        "escape-string-regexp": "^1.0.2",
+        "has-ansi": "^2.0.0",
+        "strip-ansi": "^3.0.0",
+        "supports-color": "^2.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/log-symbols/node_modules/supports-color": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
+      "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=0.8.0"
+      }
+    },
+    "node_modules/log-update": {
+      "version": "2.3.0",
+      "resolved": "https://registry.npmjs.org/log-update/-/log-update-2.3.0.tgz",
+      "integrity": "sha512-vlP11XfFGyeNQlmEn9tJ66rEW1coA/79m5z6BCkudjbAGE83uhAcGYrBFwfs3AdLiLzGRusRPAbSPK9xZteCmg==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "ansi-escapes": "^3.0.0",
+        "cli-cursor": "^2.0.0",
+        "wrap-ansi": "^3.0.1"
+      },
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/lru-cache": {
+      "version": "7.18.3",
+      "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz",
+      "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==",
+      "dev": true,
+      "license": "ISC",
+      "engines": {
+        "node": ">=12"
+      }
+    },
+    "node_modules/marked": {
+      "version": "4.3.0",
+      "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz",
+      "integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==",
+      "dev": true,
+      "license": "MIT",
+      "bin": {
+        "marked": "bin/marked.js"
+      },
+      "engines": {
+        "node": ">= 12"
+      }
+    },
+    "node_modules/md-to-pdf": {
+      "version": "5.2.5",
+      "resolved": "https://registry.npmjs.org/md-to-pdf/-/md-to-pdf-5.2.5.tgz",
+      "integrity": "sha512-TG8TgDM0PmEwCldR6j/1QP9gBElLL3DSn5ID8P3bEXEl3Y2zHOUSyszHzabWnDNxklRjKbi40ybli8YQJ5Ym5w==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "arg": "^5.0.2",
+        "chalk": "^4.1.2",
+        "chokidar": "^3.5.2",
+        "get-port": "^5.1.1",
+        "get-stdin": "^8.0.0",
+        "gray-matter": "^4.0.3",
+        "highlight.js": "^11.7.0",
+        "iconv-lite": "^0.6.3",
+        "listr": "^0.14.3",
+        "marked": "^4.2.12",
+        "puppeteer": ">=8.0.0",
+        "semver": "^7.3.7",
+        "serve-handler": "^6.1.3"
+      },
+      "bin": {
+        "md-to-pdf": "dist/cli.js",
+        "md2pdf": "dist/cli.js"
+      },
+      "engines": {
+        "node": ">=12.0"
+      }
+    },
+    "node_modules/mime-db": {
+      "version": "1.33.0",
+      "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz",
+      "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">= 0.6"
+      }
+    },
+    "node_modules/mime-types": {
+      "version": "2.1.18",
+      "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz",
+      "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "mime-db": "~1.33.0"
+      },
+      "engines": {
+        "node": ">= 0.6"
+      }
+    },
+    "node_modules/mimic-fn": {
+      "version": "1.2.0",
+      "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz",
+      "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/minimatch": {
+      "version": "3.1.2",
+      "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
+      "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
+      "dev": true,
+      "license": "ISC",
+      "dependencies": {
+        "brace-expansion": "^1.1.7"
+      },
+      "engines": {
+        "node": "*"
+      }
+    },
+    "node_modules/mitt": {
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/mitt/-/mitt-3.0.1.tgz",
+      "integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==",
+      "dev": true,
+      "license": "MIT"
+    },
+    "node_modules/ms": {
+      "version": "2.1.3",
+      "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+      "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
+      "dev": true,
+      "license": "MIT"
+    },
+    "node_modules/netmask": {
+      "version": "2.0.2",
+      "resolved": "https://registry.npmjs.org/netmask/-/netmask-2.0.2.tgz",
+      "integrity": "sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">= 0.4.0"
+      }
+    },
+    "node_modules/normalize-path": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
+      "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/number-is-nan": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
+      "integrity": "sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/object-assign": {
+      "version": "4.1.1",
+      "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
+      "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/once": {
+      "version": "1.4.0",
+      "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
+      "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
+      "dev": true,
+      "license": "ISC",
+      "dependencies": {
+        "wrappy": "1"
+      }
+    },
+    "node_modules/onetime": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz",
+      "integrity": "sha512-oyyPpiMaKARvvcgip+JV+7zci5L8D1W9RZIz2l1o08AM3pfspitVWnPt3mzHcBPp12oYMTy0pqrFs/C+m3EwsQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "mimic-fn": "^1.0.0"
+      },
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/p-map": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz",
+      "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/pac-proxy-agent": {
+      "version": "7.2.0",
+      "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-7.2.0.tgz",
+      "integrity": "sha512-TEB8ESquiLMc0lV8vcd5Ql/JAKAoyzHFXaStwjkzpOpC5Yv+pIzLfHvjTSdf3vpa2bMiUQrg9i6276yn8666aA==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "@tootallnate/quickjs-emscripten": "^0.23.0",
+        "agent-base": "^7.1.2",
+        "debug": "^4.3.4",
+        "get-uri": "^6.0.1",
+        "http-proxy-agent": "^7.0.0",
+        "https-proxy-agent": "^7.0.6",
+        "pac-resolver": "^7.0.1",
+        "socks-proxy-agent": "^8.0.5"
+      },
+      "engines": {
+        "node": ">= 14"
+      }
+    },
+    "node_modules/pac-resolver": {
+      "version": "7.0.1",
+      "resolved": "https://registry.npmjs.org/pac-resolver/-/pac-resolver-7.0.1.tgz",
+      "integrity": "sha512-5NPgf87AT2STgwa2ntRMr45jTKrYBGkVU36yT0ig/n/GMAa3oPqhZfIQ2kMEimReg0+t9kZViDVZ83qfVUlckg==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "degenerator": "^5.0.0",
+        "netmask": "^2.0.2"
+      },
+      "engines": {
+        "node": ">= 14"
+      }
+    },
+    "node_modules/pako": {
+      "version": "1.0.11",
+      "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz",
+      "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==",
+      "dev": true,
+      "license": "(MIT AND Zlib)"
+    },
+    "node_modules/parent-module": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
+      "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "callsites": "^3.0.0"
+      },
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/parse-json": {
+      "version": "5.2.0",
+      "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz",
+      "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "@babel/code-frame": "^7.0.0",
+        "error-ex": "^1.3.1",
+        "json-parse-even-better-errors": "^2.3.0",
+        "lines-and-columns": "^1.1.6"
+      },
+      "engines": {
+        "node": ">=8"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/sindresorhus"
+      }
+    },
+    "node_modules/path-is-inside": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz",
+      "integrity": "sha512-DUWJr3+ULp4zXmol/SZkFf3JGsS9/SIv+Y3Rt93/UjPpDpklB5f1er4O3POIbUuUJ3FXgqte2Q7SrU6zAqwk8w==",
+      "dev": true,
+      "license": "(WTFPL OR MIT)"
+    },
+    "node_modules/path-to-regexp": {
+      "version": "3.3.0",
+      "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-3.3.0.tgz",
+      "integrity": "sha512-qyCH421YQPS2WFDxDjftfc1ZR5WKQzVzqsp4n9M2kQhVOo/ByahFoUNJfl58kOcEGfQ//7weFTDhm+ss8Ecxgw==",
+      "dev": true,
+      "license": "MIT"
+    },
+    "node_modules/pdf-lib": {
+      "version": "1.17.1",
+      "resolved": "https://registry.npmjs.org/pdf-lib/-/pdf-lib-1.17.1.tgz",
+      "integrity": "sha512-V/mpyJAoTsN4cnP31vc0wfNA1+p20evqqnap0KLoRUN0Yk/p3wN52DOEsL4oBFcLdb76hlpKPtzJIgo67j/XLw==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "@pdf-lib/standard-fonts": "^1.0.0",
+        "@pdf-lib/upng": "^1.0.1",
+        "pako": "^1.0.11",
+        "tslib": "^1.11.1"
+      }
+    },
+    "node_modules/pdf-lib/node_modules/tslib": {
+      "version": "1.14.1",
+      "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
+      "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
+      "dev": true,
+      "license": "0BSD"
+    },
+    "node_modules/pend": {
+      "version": "1.2.0",
+      "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz",
+      "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==",
+      "dev": true,
+      "license": "MIT"
+    },
+    "node_modules/picocolors": {
+      "version": "1.1.1",
+      "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
+      "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",
+      "dev": true,
+      "license": "ISC"
+    },
+    "node_modules/picomatch": {
+      "version": "2.3.1",
+      "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
+      "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=8.6"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/jonschlinkert"
+      }
+    },
+    "node_modules/progress": {
+      "version": "2.0.3",
+      "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",
+      "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=0.4.0"
+      }
+    },
+    "node_modules/proxy-agent": {
+      "version": "6.5.0",
+      "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-6.5.0.tgz",
+      "integrity": "sha512-TmatMXdr2KlRiA2CyDu8GqR8EjahTG3aY3nXjdzFyoZbmB8hrBsTyMezhULIXKnC0jpfjlmiZ3+EaCzoInSu/A==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "agent-base": "^7.1.2",
+        "debug": "^4.3.4",
+        "http-proxy-agent": "^7.0.1",
+        "https-proxy-agent": "^7.0.6",
+        "lru-cache": "^7.14.1",
+        "pac-proxy-agent": "^7.1.0",
+        "proxy-from-env": "^1.1.0",
+        "socks-proxy-agent": "^8.0.5"
+      },
+      "engines": {
+        "node": ">= 14"
+      }
+    },
+    "node_modules/proxy-from-env": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
+      "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==",
+      "dev": true,
+      "license": "MIT"
+    },
+    "node_modules/pump": {
+      "version": "3.0.3",
+      "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.3.tgz",
+      "integrity": "sha512-todwxLMY7/heScKmntwQG8CXVkWUOdYxIvY2s0VWAAMh/nd8SoYiRaKjlr7+iCs984f2P8zvrfWcDDYVb73NfA==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "end-of-stream": "^1.1.0",
+        "once": "^1.3.1"
+      }
+    },
+    "node_modules/puppeteer": {
+      "version": "24.37.2",
+      "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-24.37.2.tgz",
+      "integrity": "sha512-FV1W/919ve0y0oiS/3Rp5XY4MUNUokpZOH/5M4MMDfrrvh6T9VbdKvAHrAFHBuCxvluDxhjra20W7Iz6HJUcIQ==",
+      "dev": true,
+      "hasInstallScript": true,
+      "license": "Apache-2.0",
+      "dependencies": {
+        "@puppeteer/browsers": "2.12.0",
+        "chromium-bidi": "13.1.1",
+        "cosmiconfig": "^9.0.0",
+        "devtools-protocol": "0.0.1566079",
+        "puppeteer-core": "24.37.2",
+        "typed-query-selector": "^2.12.0"
+      },
+      "bin": {
+        "puppeteer": "lib/cjs/puppeteer/node/cli.js"
+      },
+      "engines": {
+        "node": ">=18"
+      }
+    },
+    "node_modules/puppeteer-core": {
+      "version": "24.37.2",
+      "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-24.37.2.tgz",
+      "integrity": "sha512-nN8qwE3TGF2vA/+xemPxbesntTuqD9vCGOiZL2uh8HES3pPzLX20MyQjB42dH2rhQ3W3TljZ4ZaKZ0yX/abQuw==",
+      "dev": true,
+      "license": "Apache-2.0",
+      "dependencies": {
+        "@puppeteer/browsers": "2.12.0",
+        "chromium-bidi": "13.1.1",
+        "debug": "^4.4.3",
+        "devtools-protocol": "0.0.1566079",
+        "typed-query-selector": "^2.12.0",
+        "webdriver-bidi-protocol": "0.4.0",
+        "ws": "^8.19.0"
+      },
+      "engines": {
+        "node": ">=18"
+      }
+    },
+    "node_modules/range-parser": {
+      "version": "1.2.0",
+      "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz",
+      "integrity": "sha512-kA5WQoNVo4t9lNx2kQNFCxKeBl5IbbSNBl1M/tLkw9WCn+hxNBAW5Qh8gdhs63CJnhjJ2zQWFoqPJP2sK1AV5A==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">= 0.6"
+      }
+    },
+    "node_modules/readdirp": {
+      "version": "3.6.0",
+      "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",
+      "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "picomatch": "^2.2.1"
+      },
+      "engines": {
+        "node": ">=8.10.0"
+      }
+    },
+    "node_modules/require-directory": {
+      "version": "2.1.1",
+      "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
+      "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/resolve-from": {
+      "version": "4.0.0",
+      "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
+      "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/restore-cursor": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz",
+      "integrity": "sha512-6IzJLuGi4+R14vwagDHX+JrXmPVtPpn4mffDJ1UdR7/Edm87fl6yi8mMBIVvFtJaNTUvjughmW4hwLhRG7gC1Q==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "onetime": "^2.0.0",
+        "signal-exit": "^3.0.2"
+      },
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/rxjs": {
+      "version": "6.6.7",
+      "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz",
+      "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==",
+      "dev": true,
+      "license": "Apache-2.0",
+      "dependencies": {
+        "tslib": "^1.9.0"
+      },
+      "engines": {
+        "npm": ">=2.0.0"
+      }
+    },
+    "node_modules/rxjs/node_modules/tslib": {
+      "version": "1.14.1",
+      "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
+      "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
+      "dev": true,
+      "license": "0BSD"
+    },
+    "node_modules/safer-buffer": {
+      "version": "2.1.2",
+      "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
+      "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
+      "dev": true,
+      "license": "MIT"
+    },
+    "node_modules/section-matter": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/section-matter/-/section-matter-1.0.0.tgz",
+      "integrity": "sha512-vfD3pmTzGpufjScBh50YHKzEu2lxBWhVEHsNGoEXmCmn2hKGfeNLYMzCJpe8cD7gqX7TJluOVpBkAequ6dgMmA==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "extend-shallow": "^2.0.1",
+        "kind-of": "^6.0.0"
+      },
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/semver": {
+      "version": "7.7.4",
+      "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz",
+      "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==",
+      "dev": true,
+      "license": "ISC",
+      "bin": {
+        "semver": "bin/semver.js"
+      },
+      "engines": {
+        "node": ">=10"
+      }
+    },
+    "node_modules/serve-handler": {
+      "version": "6.1.6",
+      "resolved": "https://registry.npmjs.org/serve-handler/-/serve-handler-6.1.6.tgz",
+      "integrity": "sha512-x5RL9Y2p5+Sh3D38Fh9i/iQ5ZK+e4xuXRd/pGbM4D13tgo/MGwbttUk8emytcr1YYzBYs+apnUngBDFYfpjPuQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "bytes": "3.0.0",
+        "content-disposition": "0.5.2",
+        "mime-types": "2.1.18",
+        "minimatch": "3.1.2",
+        "path-is-inside": "1.0.2",
+        "path-to-regexp": "3.3.0",
+        "range-parser": "1.2.0"
+      }
+    },
+    "node_modules/signal-exit": {
+      "version": "3.0.7",
+      "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",
+      "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==",
+      "dev": true,
+      "license": "ISC"
+    },
+    "node_modules/slice-ansi": {
+      "version": "0.0.4",
+      "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz",
+      "integrity": "sha512-up04hB2hR92PgjpyU3y/eg91yIBILyjVY26NvvciY3EVVPjybkMszMpXQ9QAkcS3I5rtJBDLoTxxg+qvW8c7rw==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/smart-buffer": {
+      "version": "4.2.0",
+      "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz",
+      "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">= 6.0.0",
+        "npm": ">= 3.0.0"
+      }
+    },
+    "node_modules/socks": {
+      "version": "2.8.7",
+      "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.7.tgz",
+      "integrity": "sha512-HLpt+uLy/pxB+bum/9DzAgiKS8CX1EvbWxI4zlmgGCExImLdiad2iCwXT5Z4c9c3Eq8rP2318mPW2c+QbtjK8A==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "ip-address": "^10.0.1",
+        "smart-buffer": "^4.2.0"
+      },
+      "engines": {
+        "node": ">= 10.0.0",
+        "npm": ">= 3.0.0"
+      }
+    },
+    "node_modules/socks-proxy-agent": {
+      "version": "8.0.5",
+      "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.5.tgz",
+      "integrity": "sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "agent-base": "^7.1.2",
+        "debug": "^4.3.4",
+        "socks": "^2.8.3"
+      },
+      "engines": {
+        "node": ">= 14"
+      }
+    },
+    "node_modules/source-map": {
+      "version": "0.6.1",
+      "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+      "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+      "dev": true,
+      "license": "BSD-3-Clause",
+      "optional": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/sprintf-js": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
+      "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==",
+      "dev": true,
+      "license": "BSD-3-Clause"
+    },
+    "node_modules/streamx": {
+      "version": "2.23.0",
+      "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.23.0.tgz",
+      "integrity": "sha512-kn+e44esVfn2Fa/O0CPFcex27fjIL6MkVae0Mm6q+E6f0hWv578YCERbv+4m02cjxvDsPKLnmxral/rR6lBMAg==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "events-universal": "^1.0.0",
+        "fast-fifo": "^1.3.2",
+        "text-decoder": "^1.1.0"
+      }
+    },
+    "node_modules/string-width": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
+      "integrity": "sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "code-point-at": "^1.0.0",
+        "is-fullwidth-code-point": "^1.0.0",
+        "strip-ansi": "^3.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/strip-ansi": {
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
+      "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "ansi-regex": "^2.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/strip-bom-string": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz",
+      "integrity": "sha512-uCC2VHvQRYu+lMh4My/sFNmF2klFymLX1wHJeXnbEJERpV/ZsVuonzerjfrGpIGF7LBVa1O7i9kjiWvJiFck8g==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/supports-color": {
+      "version": "7.2.0",
+      "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
+      "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "has-flag": "^4.0.0"
+      },
+      "engines": {
+        "node": ">=8"
+      }
+    },
+    "node_modules/symbol-observable": {
+      "version": "1.2.0",
+      "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz",
+      "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/tar-fs": {
+      "version": "3.1.1",
+      "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.1.1.tgz",
+      "integrity": "sha512-LZA0oaPOc2fVo82Txf3gw+AkEd38szODlptMYejQUhndHMLQ9M059uXR+AfS7DNo0NpINvSqDsvyaCrBVkptWg==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "pump": "^3.0.0",
+        "tar-stream": "^3.1.5"
+      },
+      "optionalDependencies": {
+        "bare-fs": "^4.0.1",
+        "bare-path": "^3.0.0"
+      }
+    },
+    "node_modules/tar-stream": {
+      "version": "3.1.7",
+      "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.7.tgz",
+      "integrity": "sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "b4a": "^1.6.4",
+        "fast-fifo": "^1.2.0",
+        "streamx": "^2.15.0"
+      }
+    },
+    "node_modules/text-decoder": {
+      "version": "1.2.3",
+      "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.3.tgz",
+      "integrity": "sha512-3/o9z3X0X0fTupwsYvR03pJ/DjWuqqrfwBgTQzdWDiQSm9KitAyz/9WqsT2JQW7KV2m+bC2ol/zqpW37NHxLaA==",
+      "dev": true,
+      "license": "Apache-2.0",
+      "dependencies": {
+        "b4a": "^1.6.4"
+      }
+    },
+    "node_modules/to-regex-range": {
+      "version": "5.0.1",
+      "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
+      "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "is-number": "^7.0.0"
+      },
+      "engines": {
+        "node": ">=8.0"
+      }
+    },
+    "node_modules/tslib": {
+      "version": "2.8.1",
+      "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
+      "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
+      "dev": true,
+      "license": "0BSD"
+    },
+    "node_modules/typed-query-selector": {
+      "version": "2.12.0",
+      "resolved": "https://registry.npmjs.org/typed-query-selector/-/typed-query-selector-2.12.0.tgz",
+      "integrity": "sha512-SbklCd1F0EiZOyPiW192rrHZzZ5sBijB6xM+cpmrwDqObvdtunOHHIk9fCGsoK5JVIYXoyEp4iEdE3upFH3PAg==",
+      "dev": true,
+      "license": "MIT"
+    },
+    "node_modules/undici-types": {
+      "version": "7.16.0",
+      "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz",
+      "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==",
+      "dev": true,
+      "license": "MIT",
+      "optional": true
+    },
+    "node_modules/webdriver-bidi-protocol": {
+      "version": "0.4.0",
+      "resolved": "https://registry.npmjs.org/webdriver-bidi-protocol/-/webdriver-bidi-protocol-0.4.0.tgz",
+      "integrity": "sha512-U9VIlNRrq94d1xxR9JrCEAx5Gv/2W7ERSv8oWRoNe/QYbfccS0V3h/H6qeNeCRJxXGMhhnkqvwNrvPAYeuP9VA==",
+      "dev": true,
+      "license": "Apache-2.0"
+    },
+    "node_modules/wrap-ansi": {
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-3.0.1.tgz",
+      "integrity": "sha512-iXR3tDXpbnTpzjKSylUJRkLuOrEC7hwEB221cgn6wtF8wpmz28puFXAEfPT5zrjM3wahygB//VuWEr1vTkDcNQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "string-width": "^2.1.1",
+        "strip-ansi": "^4.0.0"
+      },
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/wrap-ansi/node_modules/ansi-regex": {
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz",
+      "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/wrap-ansi/node_modules/is-fullwidth-code-point": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
+      "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/wrap-ansi/node_modules/string-width": {
+      "version": "2.1.1",
+      "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
+      "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "is-fullwidth-code-point": "^2.0.0",
+        "strip-ansi": "^4.0.0"
+      },
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/wrap-ansi/node_modules/strip-ansi": {
+      "version": "4.0.0",
+      "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
+      "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "ansi-regex": "^3.0.0"
+      },
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/wrappy": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
+      "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
+      "dev": true,
+      "license": "ISC"
+    },
+    "node_modules/ws": {
+      "version": "8.19.0",
+      "resolved": "https://registry.npmjs.org/ws/-/ws-8.19.0.tgz",
+      "integrity": "sha512-blAT2mjOEIi0ZzruJfIhb3nps74PRWTCz1IjglWEEpQl5XS/UNama6u2/rjFkDDouqr4L67ry+1aGIALViWjDg==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=10.0.0"
+      },
+      "peerDependencies": {
+        "bufferutil": "^4.0.1",
+        "utf-8-validate": ">=5.0.2"
+      },
+      "peerDependenciesMeta": {
+        "bufferutil": {
+          "optional": true
+        },
+        "utf-8-validate": {
+          "optional": true
+        }
+      }
+    },
+    "node_modules/y18n": {
+      "version": "5.0.8",
+      "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
+      "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==",
+      "dev": true,
+      "license": "ISC",
+      "engines": {
+        "node": ">=10"
+      }
+    },
+    "node_modules/yargs": {
+      "version": "17.7.2",
+      "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz",
+      "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "cliui": "^8.0.1",
+        "escalade": "^3.1.1",
+        "get-caller-file": "^2.0.5",
+        "require-directory": "^2.1.1",
+        "string-width": "^4.2.3",
+        "y18n": "^5.0.5",
+        "yargs-parser": "^21.1.1"
+      },
+      "engines": {
+        "node": ">=12"
+      }
+    },
+    "node_modules/yargs-parser": {
+      "version": "21.1.1",
+      "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz",
+      "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==",
+      "dev": true,
+      "license": "ISC",
+      "engines": {
+        "node": ">=12"
+      }
+    },
+    "node_modules/yargs/node_modules/ansi-regex": {
+      "version": "5.0.1",
+      "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
+      "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=8"
+      }
+    },
+    "node_modules/yargs/node_modules/is-fullwidth-code-point": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
+      "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=8"
+      }
+    },
+    "node_modules/yargs/node_modules/string-width": {
+      "version": "4.2.3",
+      "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
+      "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "emoji-regex": "^8.0.0",
+        "is-fullwidth-code-point": "^3.0.0",
+        "strip-ansi": "^6.0.1"
+      },
+      "engines": {
+        "node": ">=8"
+      }
+    },
+    "node_modules/yargs/node_modules/strip-ansi": {
+      "version": "6.0.1",
+      "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
+      "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "ansi-regex": "^5.0.1"
+      },
+      "engines": {
+        "node": ">=8"
+      }
+    },
+    "node_modules/yauzl": {
+      "version": "2.10.0",
+      "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz",
+      "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "buffer-crc32": "~0.2.3",
+        "fd-slicer": "~1.1.0"
+      }
+    },
+    "node_modules/zod": {
+      "version": "3.25.76",
+      "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz",
+      "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==",
+      "dev": true,
+      "license": "MIT",
+      "funding": {
+        "url": "https://github.com/sponsors/colinhacks"
+      }
+    }
+  }
+}

+ 16 - 0
_bmad-output/planning-artifacts/pdfGenerator/package.json

@@ -0,0 +1,16 @@
+{
+  "name": "pdfGenerator",
+  "version": "1.0.0",
+  "description": "Génération de PDF à partir des fichiers Markdown (planning-artifacts)",
+  "private": true,
+  "scripts": {
+    "pdf": "node generate-pdfs.js",
+    "merge": "node merge-pdfs.js",
+    "build": "npm run pdf && npm run merge",
+    "pdf:single": "node -e \"require('md-to-pdf')({ path: process.argv[1] }, { dest: process.argv[1].replace(/.md$/i,'.pdf'), stylesheet: 'pdf-style.css', basedir: '..' }).then(()=>console.log('OK'))\""
+  },
+  "devDependencies": {
+    "md-to-pdf": "^5.2.4",
+    "pdf-lib": "^1.17.1"
+  }
+}

+ 149 - 0
_bmad-output/planning-artifacts/pdfGenerator/pdf-style.css

@@ -0,0 +1,149 @@
+/* Style pour génération PDF propres - planning-artifacts */
+
+@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:ital,wght@0,400;0,600;0,700;1,400&display=swap');
+
+* {
+  box-sizing: border-box;
+}
+
+body {
+  font-family: 'Source Sans 3', 'Segoe UI', sans-serif;
+  font-size: 11pt;
+  line-height: 1.5;
+  color: #1a1a1a;
+  max-width: 100%;
+  margin: 0;
+  padding: 0;
+}
+
+/* Titres */
+h1 {
+  font-size: 1.6em;
+  font-weight: 700;
+  margin: 0 0 0.75em 0;
+  padding-bottom: 0.35em;
+  border-bottom: 2px solid #2563eb;
+  color: #1e3a5f;
+  page-break-after: avoid;
+}
+
+h2 {
+  font-size: 1.25em;
+  font-weight: 700;
+  margin: 1.25em 0 0.5em 0;
+  color: #1e3a5f;
+  page-break-after: avoid;
+}
+
+h3, h4 {
+  font-size: 1.05em;
+  font-weight: 600;
+  margin: 1em 0 0.4em 0;
+  color: #334155;
+  page-break-after: avoid;
+}
+
+/* Paragraphes et listes */
+p {
+  margin: 0 0 0.6em 0;
+}
+
+ul, ol {
+  margin: 0 0 0.75em 0;
+  padding-left: 1.5em;
+}
+
+li {
+  margin-bottom: 0.25em;
+}
+
+/* Tableaux - rendu propre */
+table {
+  width: 100%;
+  border-collapse: collapse;
+  margin: 0.75em 0;
+  font-size: 10pt;
+  page-break-inside: avoid;
+}
+
+th, td {
+  border: 1px solid #cbd5e1;
+  padding: 0.4em 0.6em;
+  text-align: left;
+  vertical-align: top;
+}
+
+th {
+  background: #1e3a5f;
+  color: #fff;
+  font-weight: 600;
+}
+
+tr:nth-child(even) {
+  background: #f8fafc;
+}
+
+/* Bloc citation / séparateur */
+hr {
+  border: none;
+  border-top: 1px solid #e2e8f0;
+  margin: 1.25em 0;
+}
+
+blockquote {
+  margin: 0.75em 0;
+  padding: 0.5em 1em;
+  border-left: 4px solid #2563eb;
+  background: #f1f5f9;
+  color: #475569;
+  font-style: italic;
+}
+
+/* Code */
+code {
+  font-family: 'Consolas', 'Monaco', monospace;
+  font-size: 0.9em;
+  background: #f1f5f9;
+  padding: 0.15em 0.35em;
+  border-radius: 3px;
+  border: 1px solid #e2e8f0;
+}
+
+pre {
+  background: #1e293b;
+  color: #e2e8f0;
+  padding: 0.75em 1em;
+  border-radius: 4px;
+  overflow-x: auto;
+  font-size: 9pt;
+  page-break-inside: avoid;
+}
+
+pre code {
+  background: none;
+  padding: 0;
+  border: none;
+  color: inherit;
+}
+
+/* Strong / emphasis */
+strong {
+  font-weight: 600;
+  color: #1e3a5f;
+}
+
+/* Sauts de page */
+h1, h2, h3, h4 {
+  page-break-after: avoid;
+}
+
+table, pre, blockquote {
+  page-break-inside: avoid;
+}
+
+@media print {
+  body {
+    print-color-adjust: exact;
+    -webkit-print-color-adjust: exact;
+  }
+}

BIN
_bmad-output/planning-artifacts/pdfGenerator/pdf/architecture.pdf


BIN
_bmad-output/planning-artifacts/pdfGenerator/pdf/cahier-recettes-livraison.pdf


BIN
_bmad-output/planning-artifacts/pdfGenerator/pdf/chiffrage-schema-et-grille.pdf


BIN
_bmad-output/planning-artifacts/pdfGenerator/pdf/decisions-client-chiffrage.pdf


BIN
_bmad-output/planning-artifacts/pdfGenerator/pdf/général et regles-metier-a-clarifier.pdf


BIN
_bmad-output/planning-artifacts/pdfGenerator/pdf/implementation-readiness-report-2026-02-09.pdf


BIN
_bmad-output/planning-artifacts/pdfGenerator/pdf/listing-complet-ecrans-pages.pdf


BIN
_bmad-output/planning-artifacts/pdfGenerator/pdf/logique-paiements-echeanciers.pdf


BIN
_bmad-output/planning-artifacts/pdfGenerator/pdf/prd.pdf


BIN
_bmad-output/planning-artifacts/pdfGenerator/pdf/product-brief-bmad-2026-02-09.pdf


BIN
_bmad-output/planning-artifacts/pdfGenerator/pdf/questions-en-suspens.pdf


BIN
_bmad-output/planning-artifacts/pdfGenerator/pdf/schema-relationnel-et-tables-donnees.pdf


BIN
_bmad-output/planning-artifacts/pdfGenerator/pdf/schema-workflows.pdf


BIN
_bmad-output/planning-artifacts/pdfGenerator/pdf/synthèse-projet-lecture-client.pdf


BIN
_bmad-output/planning-artifacts/planning-artifacts-complet.pdf


+ 202 - 0
_bmad-output/planning-artifacts/prd.md

@@ -0,0 +1,202 @@
+---
+stepsCompleted: ['step-01-init', 'step-02-discovery', 'step-03-success', 'step-04-journeys', 'step-05-domain', 'step-06-innovation', 'step-07-project-type', 'step-08-scoping', 'step-09-functional', 'step-10-nonfunctional', 'step-11-polish']
+inputDocuments: ['product-brief-bmad-2026-02-09.md']
+briefCount: 1
+researchCount: 0
+brainstormingCount: 0
+projectDocsCount: 0
+workflowType: 'prd'
+classification:
+  projectType: web_app
+  domain: general
+  complexity: medium
+  projectContext: greenfield
+---
+
+# Product Requirements Document - dirCops
+
+**Application :** dirCops (suivi facturation / échéancier – Écloserie marine Gravelines)  
+**Author:** Livinweb  
+**Date:** 2026-02-09
+
+## Success Criteria
+
+### User Success
+
+L'équipe commerciale utilise l'application pour le suivi facturation / échéancier / paiement sans dépendre d'une seule personne ; consultation et reporting en quelques clics ; plus d'usage d'Excel pour ce périmètre. Application simple et efficace (~20 k€).
+
+### Business Success
+
+Une seule source de vérité pour trésorerie et direction ; moins d'erreurs de suivi et de décisions sur des données fausses ; temps gagné et possibilité d'expliquer un encours à un client de façon fiable.
+
+### Technical Success
+
+Application web simple, stable, facile à maintenir.
+
+### Measurable Outcomes
+
+- Utilisation effective par les commerciaux (suivi et reporting faits dans l'appli).
+- Fin de la dépendance à une seule personne pour « faire tourner » le suivi.
+- Réduction des erreurs / incohérences constatées par trésorerie et direction (qualitatif ou via feedback).
+
+## Product Scope
+
+### MVP - Minimum Viable Product
+
+**Core Features:**
+- Suivi des factures : liste par client, n° facture, n° vente, date, quantités, montants (ex. CA HT).
+- Suivi des paiements / échéancier : ce qui est payé, ce qui reste dû (encours), échéances.
+- Vue par client : synthèse par client (factures, paiements, encours).
+- Données métier spécifiques : au minimum encours, échéances ; couverture / indicateurs type Excel si possible dans la limite du budget.
+- Reporting simple : exports ou vues synthétiques (tableaux de bord basiques) pour commercial, trésorerie, direction.
+- Données centralisées, remplacement du classeur Excel pour ce périmètre.
+
+**In Scope (clarification):**
+- **Ajout manuel de factures pour le suivi** : la facturation (document facture, PDF, édition) provient de **Pennylane** ; dans l'appli, le commercial **ajoute à la main** les factures pour en assurer le suivi (n° facture, n° vente, date, type produit, cycle, quantités, quantité livrée, montant HT).
+- **Type de produit et cycle** : alevins, larves ; cycles (ex. 24-25, 25-26) pour le reporting.
+- **Quantité livrée** : suivi de la quantité déjà livrée par facture (QTE FACT / QTE LIVREE).
+- **Top clients par catégorie** : vues « Top clients alevins », « Top clients larves » (quantités + CA), filtrable par cycle.
+- **Quantités vendues par client** : synthèse par client des quantités facturées et livrées (avec répartition par type si besoin).
+- **Écheancier de paiement** : pour une facture, le commercial peut ajouter un écheancier avec facture associée, nombre d’échéances et date de début d’écheancier.
+- **Clients** : les libellés « client » désignent les **noms de clients** (ex. AQUANARIA, PHILOSOFISH, AQN). EMGI est un **lieu de départ**, pas un nom de client (cf. référentiel Excel EMGI_FTI_Suivi des Ventes).
+- **Tableau de bord** : encours par client (tri croissant), synthèse (encours total en k€, délai moyen de paiement en jours), colonnes optionnelles accord / j out / situation (à alimenter si les données existent). Export encours CSV et **export de l’ensemble des factures en pièce jointe** (fichier téléchargeable).
+
+**Out of Scope for MVP:**
+- Génération ou édition du **document** facture (PDF, impression) — gérée par **Pennylane**.
+- Gestion complète trésorerie (bancaire, prévisionnel détaillé).
+- Parcours dédiés complexes pour trésorerie / direction (priorité au besoin commercial).
+- Fonctionnalités « nice to have » qui feraient dépasser le cadre coût / simplicité.
+
+**MVP Success Criteria:**
+- L'équipe commerciale utilise l'appli pour ce suivi et n'utilise plus Excel pour ce périmètre.
+- Plus de dépendance à une seule personne ; trésorerie et direction s'appuient sur les mêmes données.
+
+### Growth Features (Post-MVP)
+
+Non défini à ce stade — focus sur l'adoption du MVP d'abord.
+
+### Vision (Future)
+
+Évolutions possibles après adoption : indicateurs métier supplémentaires, intégrations (ERP, compta), extensions vers d'autres processus — sans engagement dans le MVP.
+
+## User Journeys
+
+### Journey 1: Commercial consulte le suivi d'un client
+
+**Opening Scene :** Marie, commerciale, reçoit un appel client demandant l'état des factures et ce qui reste à payer. Actuellement, elle doit ouvrir Excel, naviguer entre plusieurs onglets, chercher le client, vérifier manuellement les paiements et calculer l'encours — avec risque d'erreur ou de données obsolètes.
+
+**Rising Action :** Avec la nouvelle application, Marie ouvre l'appli, tape le nom du client, et voit immédiatement : liste des factures (n°, date, montant, quantités), état des paiements, encours calculé automatiquement, échéances à venir.
+
+**Climax :** Pendant l'appel, Marie peut expliquer précisément l'état, confirmer les paiements, donner l'encours exact, et rassurer le client avec des données fiables partagées par toute l'équipe.
+
+**Resolution :** Plus besoin d'Excel pour ce suivi, plus de dépendance à une seule personne, données fiables et à jour, confiance restaurée avec le client.
+
+### Journey 2: Commercial met à jour un paiement
+
+**Opening Scene :** Thomas apprend qu'un client a effectué un paiement. Actuellement, il doit ouvrir Excel, trouver la bonne feuille et ligne, mettre à jour manuellement avec risque de casser une formule.
+
+**Rising Action :** Thomas ouvre l'appli, sélectionne le client, voit les factures en attente, clique sur "Enregistrer un paiement", saisit le montant et la date. L'encours se met à jour automatiquement.
+
+**Climax :** En quelques clics, le paiement est enregistré et visible par toute l'équipe. Plus besoin de modifier Excel ou de dépendre d'une seule personne.
+
+**Resolution :** Mise à jour rapide et simple, données à jour pour toute l'équipe, plus d'erreurs de formules Excel.
+
+### Journey 3: Commercial génère un reporting rapide
+
+**Opening Scene :** Sophie doit préparer un rapport pour la direction sur les encours clients. Actuellement, elle doit ouvrir plusieurs onglets Excel, copier-coller des données, faire des calculs manuels avec risque d'erreurs.
+
+**Rising Action :** Sophie ouvre l'appli, va dans "Reporting" ou "Tableaux de bord", voit une vue synthétique : encours par client, factures en attente, échéances à venir. Elle peut exporter ou faire une capture d'écran.
+
+**Climax :** En quelques clics, elle a une vue claire et à jour pour la direction, sans manipulation Excel.
+
+**Resolution :** Reporting rapide et fiable, données cohérentes avec trésorerie/direction, gain de temps.
+
+## Web App Specific Requirements
+
+### Project-Type Overview
+
+Application web classique (Multi-Page Application) pour usage interne de l'équipe commerciale.
+
+### Technical Architecture Considerations
+
+**Architecture :** Multi-Page Application (MPA) - approche traditionnelle adaptée à une application interne.
+
+**Browser Support :** Navigateurs modernes (Chrome, Firefox, Edge) - pas de support nécessaire pour navigateurs anciens.
+
+**SEO Strategy :** Non applicable - application interne, pas d'indexation par les moteurs de recherche nécessaire.
+
+**Real-time Updates :** Non requis - rafraîchissement manuel suffit pour les besoins de suivi facturation/paiement.
+
+**Accessibility Level :** Basique - conformité WCAG niveau A suffisante pour usage interne.
+
+### Browser Matrix
+
+- Chrome (dernières 2 versions) : Support complet
+- Firefox (dernières 2 versions) : Support complet
+- Edge (dernières 2 versions) : Support complet
+- Safari : Support basique si nécessaire
+- Navigateurs anciens : Non supportés
+
+### Responsive Design
+
+Interface responsive pour usage sur desktop principalement, avec support basique tablette si nécessaire. Pas de priorité mobile-first.
+
+### Performance Targets
+
+- Temps de chargement initial : < 3 secondes
+- Temps de réponse aux interactions : < 1 seconde
+
+### Implementation Considerations
+
+- Stack technique simple et maintenable
+- Architecture permettant évolution future si besoin
+
+## Functional Requirements
+
+### Client Management
+
+- FR1: Commercial peut rechercher un client par nom
+- FR2: Commercial peut voir la vue détaillée d'un client (factures, paiements, encours sur une seule page)
+- FR2b: Commercial peut ajouter un client (depuis la liste clients)
+- FR2c: Commercial peut supprimer un client (avec confirmation ; cascade factures, paiements, écheanciers)
+
+### Invoice Tracking
+
+- FR3: Commercial peut voir la liste des factures d'un client avec détails (n° facture, n° vente, date, type produit, cycle, quantités, quantité livrée, montants CA HT, état payé/en attente)
+- FR3b: Commercial peut ajouter manuellement une facture pour le suivi (saisie des données de suivi ; la facturation provient de Pennylane)
+- FR3c: Commercial peut modifier une facture existante (correction de saisie)
+- FR3d: Commercial peut supprimer une facture (avec confirmation ; cascade paiements et écheancier)
+
+### Payment Management
+
+- FR4: Commercial peut enregistrer un paiement (montant, date) pour une facture
+- FR4b: Commercial peut ajouter un écheancier de paiement à une facture (facture associée, nombre d’échéances, date de début d’écheancier)
+- FR5: Commercial peut voir l'historique des paiements d'un client
+- FR5b: Commercial peut voir l’écheancier associé à une facture (nombre d’échéances, date de début)
+- FR5c: Commercial peut supprimer un paiement (avec confirmation)
+- FR5d: Commercial peut supprimer un écheancier (avec confirmation)
+
+### Financial Calculations
+
+- FR6: Le système calcule automatiquement l'encours (montant restant dû) par client
+- FR7: Le système calcule automatiquement l'encours total
+- FR8: Le système affiche les échéances à venir (dates ≥ aujourd’hui) : pour les factures avec écheancier, dates et montants sont calculés à partir de l’écheancier (date début + N mois, montant par échéance) ; pour les factures sans écheancier, date de facture et encours
+- FR9: Le système met à jour automatiquement les calculs après enregistrement d'un paiement
+
+### Reporting & Analytics
+
+- FR10: Commercial peut voir un tableau de bord synthétique (encours par client, factures en attente, échéances)
+- FR10b: Commercial peut voir les top clients par type de produit (alevins, larves) avec quantités et CA, filtrable par cycle
+- FR10c: Commercial peut voir la synthèse des quantités vendues par client (quantités facturées, quantités livrées), avec répartition par type si pertinent
+- FR11: Commercial peut exporter les données
+
+### Data Management
+
+- FR12: Le système maintient une seule source de vérité centralisée pour toutes les données de suivi
+- FR13: Les données sont accessibles par toute l'équipe commerciale
+
+## Non-Functional Requirements
+
+### Security
+
+- NFR1: Accès restreint à l'équipe commerciale autorisée uniquement

+ 115 - 0
_bmad-output/planning-artifacts/product-brief-bmad-2026-02-09.md

@@ -0,0 +1,115 @@
+---
+stepsCompleted: [1, 2, 3, 4, 5]
+inputDocuments: []
+date: 2026-02-09
+author: Livinweb
+---
+
+# Product Brief: dirCops
+
+**Nom de l’application :** dirCops (suivi facturation / échéancier – Écloserie marine Gravelines)
+
+<!-- Content will be appended sequentially through collaborative workflow steps -->
+
+## Executive Summary
+
+Le client (Ecloserie marine Gravelines / EMGI) gère aujourd'hui tout son suivi commercial dans Excel : facturation, paiements, échéanciers, encours clients, trésorerie. L'outil atteint ses limites : formules cassées, actualisation impossible, multiplication des feuilles. L'équipe commerciale ne s'y retrouve plus, les décisions s'appuient sur des données peu fiables et il est difficile d'expliquer un encours à un client. Une seule personne maîtrise le classeur.
+L'objectif est de remplacer cette partie par une application dédiée au **suivi** (sans gérer la création des factures) : suivi factures, paiements et échéanciers par client, avec les données métier (quantités, n° facture, indicateurs type encours, couverture, etc.) que les ERP du marché ne gèrent pas bien. L'application doit être **simple**, **facile à utiliser**, permettre de suivre clients, échéanciers et paiements sans effort, et de faire du **reporting rapidement**. Elle reste à coût maîtrisé (~20 k€), donc volontairement sobre et ciblée.
+
+---
+
+## Core Vision
+
+### Problem Statement
+
+L'équipe commerciale d'EMGI s'appuie sur des classeurs Excel partagés (SharePoint/Teams) pour le suivi des factures, des paiements et des échéanciers par client. Le système est devenu fragile (liens cassés, formules en erreur, message « impossible d'actualiser »), difficile à maintenir et concentré entre les mains d'une seule personne. Les utilisateurs ne s'y retrouvent plus.
+
+### Problem Impact
+
+- **Erreurs de suivi** : données incohérentes ou obsolètes.
+- **Temps perdu** : navigation entre onglets et feuilles, vérifications manuelles.
+- **Décisions sur des données fausses** : risque pour la trésorerie et la relation client.
+- **Difficulté à expliquer un encours à un client** : pas de vue fiable et partagée par toute l'équipe commerciale.
+
+### Why Existing Solutions Fall Short
+
+Les ERP standards ne couvrent pas les spécificités métier du suivi tel qu'EMGI le pratique (indicateurs type échéance contrat, encours, couverture, écarts cumulés, suivi par type de produit / cycle, etc.). L'adaptation serait lourde ou inadaptée. Le besoin est ciblé : un **suivi** facturation / échéancier / paiement, pas un ERP complet.
+
+### Proposed Solution
+
+Une application dédiée au **suivi facturation et échéancier de paiement** :
+- Suivi des factures, paiements et échéanciers **par client**.
+- Données essentielles : quantités, numéros de facture et de vente, montants, et indicateurs métier (encours, couverture, etc.) que les ERP ne gèrent pas « proprement ».
+- Pas de gestion de la facture en tant que document (création/édition) : la facturation provient de **Pennylane** ; l'appli consolide et affiche le suivi de ce qui est déjà facturé et payé.
+Objectif : une seule source de vérité, utilisable par toute l'équipe commerciale.
+
+### Key Differentiators
+
+- **Simplicité et facilité d'utilisation** : plus besoin qu'une seule personne sache « faire tourner le système ».
+- **Suivi client, échéancier et paiement** : consultation et mise à jour faciles, sans se perdre dans des feuilles Excel.
+- **Reporting rapide** : tableaux de bord et exports pour le commercial et la direction.
+- **Métier-first** : modélisation des notions (encours, échéances, couverture, etc.) telles qu'EMGI les utilise, au lieu d'un ERP générique.
+- **Coût maîtrisé / simplicité** : l'application ne coûte pas cher ; elle reste volontairement simple pour répondre au besoin sans sur-dimensionnement.
+
+---
+
+## Target Users
+
+### Primary Users
+
+**Équipe commerciale** — Utilisateurs principaux au quotidien. Ils consultent et mettent à jour le suivi des factures, des échéanciers et des paiements par client. L'objectif est qu'ils puissent le faire sans dépendre d'une seule personne maîtrisant un classeur Excel complexe : application simple, compréhensible par tous les commerciaux.
+
+### Secondary Users
+
+**Trésorerie** et **Direction** — Bénéficiaires indirects. Ils profitent de données plus fiables et d'un reporting plus clair ; si le suivi commercial est mal fait, ils sont fortement impactés. Pas de conflit avec le commercial : le besoin est de simplifier le travail du commercial pour que trésorerie et direction aient une base de données fiable. Dans le cadre d'une application ciblée (~20 k€), aucun parcours ni persona dédié complexe pour ces rôles — un seul groupe utilisateur principal (commercial) est privilégié.
+
+### User Journey
+
+Non détaillé dans ce brief ; l'accent est mis sur un usage simple et répétitif (consultation et mise à jour du suivi par client, reporting rapide) sans scénarios multiples.
+
+---
+
+## Success Metrics
+
+**Succès utilisateur** : l'équipe commerciale utilise l'application pour le suivi facturation / échéancier / paiement sans dépendre d'une seule personne ; consultation et reporting en quelques clics ; plus d'usage d'Excel pour ce périmètre. **Contrainte de coût** : l'application reste peu chère et donc volontairement simple — le succès inclut de livrer une solution efficace dans ce cadre.
+
+**Succès business** : une seule source de vérité pour trésorerie et direction ; moins d'erreurs de suivi et de décisions sur des données fausses ; temps gagné et possibilité d'expliquer un encours à un client de façon fiable.
+
+### Business Objectives
+
+Adoption par l'équipe commerciale ; abandon du classeur Excel pour le suivi concerné ; données fiables pour la trésorerie et la direction.
+
+### Key Performance Indicators
+
+- Utilisation effective par les commerciaux (suivi et reporting faits dans l'appli).
+- Fin de la dépendance à une seule personne pour « faire tourner » le suivi.
+- Réduction des erreurs / incohérences constatées par trésorerie et direction (qualitatif ou via feedback).
+
+---
+
+## MVP Scope
+
+### Core Features
+
+- **Suivi des factures** : liste par client, n° facture, n° vente, date, quantités, montants (ex. CA HT).
+- **Suivi des paiements / échéancier** : ce qui est payé, ce qui reste dû (encours), échéances. Possibilité d’ajouter un **écheancier de paiement** à une facture : facture associée, nombre d’échéances, date de début d’écheancier.
+- **Vue par client** : synthèse par client (factures, paiements, encours).
+- **Données métier spécifiques** : au minimum encours, échéances ; couverture / indicateurs type Excel si possible dans la limite du budget.
+- **Reporting simple** : exports ou vues synthétiques (tableaux de bord basiques) pour commercial, trésorerie, direction.
+- **Une seule source de vérité** : données centralisées, plus de classeur Excel pour ce périmètre.
+
+### Out of Scope for MVP
+
+- Création / édition des factures (document facture) — gérée par Pennylane.
+- Gestion complète trésorerie (bancaire, prévisionnel détaillé).
+- Parcours dédiés complexes pour trésorerie / direction (priorité au besoin commercial).
+- Fonctionnalités « nice to have » qui feraient dépasser le cadre coût / simplicité.
+
+### MVP Success Criteria
+
+- L'équipe commerciale utilise l'appli pour ce suivi et n'utilise plus Excel pour ce périmètre.
+- Plus de dépendance à une seule personne ; trésorerie et direction s'appuient sur les mêmes données.
+
+### Future Vision
+
+- Évolutions possibles après adoption : indicateurs métier supplémentaires, intégrations (ERP, compta), extensions vers d'autres processus — sans engagement dans le MVP.

+ 25 - 0
_bmad-output/planning-artifacts/questions-en-suspens.md

@@ -0,0 +1,25 @@
+# Questions en suspens
+
+**Application :** dirCops  
+**Projet :** Suivi facturation / échéancier / paiement (EMGI)  
+**Date :** 2026-02-09
+
+---
+
+## Récapitulatif par priorité
+
+| Priorité   | Thème              | Question courte |
+|-----------|--------------------|-----------------|
+| Élevée    | Pennylane          | Import/sync Pennylane prévu ou saisie manuelle uniquement ? |
+| Moyenne   | Export             | Format et contenu des exports (CSV/JSON, champs) ? |
+| Moyenne   | Couverture / GTT   | Indicateurs « type Excel » et % GTT dans le MVP ou après ? |
+| Moyenne   | Top clients        | Limite (Top 10/15) ou pas de limite ? |
+| Basse     | Accessibilité      | Niveau WCAG (A vs AA) ? |
+| Basse     | Écheancier         | Échéances toujours mensuelles ? Suivi par échéance requis ? |
+| — (résolu) | Rôles              | Un seul rôle (commercial/admin) en MVP. |
+| — (résolu) | Safari             | Pas requis, pas supporté (option). |
+| — (résolu) | Correction données | Modification / suppression : implémenté (facture, paiement, écheancier, client). |
+
+---
+
+*Document à mettre à jour au fur et à mesure des réponses du prospect ou des décisions techniques.*

+ 169 - 0
_bmad-output/planning-artifacts/schema-relationnel-et-tables-donnees.md

@@ -0,0 +1,169 @@
+# Schéma relationnel simplifié et tables de données
+
+**Application :** dirCops  
+**Projet :** Suivi facturation / échéancier / paiement (EMGI)  
+**Date :** 2026-02-09  
+**Référence physique :** `app/sql/schema.sql`
+
+---
+
+## 1. Schéma relationnel simplifié
+
+Représentation des tables et des relations (clés primaires et étrangères). Les cardinalités sont indiquées (1:N, 0:1).
+
+```
+                    ┌──────────────────────────┐
+                    │        clients           │
+                    ├──────────────────────────┤
+                    │ id (PK)                  │
+                    │ nom                      │
+                    │ created_at              │
+                    └────────────┬─────────────┘
+                                 │ 1
+                                 │
+                                 │ N
+                    ┌────────────▼─────────────┐
+                    │       factures           │
+                    ├──────────────────────────┤
+                    │ id (PK)                  │
+                    │ client_id (FK → clients) │
+                    │ n_facture, n_vente       │
+                    │ date_facture             │
+                    │ type_produit, cycle      │
+                    │ quantites, qte_livree    │
+                    │ montant_ht               │
+                    │ created_at               │
+                    └────┬──────────────┬──────┘
+                         │ 1            │ 1
+              ┌──────────┘              └──────────┐
+              │ N                                   │ 0..1
+              ▼                                     ▼
+┌─────────────────────────┐           ┌─────────────────────────┐
+│      paiements           │           │      echeanciers       │
+├─────────────────────────┤           ├─────────────────────────┤
+│ id (PK)                  │           │ id (PK)                 │
+│ facture_id (FK→factures) │           │ facture_id (FK→factures)│
+│ montant                  │           │ nb_echeances            │
+│ date_paiement            │           │ date_debut_echeancier  │
+│ created_at               │           │ montant_par_echeance   │
+└─────────────────────────┘           │ created_at             │
+                                      └─────────────────────────┘
+```
+
+**Relations :**
+- **clients** 1 —— N **factures** (un client a plusieurs factures ; une facture appartient à un client).
+- **factures** 1 —— N **paiements** (une facture a plusieurs paiements ; un paiement est rattaché à une facture).
+- **factures** 1 —— 0..1 **echeanciers** (une facture a au plus un écheancier ; un écheancier est rattaché à une facture).
+
+**Contraintes :**
+- Suppression en cascade : suppression d’un client → suppression de ses factures, puis de leurs paiements et écheanciers. Suppression d’une facture → suppression de ses paiements et de son écheancier.
+
+---
+
+## 2. Tables – Détail des champs
+
+Format : pour chaque table, description courte puis pour chaque colonne : **Nom**, **Type**, **Description**, **Clé**.
+
+---
+
+### Table `clients`
+
+Table des clients (sociétés ou entités facturées). Une facture est toujours liée à un client.
+
+| Nom         | Type              | Description                                      | Clé     |
+|-------------|-------------------|--------------------------------------------------|---------|
+| id          | int UNSIGNED      | Identifiant unique auto incrémenté               | Primaire|
+| nom         | varchar(255)      | Nom du client (raison sociale ou libellé)        |         |
+| created_at  | datetime          | Date et heure de création de l’enregistrement   |         |
+
+---
+
+### Table `factures`
+
+Table des factures pour le suivi. La facturation (document, PDF) est gérée dans Pennylane ; ici on enregistre les données de suivi (n° facture, montant, type produit, cycle, quantités, etc.).
+
+| Nom          | Type              | Description                                                                 | Clé     |
+|--------------|-------------------|-----------------------------------------------------------------------------|---------|
+| id           | int UNSIGNED      | Identifiant unique auto incrémenté                                          | Primaire|
+| client_id    | int UNSIGNED      | Référence du client concerné                                               | Étrangère (→ clients.id), NOT NULL |
+| n_facture    | varchar(64)       | Numéro de facture (ex. FA-001)                                              | NOT NULL |
+| n_vente      | varchar(64)       | Numéro de vente ou référence vente (optionnel)                              |         |
+| date_facture | date              | Date de la facture                                                          | NOT NULL |
+| type_produit | varchar(32)       | Type de produit : alevins, larves (ou NULL)                                 |         |
+| cycle        | varchar(16)       | Cycle de référence (ex. 24-25, 25-26)                                       |         |
+| quantites    | decimal(12,2)     | Quantité facturée                                                           |         |
+| qte_livree   | decimal(12,2)     | Quantité déjà livrée                                                        |         |
+| montant_ht   | decimal(12,2)     | Montant HT de la facture (€)                                                | NOT NULL |
+| created_at   | datetime          | Date et heure de création de l’enregistrement dans l’appli                 |         |
+
+**Index :** `client_id`, `type_produit`, `cycle`.
+
+---
+
+### Table `paiements`
+
+Table des paiements enregistrés pour une facture. L’encours d’une facture est calculé comme (montant_ht − somme des montants des paiements de cette facture).
+
+| Nom           | Type              | Description                                      | Clé     |
+|---------------|-------------------|--------------------------------------------------|---------|
+| id            | int UNSIGNED      | Identifiant unique auto incrémenté               | Primaire|
+| facture_id    | int UNSIGNED      | Référence de la facture concernée               | Étrangère (→ factures.id), NOT NULL |
+| montant       | decimal(12,2)     | Montant du paiement (€)                         | NOT NULL |
+| date_paiement | date              | Date du paiement                                | NOT NULL |
+| created_at    | datetime          | Date et heure de création de l’enregistrement  |         |
+
+**Index :** `facture_id`, `date_paiement` (idx_paiements_date).
+
+**Contraintes de validation :** `CHECK (montant > 0)`.
+
+---
+
+### Table `echeanciers`
+
+Table des écheanciers de paiement associés à une facture. Une facture peut avoir au plus un écheancier. Les dates d’échéance sont dérivées à l’affichage : date_debut_echeancier + 0 mois, +1 mois, +2 mois, etc. (échéances mensuelles). Le champ `montant_par_echeance` est calculé à la création (encours / nb_echeances) et stocké.
+
+| Nom                    | Type              | Description                                                                 | Clé     |
+|------------------------|-------------------|-----------------------------------------------------------------------------|---------|
+| id                     | int UNSIGNED      | Identifiant unique auto incrémenté                                          | Primaire|
+| facture_id             | int UNSIGNED      | Référence de la facture concernée                                           | Étrangère (→ factures.id), NOT NULL, UNIQUE |
+| nb_echeances           | int UNSIGNED      | Nombre d’échéances prévues                                                   | NOT NULL |
+| date_debut_echeancier  | date              | Date de début de l’écheancier (1ère échéance)                               | NOT NULL |
+| montant_par_echeance   | decimal(12,2)     | Montant par échéance (calculé à la création : encours / nb_echeances)      | NOT NULL |
+| created_at             | datetime          | Date et heure de création de l’enregistrement                              |         |
+
+**Index :** `facture_id` (UNIQUE pour garantir un écheancier par facture).
+
+**Contraintes de validation :** `CHECK (nb_echeances > 0)`, `CHECK (montant_par_echeance > 0)`.
+
+---
+
+## 3. Résumé des clés et contraintes
+
+| Table       | Clé primaire | Clés étrangères     | Contrainte cascade                          |
+|-------------|--------------|---------------------|---------------------------------------------|
+| clients     | id           | —                   | —                                           |
+| factures    | id           | client_id → clients | ON DELETE CASCADE (client supprimé)         |
+| paiements   | id           | facture_id → factures | ON DELETE CASCADE (facture supprimée)      |
+| echeanciers | id           | facture_id → factures | ON DELETE CASCADE (facture supprimée)      |
+
+### 3.1 Contraintes de validation (CHECK)
+
+| Table       | Contrainte | Description |
+|-------------|------------|-------------|
+| paiements   | chk_paiements_montant | montant > 0 |
+| echeanciers | chk_echeanciers_nb_echeances | nb_echeances > 0 |
+| echeanciers | chk_echeanciers_montant | montant_par_echeance > 0 |
+
+### 3.2 Index (référence app/sql/schema.sql)
+
+| Table       | Index | Colonne(s) |
+|-------------|-------|------------|
+| factures    | idx_factures_client_id | client_id |
+| factures    | idx_factures_type_produit | type_produit |
+| factures    | idx_factures_cycle | cycle |
+| paiements   | idx_paiements_facture_id | facture_id |
+| paiements   | idx_paiements_date | date_paiement |
+| echeanciers | uk_echeanciers_facture_id (UNIQUE) | facture_id |
+| echeanciers | idx_echeanciers_facture_id | facture_id |
+
+**Note :** Les statuts « payé » / « en attente » ne sont pas stockés ; ils sont calculés (encours facture = montant_ht − somme des paiements ; si encours ≤ 0 alors payé, sinon en attente).

+ 137 - 0
_bmad-output/planning-artifacts/schema-workflows.md

@@ -0,0 +1,137 @@
+# Schéma des workflows métier
+
+**Application :** dirCops  
+**Projet :** Suivi facturation / échéancier / paiement (EMGI)  
+**Date :** 2026-02-09  
+**Objectif :** Décrire de façon détaillée tous les workflows (états, transitions, acteurs, règles). En MVP il n’y a qu’un seul cycle de vie formalisé : celui de la facture (état dérivé de l’encours).
+
+---
+
+## 1. Vue d’ensemble
+
+Dans ce projet, les **workflows sont volontairement simples** : pas de chaîne de validation (RH, IT), pas de statuts stockés en base pour les factures, pas de SLA ni relances. Le seul cycle de vie explicite est celui de la **facture** (état calculé : en attente / payée). Les autres entités (client, paiement, écheancier) n’ont pas de machine à états.
+
+| Workflow / entité | États ? | Stocké en base ? | Acteur | Détail ci‑dessous |
+|-------------------|---------|-------------------|--------|--------------------|
+| **Facture (suivi)** | Oui (2 états dérivés) | Non (calculé) | Commercial / système | § 2 |
+| **Paiement** | Non | — | Commercial | Création directe, pas de statut |
+| **Écheancier** | Non | — | Commercial | Création directe, pas de statut |
+| **Client** | Non | — | — | Pas de cycle de vie métier |
+
+---
+
+## 2. Workflow « Facture (état de suivi) »
+
+L’état d’une facture est **dérivé** des paiements (non stocké en base). Il sert à l’affichage (Payé / En attente) et au filtrage (échéances à venir = factures en attente).
+
+### 2.1 Entité concernée
+
+- **Table :** `factures` (+ agrégation des `paiements`).
+- **Champ état :** aucun. L’état est calculé : `encours_facture = montant_ht - SUM(paiements.montant)` ; si `encours_facture <= 0` → **Payée**, sinon → **En attente**.
+
+### 2.2 États
+
+| Code état   | Libellé   | Condition (calcul)           |
+|-------------|-----------|-----------------------------|
+| `en_attente`| En attente| encours_facture > 0          |
+| `paye`      | Payée     | encours_facture ≤ 0          |
+
+### 2.3 Transitions
+
+| Transition     | Depuis      | Vers   | Déclencheur                    | Acteur     | Règle métier |
+|----------------|-------------|--------|---------------------------------|------------|--------------|
+| Paiement enregistré | En attente | Payée* | POST paiement (montant ≥ encours restant) | Commercial | Automatique après enregistrement du paiement. Pas de validation. |
+
+*Une facture peut rester « En attente » après un paiement partiel (plusieurs paiements possibles).
+
+### 2.4 Diagramme d’états (machine à états simplifiée)
+
+```
+                    ┌─────────────────────────────────────┐
+                    │  Condition : encours_facture > 0     │
+                    ▼                                     │
+              ┌─────────────┐                             │
+              │ EN ATTENTE  │                             │
+              └──────┬──────┘                             │
+                     │                                    │
+                     │ Transition : enregistrement        │
+                     │ d’un ou plusieurs paiements       │
+                     │ tels que encours_facture ≤ 0        │
+                     │ (acteur : Commercial)               │
+                     ▼                                    │
+              ┌─────────────┐                             │
+              │   PAYÉE     │ ────────────────────────────┘
+              └─────────────┘   (pas de transition retour
+                    │            en MVP : on ne « défait »
+                    │            pas un paiement)
+                    │
+                    └── État final (aucune autre transition)
+```
+
+### 2.5 Règles complémentaires
+
+- **Transition retour possible** : la suppression d’un paiement (DELETE) fait recalculer l’encours ; une facture « Payée » peut redevenir « En attente » si le dernier paiement est supprimé.
+- **Pas de validation métier** : la saisie d’un paiement est directe (pas d’approbation RH/IT).
+- **Pas de SLA, relances, escalades** : hors périmètre MVP.
+- **Historisation** : les dates de création sont dans `factures.created_at` et `paiements.created_at` ; pas d’audit log « qui a changé quel statut ».
+
+---
+
+## 3. Entités sans workflow (création directe)
+
+### 3.1 Paiement
+
+- **Création** : formulaire « Enregistrer un paiement » → POST `/api/paiements.php` (facture_id, montant, date_paiement). Acteur : Commercial.
+- **Suppression** : bouton Supprimer → confirmation → DELETE `/api/paiements.php?id=`. Acteur : Commercial. L’encours de la facture est recalculé à la volée après suppression.
+- **Pas d’états** : pas de statut « brouillon », « validé », etc. Enregistrement direct.
+
+### 3.2 Écheancier
+
+- **Création** : formulaire « Ajouter un écheancier » → POST `/api/echeanciers.php` (facture_id, nb_echeances, date_debut_echeancier). Acteur : Commercial.
+- **Suppression** : bouton Supprimer → confirmation → DELETE `/api/echeanciers.php?id=`. Acteur : Commercial.
+- **Pas d’états** : une facture a ou n’a pas d’écheancier ; pas de statut « en cours », « terminé » sur l’écheancier en MVP.
+- **Évolution possible** (post‑MVP) : statut par échéance (à venir / payée / partielle) si le client le demande.
+
+### 3.3 Client
+
+- **Création** : formulaire « Ajouter un client » (accueil) → POST `/api/clients.php` (nom). Acteur : Commercial.
+- **Suppression** : bouton Supprimer → confirmation → DELETE `/api/clients.php?id=`. En cascade : factures, paiements, écheanciers du client. Vérification applicative possible (refus si factures existantes selon règle métier). Acteur : Commercial.
+- Pas de cycle de vie métier (pas de statut actif/archivé en MVP).
+
+---
+
+## 4. Suppressions (actions destructives)
+
+| Entité    | Action   | Déclencheur | Confirmation | Effet |
+|-----------|----------|-------------|--------------|--------|
+| Client    | Suppression | Bouton Supprimer (liste clients) | Oui (avec avertissement cascade) | DELETE clients.php?id= ; cascade factures → paiements, écheanciers. Vérification possible côté API (refus si factures). |
+| Facture   | Suppression | Bouton Supprimer (liste factures, fiche client) | Oui | DELETE factures.php?id= ; cascade paiements, écheancier. |
+| Paiement  | Suppression | Bouton Supprimer (liste paiements, fiche client) | Oui | DELETE paiements.php?id= ; encours recalculé à la volée. |
+| Écheancier| Suppression | Bouton Supprimer (liste écheanciers, fiche client) | Oui | DELETE echeanciers.php?id= ; facture inchangée. |
+
+Aucun workflow de validation : la confirmation utilisateur (dialog) suffit ; pas d’audit log des suppressions en MVP.
+
+---
+
+## 5. Ce qui n’est pas dans le périmètre workflow (MVP)
+
+- **Validation en plusieurs étapes** (ex. brouillon → nouveau → en attente lettre → en traitement IT → terminé) : non.
+- **Statuts RH / IT distincts** : non.
+- **SLA, relances, escalades** : non.
+- **Audit log des changements d’état** : non.
+- **Champ `global_status` / `hr_status` / `it_status` en base** : non (seul l’état dérivé « en attente / payée » pour la facture, calculé à la volée).
+
+---
+
+## 6. Synthèse pour le chiffrage
+
+| Élément | Présent en MVP ? | Détail |
+|---------|-------------------|--------|
+| États facture (en attente / payée) | Oui | Dérivés, non stockés ; diagramme § 2.4. |
+| Transitions avec acteur | Oui | 1 transition : enregistrement paiement → passage à Payée si encours ≤ 0. |
+| Workflow de validation (approbation) | Non | Saisie directe. |
+| Statuts stockés en base | Non | Uniquement calcul à l’affichage. |
+| SLA / relances / escalades | Non | Hors scope. |
+| Historisation / audit log | Non | Uniquement created_at. |
+
+Les workflows sont donc **bien détaillés en schéma** pour ce qui existe (facture) ; le reste du projet repose sur des créations directes sans machine à états.

+ 89 - 0
_bmad-output/planning-artifacts/synthèse-projet-lecture-client.md

@@ -0,0 +1,89 @@
+# Synthèse projet – Lecture client
+
+**Application :** dirCops (suivi facturation / échéancier – Écloserie marine Gravelines)  
+**Projet :** Suivi facturation / échéancier / paiement — Écloserie marine  
+**Date :** 2026-02-10  
+**Objectif :** Permettre au client de relire et valider le périmètre en peu de temps.
+
+---
+
+## 1. En une page : objectif et livrable
+
+- **Problème :** Aujourd’hui le suivi facturation, paiements et échéanciers se fait dans Excel. C’est fragile, peu lisible et dépendant d’une seule personne.
+- **Solution :** Une application web **dirCops** dédiée au **suivi** : les factures sont émises dans **Pennylane** ; dans l’appli, l’équipe commerciale saisit et consulte les factures pour le suivi (encours, paiements, écheanciers) et dispose de tableaux de bord et d’exports.
+- **Livré :** Application utilisable par l’équipe commerciale (liste **clients** — noms de clients réels, pas des champs Excel de type « lieu de départ » —, détail client avec factures/paiements/écheanciers, ajout/modification/suppression facture, ajout/suppression paiements, ajout/suppression écheanciers, tableau de bord (encours + synthèse + échéances à venir), **Top clients (Top 15)**, Quantités par client, **export encours CSV** et **export de l’ensemble des factures (CSV) en pièce jointe**). Une seule source de vérité, plus besoin d’Excel pour ce périmètre.
+- **Accès :** authentification **Livinweb ModX** (identifiant / mot de passe), SSO en option.
+- **Prochaines étapes :** Valider cette synthèse, répondre aux questions encore ouvertes (voir § 6), puis chiffrage et planning.
+
+---
+
+## 2. Glossaire (vocabulaire du projet)
+
+| Terme | Signification |
+|-------|----------------|
+| **Encours** | Montant restant dû (somme des factures non encore soldées par les paiements). |
+| **Écheancier** | Plan de paiement d’une facture : nombre d’échéances et date de début (ex. 3 échéances à partir du 01/02/2026). |
+| **Facture (suivi)** | Saisie dans l’appli pour le suivi ; le document officiel (PDF) est émis dans Pennylane. |
+| **Pennylane** | Logiciel de facturation utilisé pour éditer et émettre les factures ; l’appli ne fait pas la facturation, elle en fait le suivi. |
+| **Type produit** | Alevins ou Larves (catégorie de produit pour le reporting). |
+| **Cycle** | Période de référence (ex. 24-25, 25-26) pour filtrer les vues Top clients et reporting. |
+| **Top clients** | Vue qui classe les clients par quantités et/ou CA (par type alevins/larves et optionnellement par cycle). |
+| **Client** | Dans l’appli = nom du client (ex. AQUANARIA, PHILOSOFISH, AQN). |
+
+---
+
+## 3. Ce qui est livré (écrans et fonctions)
+
+- **Accueil / Liste des clients** : recherche par nom, accès au détail d’un client. Formulaire « Ajouter un client », bouton Supprimer par client (avec confirmation).
+- **Fiche client** : encours, liste des factures (n°, date, type, cycle, quantités, montant, encours, état) avec boutons Modifier et Supprimer ; liste des paiements et des écheanciers avec bouton Supprimer. Formulaires : ajouter une facture (suivi), modifier une facture, ajouter un écheancier, enregistrer un paiement.
+- **Tableau de bord** : encours par client (tri croissant), synthèse (encours total en k€, délai moyen de paiement en jours), échéances à venir (calculées à partir des écheanciers quand ils existent : date et montant par échéance ; sinon date de facture et encours). Liens : **export encours CSV** et **export de l’ensemble des factures (PJ)** (fichier téléchargeable contenant toutes les factures renseignées).
+- **Top clients** : choix type (Alevins / Larves) et cycle ; tableau **Top 15** clients avec quantités, CA, pourcentages.
+- **Quantités par client** : synthèse quantités facturées / livrées par client (filtre type optionnel).
+- **Exports** : (1) CSV encours par client ; (2) CSV « ensemble des factures » (suivi-factures-YYYY-MM-DD.csv) utilisable en pièce jointe.
+
+---
+
+## 4. Règles métier et points d’alignement (résumé)
+
+- **Encours** : encours facture = `montant_ht − somme(paiements)` ; si encours < 0, on affiche **0** (pas de crédit client affiché).
+- **Paiement > montant facture** : autorisé ; encours affiché = **0**.
+- **Unicité n° facture** : pas de contrainte dans le périmètre actuel (option future : unicité par client).
+- **Clients en doublon** : pas de détection/fusion (acceptés tels quels).
+- **Navigateurs** : Safari **non supporté** (option future) ; pas de recette Safari.
+
+---
+
+## 5. Ce qui n’est pas livré (hors périmètre)
+
+- **Génération ou édition du document facture (PDF)** — gérée par Pennylane.
+- **Gestion complète de la trésorerie** (bancaire, prévisionnel détaillé).
+- **Parcours dédiés complexes** pour la trésorerie ou la direction (priorité au besoin commercial).
+- **Import automatique depuis Pennylane** (pour l’instant saisie manuelle dans l’appli après émission dans Pennylane) — à discuter si besoin.
+- **Crédit client** (si paiements > encours) : non géré/affiché dans le MVP (option future).
+
+---
+
+## 6. Questions restantes / à préciser
+
+Les décisions déjà figées (accès, rôles, Top 15, Safari non supporté, règles métier clés) sont consolidées dans la doc projet.  
+Les points ci-dessous restent à préciser (selon besoin) :
+
+- **Exports CSV** : liste exacte des colonnes attendues pour :
+  - Export « Encours par client »
+  - Export « Ensemble des factures (PJ) »
+  - Formats (dates, montants, séparateur, compatibilité Excel)
+- **Pennylane** : souhaitez-vous (plus tard) un import/synchronisation automatique des factures (et éventuellement des paiements), ou la saisie manuelle reste-t-elle la règle ?
+- **Déploiement / hébergement** : où et par qui (déploiement, sauvegardes, accès) ?
+
+Vos réponses permettront de finaliser le chiffrage et le planning.
+
+---
+
+## 6. Engagements réciproques (à valider)
+
+- **Côté client :** Fourniture des accès nécessaires (hébergement si applicable), données de test si besoin, désignation d’un interlocuteur pour la recette et les validations, réponses aux questions ouvertes dans les délais convenus.
+- **Côté livrant :** Livraison de l’application selon le périmètre décrit, déploiement (selon accord), recette selon le cahier des recettes fourni, et éventuellement formation et garantie (à préciser dans le devis).
+
+---
+
+*Document à remettre au client pour relecture du projet. À adapter selon le contexte (nom du livrant, délais, détails du devis).*

+ 0 - 6
app/.env.example

@@ -1,6 +0,0 @@
-DB_HOST=localhost
-DB_NAME=bmad
-DB_USER=root
-DB_PASS=
-DB_CHARSET=utf8mb4
-MOCK_MODE=1

+ 0 - 4
app/.gitignore

@@ -1,4 +0,0 @@
-.env
-vendor/
-*.log
-.DS_Store

+ 0 - 133
app/INSTALL.md

@@ -1,133 +0,0 @@
-# Création de la base et lancement
-
-## 0. Si « mysql » n’est pas reconnu
-
-La commande `mysql` doit être exécutable. Soit tu l’ajoutes au PATH, soit tu utilises le **chemin complet** vers `mysql.exe`.
-
-**Où se trouve mysql.exe ?**
-
-- **XAMPP** : `C:\xampp\mysql\bin\mysql.exe`
-- **WAMP** : `C:\wamp64\bin\mysql\mysql8.x.x\bin\mysql.exe` (adapte la version)
-- **MySQL installé seul** : souvent `C:\Program Files\MySQL\MySQL Server 8.x\bin\mysql.exe`
-- **Laragon** : `C:\laragon\bin\mysql\mysql-8.x.x-w64\bin\mysql.exe`
-
-Dans les commandes ci‑dessous, remplace `mysql` par le chemin complet, par exemple :
-```powershell
-& "C:\xampp\mysql\bin\mysql.exe" -u root -p -e "CREATE DATABASE IF NOT EXISTS bmad CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
-```
-(Le `&` en PowerShell permet d’exécuter un chemin entre guillemets.)
-
-**Si tu n’as ni XAMPP ni MySQL** : installe [XAMPP](https://www.apachefriends.org/) (avec MySQL) ou [MariaDB](https://mariadb.org/download/), puis utilise le chemin vers `mysql.exe` comme ci‑dessus.
-
----
-
-## 1. Créer la base de données
-
-Ouvre un terminal (PowerShell ou CMD) et lance MySQL/MariaDB.
-
-**Si MySQL/MariaDB est dans le PATH :**
-```bash
-mysql -u root -p -e "CREATE DATABASE IF NOT EXISTS bmad CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
-```
-(Entre le mot de passe root quand il est demandé. Si pas de mot de passe, utilise `mysql -u root` sans `-p`.)
-
-**Avec XAMPP** (MySQL dans `C:\xampp\mysql\bin`) :
-```bash
-C:\xampp\mysql\bin\mysql.exe -u root -p -e "CREATE DATABASE IF NOT EXISTS bmad CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
-```
-
-**Avec WAMP** (chemin type `C:\wamp64\bin\mysql\mysql8.x.x\bin\mysql.exe`) :
-```bash
-C:\wamp64\bin\mysql\mysql8.2.0\bin\mysql.exe -u root -p -e "CREATE DATABASE IF NOT EXISTS bmad CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
-```
-(Adapte la version MySQL dans le chemin.)
-
----
-
-## 2. Importer le schéma (créer les tables)
-
-Depuis la racine du projet **bmad** (le dossier qui contient `app`).
-
-**MySQL dans le PATH :**
-```bash
-mysql -u root -p bmad < app/sql/schema.sql
-```
-
-**Avec XAMPP :**
-```bash
-C:\xampp\mysql\bin\mysql.exe -u root -p bmad < app/sql/schema.sql
-```
-
-**Si tu es déjà dans le dossier `app` :**
-```bash
-mysql -u root -p bmad < sql/schema.sql
-```
-
----
-
-## 3. Fichier de configuration .env
-
-Dans le dossier **app**, copie le fichier d’exemple puis édite-le :
-
-**PowerShell (depuis la racine du projet) :**
-```powershell
-cd app
-Copy-Item .env.example .env
-notepad .env
-```
-
-**CMD :**
-```cmd
-cd app
-copy .env.example .env
-notepad .env
-```
-
-Dans `.env`, vérifie ou modifie :
-- `DB_HOST=localhost`
-- `DB_NAME=bmad`
-- `DB_USER=root`
-- `DB_PASS=` (ton mot de passe MySQL, ou vide si pas de mot de passe)
-
-Sauvegarde et ferme.
-
----
-
-## 4. Lancer l’application
-
-Toujours depuis le dossier **app** :
-
-```bash
-php -S localhost:8080
-```
-
-Ouvre le navigateur : **http://localhost:8080**
-
----
-
-## 5. (Optionnel) Données de test
-
-Pour avoir des clients et des factures tout de suite, exécute ce SQL après l’import du schéma :
-
-```bash
-mysql -u root -p bmad -e "
-INSERT INTO clients (nom) VALUES ('Client A'), ('Client B');
-INSERT INTO factures (client_id, n_facture, n_vente, date_facture, montant_ht) VALUES (1, 'FA-001', 'V1', '2026-01-15', 1000), (1, 'FA-002', 'V2', '2026-02-01', 500);
-INSERT INTO paiements (facture_id, montant, date_paiement) VALUES (1, 500, '2026-02-01');
-"
-```
-
-**Avec XAMPP :**
-```bash
-C:\xampp\mysql\bin\mysql.exe -u root -p bmad -e "INSERT INTO clients (nom) VALUES ('Client A'), ('Client B'); INSERT INTO factures (client_id, n_facture, n_vente, date_facture, montant_ht) VALUES (1, 'FA-001', 'V1', '2026-01-15', 1000), (1, 'FA-002', 'V2', '2026-02-01', 500); INSERT INTO paiements (facture_id, montant, date_paiement) VALUES (1, 500, '2026-02-01');"
-```
-
----
-
-## Récap ordre des commandes
-
-1. Créer la base : `mysql -u root -p -e "CREATE DATABASE ..."`
-2. Importer le schéma : `mysql -u root -p bmad < app/sql/schema.sql`
-3. Copier et éditer `app/.env`
-4. Lancer : `cd app` puis `php -S localhost:8080`
-5. (Optionnel) Insérer les données de test

+ 0 - 120
app/ONBOARDING-STAGIAIRE.md

@@ -1,120 +0,0 @@
-# Guide stagiaire – Onboarding projet bmad
-
-**Projet :** Suivi facturation / échéancier / paiement (EMGI).  
-**Objectif :** Comprendre le projet, lancer l’appli et savoir où modifier le code.
-
----
-
-## 1. En deux phrases
-
-L’appli remplace Excel pour le suivi des factures, paiements et échéanciers. Les factures sont émises dans Pennylane ; ici on les saisit pour le suivi (encours, paiements, tableaux de bord, exports).
-
----
-
-## 2. Où sont les docs ?
-
-| Doc | Contenu |
-|-----|--------|
-| **Ce fichier** (`app/ONBOARDING-STAGIAIRE.md`) | Démarrage, structure, où modifier quoi. |
-| **`app/README.md`** | Installation (mock + base), structure dossiers, export. |
-| **`_bmad-output/planning-artifacts/prd.md`** | Périmètre, fonctionnalités (FR), user journeys. |
-| **`_bmad-output/planning-artifacts/architecture.md`** | Stack, API, conventions, limites techniques. |
-| **`_bmad-output/planning-artifacts/schema-chiffrage-projet.md`** | Modules, endpoints, données, points complexes. |
-| **`_bmad-output/planning-artifacts/cahier-recettes-livraison.md`** | Critères de recette (pour vérifier que ça marche). |
-| **`_bmad-output/planning-artifacts/questions-en-suspens.md`** | Questions pas encore tranchées (auth, Pennylane, etc.). |
-
-Ordre conseillé : README app → PRD (pour le métier) → ce guide → architecture si tu creuses le technique.
-
----
-
-## 3. Lancer l’application
-
-**Sans base de données (démo mock) :**
-```bash
-cd app
-php -S localhost:8080
-```
-Puis ouvrir http://localhost:8080. Les données viennent de `mock/*.json`.
-
-**Avec base de données :**
-1. Créer la base : `mysql -u root -p -e "CREATE DATABASE IF NOT EXISTS bmad CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"`
-2. Importer le schéma : `mysql -u root -p bmad < sql/schema.sql`
-3. Copier `.env.example` en `.env`, mettre `MOCK_MODE=0` et renseigner DB_HOST, DB_NAME, DB_USER, DB_PASS
-4. Depuis `app/` : `php -S localhost:8080`
-5. Ouvrir http://localhost:8080
-
-Prérequis : PHP 7.4+ avec extensions `pdo`, `pdo_mysql`, `json`. MariaDB ou MySQL pour le mode base.
-
----
-
-## 4. Structure du code (où modifier quoi)
-
-| Besoin | Fichiers à toucher |
-|--------|--------------------|
-| **Liste des clients, recherche** | `index.html`, `js/` (script liste clients si dédié), `api/clients.php` |
-| **Fiche client (en-tête, encours)** | `client.html`, `js/client-detail.js`, `api/clients.php`, `api/calculs.php` |
-| **Liste des factures d’un client** | `js/client-detail.js` (affichage), `api/factures.php` (données) |
-| **Ajouter une facture** | `client.html` (formulaire), `js/facture-form.js`, `api/factures.php` (POST) |
-| **Liste des paiements, enregistrer un paiement** | `client.html`, `js/paiements.js`, `api/paiements.php` |
-| **Écheanciers (liste + ajout)** | `client.html`, `js/client-detail.js`, `js/echeancier-form.js`, `api/echeanciers.php` |
-| **Calculs (encours, échéances à venir)** | `api/calculs.php` (et logique mock dans `api/factures.php`, `api/reporting.php`) |
-| **Tableau de bord** | `dashboard.html`, `js/dashboard.js`, `api/calculs.php`, `api/reporting.php` |
-| **Top clients** | `top-clients.html`, `js/top-clients.js`, `api/top-clients.php` |
-| **Quantités par client** | `quantites-clients.html`, `js/quantites-clients.js`, `api/quantites-clients.php` |
-| **Export CSV** | `api/reporting.php` (?format=csv) |
-| **Schéma de données** | `sql/schema.sql` ; migrations dans `sql/migration-*.sql` |
-
-Convention : **un fichier API par ressource** (clients, factures, paiements, echeanciers, calculs, reporting, top-clients, quantites-clients). Pas d’appels API-to-API. Front en **JavaScript vanilla** (pas de framework) et **Tailwind** en CDN.
-
----
-
-## 5. Conventions (résumé)
-
-- **Base de données / API :** noms en `snake_case` (ex. `client_id`, `date_facture`). Réponses JSON sans wrapper `{ data: ... }` ; erreurs en `{ error: "message" }`.
-- **PHP :** variables `$camelCase`, fonctions en camelCase.
-- **JS :** variables et fonctions en camelCase. Fichiers en minuscules avec tirets (ex. `client-detail.js`).
-- **Endpoints :** pluriel (`/api/clients.php`, `/api/factures.php`). Paramètres en query ou body selon besoin.
-
-Détails complets dans `_bmad-output/planning-artifacts/architecture.md`.
-
----
-
-## 6. Comment vérifier que ça marche
-
-- **À la main :** naviguer dans l’appli (liste clients, fiche client, ajout facture/paiement/écheancier, dashboard, Top clients, Quantités, export CSV).
-- **Recette :** le fichier `cahier-recettes-livraison.md` liste 32 critères (O/N) pour la livraison.
-- **API sans le front :** avec Postman ou curl, par ex. `GET http://localhost:8080/api/clients.php`, `GET http://localhost:8080/api/factures.php?client_id=1`, `POST http://localhost:8080/api/paiements.php` avec body JSON.
-
-Il n’y a pas de tests automatisés pour le POC.
-
----
-
-## 7. FAQ (questions que tu vas te poser)
-
-- **Pourquoi saisir les factures à la main alors qu’il y a Pennylane ?**  
-  L’appli fait le **suivi** (encours, paiements, écheanciers). La facturation « document » (PDF) reste dans Pennylane. Pas d’import automatique prévu en MVP.
-
-- **Où est la logique d’encours ?**  
-  Dans `api/calculs.php`. La même logique est reproduite en mode mock dans `api/factures.php` et `api/reporting.php` pour afficher encours et état par facture.
-
-- **Pourquoi mock et DB ?**  
-  Le mode mock permet de démo sans installer MySQL. En prod on utilise la base (MOCK_MODE=0 dans `.env`).
-
-- **Je peux utiliser Vue / React ?**  
-  Non pour ce POC : on reste en JavaScript vanilla (décision architecture).
-
-- **Paiement supérieur au montant de la facture ?**  
-  Règle à clarifier (autoriser ou bloquer) ; pour l’instant à vérifier dans le code et le cahier recettes.
-
-- **Modifier / supprimer une facture ou un paiement ?**  
-  Pas prévu dans le MVP ; à confirmer avec le responsable projet (voir questions-en-suspens.md).
-
----
-
-## 8. Contact
-
-En cas de doute technique ou métier : [à compléter — responsable technique / tuteur stagiaire].
-
----
-
-*À mettre à jour au fil des retours (nouvelles questions, changements de structure).*

+ 0 - 60
app/README.md

@@ -1,60 +0,0 @@
-# Suivi facturation / échéancier (POC EMGI)
-
-Application de suivi facturation et échéancier de paiement — remplacement Excel pour l’équipe commerciale. La facturation (émission des factures, PDF) provient de **Pennylane** ; l’appli sert au suivi (saisie manuelle des factures pour encours, paiements, écheanciers).
-
-## Démo sans base (mode mock)
-
-Aucune config, pas de MySQL. Depuis le dossier `app` :
-
-```bash
-cd app
-php -S localhost:8080
-```
-
-Ouvre http://localhost:8080 — les données viennent de `mock/*.json`. Pour utiliser la vraie base, crée `.env` (copie de `.env.example`), mets `MOCK_MODE=0` et configure DB_*.
-
-## Prérequis (mode base)
-
-- PHP 7.4+ (avec extensions `pdo`, `pdo_mysql`, `json`)
-- MariaDB ou MySQL
-
-## Installation (mode base)
-
-1. Créer la base et importer le schéma :
-   ```bash
-   mysql -u root -p -e "CREATE DATABASE IF NOT EXISTS bmad CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
-   mysql -u root -p bmad < sql/schema.sql
-   ```
-
-2. Configurer l’accès DB :
-   ```bash
-   cp .env.example .env
-   # Éditer .env : DB_HOST, DB_NAME, DB_USER, DB_PASS
-   ```
-
-3. Démarrer le serveur PHP (depuis le dossier `app/`) :
-   ```bash
-   php -S localhost:8080
-   ```
-
-4. Ouvrir dans le navigateur : [http://localhost:8080](http://localhost:8080)
-
-## Structure
-
-- `api/` — API REST PHP (clients, factures GET/POST, paiements, calculs, reporting, top-clients, quantites-clients)
-- `js/` — Scripts front (liste clients, détail client, formulaire ajout facture, paiements, tableau de bord, top clients, quantités par client)
-- `sql/schema.sql` — Schéma : `clients`, `factures` (type_produit, cycle, qte_livree), `paiements`
-- Pages : index (clients), client (détail + ajout facture + paiement), dashboard, top-clients, quantites-clients
-
-## Données de test (optionnel)
-
-```sql
-INSERT INTO clients (nom) VALUES ('Client A'), ('Client B');
-INSERT INTO factures (client_id, n_facture, n_vente, date_facture, montant_ht) VALUES (1, 'FA-001', 'V1', '2026-01-15', 1000), (1, 'FA-002', 'V2', '2026-02-01', 500);
-INSERT INTO paiements (facture_id, montant, date_paiement) VALUES (1, 500, '2026-02-01');
-```
-
-## Export
-
-- Tableau de bord : lien « Exporter CSV » pour télécharger l’encours par client.
-- API : `GET /api/reporting.php?format=csv` pour le même export.

+ 1 - 1
app/api/clients.php

@@ -1,6 +1,6 @@
 <?php
 /**
- * API Clients - liste et détail (FR1, FR2).
+ * API Clients - liste et détail (FR2).
  * GET ?q=nom pour recherche, GET ?id= pour un client.
  */
 require_once __DIR__ . '/config.php';

+ 2 - 2
app/api/config.php

@@ -1,6 +1,6 @@
 <?php
 /**
- * Configuration DB pour l'API POC.
+ * Configuration base de données pour dirCops.
  * Lit les variables d'environnement ou des constantes (fallback).
  */
 
@@ -17,7 +17,7 @@ if (is_readable($envFile)) {
 }
 
 $dbHost = $_ENV['DB_HOST'] ?? 'localhost';
-$dbName = $_ENV['DB_NAME'] ?? 'bmad';
+$dbName = $_ENV['DB_NAME'] ?? 'dircops';
 $dbUser = $_ENV['DB_USER'] ?? 'root';
 $dbPass = $_ENV['DB_PASS'] ?? '';
 $dbCharset = $_ENV['DB_CHARSET'] ?? 'utf8mb4';

+ 6 - 6
app/api/reporting.php

@@ -140,7 +140,7 @@ if (isMockMode()) {
         header('Content-Disposition: attachment; filename=suivi-factures-' . date('Y-m-d') . '.csv');
         $out = fopen('php://output', 'w');
         fprintf($out, "\xEF\xBB\xBF");
-        // En-têtes alignés sur l’onglet Factures Excel (EMGI_FTI_Suivi des Ventes) + Total payé, Encours
+        // En-têtes alignés sur l’onglet Factures Excel (Écloserie marine - Suivi des Ventes) + Total payé, Encours
         $headers = ['EXO', 'Mois', 'CLIENT', 'PAYS', 'DEPART DEM', 'NEG.', 'TYPE', 'CYCLE', 'produc', 'PAI', 'DATE FACTUR', 'N° DE VENTE', 'N° FACTURE', 'QTE FACT', 'QTE LIVREE', '% GT', 'CA FACTURE HT', 'PU', 'Total payé', 'Encours'];
         fputcsv($out, $headers, ';');
         foreach ($factures as $f) {
@@ -155,7 +155,7 @@ if (isMockMode()) {
             $enc = (float) $f['montant_ht'] - $tp;
             $cycle = $f['cycle'] ?? '';
             $exo = $cycle ? str_replace('-', '/', $cycle) : ''; // 25-26 -> 25/26
-            $typeLabel = isset($f['type_produit']) ? (stripos($f['type_produit'], 'alevin') !== false ? 'Alevin Bar' : (stripos($f['type_produit'], 'larve') !== false ? 'Larve Bar' : $f['type_produit'])) : '';
+            $typeLabel = isset($f['type_produit']) ? (stripos($f['type_produit'], 'alevin') !== false ? 'Alevin bar' : (stripos($f['type_produit'], 'larve') !== false ? 'Larve bar' : $f['type_produit'])) : '';
             $dateFactur = !empty($f['date_facture']) ? (new DateTime($f['date_facture']))->format('d/m/Y') : '';
             $qteFact = $f['quantites'] ?? '';
             $qteLivree = $f['qte_livree'] ?? '';
@@ -174,7 +174,7 @@ if (isMockMode()) {
                 '', // Mois (non géré dans l’appli)
                 $nom,
                 '', // PAYS
-                'EMGI', // DEPART DEM
+                'Écloserie marine', // DEPART DEM
                 $typeLabel,
                 $typeLabel,
                 $cycle,
@@ -328,7 +328,7 @@ if ($format === 'factures_csv') {
     header('Content-Disposition: attachment; filename=suivi-factures-' . date('Y-m-d') . '.csv');
     $out = fopen('php://output', 'w');
     fprintf($out, "\xEF\xBB\xBF");
-    // En-têtes alignés sur l’onglet Factures Excel (EMGI_FTI_Suivi des Ventes) + Total payé, Encours
+    // En-têtes alignés sur l’onglet Factures Excel (Écloserie marine - Suivi des Ventes) + Total payé, Encours
     $headers = ['EXO', 'Mois', 'CLIENT', 'PAYS', 'DEPART DEM', 'NEG.', 'TYPE', 'CYCLE', 'produc', 'PAI', 'DATE FACTUR', 'N° DE VENTE', 'N° FACTURE', 'QTE FACT', 'QTE LIVREE', '% GT', 'CA FACTURE HT', 'PU', 'Total payé', 'Encours'];
     fputcsv($out, $headers, ';');
     foreach ($allFactures as $f) {
@@ -336,7 +336,7 @@ if ($format === 'factures_csv') {
         $enc = (float) $f['montant_ht'] - $totalPaye;
         $cycle = $f['cycle'] ?? '';
         $exo = $cycle ? str_replace('-', '/', $cycle) : '';
-        $typeLabel = isset($f['type_produit']) ? (stripos($f['type_produit'], 'alevin') !== false ? 'Alevin Bar' : (stripos($f['type_produit'], 'larve') !== false ? 'Larve Bar' : $f['type_produit'])) : '';
+        $typeLabel = isset($f['type_produit']) ? (stripos($f['type_produit'], 'alevin') !== false ? 'Alevin bar' : (stripos($f['type_produit'], 'larve') !== false ? 'Larve bar' : $f['type_produit'])) : '';
         $dateFactur = !empty($f['date_facture']) ? (new DateTime($f['date_facture']))->format('d/m/Y') : '';
         $qteFact = $f['quantites'] ?? '';
         $qteLivree = $f['qte_livree'] ?? '';
@@ -355,7 +355,7 @@ if ($format === 'factures_csv') {
             '',
             $f['nom'],
             '',
-            'EMGI',
+            'Écloserie marine',
             $typeLabel,
             $typeLabel,
             $cycle ?? '',

+ 1 - 1
app/api/top-clients.php

@@ -1,6 +1,6 @@
 <?php
 /**
- * API Top clients par type de produit (FR10b).
+ * API Meilleurs clients par type de produit (FR10b).
  * GET ?type=alevins|larves & optionnel ?cycle=24-25|25-26
  */
 require_once __DIR__ . '/config.php';

+ 0 - 102
app/client.html

@@ -1,102 +0,0 @@
-<!DOCTYPE html>
-<html lang="fr">
-<head>
-  <meta charset="UTF-8">
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-  <title>Détail client - Suivi FTI EMGI</title>
-  <script src="https://cdn.tailwindcss.com"></script>
-</head>
-<body class="bg-gray-50 min-h-screen">
-  <div class="max-w-5xl mx-auto px-4 py-8">
-    <header class="flex justify-between items-center mb-8">
-      <h1 class="text-2xl font-semibold text-gray-800">Suivi FTI EMGI</h1>
-      <nav class="space-x-4">
-        <a href="index.html" class="text-gray-600 hover:text-blue-600">Clients</a>
-        <a href="dashboard.html" class="text-gray-600 hover:text-blue-600">Tableau de bord</a>
-        <a href="top-clients.html" class="text-gray-600 hover:text-blue-600">Top clients</a>
-        <a href="quantites-clients.html" class="text-gray-600 hover:text-blue-600">Quantités</a>
-      </nav>
-    </header>
-
-    <div id="error-message" class="hidden mb-4 p-3 bg-red-100 text-red-700 rounded"></div>
-
-    <div id="client-header" class="mb-8">
-      <p class="text-gray-500">Chargement...</p>
-    </div>
-
-    <section class="bg-white rounded-lg shadow p-6 mb-8">
-      <h2 class="text-lg font-medium text-gray-800 mb-4">Factures</h2>
-      <div id="factures-list" class="overflow-x-auto -mx-2 px-2">Chargement...</div>
-    </section>
-
-    <section class="bg-white rounded-lg shadow p-6 mb-8">
-      <h2 class="text-lg font-medium text-gray-800 mb-4">Ajouter une facture (suivi)</h2>
-      <p class="text-sm text-gray-500 mb-4">La facturation provient de Pennylane ; saisir ici les données pour le suivi (même structure que l’onglet Factures Excel).</p>
-      <form id="form-facture" class="flex flex-wrap gap-4 items-end">
-        <input type="hidden" id="facture_client_id" name="client_id" value="">
-        <div><label for="n_facture" class="block text-sm text-gray-600 mb-1">N° FACTURE</label><input type="text" id="n_facture" name="n_facture" class="border border-gray-300 rounded px-3 py-2" required></div>
-        <div><label for="n_vente" class="block text-sm text-gray-600 mb-1">N° DE VENTE</label><input type="text" id="n_vente" name="n_vente" class="border border-gray-300 rounded px-3 py-2"></div>
-        <div><label for="date_facture" class="block text-sm text-gray-600 mb-1">DATE FACTUR</label><input type="date" id="date_facture" name="date_facture" class="border border-gray-300 rounded px-3 py-2" required></div>
-        <div><label for="type_produit" class="block text-sm text-gray-600 mb-1">TYPE (NEG.)</label><select id="type_produit" name="type_produit" class="border border-gray-300 rounded px-3 py-2"><option value="">—</option><option value="alevins">Alevin Bar</option><option value="larves">Larve Bar</option></select></div>
-        <div><label for="cycle" class="block text-sm text-gray-600 mb-1">CYCLE</label><input type="text" id="cycle" name="cycle" placeholder="24-25 ou 25-26" class="border border-gray-300 rounded px-3 py-2"></div>
-        <div><label for="quantites" class="block text-sm text-gray-600 mb-1">QTE FACT</label><input type="number" id="quantites" name="quantites" step="0.01" min="0" class="border border-gray-300 rounded px-3 py-2" placeholder="Qté facturée"></div>
-        <div><label for="qte_livree" class="block text-sm text-gray-600 mb-1">QTE LIVREE</label><input type="number" id="qte_livree" name="qte_livree" step="0.01" min="0" class="border border-gray-300 rounded px-3 py-2" placeholder="Qté livrée"></div>
-        <div><label for="montant_ht" class="block text-sm text-gray-600 mb-1">CA FACTURE HT (€)</label><input type="number" id="montant_ht" name="montant_ht" step="0.01" min="0.01" class="border border-gray-300 rounded px-3 py-2" required></div>
-        <button type="submit" class="px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700">Ajouter la facture</button>
-      </form>
-    </section>
-
-    <section class="bg-white rounded-lg shadow p-6 mb-8">
-      <h2 class="text-lg font-medium text-gray-800 mb-4">Écheancier de paiement</h2>
-      <p class="text-sm text-gray-500 mb-4">Associer à une facture un plan de paiement échelonné (échéances mensuelles). Le montant de l’encours sera réparti équitablement sur le nombre d’échéances.</p>
-      <div id="echeanciers-list" class="mb-4">—</div>
-      <form id="form-echeancier" class="flex flex-wrap gap-4 items-end">
-        <div>
-          <label for="echeancier_facture_id" class="block text-sm text-gray-600 mb-1">Facture</label>
-          <select id="echeancier_facture_id" name="facture_id" class="border border-gray-300 rounded px-3 py-2 min-w-[200px]" required></select>
-        </div>
-        <div>
-          <label for="nb_echeances" class="block text-sm text-gray-600 mb-1">Nombre d’échéances</label>
-          <input type="number" id="nb_echeances" name="nb_echeances" min="1" class="border border-gray-300 rounded px-3 py-2" required>
-        </div>
-        <div>
-          <label for="date_debut_echeancier" class="block text-sm text-gray-600 mb-1">Date de début</label>
-          <input type="date" id="date_debut_echeancier" name="date_debut_echeancier" class="border border-gray-300 rounded px-3 py-2" required>
-        </div>
-        <button type="submit" class="px-4 py-2 bg-indigo-600 text-white rounded hover:bg-indigo-700">Ajouter l’écheancier</button>
-      </form>
-      <div id="apercu-echeancier"></div>
-    </section>
-
-    <section class="bg-white rounded-lg shadow p-6 mb-8">
-      <h2 class="text-lg font-medium text-gray-800 mb-4">Enregistrer un paiement</h2>
-      <form id="form-paiement" class="flex flex-wrap gap-4 items-end">
-        <div>
-          <label for="facture_id" class="block text-sm text-gray-600 mb-1">Facture</label>
-          <select id="facture_id" name="facture_id" class="border border-gray-300 rounded px-3 py-2 min-w-[200px]" required></select>
-        </div>
-        <div>
-          <label for="montant" class="block text-sm text-gray-600 mb-1">Montant (€)</label>
-          <input type="number" id="montant" name="montant" step="0.01" min="0.01" class="border border-gray-300 rounded px-3 py-2" required>
-        </div>
-        <div>
-          <label for="date_paiement" class="block text-sm text-gray-600 mb-1">Date</label>
-          <input type="date" id="date_paiement" name="date_paiement" class="border border-gray-300 rounded px-3 py-2" required>
-        </div>
-        <button type="submit" class="px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700">Enregistrer</button>
-      </form>
-    </section>
-
-    <section class="bg-white rounded-lg shadow p-6 mb-8">
-      <h2 class="text-lg font-medium text-gray-800 mb-4">Paiements</h2>
-      <div id="paiements-list">Chargement...</div>
-    </section>
-  </div>
-
-  <script src="js/utils.js"></script>
-  <script src="js/client-detail.js"></script>
-  <script src="js/facture-form.js"></script>
-  <script src="js/echeancier-form.js"></script>
-  <script src="js/paiements.js"></script>
-</body>
-</html>

+ 0 - 43
app/dashboard.html

@@ -1,43 +0,0 @@
-<!DOCTYPE html>
-<html lang="fr">
-<head>
-  <meta charset="UTF-8">
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-  <title>Tableau de bord - Suivi FTI EMGI</title>
-  <script src="https://cdn.tailwindcss.com"></script>
-</head>
-<body class="bg-gray-50 min-h-screen">
-  <div class="max-w-5xl mx-auto px-4 py-8">
-    <header class="flex justify-between items-center mb-8">
-      <h1 class="text-2xl font-semibold text-gray-800">Suivi FTI EMGI</h1>
-      <nav class="space-x-4">
-        <a href="index.html" class="text-gray-600 hover:text-blue-600">Clients</a>
-        <a href="dashboard.html" class="text-blue-600 font-medium">Tableau de bord</a>
-        <a href="top-clients.html" class="text-gray-600 hover:text-blue-600">Top clients</a>
-        <a href="quantites-clients.html" class="text-gray-600 hover:text-blue-600">Quantités</a>
-      </nav>
-    </header>
-
-    <div id="error-message" class="hidden mb-4 p-3 bg-red-100 text-red-700 rounded"></div>
-
-    <section class="bg-white rounded-lg shadow overflow-hidden mb-8">
-      <div class="px-6 py-4 border-b border-gray-200 flex flex-wrap justify-between items-center gap-2">
-        <h2 id="titre-encours" class="text-lg font-medium text-gray-800">Encours clients au …</h2>
-        <div class="flex flex-wrap gap-3 text-sm">
-          <a href="api/reporting.php?format=csv" class="text-blue-600 hover:underline">Exporter encours CSV</a>
-          <a href="api/reporting.php?format=factures_csv" class="text-blue-600 hover:underline">Exporter l’ensemble des factures (PJ)</a>
-        </div>
-      </div>
-      <div id="encours-par-client" class="p-6 overflow-x-auto">Chargement...</div>
-      <div id="synthèse-encours" class="px-6 pb-6"></div>
-    </section>
-    <section class="bg-white rounded-lg shadow overflow-hidden mt-8">
-      <h2 class="px-6 py-4 border-b border-gray-200 text-lg font-medium text-gray-800">Échéances à venir</h2>
-      <div id="echeances" class="p-6">Chargement...</div>
-    </section>
-  </div>
-
-  <script src="js/utils.js"></script>
-  <script src="js/dashboard.js"></script>
-</body>
-</html>

+ 0 - 128
app/index.html

@@ -1,128 +0,0 @@
-<!DOCTYPE html>
-<html lang="fr">
-<head>
-  <meta charset="UTF-8">
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-  <title>Clients - Suivi FTI EMGI</title>
-  <script src="https://cdn.tailwindcss.com"></script>
-</head>
-<body class="bg-gray-50 min-h-screen">
-  <div class="max-w-4xl mx-auto px-4 py-8">
-    <header class="flex justify-between items-center mb-8">
-      <h1 class="text-2xl font-semibold text-gray-800">Suivi FTI EMGI</h1>
-      <nav class="space-x-4">
-        <a href="index.html" class="text-blue-600 font-medium">Clients</a>
-        <a href="dashboard.html" class="text-gray-600 hover:text-blue-600">Tableau de bord</a>
-        <a href="top-clients.html" class="text-gray-600 hover:text-blue-600">Top clients</a>
-        <a href="quantites-clients.html" class="text-gray-600 hover:text-blue-600">Quantités</a>
-      </nav>
-    </header>
-
-    <div id="error-message" class="hidden mb-4 p-3 bg-red-100 text-red-700 rounded"></div>
-
-    <section class="bg-white rounded-lg shadow p-6 mb-6">
-      <h2 class="text-lg font-medium text-gray-800 mb-4">Ajouter un client</h2>
-      <form id="form-client" class="flex gap-4 items-end">
-        <div class="flex-1">
-          <label for="nom_client" class="block text-sm text-gray-600 mb-1">Nom du client</label>
-          <input type="text" id="nom_client" name="nom" class="w-full border border-gray-300 rounded px-3 py-2" placeholder="Ex: AQUANARIA" required>
-        </div>
-        <button type="submit" class="px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700">Ajouter</button>
-      </form>
-    </section>
-
-    <div class="mb-6">
-      <label for="search" class="block text-sm font-medium text-gray-700 mb-1">Rechercher un client</label>
-      <input type="text" id="search" placeholder="Nom du client..." class="w-full max-w-md border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
-    </div>
-
-    <div id="client-list" class="bg-white rounded-lg shadow overflow-hidden">
-      <table class="min-w-full divide-y divide-gray-200">
-        <thead class="bg-gray-100">
-          <tr>
-            <th class="px-4 py-3 text-left text-xs font-medium text-gray-600 uppercase">Client</th>
-            <th class="px-4 py-3 text-right text-xs font-medium text-gray-600 uppercase">Actions</th>
-          </tr>
-        </thead>
-        <tbody id="client-list-body" class="divide-y divide-gray-200">
-          <tr><td colspan="2" class="px-4 py-6 text-center text-gray-500">Chargement...</td></tr>
-        </tbody>
-      </table>
-    </div>
-  </div>
-
-  <script src="js/utils.js"></script>
-  <script>
-    const listBody = document.getElementById('client-list-body');
-    const searchInput = document.getElementById('search');
-
-    async function loadClients(q = '') {
-      hideError();
-      try {
-        const clients = await apiGet('/clients.php', q ? { q } : {});
-        if (clients.length === 0) {
-          listBody.innerHTML = '<tr><td colspan="2" class="px-4 py-6 text-center text-gray-500">Aucun client trouvé.</td></tr>';
-          return;
-        }
-        listBody.innerHTML = clients.map(c => {
-          const nomEscaped = escapeHtml(c.nom).replace(/'/g, "\\'").replace(/"/g, '&quot;');
-          return `
-          <tr class="hover:bg-gray-50">
-            <td class="px-4 py-3 font-medium text-gray-900">${escapeHtml(c.nom)}</td>
-            <td class="px-4 py-3 text-right">
-              <a href="client.html?id=${c.id}" class="text-blue-600 hover:underline mr-4">Voir le détail</a>
-              <button onclick="deleteClient(${c.id}, ${JSON.stringify(c.nom)})" class="text-red-600 hover:text-red-800" title="Supprimer">
-                <svg class="w-4 h-4 inline" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"></path></svg>
-              </button>
-            </td>
-          </tr>
-        `;
-        }).join('');
-      } catch (e) {
-        showError(e.message);
-        listBody.innerHTML = '<tr><td colspan="2" class="px-4 py-6 text-center text-red-500">Erreur de chargement.</td></tr>';
-      }
-    }
-
-    function escapeHtml(text) {
-      const div = document.createElement('div');
-      div.textContent = text;
-      return div.innerHTML;
-    }
-
-    searchInput.addEventListener('input', () => {
-      const q = searchInput.value.trim();
-      loadClients(q);
-    });
-
-    const formClient = document.getElementById('form-client');
-    formClient.addEventListener('submit', async (e) => {
-      e.preventDefault();
-      hideError();
-      const nom = document.getElementById('nom_client').value.trim();
-      if (!nom) return;
-      try {
-        await apiPost('/clients.php', { nom });
-        document.getElementById('nom_client').value = '';
-        loadClients(searchInput.value.trim());
-      } catch (err) {
-        showError(err.message);
-      }
-    });
-
-    window.deleteClient = async function(clientId, nomClient) {
-      if (!confirm('Êtes-vous sûr de vouloir supprimer le client "' + nomClient + '" ? Cette action supprimera également toutes les factures, paiements et écheanciers associés.')) {
-        return;
-      }
-      try {
-        await apiDelete(`/clients.php?id=${clientId}`);
-        loadClients(searchInput.value.trim());
-      } catch (err) {
-        showError(err.message);
-      }
-    };
-
-    loadClients();
-  </script>
-</body>
-</html>

+ 3 - 3
app/js/client-detail.js

@@ -32,8 +32,8 @@
       if (factures.length === 0) {
         facturesList.innerHTML = '<p class="text-gray-500">Aucune facture.</p>';
       } else {
-        // Colonnes alignées sur l’onglet Factures Excel (EMGI_FTI_Suivi des Ventes) + Total payé, Encours, État, Écheancier
-        const factureTypeLabel = (tp) => !tp ? '—' : (String(tp).toLowerCase().indexOf('alevin') !== -1 ? 'Alevin Bar' : (String(tp).toLowerCase().indexOf('larve') !== -1 ? 'Larve Bar' : tp));
+        // Colonnes alignées sur l’onglet Factures Excel (Écloserie marine - Suivi des Ventes) + Total payé, Encours, État, Écheancier
+        const factureTypeLabel = (tp) => !tp ? '—' : (String(tp).toLowerCase().indexOf('alevin') !== -1 ? 'Alevin bar' : (String(tp).toLowerCase().indexOf('larve') !== -1 ? 'Larve bar' : tp));
         facturesList.innerHTML = `
           <div class="overflow-x-auto">
             <table class="min-w-[1000px] w-full text-sm">
@@ -67,7 +67,7 @@
                     <td class="py-2 pr-2 whitespace-nowrap">—</td>
                     <td class="py-2 pr-2 whitespace-nowrap">${escapeHtml(client.nom)}</td>
                     <td class="py-2 pr-2 whitespace-nowrap">—</td>
-                    <td class="py-2 pr-2 whitespace-nowrap">EMGI</td>
+                    <td class="py-2 pr-2 whitespace-nowrap">Écloserie marine</td>
                     <td class="py-2 pr-2 whitespace-nowrap">${escapeHtml(typeLabel)}</td>
                     <td class="py-2 pr-2 whitespace-nowrap">${escapeHtml(typeLabel)}</td>
                     <td class="py-2 pr-2 whitespace-nowrap">${escapeHtml(f.cycle || '—')}</td>

+ 2 - 2
app/js/dashboard.js

@@ -36,7 +36,7 @@
                 <th class="px-4 py-2 text-center text-xs font-medium text-gray-600 uppercase">accord</th>
                 <th class="px-4 py-2 text-center text-xs font-medium text-gray-600 uppercase">j out</th>
                 <th class="px-4 py-2 text-left text-xs font-medium text-gray-600 uppercase">situation</th>
-                <th class="px-4 py-2 text-right text-xs font-medium text-gray-600 uppercase">Action</th>
+                <th class="px-4 py-2 text-right text-xs font-medium text-gray-600 uppercase">Actions</th>
               </tr>
             </thead>
             <tbody class="divide-y divide-gray-200 bg-white">
@@ -73,7 +73,7 @@
       } else {
         echeancesEl.innerHTML = `
           <table class="min-w-full divide-y divide-gray-200">
-            <thead class="bg-gray-50"><tr><th class="px-4 py-2 text-left text-xs font-medium text-gray-600">Client</th><th class="px-4 py-2 text-left text-xs font-medium text-gray-600">N° facture</th><th class="px-4 py-2 text-left text-xs font-medium text-gray-600">Date échéance</th><th class="px-4 py-2 text-right text-xs font-medium text-gray-600">Montant</th><th class="px-4 py-2 text-right text-xs font-medium text-gray-600">Action</th></tr></thead>
+            <thead class="bg-gray-50"><tr><th class="px-4 py-2 text-left text-xs font-medium text-gray-600">Client</th><th class="px-4 py-2 text-left text-xs font-medium text-gray-600">N° facture</th><th class="px-4 py-2 text-left text-xs font-medium text-gray-600">Date échéance</th><th class="px-4 py-2 text-right text-xs font-medium text-gray-600">Montant</th><th class="px-4 py-2 text-right text-xs font-medium text-gray-600">Actions</th></tr></thead>
             <tbody class="divide-y divide-gray-200">
               ${data.echeances_a_venir.map(e => {
                 const dateEch = e.date_echeance || e.date_facture;

+ 1 - 1
app/js/quantites-clients.js

@@ -19,7 +19,7 @@
               <th class="px-4 py-2 text-left text-xs font-medium text-gray-600">Client</th>
               <th class="px-4 py-2 text-right text-xs font-medium text-gray-600">Qté facturée</th>
               <th class="px-4 py-2 text-right text-xs font-medium text-gray-600">Qté livrée</th>
-              <th class="px-4 py-2 text-right text-xs font-medium text-gray-600">Action</th>
+              <th class="px-4 py-2 text-right text-xs font-medium text-gray-600">Actions</th>
             </tr>
           </thead>
           <tbody class="divide-y divide-gray-200">

+ 2 - 2
app/js/top-clients.js

@@ -14,7 +14,7 @@
       if (cycle) params.cycle = cycle;
       const data = await apiGet('/top-clients.php', params);
       const label = type === 'alevins' ? 'Alevins' : 'Larves';
-      titleEl.textContent = 'Top clients ' + label + (cycle ? ' (cycle ' + cycle + ')' : '');
+      titleEl.textContent = 'Meilleurs clients ' + label + (cycle ? ' (cycle ' + cycle + ')' : '');
       if (!data.top_clients || data.top_clients.length === 0) {
         topListEl.innerHTML = '<p class="text-gray-500">Aucune donnée pour ce filtre.</p>';
         totauxEl.textContent = '';
@@ -29,7 +29,7 @@
               <th class="px-4 py-2 text-right text-xs font-medium text-gray-600">% qté</th>
               <th class="px-4 py-2 text-right text-xs font-medium text-gray-600">CA HT</th>
               <th class="px-4 py-2 text-right text-xs font-medium text-gray-600">% CA</th>
-              <th class="px-4 py-2 text-right text-xs font-medium text-gray-600">Action</th>
+              <th class="px-4 py-2 text-right text-xs font-medium text-gray-600">Actions</th>
             </tr>
           </thead>
           <tbody class="divide-y divide-gray-200">

+ 4 - 4
app/js/utils.js

@@ -9,7 +9,7 @@ async function apiGet(path, params = {}) {
   const res = await fetch(url.toString());
   const data = await res.json().catch(() => ({}));
   if (!res.ok) {
-    throw new Error(data.error || res.statusText || 'Erreur API');
+    throw new Error(data.error || 'Erreur API');
   }
   return data;
 }
@@ -22,7 +22,7 @@ async function apiPost(path, body) {
   });
   const data = await res.json().catch(() => ({}));
   if (!res.ok) {
-    throw new Error(data.error || res.statusText || 'Erreur API');
+    throw new Error(data.error || 'Erreur API');
   }
   return data;
 }
@@ -35,7 +35,7 @@ async function apiPut(path, body) {
   });
   const data = await res.json().catch(() => ({}));
   if (!res.ok) {
-    throw new Error(data.error || res.statusText || 'Erreur API');
+    throw new Error(data.error || 'Erreur API');
   }
   return data;
 }
@@ -46,7 +46,7 @@ async function apiDelete(path) {
   });
   const data = await res.json().catch(() => ({}));
   if (!res.ok) {
-    throw new Error(data.error || res.statusText || 'Erreur API');
+    throw new Error(data.error || 'Erreur API');
   }
   return data;
 }

+ 9 - 4
app/mock/clients.json

@@ -1,22 +1,27 @@
 [
     {
         "id": 1,
-        "nom": "AQUANARIA",
+        "nom": "Client 1",
         "created_at": "2026-02-01T09:00:00+00:00"
     },
     {
         "id": 2,
-        "nom": "PHILOSOFISH",
+        "nom": "Client 2",
         "created_at": "2026-02-02T10:00:00+00:00"
     },
     {
         "id": 3,
-        "nom": "AQN",
+        "nom": "Client 3",
         "created_at": "2026-02-03T11:00:00+00:00"
     },
     {
         "id": 4,
-        "nom": "Test client",
+        "nom": "Client 4",
         "created_at": "2026-02-09T17:54:23+00:00"
+    },
+    {
+        "id": 5,
+        "nom": "Client 5",
+        "created_at": "2026-02-10T09:02:21+00:00"
     }
 ]

+ 8 - 0
app/mock/echeanciers.json

@@ -30,5 +30,13 @@
         "date_debut_echeancier": "2026-02-09",
         "montant_par_echeance": 225,
         "created_at": "2026-02-09T18:02:36+00:00"
+    },
+    {
+        "id": 7,
+        "facture_id": 304,
+        "nb_echeances": 2,
+        "date_debut_echeancier": "2026-02-09",
+        "montant_par_echeance": 5,
+        "created_at": "2026-02-09T22:49:34+00:00"
     }
 ]

+ 31 - 5
app/mock/factures.json

@@ -2,7 +2,7 @@
     {
         "id": 101,
         "client_id": 1,
-        "n_facture": "FA260025",
+        "n_facture": "Facture 1",
         "n_vente": "AL-25\/26-14",
         "date_facture": "2026-01-15",
         "type_produit": "alevins",
@@ -15,7 +15,7 @@
     {
         "id": 102,
         "client_id": 1,
-        "n_facture": "FA-002",
+        "n_facture": "Facture 2",
         "n_vente": "LV-25\/26-11",
         "date_facture": "2026-02-01",
         "type_produit": "larves",
@@ -28,7 +28,7 @@
     {
         "id": 201,
         "client_id": 2,
-        "n_facture": "F-2025-11-1",
+        "n_facture": "Facture 3",
         "n_vente": "AL-25\/26-02",
         "date_facture": "2026-01-20",
         "type_produit": "alevins",
@@ -41,7 +41,7 @@
     {
         "id": 301,
         "client_id": 3,
-        "n_facture": "FA260031",
+        "n_facture": "Facture 4",
         "n_vente": "LV-25\/26-05",
         "date_facture": "2026-02-05",
         "type_produit": "larves",
@@ -54,7 +54,7 @@
     {
         "id": 303,
         "client_id": 4,
-        "n_facture": "56",
+        "n_facture": "Facture 5",
         "n_vente": "465",
         "date_facture": "2026-02-09",
         "type_produit": "alevins",
@@ -63,5 +63,31 @@
         "qte_livree": 10,
         "montant_ht": 100,
         "created_at": "2026-02-09T17:57:25+00:00"
+    },
+    {
+        "id": 304,
+        "client_id": 4,
+        "n_facture": "Facture 6",
+        "n_vente": "465",
+        "date_facture": "2026-02-09",
+        "type_produit": "alevins",
+        "cycle": "25",
+        "quantites": 10,
+        "qte_livree": 10,
+        "montant_ht": 10,
+        "created_at": "2026-02-09T22:49:22+00:00"
+    },
+    {
+        "id": 305,
+        "client_id": 5,
+        "n_facture": "Facture 7",
+        "n_vente": "2",
+        "date_facture": "2026-02-10",
+        "type_produit": "alevins",
+        "cycle": "24-24",
+        "quantites": 10,
+        "qte_livree": 10,
+        "montant_ht": 1000,
+        "created_at": "2026-02-10T09:03:56+00:00"
     }
 ]

+ 14 - 0
app/mock/paiements.json

@@ -54,5 +54,19 @@
         "montant": 225,
         "date_paiement": "2026-02-09",
         "created_at": "2026-02-09T18:03:02+00:00"
+    },
+    {
+        "id": 1009,
+        "facture_id": 304,
+        "montant": 5,
+        "date_paiement": "2026-02-09",
+        "created_at": "2026-02-09T22:49:50+00:00"
+    },
+    {
+        "id": 1010,
+        "facture_id": 305,
+        "montant": 650,
+        "date_paiement": "2026-02-10",
+        "created_at": "2026-02-10T09:06:23+00:00"
     }
 ]

+ 0 - 43
app/quantites-clients.html

@@ -1,43 +0,0 @@
-<!DOCTYPE html>
-<html lang="fr">
-<head>
-  <meta charset="UTF-8">
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-  <title>Quantités par client - Suivi FTI EMGI</title>
-  <script src="https://cdn.tailwindcss.com"></script>
-</head>
-<body class="bg-gray-50 min-h-screen">
-  <div class="max-w-5xl mx-auto px-4 py-8">
-    <header class="flex justify-between items-center mb-8">
-      <h1 class="text-2xl font-semibold text-gray-800">Suivi FTI EMGI</h1>
-      <nav class="space-x-4">
-        <a href="index.html" class="text-gray-600 hover:text-blue-600">Clients</a>
-        <a href="dashboard.html" class="text-gray-600 hover:text-blue-600">Tableau de bord</a>
-        <a href="top-clients.html" class="text-gray-600 hover:text-blue-600">Top clients</a>
-        <a href="quantites-clients.html" class="text-blue-600 font-medium">Quantités</a>
-      </nav>
-    </header>
-
-    <div id="error-message" class="hidden mb-4 p-3 bg-red-100 text-red-700 rounded"></div>
-
-    <div class="mb-6">
-      <label for="type" class="block text-sm font-medium text-gray-700 mb-1">Filtrer par type (optionnel)</label>
-      <select id="type" class="border border-gray-300 rounded px-3 py-2">
-        <option value="">Tous</option>
-        <option value="alevins">Alevins</option>
-        <option value="larves">Larves</option>
-      </select>
-      <button type="button" id="btn-refresh" class="ml-2 px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700">Actualiser</button>
-    </div>
-
-    <div class="bg-white rounded-lg shadow overflow-hidden">
-      <h2 class="px-6 py-4 border-b text-lg font-medium text-gray-800">Quantités vendues par client</h2>
-      <p class="px-6 text-sm text-gray-500">Qté facturée = quantité sur facture ; Qté livrée = déjà livré.</p>
-      <div id="quantites-list" class="p-6">Chargement...</div>
-    </div>
-  </div>
-
-  <script src="js/utils.js"></script>
-  <script src="js/quantites-clients.js"></script>
-</body>
-</html>

+ 1 - 1
app/sql/schema.sql

@@ -1,4 +1,4 @@
--- Schéma POC suivi facturation / échéancier / paiement (EMGI)
+-- Schéma dirCops — suivi facturation / échéancier / paiement
 -- MariaDB/MySQL
 -- Factures : type_produit (alevins, larves), cycle (24-25, 25-26), qte_livree
 

+ 0 - 52
app/top-clients.html

@@ -1,52 +0,0 @@
-<!DOCTYPE html>
-<html lang="fr">
-<head>
-  <meta charset="UTF-8">
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-  <title>Top clients - Suivi FTI EMGI</title>
-  <script src="https://cdn.tailwindcss.com"></script>
-</head>
-<body class="bg-gray-50 min-h-screen">
-  <div class="max-w-5xl mx-auto px-4 py-8">
-    <header class="flex justify-between items-center mb-8">
-      <h1 class="text-2xl font-semibold text-gray-800">Suivi FTI EMGI</h1>
-      <nav class="space-x-4">
-        <a href="index.html" class="text-gray-600 hover:text-blue-600">Clients</a>
-        <a href="dashboard.html" class="text-gray-600 hover:text-blue-600">Tableau de bord</a>
-        <a href="top-clients.html" class="text-blue-600 font-medium">Top clients</a>
-        <a href="quantites-clients.html" class="text-gray-600 hover:text-blue-600">Quantités</a>
-      </nav>
-    </header>
-
-    <div id="error-message" class="hidden mb-4 p-3 bg-red-100 text-red-700 rounded"></div>
-
-    <div class="flex flex-wrap gap-4 mb-6">
-      <div>
-        <label for="type" class="block text-sm font-medium text-gray-700 mb-1">Type de produit</label>
-        <select id="type" class="border border-gray-300 rounded px-3 py-2">
-          <option value="alevins">Alevins</option>
-          <option value="larves">Larves</option>
-        </select>
-      </div>
-      <div>
-        <label for="cycle" class="block text-sm font-medium text-gray-700 mb-1">Cycle (optionnel)</label>
-        <select id="cycle" class="border border-gray-300 rounded px-3 py-2">
-          <option value="">Tous</option>
-          <option value="24-25">24-25</option>
-          <option value="25-26">25-26</option>
-        </select>
-      </div>
-      <div class="flex items-end"><button type="button" id="btn-refresh" class="px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700">Actualiser</button></div>
-    </div>
-
-    <div class="bg-white rounded-lg shadow overflow-hidden mb-8">
-      <h2 id="title-section" class="px-6 py-4 border-b text-lg font-medium text-gray-800">Top clients Alevins</h2>
-      <div id="top-list" class="p-6">Chargement...</div>
-      <div id="totaux" class="px-6 pb-4 text-sm text-gray-600"></div>
-    </div>
-  </div>
-
-  <script src="js/utils.js"></script>
-  <script src="js/top-clients.js"></script>
-</body>
-</html>