fix: roster validation includes org affiliate transactions #50
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#50
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/roster-validation-org-affiliates"
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 #49 — Team POR was getting a false "too many players" error when trying to move Jeffrey Springs from IL to MiL next week, despite a pending trade that would clear a MiL spot.
Root cause:
load_existing_transactions()only queried for transactions matching the base team abbreviation (e.g.,POR). The database API does exact matching onTeam.abbrev, so trade transactions involving affiliates (PORMIL,PORIL) were invisible to roster validation.Fix:
get_team_transactions()now acceptsUnion[str, List[str]]forteam_abbrevload_existing_transactions()queries all org affiliates:["POR", "PORMIL", "PORIL"]Changes
services/transaction_service.py— Accept list of abbreviations (backwards compatible)services/transaction_builder.py— Query org affiliates inload_existing_transactions()tests/test_roster_validation_org_affiliates.py— 5 new tests covering the exact POR scenarioTest plan
load_existing_transactions only queried for the base team abbreviation (e.g. "POR"), missing trades involving MiL/IL affiliates ("PORMIL", "PORIL"). This caused false "too many players" errors when a pending trade would have cleared a roster spot. - get_team_transactions now accepts Union[str, List[str]] for team_abbrev - load_existing_transactions queries all org affiliates [BASE, BASEMiL, BASEIL] - Added 5 tests covering the fix and backwards compatibility Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>