feat(inscription AM #120): UI étape pro, photo unifiée, scripts et données test

- Panneau AM : validation NIR alignée API, date d’agrément requise côté app,
  capacité 1–10, n° agrément + date sur une ligne, ville/pays formatés au blur.
- Widget RegistrationPhotoSlot (cadre, croix) partagé avec les cartes enfant.
- AuthService : MIME PNG/JPEG pour la photo ; payload date_agrement.
- Scripts register-am-dubois / mansouri ; chemins tests/ressources/photos ;
  doc test-data + seed ; smoke curl inscription AM.

Made-with: Cursor
This commit is contained in:
2026-04-13 13:19:32 +02:00
parent 12bf85b7bd
commit 58607cdbc9
18 changed files with 763 additions and 284 deletions
@@ -24,6 +24,8 @@ class AmRegistrationData extends ChangeNotifier {
// String placeOfBirth = ''; // Remplacé par birthCity et birthCountry
String nir = ''; // Numéro de Sécurité Sociale
String agrementNumber = ''; // Numéro d'agrément
/// Date d'obtention de l'agrément — obligatoire (API `date_agrement`).
DateTime? agreementDate;
int? capacity; // Number of children the AM can look after
// Step 3: Presentation & CGU
@@ -68,6 +70,7 @@ class AmRegistrationData extends ChangeNotifier {
// String? placeOfBirth, // Remplacé
String? nir,
String? agrementNumber,
DateTime? agreementDate,
int? capacity,
}) {
this.photoPath = photoPath;
@@ -80,6 +83,7 @@ class AmRegistrationData extends ChangeNotifier {
// this.placeOfBirth = placeOfBirth ?? this.placeOfBirth; // Remplacé
this.nir = nir ?? this.nir;
this.agrementNumber = agrementNumber ?? this.agrementNumber;
this.agreementDate = agreementDate ?? this.agreementDate;
this.capacity = capacity ?? this.capacity;
notifyListeners();
}
@@ -118,7 +122,10 @@ class AmRegistrationData extends ChangeNotifier {
birthCountry.isNotEmpty &&
nir.isNotEmpty && // Basic check, could add validation
agrementNumber.isNotEmpty &&
capacity != null && capacity! > 0;
agreementDate != null &&
capacity != null &&
capacity! >= 1 &&
capacity! <= 10;
bool get isStep3Complete =>
// presentationText is optional as per CDC (message au gestionnaire)
@@ -135,7 +142,7 @@ class AmRegistrationData extends ChangeNotifier {
'phone: $phone, email: $email, '
// 'photoPath: $photoPath, photoConsent: $photoConsent, ' // Commenté car déplacé/modifié
'dateOfBirth: $dateOfBirth, birthCity: $birthCity, birthCountry: $birthCountry, '
'nir: $nir, agrementNumber: $agrementNumber, capacity: $capacity, '
'nir: $nir, agrementNumber: $agrementNumber, agreementDate: $agreementDate, capacity: $capacity, '
'photoPath (step2): $photoPath, photoConsent (step2): $photoConsent, '
'presentationText: $presentationText, cguAccepted: $cguAccepted)';
}