Files
nuzlocke-tracker/backend/src/app/schemas/genlocke.py

90 lines
1.8 KiB
Python
Raw Normal View History

from datetime import datetime
from app.schemas.base import CamelModel
from app.schemas.game import GameResponse
class GenlockeCreate(CamelModel):
name: str
game_ids: list[int]
genlocke_rules: dict = {}
nuzlocke_rules: dict = {}
class GenlockeUpdate(CamelModel):
name: str | None = None
status: str | None = None
class AddLegRequest(CamelModel):
game_id: int
class GenlockeLegResponse(CamelModel):
id: int
genlocke_id: int
game_id: int
run_id: int | None = None
leg_order: int
retired_pokemon_ids: list[int] | None = None
game: GameResponse
class GenlockeResponse(CamelModel):
id: int
name: str
status: str
genlocke_rules: dict
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] = {}