Skip to content

Expose the muster fields on the game serializers #1271

Description

@johnpooch

Goal

A read-only wire surface for mustering, so the frontend has something to render.

Context

Step 4 of the mustering series. Implementation on claude/game-mustering-state-ah1fw2 (PR #1235).

Approach

muster_required, muster_deadline and a muster_status method field on both GameListSerializer and GameRetrieveSerializer (service/game/serializers.py). muster_status is null unless the game is mustering and the requester is a member; otherwise confirmation_required or confirmed.

Regenerated schemas and clients: docker compose up codegen, then npx tsc -b --noEmit in packages/web.

Frontend mock plumbing, so the fixtures stay type-valid and step 5 has something to render against:

  • musterRequired/musterDeadline/musterStatus on the makeGame builder (packages/web/src/mocks/fixtures/builders.ts) and on the eight game literals in packages/web/src/mocks/legacy.ts — indent these to match their neighbours; the branch's copies are two spaces short.
  • comma-separated status filtering in the MSW games-list handler (packages/web/src/mocks/handlers.ts), which currently does an exact g.status === status match. The real GameFilter.filter_status (service/game/filters.py:57) already splits on commas and validates against GameStatus.STATUS_CHOICES, so only the mock needs changing.
  • the musteringGame fixture in packages/web/src/mocks/fixtures/games.ts, exported from fixtures/index.ts.

Tests: TestMusterSerializerFields from service/game/tests/test_mustering.py.

Note that the branch duplicates the get_muster_status getter verbatim across both serializers. It should be a shared mixin, and this is the step to do that in.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions