Add genlocke creation wizard with backend API and 4-step frontend

Implements the genlocke creation feature end-to-end: Genlocke and
GenlockeLeg models with migration, POST /genlockes endpoint that
creates the genlocke with all legs and auto-starts the first run,
and a 4-step wizard UI (Name, Select Games with preset templates,
Rules, Confirm) at /genlockes/new.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Julian Tabel
2026-02-09 09:23:48 +01:00
parent aaaeb2146e
commit 7851e14c2f
18 changed files with 923 additions and 29 deletions

View File

@@ -1,11 +1,11 @@
---
# nuzlocke-tracker-kz5g
title: Genlocke creation wizard
status: todo
status: in-progress
type: feature
priority: normal
created_at: 2026-02-09T07:42:10Z
updated_at: 2026-02-09T07:45:34Z
updated_at: 2026-02-09T08:10:10Z
parent: nuzlocke-tracker-25mh
blocking:
- nuzlocke-tracker-x4p6
@@ -50,16 +50,16 @@ Multi-step wizard UI for creating a new genlocke. This is the entry point for th
- Needs generation/region metadata to power the preset templates (see nuzlocke-tracker-glh8)
## Checklist
- [ ] Create `Genlocke` SQLAlchemy model (name, status, genlocke_rules JSONB, nuzlocke_rules JSONB, created_at)
- [ ] Create `GenlockeLeg` SQLAlchemy model (genlocke_id FK, run_id FK nullable, leg_order, game_id FK)
- [ ] Create Alembic migration for both new tables
- [ ] Create Pydantic schemas for genlocke creation request/response
- [ ] Implement `POST /api/v1/genlockes` endpoint (creates genlocke, legs, and first run)
- [ ] Build the multi-step wizard shell component with back/next navigation and step indicator
- [ ] Build Step 1: Name input
- [ ] Build Step 2: Preset template selector (True / Normal / Custom) with region-grouped game picker
- [ ] Build Step 3: Rules configuration (reuse `RulesConfiguration` + genlocke rules radio)
- [ ] Build Step 4: Confirmation summary with "Start Genlocke" action
- [ ] Add `/genlockes/new` route to the React Router config
- [ ] Add TypeScript types for genlocke API responses
- [ ] Wire up the wizard to call the create endpoint and redirect to the genlocke overview on success
- [x] Create `Genlocke` SQLAlchemy model (name, status, genlocke_rules JSONB, nuzlocke_rules JSONB, created_at)
- [x] Create `GenlockeLeg` SQLAlchemy model (genlocke_id FK, run_id FK nullable, leg_order, game_id FK)
- [x] Create Alembic migration for both new tables
- [x] Create Pydantic schemas for genlocke creation request/response
- [x] Implement `POST /api/v1/genlockes` endpoint (creates genlocke, legs, and first run)
- [x] Build the multi-step wizard shell component with back/next navigation and step indicator
- [x] Build Step 1: Name input
- [x] Build Step 2: Preset template selector (True / Normal / Custom) with region-grouped game picker
- [x] Build Step 3: Rules configuration (reuse `RulesConfiguration` + genlocke rules radio)
- [x] Build Step 4: Confirmation summary with "Start Genlocke" action
- [x] Add `/genlockes/new` route to the React Router config
- [x] Add TypeScript types for genlocke API responses
- [x] Wire up the wizard to call the create endpoint and redirect to the genlocke overview on success