Add a nullable naming_scheme column to NuzlockeRun so users can pick a themed word category for nickname suggestions. Includes Alembic migration, updated Pydantic schemas, a GET /runs/naming-categories endpoint backed by a cached dictionary loader, and frontend dropdowns in both the NewRun creation flow and the RunDashboard for mid-run changes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
49 lines
1.1 KiB
Python
49 lines
1.1 KiB
Python
from datetime import datetime
|
|
|
|
from app.schemas.base import CamelModel
|
|
from app.schemas.encounter import EncounterDetailResponse
|
|
from app.schemas.game import GameResponse
|
|
|
|
|
|
class RunCreate(CamelModel):
|
|
game_id: int
|
|
name: str
|
|
rules: dict = {}
|
|
naming_scheme: str | None = None
|
|
|
|
|
|
class RunUpdate(CamelModel):
|
|
name: str | None = None
|
|
status: str | None = None
|
|
rules: dict | None = None
|
|
hof_encounter_ids: list[int] | None = None
|
|
naming_scheme: str | None = None
|
|
|
|
|
|
class RunResponse(CamelModel):
|
|
id: int
|
|
game_id: int
|
|
name: str
|
|
status: str
|
|
rules: dict
|
|
hof_encounter_ids: list[int] | None = None
|
|
naming_scheme: str | None = None
|
|
started_at: datetime
|
|
completed_at: datetime | None
|
|
|
|
|
|
class RunGenlockeContext(CamelModel):
|
|
genlocke_id: int
|
|
genlocke_name: str
|
|
leg_order: int
|
|
total_legs: int
|
|
is_final_leg: bool
|
|
retired_pokemon_ids: list[int] = []
|
|
|
|
|
|
class RunDetailResponse(RunResponse):
|
|
game: GameResponse
|
|
encounters: list[EncounterDetailResponse] = []
|
|
genlocke: RunGenlockeContext | None = None
|
|
transfer_encounter_ids: list[int] = []
|