Add REST API endpoints for games, runs, and encounters
Implement 13 endpoints: read-only reference data (games, routes, pokemon), run CRUD with cascading deletes, and encounter management. Uses Pydantic v2 with camelCase alias generation to match frontend types, and nested response schemas for detail views. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
23
backend/src/app/schemas/pokemon.py
Normal file
23
backend/src/app/schemas/pokemon.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from app.schemas.base import CamelModel
|
||||
|
||||
|
||||
class PokemonResponse(CamelModel):
|
||||
id: int
|
||||
national_dex: int
|
||||
name: str
|
||||
types: list[str]
|
||||
sprite_url: str | None
|
||||
|
||||
|
||||
class RouteEncounterResponse(CamelModel):
|
||||
id: int
|
||||
route_id: int
|
||||
pokemon_id: int
|
||||
encounter_method: str
|
||||
encounter_rate: int
|
||||
min_level: int
|
||||
max_level: int
|
||||
|
||||
|
||||
class RouteEncounterDetailResponse(RouteEncounterResponse):
|
||||
pokemon: PokemonResponse
|
||||
Reference in New Issue
Block a user