feat(inscription-am): places disponibles, UI étape 2, plafond capacité 4 côté app

- POST /auth/register/am : places_disponibles, enregistrement place_disponible, contrôle ≤ capacité

- Formulaire pro AM : places sur la ligne capacité, mobile un champ par ligne, carte desktop plus compacte (espacements, polices, labelFieldSpacing)

- Capacité et places validées jusqu’à 4 dans l’app (kAmCapaciteAccueilMax) ; hint NIR « 13 chiffres + clé »

- Scripts d’inscription AM (Node + smoke shell) : places_disponibles

Made-with: Cursor
This commit is contained in:
2026-04-13 13:20:26 +02:00
parent 58607cdbc9
commit b4b44cb1b9
12 changed files with 163 additions and 68 deletions
+12 -2
View File
@@ -1,5 +1,8 @@
import 'package:flutter/foundation.dart';
/// Accueil simultané : plafond légal courant en France pour une AM agréée (enfants de moins de 3 ans).
const int kAmCapaciteAccueilMax = 4;
class AmRegistrationData extends ChangeNotifier {
// Step 1: Identity Info
String firstName = '';
@@ -27,6 +30,8 @@ class AmRegistrationData extends ChangeNotifier {
/// Date d'obtention de l'agrément — obligatoire (API `date_agrement`).
DateTime? agreementDate;
int? capacity; // Number of children the AM can look after
/// Places libres actuellement (0 ≤ valeur ≤ capacité) — API `places_disponibles`.
int? placesAvailable;
// Step 3: Presentation & CGU
String presentationText = '';
@@ -72,6 +77,7 @@ class AmRegistrationData extends ChangeNotifier {
String? agrementNumber,
DateTime? agreementDate,
int? capacity,
int? placesAvailable,
}) {
this.photoPath = photoPath;
this.photoBytes = photoBytes;
@@ -85,6 +91,7 @@ class AmRegistrationData extends ChangeNotifier {
this.agrementNumber = agrementNumber ?? this.agrementNumber;
this.agreementDate = agreementDate ?? this.agreementDate;
this.capacity = capacity ?? this.capacity;
this.placesAvailable = placesAvailable ?? this.placesAvailable;
notifyListeners();
}
@@ -125,7 +132,10 @@ class AmRegistrationData extends ChangeNotifier {
agreementDate != null &&
capacity != null &&
capacity! >= 1 &&
capacity! <= 10;
capacity! <= kAmCapaciteAccueilMax &&
placesAvailable != null &&
placesAvailable! >= 0 &&
placesAvailable! <= capacity!;
bool get isStep3Complete =>
// presentationText is optional as per CDC (message au gestionnaire)
@@ -142,7 +152,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, agreementDate: $agreementDate, capacity: $capacity, '
'nir: $nir, agrementNumber: $agrementNumber, agreementDate: $agreementDate, capacity: $capacity, placesAvailable: $placesAvailable, '
'photoPath (step2): $photoPath, photoConsent (step2): $photoConsent, '
'presentationText: $presentationText, cguAccepted: $cguAccepted)';
}