feat(#112): reprise après refus via lien e-mail (/reprise?token=)
Branche le flux front : chargement du dossier, session reprise, wizards parent/AM préremplis et resoumission via reprise-resoumettre. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -33,6 +33,9 @@ class AmRegistrationData extends ChangeNotifier {
|
||||
/// Places libres actuellement (0 ≤ valeur ≤ capacité) — API `places_disponibles`.
|
||||
int? placesAvailable;
|
||||
|
||||
/// Photo déjà en base lors d'une reprise (#112) — sert pour l'affichage et `photo_url` API.
|
||||
String? repriseExistingPhotoUrl;
|
||||
|
||||
// Step 3: Presentation & CGU
|
||||
String presentationText = '';
|
||||
bool cguAccepted = false;
|
||||
@@ -104,6 +107,43 @@ class AmRegistrationData extends ChangeNotifier {
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
/// Reprise après refus (#112).
|
||||
void resetForReprise({
|
||||
required String firstName,
|
||||
required String lastName,
|
||||
required String phone,
|
||||
required String email,
|
||||
required String streetAddress,
|
||||
required String postalCode,
|
||||
required String city,
|
||||
String? existingPhotoUrl,
|
||||
}) {
|
||||
this.firstName = firstName;
|
||||
this.lastName = lastName;
|
||||
this.phone = phone;
|
||||
this.email = email;
|
||||
this.streetAddress = streetAddress;
|
||||
this.postalCode = postalCode;
|
||||
this.city = city;
|
||||
password = '';
|
||||
repriseExistingPhotoUrl = existingPhotoUrl;
|
||||
photoPath = existingPhotoUrl;
|
||||
photoBytes = null;
|
||||
photoFilename = null;
|
||||
photoConsent = false;
|
||||
dateOfBirth = null;
|
||||
birthCity = '';
|
||||
birthCountry = '';
|
||||
nir = '';
|
||||
agrementNumber = '';
|
||||
agreementDate = null;
|
||||
capacity = null;
|
||||
placesAvailable = null;
|
||||
presentationText = '';
|
||||
cguAccepted = false;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
// --- Getters for validation or display ---
|
||||
bool get isStep1Complete =>
|
||||
firstName.trim().length >= 2 &&
|
||||
@@ -118,6 +158,8 @@ class AmRegistrationData extends ChangeNotifier {
|
||||
/// Photo réelle (pas seulement un placeholder asset).
|
||||
bool get _hasUserPhoto =>
|
||||
(photoBytes != null && photoBytes!.isNotEmpty) ||
|
||||
(repriseExistingPhotoUrl != null &&
|
||||
repriseExistingPhotoUrl!.trim().isNotEmpty) ||
|
||||
(photoPath != null &&
|
||||
photoPath!.isNotEmpty &&
|
||||
!photoPath!.startsWith('assets/'));
|
||||
@@ -145,6 +187,9 @@ class AmRegistrationData extends ChangeNotifier {
|
||||
bool get isRegistrationComplete =>
|
||||
isStep1Complete && isStep2Complete && isStep3Complete;
|
||||
|
||||
/// Reprise (#112) : champs renvoyés par PATCH reprise-resoumettre.
|
||||
bool get isRepriseSubmitReady => isStep1Complete && cguAccepted;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'AmRegistrationData('
|
||||
|
||||
Reference in New Issue
Block a user