Implement dynamic roster type detection in /trade add-player
#29
Labels
No Label
ai-changes-requested
ai-pr-opened
ai-reviewed
ai-reviewing
ai-working
in-next-release
status/in-progress
status/pr-open
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cal/major-domo-v2#29
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
commands/transactions/trade.py:309-312— When adding a player to a trade, code hardcodesfrom_roster = RosterType.MAJOR_LEAGUEandto_roster = RosterType.MAJOR_LEAGUE. Impossible to correctly trade a player from/to Minor League via the command.File Locations
commands/transactions/trade.py:309-312Labels
bug, enhancement, todo
Priority
medium
Fixed in PR #56 (commit
58043c9), already merged tonext-release. Both/trade add-playerand/trade supplementarynow auto-detect roster type viateam_service.get_team()→roster_type()instead of hardcodingMAJOR_LEAGUE. Will close whennext-releasemerges tomain.Fixed in PR #61.
Approach: Replaced the hardcoded
RosterType.MAJOR_LEAGUEdefaults with dynamic detection:from_roster: derived fromplayer.team.roster_type(). If the search endpoint only returns ateam_id(no nested team object), falls back to fetching the full team viateam_service.get_team().to_roster: derived fromdest_team.roster_type(), which resolves via the team's abbreviation suffix (e.g.NYYMIL→ Minor League,NYYIL→ Injured List).All 930 tests pass.