Files
nuzlocke-tracker/backend/src/app/schemas/boss.py
Julian Tabel 0e4fac8790 Add optional specialty type field to boss battles
Gym leaders, Elite Four, and champions can now have a Pokemon type
specialty (e.g. Rock, Water). Shown as a type image badge on boss
cards in the run view, and editable via dropdown in the admin form.
Includes migration, export, and seed pipeline support.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 15:23:59 +01:00

96 lines
1.9 KiB
Python

from datetime import datetime
from app.schemas.base import CamelModel
from app.schemas.pokemon import PokemonResponse
class BossPokemonResponse(CamelModel):
id: int
pokemon_id: int
level: int
order: int
pokemon: PokemonResponse
class BossBattleResponse(CamelModel):
id: int
version_group_id: int
name: str
boss_type: str
specialty_type: str | None
badge_name: str | None
badge_image_url: str | None
level_cap: int
order: int
after_route_id: int | None
location: str
section: str | None
sprite_url: str | None
pokemon: list[BossPokemonResponse] = []
class BossResultResponse(CamelModel):
id: int
run_id: int
boss_battle_id: int
result: str
attempts: int
completed_at: datetime | None
# --- Input schemas ---
class BossBattleCreate(CamelModel):
name: str
boss_type: str
specialty_type: str | None = None
badge_name: str | None = None
badge_image_url: str | None = None
level_cap: int
order: int
after_route_id: int | None = None
location: str
section: str | None = None
sprite_url: str | None = None
class BossBattleUpdate(CamelModel):
name: str | None = None
boss_type: str | None = None
specialty_type: str | None = None
badge_name: str | None = None
badge_image_url: str | None = None
level_cap: int | None = None
order: int | None = None
after_route_id: int | None = None
location: str | None = None
section: str | None = None
sprite_url: str | None = None
class BossPokemonInput(CamelModel):
pokemon_id: int
level: int
order: int
class BossResultCreate(CamelModel):
boss_battle_id: int
result: str
attempts: int = 1
class BossReorderItem(CamelModel):
id: int
order: int
class BossReorderRequest(CamelModel):
bosses: list[BossReorderItem]
class BossResultUpdate(CamelModel):
result: str | None = None
attempts: int | None = None