Commit Graph

9 Commits

Author SHA1 Message Date
Cal Corum
e6a325ac8f Add CACHE_ENABLED env var to toggle Redis caching (v2.2.1)
- Set CACHE_ENABLED=false to disable caching without stopping Redis
- Defaults to true (caching enabled)
- Useful for draft periods requiring real-time data

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 07:59:54 -06:00
Cal Corum
abf4435931 CLAUDE: Fix cache_result decorator to handle Response objects properly
- Skip caching for FastAPI Response objects (CSV downloads, etc.)
- Response objects can't be JSON-serialized/deserialized without corruption
- Regular JSON responses continue to be cached normally
- Fixes issue where CSV endpoints returned Response object string representation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-27 22:48:30 -05:00
Cal Corum
2c3835c8ac Added SeasonPitchingStats 2025-08-26 00:17:57 -05:00
Cal Corum
54a1a407d0 CLAUDE: Season batting stats table and selective update system
Major database enhancement implementing fast-querying season batting stats:

Database Schema:
- Created seasonbattingstats table with composite primary key (player_id, season)
- All batting stats (counting + calculated): pa, ab, avg, obp, slg, ops, woba, etc.
- Proper foreign key constraints and performance indexes
- Production-ready SQL creation script included

Selective Update System:
- update_season_batting_stats() function with PostgreSQL upsert logic
- Triggers on game PATCH operations to update affected player stats
- Recalculates complete season stats from stratplay data
- Efficient updates of only players who participated in modified games

API Enhancements:
- Enhanced SeasonBattingStats.get_top_hitters() with full filtering support
- New /api/v3/views/season-stats/batting/refresh endpoint for season rebuilds
- Updated views endpoint to use centralized get_top_hitters() method
- Support for team, player, min PA, and pagination filtering

Infrastructure:
- Production database sync Docker service with SSH automation
- Comprehensive error handling and logging throughout
- Fixed Peewee model to match actual table structure (no auto-id)
- Updated CLAUDE.md with dev server info and sync commands

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-23 22:18:27 -05:00
Cal Corum
c05d00d60e DB Error Handling
Added error handling wrapper and fixed SQLite -> Postgres issues
2025-08-20 19:33:40 -05:00
Cal Corum
cd1321553e Logging updates 2024-12-16 09:03:23 -06:00
Cal Corum
4380c26319 Add Swagger support 2024-07-14 13:23:37 -05:00
Cal Corum
8f53d83d9e Added logging to dependencies, added week parameter to stats/totals 2023-05-27 11:16:52 -05:00
Cal Corum
7ac8b752ec Initial commit
File structure in place
/players and /current built
2023-03-21 16:09:46 -05:00