feat(#131): fiches parent/AM éditable, placement AM↔enfant, statuts garde/sans_garde

Squash merge develop → master.

- Fiche parent éditable (co-parent, PATCH fiche, GET /parents)
- Fiche AM 3 onglets (PATCH fiche, rattacher/détacher enfants)
- Table enfants_assistantes_maternelles + enum garde/sans_garde
- Migration SQL + BDD.sql canonique
- Correctifs recette : @Get() parents, DTO fiche AM, fix NIR

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-11 22:49:57 +02:00
co-authored by Cursor
parent b99745e0fe
commit 003fe6b762
69 changed files with 6290 additions and 417 deletions
@@ -0,0 +1,51 @@
/// Statuts enfant alignés sur `statut_enfant_type` (BDD / back #131).
const enfantStatusValues = [
'a_naitre',
'sans_garde',
'garde',
'scolarise',
];
/// Normalise une valeur API (legacy `actif` → `sans_garde`).
String normalizeEnfantStatus(String? raw) {
final s = (raw ?? '').trim().toLowerCase();
if (s.isEmpty) return 'sans_garde';
if (s == 'actif') return 'sans_garde';
return s;
}
String _scolariseAccordeAuGenre(String? gender) {
final g = (gender ?? '').trim().toUpperCase();
if (g == 'F') return 'Scolarisée';
return 'Scolarisé';
}
/// Libellé affiché pour un statut enfant.
String enfantStatusLabel(String? status, {String? gender}) {
switch (normalizeEnfantStatus(status)) {
case 'a_naitre':
return 'À naître';
case 'sans_garde':
return 'Sans garde';
case 'garde':
return 'En garde';
case 'scolarise':
return _scolariseAccordeAuGenre(gender);
default:
return status?.trim().isNotEmpty == true ? status!.trim() : '';
}
}
/// Libellé court pour colonnes validation (null = pas de bandeau).
String? enfantColumnStatusLabel({String? status, String? gender}) {
final s = normalizeEnfantStatus(status);
switch (s) {
case 'a_naitre':
case 'sans_garde':
case 'garde':
case 'scolarise':
return enfantStatusLabel(s, gender: gender);
default:
return null;
}
}