strat-gameplay-webapp/backend/app/models
Cal Corum d560844704 CLAUDE: Phase 3E-Prep - Refactor GameState to use full LineupPlayerState objects
**Architectural Improvement**: Unified player references in GameState

**Changed**: Make all player references consistent
- BEFORE: current_batter/pitcher/catcher were IDs (int)
- AFTER: current_batter/pitcher/catcher are full LineupPlayerState objects
- Matches pattern of on_first/on_second/on_third (already objects)

**Benefits**:
1. Consistent API - all player references use same type
2. Self-contained GameState - everything needed for resolution
3. No lookups needed - direct access to player data
4. Sets foundation for Phase 3E-Main (adding position ratings)

**Files Modified**:
- app/models/game_models.py: Changed current_batter/pitcher/catcher to objects
- app/core/game_engine.py: Updated _prepare_next_play() to populate full objects
- app/core/state_manager.py: Create placeholder batter on game creation
- tests/unit/models/test_game_models.py: Updated all 27 GameState tests

**Database Operations**:
- No schema changes needed
- Play table still stores IDs (for referential integrity)
- IDs extracted from objects when saving: state.current_batter.lineup_id

**Testing**:
- All 27 GameState tests passing
- No regressions in existing functionality
- Type checking passes

**Next**: Phase 3E-Main - Add PositionRating dataclass and load ratings at game start

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-03 14:11:40 -06:00
..
__init__.py CLAUDE: Implement player models and optimize database queries 2025-10-28 14:08:56 -05:00
CLAUDE.md CLAUDE: Refactor ManualOutcomeSubmission to use PlayOutcome enum + comprehensive documentation 2025-10-31 16:03:54 -05:00
db_models.py CLAUDE: Implement Phase 3A - X-Check data models and enums 2025-11-01 15:32:09 -05:00
game_models.py CLAUDE: Phase 3E-Prep - Refactor GameState to use full LineupPlayerState objects 2025-11-03 14:11:40 -06:00
player_model_info.md CLAUDE: Reorganize Week 6 documentation and separate player model specifications 2025-10-25 23:48:57 -05:00
player_models.py CLAUDE: Implement Phase 3A - X-Check data models and enums 2025-11-01 15:32:09 -05:00
roster_models.py CLAUDE: Implement polymorphic RosterLink for both PD and SBA leagues 2025-10-22 22:45:44 -05:00
visual_model_relationships.md CLAUDE: Refactor game models and modularize terminal client 2025-10-28 14:16:38 -05:00