Provide targeted context for each app subdirectory so Claude Code understands local patterns without relying on the root CLAUDE.md. Also simplifies root CLAUDE.md dev/prod environment sections. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1.1 KiB
1.1 KiB
Stratplay Router (sub-package)
Play-by-play data for Strat-o-Matic games. Mounted at /api/v3/plays.
Structure
| File | Purpose |
|---|---|
__init__.py |
Assembles sub-routers into parent router |
common.py |
Shared build_season_games() filter builder |
models.py |
Pydantic models (PlayModel, POS_LIST literal) |
plays.py |
General play queries |
batting.py |
Batting stats aggregated from plays |
pitching.py |
Pitching stats aggregated from plays |
fielding.py |
Fielding stats aggregated from plays |
crud.py |
POST/PATCH/DELETE operations (auth required) |
Key Patterns
- All stat endpoints use
build_season_games()fromcommon.pyfor consistent filtering - Filter params:
season,week,s_type(regular/post),week_start/week_end,manager_id weekands_typeare mutually exclusive;weekandweek_start/week_endare mutually exclusive- Stats aggregate from
StratPlayjoined toStratGameviagame_id - CRUD writes trigger
update_season_batting_stats()/update_season_pitching_stats()fromdependencies.py