Étape 9 : suppression du statut d'affectation (plus de confirmation)

Une affectation est valide dès sa création ; la retirer = supprimer la ligne.

- Modèle : suppression de AssignmentStatus, ACTIVE_ASSIGNMENT_STATUSES et de
  Assignment.status ; migration 0003 (drop_column, alembic check vert)
- Loader de validation : toutes les affectations du bénévole comptent, plus de
  filtre par statut
- API : AssignmentCreate/Update/Read sans status ; création → validation
  toujours exécutée (blocage si violation bloquante) ; PATCH ne porte plus que
  source/locked
- Matrice : MatrixShift.{confirmed, proposed} → {assigned} (compte unique)
- Seed : affectations sans statut, résumé « Affectations » (260)
- Tests mis à jour (matrice, loader, modèle, API) ; 128 tests au total
- CLAUDE.md : glossaire, modèle, sémantique de validation, périmètre

Frontend : les références au statut (propositions, badges confirmé/proposé,
écran de confirmation mobile, mock, schema.ts) restent à retirer séparément.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017uUsRg7XzopkCPWimwg9ZM
This commit is contained in:
AdamThomas
2026-09-10 07:36:06 +02:00
co-authored by Claude Sonnet 5
parent 8a879ca5c3
commit 464635656a
15 changed files with 109 additions and 208 deletions
+2 -4
View File
@@ -7,7 +7,6 @@ import uuid
from sqlmodel import Session, select
from app.models import (
ACTIVE_ASSIGNMENT_STATUSES,
Assignment,
Availability,
DayPart,
@@ -65,13 +64,12 @@ def build_validation_input(
)
code_by_day_part_id = {dp.id: dp.code for dp in day_parts}
# Toute affectation existante du bénévole compte (une affectation = une
# décision, toujours active).
stmt = (
select(Shift)
.join(Assignment, Assignment.shift_id == Shift.id)
.where(Assignment.volunteer_id == volunteer.id)
.where(
Assignment.status.in_(tuple(ACTIVE_ASSIGNMENT_STATUSES))
)
.where(Shift.id != shift.id)
)
if exclude_assignment_id is not None: