Add genlocke list and detail pages

Add GET /genlockes and GET /genlockes/{id} endpoints with aggregate
encounter/death stats per leg, and a frontend list page at /genlockes
plus a detail page at /genlockes/:genlockeId showing progress timeline,
cumulative stats, configuration, retired families, and quick actions.
Update nav link to point to the list page instead of /genlockes/new.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Julian Tabel
2026-02-09 10:39:59 +01:00
parent c7c66c76d3
commit 08f6857451
11 changed files with 669 additions and 9 deletions

View File

@@ -17,6 +17,7 @@ class GenlockeLegResponse(CamelModel):
game_id: int
run_id: int | None = None
leg_order: int
retired_pokemon_ids: list[int] | None = None
game: GameResponse
@@ -28,3 +29,52 @@ class GenlockeResponse(CamelModel):
nuzlocke_rules: dict
created_at: datetime
legs: list[GenlockeLegResponse] = []
# --- List / Detail schemas ---
class RetiredPokemonResponse(CamelModel):
id: int
name: str
sprite_url: str | None = None
class GenlockeLegDetailResponse(CamelModel):
id: int
leg_order: int
game: GameResponse
run_id: int | None = None
run_status: str | None = None
encounter_count: int = 0
death_count: int = 0
retired_pokemon_ids: list[int] | None = None
class GenlockeStatsResponse(CamelModel):
total_encounters: int
total_deaths: int
legs_completed: int
total_legs: int
class GenlockeListItem(CamelModel):
id: int
name: str
status: str
created_at: datetime
total_legs: int
completed_legs: int
current_leg_order: int | None = None
class GenlockeDetailResponse(CamelModel):
id: int
name: str
status: str
genlocke_rules: dict
nuzlocke_rules: dict
created_at: datetime
legs: list[GenlockeLegDetailResponse] = []
stats: GenlockeStatsResponse
retired_pokemon: dict[int, RetiredPokemonResponse] = {}