feat(#132): photo à la création enfant staff (multipart + bools).

Transform "true"/"false" pour class-validator ; multipart staff
avec FileInterceptor('photo') inchangé côté stockage.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-17 18:08:52 +02:00
co-authored by Cursor
parent 26e9738ec7
commit f7ac628445
3 changed files with 26 additions and 6 deletions
@@ -37,7 +37,8 @@ export class EnfantsService {
/**
* Création d'un enfant.
* - PARENT : rattache au parent connecté (multipart photo optionnel).
* - Staff : JSON + `parent_user_id` obligatoire (foyer existant). Ticket #132.
* - Staff : `parent_user_id` obligatoire ; JSON sans photo OK ;
* avec photo → multipart (même stockage `/uploads/photos/...`). Ticket #132.
*/
async create(
dto: CreateEnfantsDto,
@@ -67,7 +68,7 @@ export class EnfantsService {
});
if (exist) throw new ConflictException('Cet enfant existe déjà');
// Gestion de la photo uploadée (parcours parent multipart)
// Gestion de la photo uploadée (multipart parent ou staff)
let photoUrl = dto.photo_url;
let consentAt: Date | undefined;
if (photoFile) {