Files
nuzlocke-tracker/.beans/archive/nuzlocke-tracker-nvd6--add-detailed-boss-pokemon-information-ability-item.md

54 lines
2.5 KiB
Markdown
Raw Normal View History

---
# nuzlocke-tracker-nvd6
title: Add detailed boss pokemon information (ability, item, nature, moveset)
status: completed
type: feature
priority: low
tags:
- failed
created_at: 2026-03-20T15:11:50Z
updated_at: 2026-03-20T19:37:18Z
parent: nuzlocke-tracker-neqv
blocked_by:
- nuzlocke-tracker-vc5o
---
Add optional detail fields to boss pokemon entries: ability, held item, nature, and moveset (up to 4 moves).
## Approach
- Ability and moves reference the seeded `moves`/`abilities` tables via FK (hybrid approach — names only, no gen-specific stats yet)
- Held item and nature stored as plain strings (items table can come later; natures are static)
## Checklist
- [x] **Migration**: Add columns to `boss_pokemon``ability_id` (FK|null), `held_item` (str|null), `nature` (str|null), `move1_id``move4_id` (FK|null)
- [x] **Model**: Update `BossPokemon` in `backend/src/app/models/boss_pokemon.py` with relationships
- [x] **Schemas**: Update `BossPokemonResponse` and `BossPokemonInput` in `backend/src/app/schemas/boss.py`
- [x] **Admin UI**: Add fields to `BossTeamEditor.tsx` (ability autocomplete, item input, nature dropdown, 4 move autocomplete inputs)
- [x] **Frontend types**: Update `BossPokemon` in `frontend/src/types/game.ts` and admin input types
- [x] **Frontend display**: Show details on boss cards in `RunEncounters.tsx` and `BossDefeatModal.tsx`
- [~] **Seed data**: (deferred) Update bulk import format to support new fields
## Dependencies
- Requires moves and abilities tables to be seeded first
## Summary of Changes
### Backend
- Created migration `l3a4b5c6d7e8_add_boss_pokemon_details.py` adding `ability_id`, `held_item`, `nature`, `move1_id`-`move4_id` columns
- Updated `BossPokemon` model with relationships to `Ability` and `Move`
- Updated `BossPokemonResponse` and `BossPokemonInput` schemas with detail fields
- Created `/moves` and `/abilities` API endpoints for autocomplete search
- Updated `set_boss_team` endpoint to handle new fields
- Added eager loading for ability/moves in boss queries
### Frontend
- Added `MoveRef` and `AbilityRef` types to game.ts
- Extended `BossPokemon` type with detail fields
- Extended `BossPokemonInput` admin type
- Created `MoveSelector` and `AbilitySelector` autocomplete components
- Updated `BossTeamEditor` with expandable detail section per pokemon
- Updated `BossTeamPreview` and `BossDefeatModal` to display details
### Deferred
- Bulk import format for seed data not updated (optional fields work with existing format)