major-domo-database/app/services
Cal Corum cc6cdcc1dd refactor: Consolidate scattered imports to top of service files
Moved imports from middle of files to the top for better code organization.

Changes:
- Moved csv, io, peewee, playhouse imports to top of player_service.py
- Moved playhouse import to top of team_service.py
- Kept lazy DB imports (Player, Team, db) in methods where needed
  with clear "Lazy import" comments explaining why

Rationale for remaining mid-file imports:
- Player/Team/db imports are lazy-loaded to avoid importing heavyweight
  db_engine module during testing with mocks
- Only imported when RealRepository methods are actually called
- Prevents circular import issues and unnecessary DB connections in tests

All tests pass: 76 passed, 9 skipped, 0 failed

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-04 08:35:48 -06:00
..
__init__.py refactor: Extract services layer for testability 2026-02-03 15:38:34 +00:00
base.py fix: Fix exception handling and CSV formatting for DI compatibility 2026-02-04 13:41:34 +00:00
interfaces.py fix: Complete dependency injection for PlayerService 2026-02-03 16:49:50 +00:00
mocks.py fix: Complete dependency injection refactor and restore caching 2026-02-04 01:13:46 -06:00
player_service.py refactor: Consolidate scattered imports to top of service files 2026-02-04 08:35:48 -06:00
team_service.py refactor: Consolidate scattered imports to top of service files 2026-02-04 08:35:48 -06:00