Add frontend TypeScript types for game data models

Define Game, Route, Pokemon, RouteEncounter, Encounter, and NuzlockeRun
types mirroring the backend schema, with EncounterStatus and RunStatus
discriminated union types.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Julian Tabel
2026-02-05 13:34:21 +01:00
parent d94364d6ce
commit 08c05f2a2f
3 changed files with 73 additions and 8 deletions

View File

@@ -1,11 +1,11 @@
---
# nuzlocke-tracker-sm1b
title: Game Data Models & Types
status: todo
status: completed
type: task
priority: normal
created_at: 2026-02-04T15:44:08Z
updated_at: 2026-02-04T15:45:00Z
updated_at: 2026-02-05T12:33:38Z
parent: nuzlocke-tracker-f5ob
blocking:
- nuzlocke-tracker-k5lm
@@ -17,12 +17,14 @@ blocking:
Define the core data structures and TypeScript types for the application.
## Checklist
- [ ] Define Game type (id, name, generation, region, routes)
- [ ] Define Route/Area type (id, name, available Pokémon, game)
- [ ] Define Pokemon type (national dex number, name, types, sprite URL)
- [ ] Define Encounter type (route, pokemon, nickname, status, caught date)
- [ ] Define NuzlockeRun type (game, settings, encounters, start date)
- [ ] Define RuleSettings type (hardcore mode, level caps, duplicates clause, etc.)
- [x] Define Game type (id, name, slug, generation, region, boxArtUrl, releaseYear)
- [x] Define Route/Area type (id, name, gameId, order)
- [x] Define Pokemon type (id, nationalDex, name, types, spriteUrl)
- [x] Define Encounter type (id, runId, routeId, pokemonId, nickname, status, catchLevel, faintLevel, caughtAt)
- [x] Define NuzlockeRun type (id, gameId, name, status, rules, startedAt, completedAt)
- [x] Define RuleSettings type (already existed in rules.ts)
- [x] Define RouteEncounter type (id, routeId, pokemonId, encounterMethod, encounterRate)
- [x] Define EncounterStatus and RunStatus discriminated union types
## Notes
- Keep types flexible for future expansion