Add a nullable naming_scheme column to NuzlockeRun so users can pick a themed word category for nickname suggestions. Includes Alembic migration, updated Pydantic schemas, a GET /runs/naming-categories endpoint backed by a cached dictionary loader, and frontend dropdowns in both the NewRun creation flow and the RunDashboard for mid-run changes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1.6 KiB
1.6 KiB
title, status, type, priority, created_at, updated_at, parent, blocking
| title | status | type | priority | created_at | updated_at | parent | blocking | |
|---|---|---|---|---|---|---|---|---|
| Build name suggestion engine | todo | task | normal | 2026-02-11T15:56:44Z | 2026-02-11T20:23:35Z | nuzlocke-tracker-igl3 |
|
Build the backend service and API endpoint that picks random name suggestions from the dictionary based on a selected naming scheme.
Requirements
- Given a category and a run ID, return 5-10 unique suggestions
- The engine queries the run's existing encounter nicknames and excludes them from suggestions
- Support regeneration (return a fresh batch, avoiding previously shown suggestions where possible)
- Handle edge case where category is nearly exhausted gracefully (return fewer suggestions)
Implementation Notes
- Backend service: A Python module that loads the dictionary JSON, filters by category, excludes used names, and picks random suggestions.
- API endpoint:
GET /api/v1/runs/{run_id}/name-suggestions?count=10— reads the run'snaming_scheme, fetches encounter nicknames, returns suggestions. - No new DB tables needed: Used names come from
Encounter.nicknameon the run's encounters. - Caching: Load the dictionary once and cache in memory (it's static data).
Checklist
- Create a service module for name suggestion logic (e.g.
services/name_suggestions.py) - Implement dictionary loading with in-memory caching
- Implement random selection from a category with exclusion of used names
- Add API endpoint for fetching suggestions
- Add unit tests for the suggestion logic