feat(#112): reprise après refus — dossier complet, email resoumission
- GET/PATCH reprise-dossier enrichis (parents, enfants, motivation, fiche AM) - Front: lien mail, modale identify login, wizards préremplis, PATCH complet - Email accusé resoumission aux parents avec n° de dossier - Fixes préremplissage AM (dates, places, ValueKey étape 2) Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -30,6 +30,7 @@ class ParentData {
|
||||
class ChildData {
|
||||
static const Object _unsetImage = Object();
|
||||
static const Object _unsetImageBytes = Object();
|
||||
static const Object _unsetExistingPhotoUrl = Object();
|
||||
|
||||
String firstName;
|
||||
String lastName;
|
||||
@@ -43,6 +44,10 @@ class ChildData {
|
||||
/// Octets de la photo (fiable à l’envoi API ; [imageFile] peut être absent sur le web).
|
||||
Uint8List? imageBytes;
|
||||
CardColorVertical cardColor; // Nouveau champ pour la couleur de la carte
|
||||
/// UUID enfant en base (reprise #112) — requis pour PATCH reprise-resoumettre.
|
||||
String? repriseChildId;
|
||||
/// Photo déjà stockée (affichage reprise sans re-upload).
|
||||
String? existingPhotoUrl;
|
||||
|
||||
ChildData({
|
||||
this.firstName = '',
|
||||
@@ -55,6 +60,8 @@ class ChildData {
|
||||
this.imageFile,
|
||||
this.imageBytes,
|
||||
required this.cardColor, // Rendre requis dans le constructeur
|
||||
this.repriseChildId,
|
||||
this.existingPhotoUrl,
|
||||
});
|
||||
|
||||
ChildData copyWith({
|
||||
@@ -68,6 +75,8 @@ class ChildData {
|
||||
Object? imageFile = _unsetImage,
|
||||
Object? imageBytes = _unsetImageBytes,
|
||||
CardColorVertical? cardColor,
|
||||
String? repriseChildId,
|
||||
Object? existingPhotoUrl = _unsetExistingPhotoUrl,
|
||||
}) {
|
||||
return ChildData(
|
||||
firstName: firstName ?? this.firstName,
|
||||
@@ -81,6 +90,10 @@ class ChildData {
|
||||
imageBytes:
|
||||
identical(imageBytes, _unsetImageBytes) ? this.imageBytes : imageBytes as Uint8List?,
|
||||
cardColor: cardColor ?? this.cardColor,
|
||||
repriseChildId: repriseChildId ?? this.repriseChildId,
|
||||
existingPhotoUrl: identical(existingPhotoUrl, _unsetExistingPhotoUrl)
|
||||
? this.existingPhotoUrl
|
||||
: existingPhotoUrl as String?,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -178,6 +191,38 @@ class UserRegistrationData extends ChangeNotifier {
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
/// Reprise après refus (#112) : réinitialise le flux parent avec les données dossier.
|
||||
void resetForReprise({
|
||||
required ParentData parent1Data,
|
||||
ParentData? parent2Data,
|
||||
List<ChildData>? childrenData,
|
||||
String motivation = '',
|
||||
}) {
|
||||
parent1 = parent1Data;
|
||||
parent2 = parent2Data;
|
||||
children
|
||||
..clear()
|
||||
..addAll(childrenData ?? const []);
|
||||
motivationText = motivation;
|
||||
cguAccepted = false;
|
||||
bankDetails = null;
|
||||
attestationCafNumber = '';
|
||||
consentQuotientFamilial = false;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
/// Reprise (#112) : coordonnées + enfants connus + CGU.
|
||||
bool get isRepriseSubmitReady =>
|
||||
parent1.firstName.isNotEmpty &&
|
||||
parent1.lastName.isNotEmpty &&
|
||||
parent1.email.isNotEmpty &&
|
||||
children.isNotEmpty &&
|
||||
children.every(
|
||||
(c) =>
|
||||
c.repriseChildId != null && c.repriseChildId!.trim().isNotEmpty,
|
||||
) &&
|
||||
cguAccepted;
|
||||
|
||||
// Méthode pour vérifier si toutes les données requises sont là (simplifié)
|
||||
bool isRegistrationComplete() {
|
||||
// Ajouter ici les validations nécessaires
|
||||
|
||||
Reference in New Issue
Block a user