feat: /teams/{id}/evolutions should sort by current_value desc #116

Closed
opened 2026-03-19 16:37:44 +00:00 by cal · 1 comment
Owner

Description

GET /api/v2/teams/{team_id}/evolutions returns results ordered by player_id (insertion order). This means /evo status in Discord shows a wall of T0/value-0 cards at the top instead of the most progressed players.

Current Behavior

Results ordered by player_id — unfiltered view starts with unranked zero-progress cards.

Expected

Default sort by current_tier DESC, current_value DESC so the most evolved players appear first. Optionally support a sort query param for other orderings.

Impact

Without this, /evo status is unusable without the tier:1 filter — users see 10 pages of zeros before reaching any interesting data.

Found during

Phase 1 smoke testing (2026-03-19)

## Description `GET /api/v2/teams/{team_id}/evolutions` returns results ordered by `player_id` (insertion order). This means `/evo status` in Discord shows a wall of T0/value-0 cards at the top instead of the most progressed players. ## Current Behavior Results ordered by player_id — unfiltered view starts with unranked zero-progress cards. ## Expected Default sort by `current_tier DESC, current_value DESC` so the most evolved players appear first. Optionally support a `sort` query param for other orderings. ## Impact Without this, `/evo status` is unusable without the `tier:1` filter — users see 10 pages of zeros before reaching any interesting data. ## Found during Phase 1 smoke testing (2026-03-19)
Author
Owner

PR opened: #120

The fix is a one-line change in list_team_evolutions — replaced .order_by(EvolutionCardState.player_id) with .order_by(current_tier DESC, current_value DESC). Most-progressed cards will now appear at the top of /evo status without needing any filter. All 117 tests pass.

PR opened: https://git.manticorum.com/cal/paper-dynasty-database/pulls/120 The fix is a one-line change in `list_team_evolutions` — replaced `.order_by(EvolutionCardState.player_id)` with `.order_by(current_tier DESC, current_value DESC)`. Most-progressed cards will now appear at the top of `/evo status` without needing any filter. All 117 tests pass.
cal closed this issue 2026-03-19 18:24:49 +00:00
Sign in to join this conversation.
No Milestone
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#116
No description provided.