Separate PokeAPI ID from national dex for correct form identification
Pokemon forms (e.g., Alolan Rattata) had their PokeAPI ID (10091) stored as national_dex, causing them to display incorrectly. This renames the unique identifier to pokeapi_id and adds a real national_dex field shared between forms and their base species, so Alolan Rattata correctly shows as #19. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,7 @@ from app.schemas.base import CamelModel
|
||||
|
||||
class PokemonResponse(CamelModel):
|
||||
id: int
|
||||
pokeapi_id: int
|
||||
national_dex: int
|
||||
name: str
|
||||
types: list[str]
|
||||
@@ -47,6 +48,7 @@ class RouteEncounterDetailResponse(RouteEncounterResponse):
|
||||
|
||||
|
||||
class PokemonCreate(CamelModel):
|
||||
pokeapi_id: int
|
||||
national_dex: int
|
||||
name: str
|
||||
types: list[str]
|
||||
@@ -54,6 +56,7 @@ class PokemonCreate(CamelModel):
|
||||
|
||||
|
||||
class PokemonUpdate(CamelModel):
|
||||
pokeapi_id: int | None = None
|
||||
national_dex: int | None = None
|
||||
name: str | None = None
|
||||
types: list[str] | None = None
|
||||
@@ -76,6 +79,7 @@ class RouteEncounterUpdate(CamelModel):
|
||||
|
||||
|
||||
class BulkImportItem(BaseModel):
|
||||
pokeapi_id: int
|
||||
national_dex: int
|
||||
name: str
|
||||
types: list[str]
|
||||
|
||||
Reference in New Issue
Block a user