WP-06: Track Catalog API Endpoints #71

Closed
opened 2026-03-12 20:55:50 +00:00 by cal · 1 comment
Owner

Description

Read-only API endpoints for browsing evolution tracks and their thresholds. Used by the bot's /evo status command and admin inspection.

Repo: database
Phase: 1b (API & Formula Engine)
Dependencies: WP-01, WP-04
Complexity: S

Endpoints

GET /v2/evolution/tracks
  Query params: card_type (optional, filter by 'batter'|'sp'|'rp')
  Response: {"count": N, "items": [track_dict_with_thresholds]}

GET /v2/evolution/tracks/{track_id}
  Response: track_dict with formula, t1-t4 thresholds

No /milestones sub-endpoint — milestones are just thresholds on the track.

Files

  • Create: database/app/routers_v2/evolution.py
  • Modify: database/app/main.py — register router

Tests (write first in database/tests/test_evolution_track_api.py)

  • Integration: list tracks returns count=3
  • Integration: filter by card_type
  • Integration: get single track with thresholds
  • Integration: 404 for nonexistent track
  • Integration: auth required

Plan reference: docs/prd-evolution/PHASE1_PROJECT_PLAN.md WP-06

## Description Read-only API endpoints for browsing evolution tracks and their thresholds. Used by the bot's `/evo status` command and admin inspection. **Repo:** `database` **Phase:** 1b (API & Formula Engine) **Dependencies:** WP-01, WP-04 **Complexity:** S ## Endpoints ``` GET /v2/evolution/tracks Query params: card_type (optional, filter by 'batter'|'sp'|'rp') Response: {"count": N, "items": [track_dict_with_thresholds]} GET /v2/evolution/tracks/{track_id} Response: track_dict with formula, t1-t4 thresholds ``` No `/milestones` sub-endpoint — milestones are just thresholds on the track. ## Files - **Create:** `database/app/routers_v2/evolution.py` - **Modify:** `database/app/main.py` — register router ## Tests (write first in `database/tests/test_evolution_track_api.py`) - [ ] Integration: list tracks returns count=3 - [ ] Integration: filter by card_type - [ ] Integration: get single track with thresholds - [ ] Integration: 404 for nonexistent track - [ ] Integration: auth required **Plan reference:** `docs/prd-evolution/PHASE1_PROJECT_PLAN.md` WP-06
cal added this to the Card Evolution Phase 1 milestone 2026-03-12 20:59:11 +00:00
cal added the
evolution
phase-1b
labels 2026-03-12 20:59:23 +00:00
Claude added the
ai-working
label 2026-03-13 01:31:48 +00:00
Claude added
ai-pr-opened
and removed
ai-working
labels 2026-03-13 01:41:20 +00:00
Collaborator

PR #86 opened: #86

Implements GET /api/v2/evolution/tracks and GET /api/v2/evolution/tracks/{track_id}. Both endpoints require Bearer auth and return track dicts with formula and t1_thresholdt4_threshold fields. EvolutionTrack is lazy-imported so the app starts cleanly before WP-01 merges. 5 integration tests in tests/test_evolution_track_api.py (auto-skip without POSTGRES_HOST). Must merge after WP-01 (#82) and WP-04 (#84).

PR #86 opened: https://git.manticorum.com/cal/paper-dynasty-database/pulls/86 Implements `GET /api/v2/evolution/tracks` and `GET /api/v2/evolution/tracks/{track_id}`. Both endpoints require Bearer auth and return track dicts with `formula` and `t1_threshold`–`t4_threshold` fields. `EvolutionTrack` is lazy-imported so the app starts cleanly before WP-01 merges. 5 integration tests in `tests/test_evolution_track_api.py` (auto-skip without `POSTGRES_HOST`). Must merge after WP-01 (#82) and WP-04 (#84).
cal closed this issue 2026-03-16 16:15:04 +00:00
Sign in to join this conversation.
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cal/paper-dynasty-database#71
No description provided.