WP-07: Card State API Endpoints #72

Closed
opened 2026-03-12 20:55:56 +00:00 by cal · 0 comments
Owner

Description

Endpoints for reading evolution card state. The bot uses these to display tier progress. card_id is resolved server-side to (player_id, team_id).

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

Endpoints

GET /v2/teams/{team_id}/evolutions
  Query params: card_type (optional), tier (optional), page (default 1), per_page (default 10)
  Response: {"count": N, "items": [card_state_with_current_value_and_next_threshold]}

GET /v2/evolution/cards/{card_id}
  Resolves card_id -> (player_id, team_id) via Card table join
  Response: card_state with current_value, current_tier, next_threshold

Files

  • Modify: database/app/routers_v2/evolution.py

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

  • Integration: list team evolutions
  • Integration: filter by card_type
  • Integration: filter by tier
  • Integration: pagination
  • Integration: get single card state with current_value
  • Integration: card_id resolution to (player_id, team_id)
  • Integration: 404 for card with no state
  • Integration: duplicate cards same player share one state

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

## Description Endpoints for reading evolution card state. The bot uses these to display tier progress. `card_id` is resolved server-side to `(player_id, team_id)`. **Repo:** `database` **Phase:** 1b (API & Formula Engine) **Dependencies:** WP-01, WP-04 **Complexity:** M ## Endpoints ``` GET /v2/teams/{team_id}/evolutions Query params: card_type (optional), tier (optional), page (default 1), per_page (default 10) Response: {"count": N, "items": [card_state_with_current_value_and_next_threshold]} GET /v2/evolution/cards/{card_id} Resolves card_id -> (player_id, team_id) via Card table join Response: card_state with current_value, current_tier, next_threshold ``` ## Files - **Modify:** `database/app/routers_v2/evolution.py` ## Tests (write first in `database/tests/test_evolution_state_api.py`) - [ ] Integration: list team evolutions - [ ] Integration: filter by card_type - [ ] Integration: filter by tier - [ ] Integration: pagination - [ ] Integration: get single card state with current_value - [ ] Integration: card_id resolution to (player_id, team_id) - [ ] Integration: 404 for card with no state - [ ] Integration: duplicate cards same player share one state **Plan reference:** `docs/prd-evolution/PHASE1_PROJECT_PLAN.md` WP-07
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 11:31:26 +00:00
cal closed this issue 2026-03-18 20:33:20 +00:00
Sign in to join this conversation.
No project
No Assignees
1 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#72
No description provided.