Add genlocke cumulative graveyard with backend endpoint and UI
Aggregates all fainted encounters across every leg of a genlocke into a
unified graveyard view. Backend serves GET /genlockes/{id}/graveyard with
per-entry leg/game context and summary stats (total deaths, deaths per
leg, deadliest leg). Frontend adds a toggle button on the genlocke detail
page that reveals a filterable/sortable grid of grayscale Pokemon cards.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,7 @@ from datetime import datetime
|
||||
|
||||
from app.schemas.base import CamelModel
|
||||
from app.schemas.game import GameResponse
|
||||
from app.schemas.pokemon import PokemonResponse
|
||||
|
||||
|
||||
class GenlockeCreate(CamelModel):
|
||||
@@ -87,3 +88,33 @@ class GenlockeDetailResponse(CamelModel):
|
||||
legs: list[GenlockeLegDetailResponse] = []
|
||||
stats: GenlockeStatsResponse
|
||||
retired_pokemon: dict[int, RetiredPokemonResponse] = {}
|
||||
|
||||
|
||||
# --- Graveyard schemas ---
|
||||
|
||||
|
||||
class GraveyardEntryResponse(CamelModel):
|
||||
id: int
|
||||
pokemon: PokemonResponse
|
||||
current_pokemon: PokemonResponse | None = None
|
||||
nickname: str | None = None
|
||||
catch_level: int | None = None
|
||||
faint_level: int | None = None
|
||||
death_cause: str | None = None
|
||||
is_shiny: bool = False
|
||||
route_name: str
|
||||
leg_order: int
|
||||
game_name: str
|
||||
|
||||
|
||||
class GraveyardLegSummary(CamelModel):
|
||||
leg_order: int
|
||||
game_name: str
|
||||
death_count: int
|
||||
|
||||
|
||||
class GenlockeGraveyardResponse(CamelModel):
|
||||
entries: list[GraveyardEntryResponse]
|
||||
total_deaths: int
|
||||
deaths_per_leg: list[GraveyardLegSummary]
|
||||
deadliest_leg: GraveyardLegSummary | None = None
|
||||
|
||||
Reference in New Issue
Block a user