paper-dynasty-database/app
Cal Corum 1b4eab9d99 refactor: replace incremental delta upserts with full recalculation in season stats
The previous approach accumulated per-game deltas into season stats rows,
which was fragile — partial processing corrupted stats, upsert bugs
compounded, and there was no self-healing mechanism.

Now update_season_stats() recomputes full season totals from all StratPlay
rows for each affected player whenever a game is processed. The result
replaces whatever was stored, eliminating double-counting and enabling
self-healing via force=True.

Also fixes:
- evolution_evaluator.py: broken PlayerSeasonStats import → queries
  BattingSeasonStats or PitchingSeasonStats based on card_type
- evolution_evaluator.py: r.k → r.strikeouts
- test_evolution_models.py, test_postgame_evolution.py: PlayerSeasonStats
  → BattingSeasonStats (model never existed)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 10:17:13 -05:00
..
models refactor: split PlayerSeasonStats into BattingSeasonStats and PitchingSeasonStats 2026-03-17 09:43:22 -05:00
routers_v2 refactor: replace incremental delta upserts with full recalculation in season stats 2026-03-19 10:17:13 -05:00
seed fix: address PR review findings 2026-03-17 21:38:12 -05:00
services refactor: replace incremental delta upserts with full recalculation in season stats 2026-03-19 10:17:13 -05:00
__init__.py Initial Commit with /current 2023-09-13 14:44:26 -05:00
card_creation.py Update card_creation.py 2024-02-24 21:36:44 -06:00
db_engine.py feat: add ProcessedGame ledger for full idempotency in update_season_stats() (#105) 2026-03-18 01:05:31 -05:00
db_helpers.py Fix PostgreSQL upsert column names and CSV null handling 2026-01-30 17:28:40 -06:00
dependencies.py fix: use constant-time comparison for bearer token validation (#8) 2026-03-05 03:43:59 +00:00
main.py feat(WP-13): post-game callback endpoints for season stats and evolution 2026-03-18 16:05:21 -05:00
player_scouting.py Update player_scouting.py 2023-09-24 19:00:21 -05:00