claude-memory/graph/solutions/implemented-dem-week-parameter-for-player-team-updates-in-ma-69415f.md
Cal Corum b140d4d82a migrate: 313 memories from MemoryGraph
- 313 new markdown files created
- 30 relationships embedded
- 313 entries indexed
- State initialized with usage data
2026-02-13 11:11:48 -06:00

2.5 KiB

id type title tags importance confidence created updated relations
69415fc4-08c7-497a-b1ef-2f135c6400f2 solution Implemented dem_week parameter for player team updates in Major Domo
major-domo
python
discord-bot
fix
feature
database
api
0.7 0.8 2026-02-02T03:18:47.588736+00:00 2026-02-02T03:18:47.588736+00:00
target type direction strength
ffdfef93-1292-4f98-9f81-a347fd22fc91 CAUSES outgoing 0.5
target type direction strength
0d5b864a-7787-4ee5-841d-b8b1556d6425 CAUSES outgoing 0.5
target type direction strength
a8820359-c25c-41af-bbfd-a991a7b9b806 FOLLOWS incoming 0.5

Added optional dem_week (demotion/designation week) parameter to player team updates for tracking roster move eligibility.

Problem: Player team updates weren't setting the dem_week field in the database, which tracks when players become eligible for certain roster moves.

Solution: Added optional dem_week parameter to PlayerService.update_player_team() method with backwards compatibility.

Implementation Details:

  • Modified services/player_service.py: Added optional dem_week parameter with None default
  • Transaction freeze (Monday 00:00): Sets dem_week = current.week + 2
  • IL moves (/ilmove command): Sets dem_week = current.week
  • Draft picks (manual and auto): Set dem_week = current.week + 2
  • Admin commands: Don't set dem_week (None) - backwards compatible

Files Modified:

  1. services/player_service.py - Added dem_week parameter to update_player_team()
  2. tasks/transaction_freeze.py - Pass dem_week=current.week+2 for transaction processing
  3. views/transaction_embed.py - Pass dem_week=current.week for IL moves
  4. commands/draft/picks.py - Pass dem_week=current.week+2 for manual draft picks
  5. tasks/draft_monitor.py - Pass dem_week=current.week+2 for auto-draft picks
  6. tests/test_services_player_service.py - Added 4 comprehensive unit tests

Testing: All 21 player service tests pass, including 4 new dem_week-specific tests verifying: with dem_week, without dem_week, dem_week=0, and explicit None.

Critical Bug Fixed: Initially forgot to import Optional from typing in transaction_freeze.py, causing production crash. Fixed with hotfix v2.29.1.

Git Workflow: Used feature branch pattern (feature/add-dem-week-to-player-updates), merged to main, deployed as v2.29.0 (feature) then v2.29.1 (hotfix).

Key Design Decision: Optional parameter with None default maintains backwards compatibility. Service layer passes values directly to API without business logic validation.