fix(#138): lire le consentement photo sans heuristique photo.
Admin et reprise utilisentent uniquement la valeur API ; plus de pré-cochage implicite si une photo est présente. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
59919834b9
commit
291ea26b34
@ -49,10 +49,7 @@ class EnfantAdminModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final photoUrl = json['photo_url'] as String? ?? json['photoUrl'] as String?;
|
final photoUrl = json['photo_url'] as String? ?? json['photoUrl'] as String?;
|
||||||
final hasPhoto = (photoUrl ?? '').trim().isNotEmpty;
|
final consentPhoto = _parseBool(json['consent_photo']) ||
|
||||||
// L'inscription parent exigeait le consentement pour envoyer la photo, mais
|
|
||||||
// le back a longtemps forcé consent_photo=false (voir reprise_mapper).
|
|
||||||
final consentFromApi = _parseBool(json['consent_photo']) ||
|
|
||||||
_parseBool(json['consentement_photo']) ||
|
_parseBool(json['consentement_photo']) ||
|
||||||
_parseBool(json['consentPhoto']);
|
_parseBool(json['consentPhoto']);
|
||||||
|
|
||||||
@ -67,7 +64,7 @@ class EnfantAdminModel {
|
|||||||
(json['status'] ?? json['statut'])?.toString(),
|
(json['status'] ?? json['statut'])?.toString(),
|
||||||
),
|
),
|
||||||
photoUrl: photoUrl,
|
photoUrl: photoUrl,
|
||||||
consentPhoto: consentFromApi || hasPhoto,
|
consentPhoto: consentPhoto,
|
||||||
isMultiple: _parseBool(json['is_multiple']) ||
|
isMultiple: _parseBool(json['is_multiple']) ||
|
||||||
_parseBool(json['est_multiple']),
|
_parseBool(json['est_multiple']),
|
||||||
parentLinks: links,
|
parentLinks: links,
|
||||||
|
|||||||
@ -199,9 +199,6 @@ class ParentRegistrationPayload {
|
|||||||
map['photo_base64'] = photo.$1;
|
map['photo_base64'] = photo.$1;
|
||||||
map['photo_filename'] = photo.$2;
|
map['photo_filename'] = photo.$2;
|
||||||
}
|
}
|
||||||
// Consentement photo enfant (le back l'ignore encore à l'inscription —
|
|
||||||
// à brancher côté API ; en attendant le front admin infère via photo).
|
|
||||||
map['consent_photo'] = c.photoConsent;
|
|
||||||
|
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -38,15 +38,12 @@ class RepriseMapper {
|
|||||||
? isoToDdMmYyyy(e.dueDate)
|
? isoToDdMmYyyy(e.dueDate)
|
||||||
: isoToDdMmYyyy(e.birthDate);
|
: isoToDdMmYyyy(e.birthDate);
|
||||||
final photo = e.photoUrl?.trim();
|
final photo = e.photoUrl?.trim();
|
||||||
final hasPhoto = photo != null && photo.isNotEmpty;
|
|
||||||
return ChildData(
|
return ChildData(
|
||||||
firstName: e.firstName ?? '',
|
firstName: e.firstName ?? '',
|
||||||
lastName: e.lastName ?? '',
|
lastName: e.lastName ?? '',
|
||||||
dob: dob,
|
dob: dob,
|
||||||
genre: e.gender ?? '',
|
genre: e.gender ?? '',
|
||||||
// Legacy : dossiers inscrits avant #144 avaient consent_photo=false malgré une photo.
|
photoConsent: e.consentPhoto,
|
||||||
// On pré-coche encore si photo en base pour ne pas bloquer la reprise.
|
|
||||||
photoConsent: e.consentPhoto || hasPhoto,
|
|
||||||
multipleBirth: e.estMultiple,
|
multipleBirth: e.estMultiple,
|
||||||
isUnbornChild: isUnborn,
|
isUnbornChild: isUnborn,
|
||||||
cardColor: _childCardColors[index % _childCardColors.length],
|
cardColor: _childCardColors[index % _childCardColors.length],
|
||||||
@ -200,7 +197,7 @@ class RepriseMapper {
|
|||||||
postalCode: dossier.codePostal ?? '',
|
postalCode: dossier.codePostal ?? '',
|
||||||
city: dossier.ville ?? '',
|
city: dossier.ville ?? '',
|
||||||
existingPhotoUrl: displayPhoto,
|
existingPhotoUrl: displayPhoto,
|
||||||
consentementPhoto: dossier.consentementPhoto || hasPhoto,
|
consentementPhoto: dossier.consentementPhoto,
|
||||||
dateOfBirth: parseIsoDate(dossier.dateNaissance),
|
dateOfBirth: parseIsoDate(dossier.dateNaissance),
|
||||||
birthCity: dossier.lieuNaissanceVille ?? '',
|
birthCity: dossier.lieuNaissanceVille ?? '',
|
||||||
birthCountry: dossier.lieuNaissancePays ?? '',
|
birthCountry: dossier.lieuNaissancePays ?? '',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user