Add naming scheme selection to run configuration
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>
This commit is contained in:
@@ -19,10 +19,16 @@ from app.schemas.run import (
|
||||
RunResponse,
|
||||
RunUpdate,
|
||||
)
|
||||
from app.services.naming import get_naming_categories
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@router.get("/naming-categories", response_model=list[str])
|
||||
async def list_naming_categories():
|
||||
return get_naming_categories()
|
||||
|
||||
|
||||
@router.post("", response_model=RunResponse, status_code=201)
|
||||
async def create_run(data: RunCreate, session: AsyncSession = Depends(get_session)):
|
||||
# Validate game exists
|
||||
@@ -35,6 +41,7 @@ async def create_run(data: RunCreate, session: AsyncSession = Depends(get_sessio
|
||||
name=data.name,
|
||||
status="active",
|
||||
rules=data.rules,
|
||||
naming_scheme=data.naming_scheme,
|
||||
)
|
||||
session.add(run)
|
||||
await session.commit()
|
||||
|
||||
Reference in New Issue
Block a user