feat(#138,#143,#144): fiche enfant admin, consentement photo et fix gestionnaire.
Squash merge develop → master. - #138 : modale enfant paysage, zone AM/scolarisation, liens responsables - #144 : persistance consent_photo à l'inscription enfant - #143 : masquer Supprimer sur la propre fiche gestionnaire Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -14,10 +14,10 @@ String normalizeEnfantStatus(String? raw) {
|
||||
return s;
|
||||
}
|
||||
|
||||
String _scolariseAccordeAuGenre(String? gender) {
|
||||
String _accordeAuGenre(String masculin, String feminin, String? gender) {
|
||||
final g = (gender ?? '').trim().toUpperCase();
|
||||
if (g == 'F') return 'Scolarisée';
|
||||
return 'Scolarisé';
|
||||
if (g == 'F') return feminin;
|
||||
return masculin;
|
||||
}
|
||||
|
||||
/// Libellé affiché pour un statut enfant.
|
||||
@@ -28,9 +28,9 @@ String enfantStatusLabel(String? status, {String? gender}) {
|
||||
case 'sans_garde':
|
||||
return 'Sans garde';
|
||||
case 'garde':
|
||||
return 'En garde';
|
||||
return _accordeAuGenre('Gardé', 'Gardée', gender);
|
||||
case 'scolarise':
|
||||
return _scolariseAccordeAuGenre(gender);
|
||||
return _accordeAuGenre('Scolarisé', 'Scolarisée', gender);
|
||||
default:
|
||||
return status?.trim().isNotEmpty == true ? status!.trim() : '–';
|
||||
}
|
||||
|
||||
@@ -167,6 +167,7 @@ class ParentRegistrationPayload {
|
||||
final map = <String, dynamic>{
|
||||
'genre': apiGenres.contains(c.genre) ? c.genre : 'Autre',
|
||||
'grossesse_multiple': c.multipleBirth,
|
||||
'consent_photo': c.photoConsent,
|
||||
};
|
||||
|
||||
final prenom = c.firstName.trim();
|
||||
|
||||
@@ -38,15 +38,12 @@ class RepriseMapper {
|
||||
? isoToDdMmYyyy(e.dueDate)
|
||||
: isoToDdMmYyyy(e.birthDate);
|
||||
final photo = e.photoUrl?.trim();
|
||||
final hasPhoto = photo != null && photo.isNotEmpty;
|
||||
return ChildData(
|
||||
firstName: e.firstName ?? '',
|
||||
lastName: e.lastName ?? '',
|
||||
dob: dob,
|
||||
genre: e.gender ?? '',
|
||||
// Inscription initiale exigeait la coche pour envoyer la photo ; le back
|
||||
// ne persistait pas toujours consent_photo — on pré-coche si photo en base.
|
||||
photoConsent: e.consentPhoto || hasPhoto,
|
||||
photoConsent: e.consentPhoto,
|
||||
multipleBirth: e.estMultiple,
|
||||
isUnbornChild: isUnborn,
|
||||
cardColor: _childCardColors[index % _childCardColors.length],
|
||||
@@ -200,7 +197,7 @@ class RepriseMapper {
|
||||
postalCode: dossier.codePostal ?? '',
|
||||
city: dossier.ville ?? '',
|
||||
existingPhotoUrl: displayPhoto,
|
||||
consentementPhoto: dossier.consentementPhoto || hasPhoto,
|
||||
consentementPhoto: dossier.consentementPhoto,
|
||||
dateOfBirth: parseIsoDate(dossier.dateNaissance),
|
||||
birthCity: dossier.lieuNaissanceVille ?? '',
|
||||
birthCountry: dossier.lieuNaissancePays ?? '',
|
||||
|
||||
Reference in New Issue
Block a user