É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:
co-authored by
Claude Sonnet 5
parent
8a879ca5c3
commit
464635656a
@@ -1,5 +1,4 @@
|
||||
|
||||
from app.models import Assignment, AssignmentStatus
|
||||
from app.models import Assignment
|
||||
from tests.factories import dt_at, make_position, make_shift, make_volunteer
|
||||
|
||||
|
||||
@@ -18,14 +17,7 @@ def test_matrix_shape_and_counts(client, edition, session):
|
||||
session, edition, parking, start=dt_at(10, 8), end=dt_at(10, 12)
|
||||
)
|
||||
|
||||
for i, status in enumerate(
|
||||
[
|
||||
AssignmentStatus.CONFIRMED,
|
||||
AssignmentStatus.CONFIRMED,
|
||||
AssignmentStatus.PROPOSED,
|
||||
AssignmentStatus.DECLINED,
|
||||
]
|
||||
):
|
||||
for i in range(3):
|
||||
volunteer = make_volunteer(
|
||||
session, edition, first_name=f"V{i}", last_name="X", email=f"v{i}@ex.fr"
|
||||
)
|
||||
@@ -34,7 +26,6 @@ def test_matrix_shape_and_counts(client, edition, session):
|
||||
edition_id=edition.id,
|
||||
volunteer_id=volunteer.id,
|
||||
shift_id=shift_a.id,
|
||||
status=status,
|
||||
)
|
||||
)
|
||||
session.commit()
|
||||
@@ -47,13 +38,12 @@ def test_matrix_shape_and_counts(client, edition, session):
|
||||
assert [s["shift_id"] for s in bar_shifts] == [str(shift_a.id), str(shift_b.id)]
|
||||
|
||||
first = bar_shifts[0]
|
||||
assert first["confirmed"] == 2
|
||||
assert first["proposed"] == 1 # la DECLINEE n'est pas comptée
|
||||
assert first["assigned"] == 3
|
||||
assert first["min_staff"] == 2
|
||||
assert first["ideal_staff"] == 5
|
||||
|
||||
assert bar_shifts[1]["confirmed"] == 0
|
||||
assert body["positions"][1]["shifts"][0]["proposed"] == 0
|
||||
assert bar_shifts[1]["assigned"] == 0
|
||||
assert body["positions"][1]["shifts"][0]["assigned"] == 0
|
||||
|
||||
|
||||
def test_matrix_unknown_edition_is_404(client):
|
||||
|
||||
Reference in New Issue
Block a user