fix: dynamic roster type detection in /trade add-player (#29) #61
No reviewers
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#61
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "ai/major-domo-v2-29"
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?
Summary
Fixes #29 —
/trade add-playerhardcodedRosterType.MAJOR_LEAGUEfor bothfrom_rosterandto_roster, making it impossible to correctly trade a player from/to a Minor League roster.Changes
from_roster: Now detected fromplayer.team.roster_type(). If the search endpoint returns only ateam_id(no nested team object), fetches the full team viateam_service.get_team()to determine the roster type. Falls back toMAJOR_LEAGUEfor free agents.to_roster: Now derived fromdest_team.roster_type(), which uses the team's abbreviation suffix (e.g.NYYMIL→MINOR_LEAGUE,NYYIL→INJURED_LIST).Files Changed
commands/transactions/trade.py— replaced hardcoded roster defaults with dynamic detection; addedteam_serviceimportTest Results
930 passed, 3 skipped ✅
Closing as superseded by PR #56 (
fix/trade-from-roster-detection), which is already merged intonext-release.Both PRs fix the same issue (hardcoded
RosterType.MAJOR_LEAGUEin/trade add-player), but #56 also fixes/trade supplementarywith auto-detection fromteam_service.get_team(), which this PR left using the old heuristic.Pull request closed