[Backend] Rattachement enfants — parent et AM #115

Closed
opened 2026-03-11 21:02:17 +00:00 by jmartin · 2 comments
Owner

Contexte — rattachement enfants (parent et AM)

Valable depuis la fiche parent (enfants_parents) et depuis la fiche AM / fiche enfant (enfants_assistantes_maternelles).

Réf. doc : 28_EVOLUTION-FAMILLE-ET-RESPONSABLES.md.

APIs AM déjà livrées avec #131 : POST/DELETE /assistantes-maternelles/:id/enfants/:enfantId.
Affiliation parent ↔ enfant via table enfants_parents. Vérité métier : liens many-to-many, pas suppression enfant pour retirer un lien.

Backend — livré / en cours

  • POST /parents/:id/enfants/:enfantId — rattacher un enfant existant
  • DELETE /parents/:id/enfants/:enfantId — détacher (garde-fou : ≥1 responsable par enfant)
  • Création enfant depuis fiche parent (dépend #129)
  • Tests unitaires attach/detach

Garde-fous

  • Ne pas supprimer l'enfant pour retirer un lien
  • Au moins un responsable par enfant
  • Erreurs métier explicites (409 lien existant, 400 dernier responsable)

Labels : backend, api

## Contexte — rattachement enfants (parent **et** AM) Valable depuis la **fiche parent** (`enfants_parents`) **et** depuis la **fiche AM** / **fiche enfant** (`enfants_assistantes_maternelles`). Réf. doc : [28_EVOLUTION-FAMILLE-ET-RESPONSABLES.md](../docs/28_EVOLUTION-FAMILLE-ET-RESPONSABLES.md). APIs AM déjà livrées avec #131 : `POST/DELETE /assistantes-maternelles/:id/enfants/:enfantId`. Affiliation parent ↔ enfant via table `enfants_parents`. Vérité métier : liens many-to-many, pas suppression enfant pour retirer un lien. ## Backend — livré / en cours - [x] `POST /parents/:id/enfants/:enfantId` — rattacher un enfant existant - [x] `DELETE /parents/:id/enfants/:enfantId` — détacher (garde-fou : ≥1 responsable par enfant) - [ ] Création enfant depuis fiche parent (dépend #129) - [ ] Tests unitaires attach/detach ## Garde-fous - Ne pas supprimer l'enfant pour retirer un lien - Au moins un responsable par enfant - Erreurs métier explicites (409 lien existant, 400 dernier responsable) **Labels** : backend, api
jmartin added the backendapi labels 2026-03-11 21:02:17 +00:00
jmartin added this to the 0.1.0 milestone 2026-04-16 08:41:43 +00:00
Author
Owner

Branche feature/140-dashboard-admin-fiches parent/enfants + affiliation-famille depuis develop — commit 1dddc679.\n\nPR: https://git.ptits-pas.fr/jmartin/petitspas/compare/develop...feature/140-dashboard-admin-fiches parent/enfants + affiliation-famille

Branche `feature/140-dashboard-admin-fiches parent/enfants + affiliation-famille` depuis `develop` — commit 1dddc679.\n\nPR: https://git.ptits-pas.fr/jmartin/petitspas/compare/develop...feature/140-dashboard-admin-fiches parent/enfants + affiliation-famille
jmartin changed title from Rattachement parent – backend to [Backend] Rattachement enfants — parent et AM 2026-07-17 13:07:06 +00:00
Author
Owner

Clôture — déjà couvert

Le rattachement parent ↔ enfant backend est livré et supersédé par le lot ultérieur :

  • POST/DELETE /parents/:id/enfants/:enfantId (cœur #115)
  • #158 (fermé) — attach/detach au niveau foyer (pivot + co-parent)
  • #157 (fermé) — détachement dernier parent autorisé + orphelin
  • AM : déjà via #131 (POST/DELETE /assistantes-maternelles/:id/enfants/:enfantId)

Écarts du body d’origine — non retenus (décision produit)

Écart Décision
Création enfant depuis fiche parent Non — parcours #132 (onglet Enfants + foyer existant)
Garde-fou « ≥1 responsable » Abandonné volontairement — #157
Tests unitaires attach/detach Non exigés pour clôturer

Fermé : déjà couvert (pas obsolète : le besoin a bien été réalisé).

## Clôture — déjà couvert Le rattachement parent ↔ enfant backend est **livré** et supersédé par le lot ultérieur : - `POST/DELETE /parents/:id/enfants/:enfantId` (cœur #115) - **#158** (fermé) — attach/detach au **niveau foyer** (pivot + co-parent) - **#157** (fermé) — détachement dernier parent autorisé + orphelin - AM : déjà via #131 (`POST/DELETE /assistantes-maternelles/:id/enfants/:enfantId`) ### Écarts du body d’origine — **non retenus** (décision produit) | Écart | Décision | |-------|----------| | Création enfant depuis fiche parent | Non — parcours **#132** (onglet Enfants + foyer existant) | | Garde-fou « ≥1 responsable » | Abandonné volontairement — **#157** | | Tests unitaires attach/detach | Non exigés pour clôturer | → **Fermé : déjà couvert** (pas obsolète : le besoin a bien été réalisé).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jmartin/petitspas#115