fix: auto-detect player roster type in trade commands #56

Merged
cal merged 1 commits from fix/trade-from-roster-detection into next-release 2026-03-02 19:14:43 +00:00
Owner

Summary

  • /trade add-player hardcoded from_roster=MAJOR_LEAGUE for all players, causing incorrect transaction records when trading MiL or IL players
  • This cascaded into false roster validation errors: other teams' /dropadd commands would incorrectly report "too many MiL players" because pre-existing transaction processing misidentified which roster a departing player was leaving from
  • Now auto-detects the player's actual roster location via team_service.get_team() + roster_type() for both /trade add-player and /trade supplementary

Test plan

  • All 930 tests pass (including 36 trade builder tests)
  • Verify a trade involving a MiL player records the correct oldteam (e.g. PORMiL not POR)
  • Verify /dropadd validation no longer shows false MiL overcount when pre-existing trades involve MiL players
  • Verify supplementary moves correctly detect IL/MiL source roster

🤖 Generated with Claude Code

## Summary - `/trade add-player` hardcoded `from_roster=MAJOR_LEAGUE` for all players, causing incorrect transaction records when trading MiL or IL players - This cascaded into false roster validation errors: other teams' `/dropadd` commands would incorrectly report "too many MiL players" because pre-existing transaction processing misidentified which roster a departing player was leaving from - Now auto-detects the player's actual roster location via `team_service.get_team()` + `roster_type()` for both `/trade add-player` and `/trade supplementary` ## Test plan - [x] All 930 tests pass (including 36 trade builder tests) - [ ] Verify a trade involving a MiL player records the correct `oldteam` (e.g. `PORMiL` not `POR`) - [ ] Verify `/dropadd` validation no longer shows false MiL overcount when pre-existing trades involve MiL players - [ ] Verify supplementary moves correctly detect IL/MiL source roster 🤖 Generated with [Claude Code](https://claude.com/claude-code)
cal added 1 commit 2026-03-02 05:29:20 +00:00
/trade add-player hardcoded from_roster=MAJOR_LEAGUE for all players,
causing incorrect transaction records when trading MiL/IL players. This
cascaded into false roster validation errors for other teams' /dropadd
commands because pre-existing transaction processing misidentified which
roster a player was leaving from.

Now looks up the player's actual team and calls roster_type() to determine
the correct source roster. Same fix applied to /trade supplementary.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
cal merged commit 677dd3b773 into next-release 2026-03-02 19:14:43 +00:00
cal deleted branch fix/trade-from-roster-detection 2026-03-02 19:14:43 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cal/major-domo-v2#56
No description provided.