Files
nuzlocke-tracker/tools/fetch-pokeapi/models.go
Julian Tabel a65efa22da Add nullable region field to evolutions for regional form filtering
Regional evolutions (e.g., Pikachu → Alolan Raichu) only occur in specific
regions. This adds a nullable region column so the app can filter evolutions
by the game's region. When a regional evolution exists for a given trigger/item,
the non-regional counterpart is automatically hidden.

Full-stack: migration, model, schemas, API with region query param, seeder,
Go fetch tool, frontend types/API/hook/components, and admin form.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 20:05:07 +01:00

48 lines
1.4 KiB
Go

package main
// Output JSON structs — identical schema to current Python output.
type GameOutput struct {
Name string `json:"name"`
Slug string `json:"slug"`
Generation int `json:"generation"`
Region string `json:"region"`
ReleaseYear int `json:"release_year"`
Color *string `json:"color"`
}
type PokemonOutput struct {
PokeAPIID int `json:"pokeapi_id"`
NationalDex int `json:"national_dex"`
Name string `json:"name"`
Types []string `json:"types"`
SpriteURL string `json:"sprite_url"`
}
type EvolutionOutput struct {
FromPokeAPIID int `json:"from_pokeapi_id"`
ToPokeAPIID int `json:"to_pokeapi_id"`
Trigger string `json:"trigger"`
MinLevel *int `json:"min_level"`
Item *string `json:"item"`
HeldItem *string `json:"held_item"`
Condition *string `json:"condition"`
Region *string `json:"region"`
}
type RouteOutput struct {
Name string `json:"name"`
Order int `json:"order"`
Encounters []EncounterOutput `json:"encounters"`
Children []RouteOutput `json:"children,omitempty"`
}
type EncounterOutput struct {
PokeAPIID int `json:"pokeapi_id"`
PokemonName string `json:"pokemon_name"`
Method string `json:"method"`
EncounterRate int `json:"encounter_rate"`
MinLevel int `json:"min_level"`
MaxLevel int `json:"max_level"`
}