Compare commits

..

3 Commits

Author SHA1 Message Date
16001f695b fix(#138): carte AM dédiée, titre placement et consent_photo au payload.
Améliore la zone AM/scolarisation (carte dédiée + titre), envoie
consent_photo à l'inscription parent, et parse le consentement enfant
de façon plus robuste (heuristique photo tant que le back ne persiste pas).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-17 12:34:40 +02:00
e65ae4cebe fix(#138): cadre vide en sans garde et passage auto en garde à l'attach AM.
En statut sans_garde, la zone placement affiche toujours le cadre vide ;
sélectionner une AM passe le statut à en garde, et passer à sans_garde
détache l'AM rattachée.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-17 12:24:20 +02:00
1ebf683825 feat(#138): refonte modale enfant admin en format paysage.
Alignement sur les fiches AM/parent : photo identité, champs en grille,
zone AM rattachable (y compris à naître) ou carte scolarisation,
suppression réservée au super_admin et ouverture au clic sur la carte
depuis la fiche parent.

Refs: #138
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-12 18:46:08 +02:00
5 changed files with 4 additions and 27 deletions

View File

@ -552,8 +552,7 @@ export class AuthService {
: undefined; : undefined;
enfant.photo_url = urlPhoto || undefined; enfant.photo_url = urlPhoto || undefined;
enfant.status = enfantDto.date_naissance ? StatutEnfantType.SANS_GARDE : StatutEnfantType.A_NAITRE; enfant.status = enfantDto.date_naissance ? StatutEnfantType.SANS_GARDE : StatutEnfantType.A_NAITRE;
enfant.consent_photo = !!enfantDto.consent_photo; enfant.consent_photo = false;
enfant.consent_photo_at = enfant.consent_photo ? new Date() : null!;
enfant.is_multiple = enfantDto.grossesse_multiple || false; enfant.is_multiple = enfantDto.grossesse_multiple || false;
const enfantEnregistre = await manager.save(Children, enfant); const enfantEnregistre = await manager.save(Children, enfant);
@ -1075,12 +1074,6 @@ export class AuthService {
if (enfantDto.grossesse_multiple !== undefined) { if (enfantDto.grossesse_multiple !== undefined) {
enfant.is_multiple = enfantDto.grossesse_multiple; enfant.is_multiple = enfantDto.grossesse_multiple;
} }
if (enfantDto.consent_photo !== undefined) {
enfant.consent_photo = !!enfantDto.consent_photo;
enfant.consent_photo_at = enfant.consent_photo
? new Date()
: null!;
}
if (enfantDto.photo_base64 && enfantDto.photo_filename) { if (enfantDto.photo_base64 && enfantDto.photo_filename) {
enfant.photo_url = await this.sauvegarderPhotoDepuisBase64( enfant.photo_url = await this.sauvegarderPhotoDepuisBase64(

View File

@ -59,14 +59,5 @@ export class EnfantInscriptionDto {
@IsOptional() @IsOptional()
@IsBoolean() @IsBoolean()
grossesse_multiple?: boolean; grossesse_multiple?: boolean;
@ApiProperty({
example: true,
required: false,
description: 'Consentement affichage / stockage photo (colonne enfants.consentement_photo)',
})
@IsOptional()
@IsBoolean()
consent_photo?: boolean;
} }

View File

@ -120,13 +120,7 @@ export class EnfantsService {
const child = await this.childrenRepository.findOne({ where: { id } }); const child = await this.childrenRepository.findOne({ where: { id } });
if (!child) throw new NotFoundException('Enfant introuvable'); if (!child) throw new NotFoundException('Enfant introuvable');
const patch: Partial<Children> = { ...dto } as Partial<Children>; await this.childrenRepository.update(id, dto);
if (dto.consent_photo !== undefined) {
patch.consent_photo = dto.consent_photo;
patch.consent_photo_at = dto.consent_photo ? new Date() : null!;
}
await this.childrenRepository.update(id, patch);
return this.findOne(id, currentUser); return this.findOne(id, currentUser);
} }

View File

@ -167,7 +167,6 @@ class ParentRegistrationPayload {
final map = <String, dynamic>{ final map = <String, dynamic>{
'genre': apiGenres.contains(c.genre) ? c.genre : 'Autre', 'genre': apiGenres.contains(c.genre) ? c.genre : 'Autre',
'grossesse_multiple': c.multipleBirth, 'grossesse_multiple': c.multipleBirth,
'consent_photo': c.photoConsent,
}; };
final prenom = c.firstName.trim(); final prenom = c.firstName.trim();

View File

@ -44,8 +44,8 @@ class RepriseMapper {
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. // Inscription initiale exigeait la coche pour envoyer la photo ; le back
// On pré-coche encore si photo en base pour ne pas bloquer la reprise. // ne persistait pas toujours consent_photo on pré-coche si photo en base.
photoConsent: e.consentPhoto || hasPhoto, photoConsent: e.consentPhoto || hasPhoto,
multipleBirth: e.estMultiple, multipleBirth: e.estMultiple,
isUnbornChild: isUnborn, isUnbornChild: isUnborn,