paper-dynasty-database/app/routers_v2
Cal Corum 0b5d0b474b feat: add GET /api/v2/refractor/cards list endpoint (#172)
Closes #172

- New GET /api/v2/refractor/cards endpoint in refractor router with
  team_id (required), card_type, tier, season, progress, limit, offset filters
- season filter uses EXISTS subquery against batting/pitching_season_stats
- progress=close filter uses CASE expression to compare current_value
  against next tier threshold (>= 80%)
- LEFT JOIN on Player so deleted players return player_name: null
- Sorting: current_tier DESC, current_value DESC
- count reflects total matching rows before pagination
- Extended _build_card_state_response() with progress_pct (computed) and
  optional player_name; single-card endpoint gains progress_pct automatically
- Added non-unique team_id index on refractor_card_state in db_engine.py
- Migration: 2026-03-25_add_refractor_card_state_team_index.sql
- Removed pre-existing unused RefractorTrack import in evaluate_game (ruff)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 01:35:18 -05:00
..
__init__.py Initial Commit with /current 2023-09-13 14:44:26 -05:00
admin.py fix: remove plaintext bearer token from warning logs (#7) 2026-03-05 03:43:27 +00:00
awards.py fix: skip total_count query for CSV requests and consolidate rewards.py counts 2026-03-24 07:43:14 -05:00
batstats.py fix: skip total_count query for CSV requests and consolidate rewards.py counts 2026-03-24 07:43:14 -05:00
battingcardratings.py fix: skip total_count query for CSV requests and consolidate rewards.py counts 2026-03-24 07:43:14 -05:00
battingcards.py fix: remove plaintext bearer token from warning logs (#7) 2026-03-05 03:43:27 +00:00
cardpositions.py fix: remove plaintext bearer token from warning logs (#7) 2026-03-05 03:43:27 +00:00
cards.py fix: update stale evolution comment in cards.py 2026-03-23 14:23:00 -05:00
cardsets.py fix: replace broad except Exception blocks with DoesNotExist (#15) 2026-03-05 15:32:53 -06:00
current.py fix: replace broad except Exception blocks with DoesNotExist (#15) 2026-03-05 15:32:53 -06:00
decisions.py fix: remove plaintext bearer token from warning logs (#7) 2026-03-05 03:43:27 +00:00
events.py fix: skip total_count query for CSV requests and consolidate rewards.py counts 2026-03-24 07:43:14 -05:00
gamerewards.py fix: skip total_count query for CSV requests and consolidate rewards.py counts 2026-03-24 07:43:14 -05:00
gauntletrewards.py feat: capture total_count before limit across all paginated endpoints 2026-03-24 07:37:26 -05:00
gauntletruns.py feat: add limit/pagination to gauntletruns endpoint (#146) 2026-03-24 07:08:37 -05:00
mlbplayers.py fix: skip total_count query for CSV requests and consolidate rewards.py counts 2026-03-24 07:43:14 -05:00
notifications.py fix: capture total_count before applying limit so response count reflects matching records not page size 2026-03-24 12:11:18 +00:00
packs.py fix: replace broad except Exception blocks with DoesNotExist (#15) 2026-03-05 15:32:53 -06:00
packtypes.py fix: replace broad except Exception blocks with DoesNotExist (#15) 2026-03-05 15:32:53 -06:00
paperdex.py fix: replace broad except Exception blocks with DoesNotExist (#15) 2026-03-05 15:32:53 -06:00
pitchingcardratings.py fix: skip total_count query for CSV requests and consolidate rewards.py counts 2026-03-24 07:43:14 -05:00
pitchingcards.py fix: remove plaintext bearer token from warning logs (#7) 2026-03-05 03:43:27 +00:00
pitstats.py fix: skip total_count query for CSV requests and consolidate rewards.py counts 2026-03-24 07:43:14 -05:00
players.py feat: persistent browser instance for card rendering (#89) 2026-03-16 11:20:42 -05:00
rarity.py fix: replace broad except Exception blocks with DoesNotExist (#15) 2026-03-05 15:32:53 -06:00
refractor.py feat: add GET /api/v2/refractor/cards list endpoint (#172) 2026-03-25 01:35:18 -05:00
results.py fix: skip total_count query for CSV requests and consolidate rewards.py counts 2026-03-24 07:43:14 -05:00
rewards.py fix: skip total_count query for CSV requests and consolidate rewards.py counts 2026-03-24 07:43:14 -05:00
scout_claims.py fix: skip total_count query for CSV requests and consolidate rewards.py counts 2026-03-24 07:43:14 -05:00
scout_opportunities.py fix: skip total_count query for CSV requests and consolidate rewards.py counts 2026-03-24 07:43:14 -05:00
scouting.py fix: remove stub live_update_pitching endpoint (#11) 2026-03-07 01:37:52 -06:00
season_stats.py docs: update stale docstrings to reflect full-recalculation approach 2026-03-19 10:34:55 -05:00
stratgame.py fix: skip total_count query for CSV requests and consolidate rewards.py counts 2026-03-24 07:43:14 -05:00
stratplays.py fix: remove plaintext bearer token from warning logs (#7) 2026-03-05 03:43:27 +00:00
teams.py fix: complete remaining evolution→refractor renames from review 2026-03-23 14:17:03 -05:00