[READY][Gameplay] Canonical session state model: explicit scoreboard phase after reveal #288
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent: #287
Problem
Backend og frontend er ikke enige om canonical round states. Frontend phase-machine har
scoreboard, men backendGameSession.Statusmangler den, og reveal/scoreboard er derfor ikke modelleret som to eksplicitte trin.Scope
Gør state/API-modellen canonical efter #287:
lobby | lie | guess | reveal | scoreboard | finishedreveal -> scoreboardsession_detailog relaterede endpoints afspejler samme faseordenAcceptance criteria
GameSession.Statusog relaterede serialiseringer understøtterscoreboardrevealtilscoreboardreveal_scoreboarder ikke længere kun et sidekald ireveal; scoreboard kan identificeres som selvstændig sessionfasestart_next_round()ogfinish_game()er gated frascoreboard, ikkereveallie -> guess -> reveal -> scoreboard -> lobby/finishedRequired artifacts
Implementeret i commit
a0277fd8be17a923d992cf92fa8e530cd2c462aapådev/issue-288-scoreboard-phase.Head SHA:
a0277fd8be17a923d992cf92fa8e530cd2c462aaPR: #291 #291
Opdaterede endpoints/flow:
GET /lobby/sessions/:code/scoreboardlaver nu eksplicit transitionreveal -> scoreboardog kan genlæses iscoreboardPOST /lobby/sessions/:code/rounds/nexter gated frascoreboardPOST /lobby/sessions/:code/finisher gated frascoreboardGameSession.Statusserialiserer nuscoreboardOpdaterede tests:
ScoreCalculationTests,RevealRoundFlowTests,SessionDetailPhaseViewModelTestssrc/app/api-contract-smoke.spec.ts,src/app/features/host/host-shell.component.spec.tstests/angular-api-client.test.ts,tests/gameplay-phase-machine.test.tsVerificeret lokalt:
.venv/bin/python manage.py test lobby.tests.RevealRoundFlowTests lobby.tests.SessionDetailPhaseViewModelTests lobby.tests.ScoreCalculationTestsnpm test -- --run src/app/api-contract-smoke.spec.ts src/app/features/host/host-shell.component.spec.ts(ifrontend/angular)npm test -- --run ../frontend/tests/angular-api-client.test.ts ../frontend/tests/gameplay-phase-machine.test.ts(ifrontend)