Commit Graph

3 Commits

Author SHA1 Message Date
Cal Corum
758be0f166 CLAUDE: Fix trade system issues and enhance documentation
Major fixes and improvements:

Trade System Fixes:
- Fix duplicate player moves in trade embed Player Exchanges section
- Resolve "WVMiL not participating" error for Minor League destinations
- Implement organizational authority model for ML/MiL/IL team relationships
- Update Trade.cross_team_moves to deduplicate using moves_giving only

Team Model Enhancements:
- Rewrite roster_type() method using sname as definitive source per spec
- Fix edge cases like "BHMIL" (Birmingham IL) vs "BHMMIL"
- Update _get_base_abbrev() to use consistent sname-based logic
- Add organizational lookup support in trade participation

Autocomplete System:
- Fix major_league_team_autocomplete invalid roster_type parameter
- Implement client-side filtering using Team.roster_type() method
- Add comprehensive test coverage for all autocomplete functions
- Centralize autocomplete logic to shared utils functions

Test Infrastructure:
- Add 25 new tests for trade models and trade builder
- Add 13 autocomplete function tests with error handling
- Fix existing test failures with proper mocking patterns
- Update dropadd tests to use shared autocomplete functions

Documentation Updates:
- Document trade model enhancements and deduplication fix
- Add autocomplete function documentation with usage examples
- Document organizational authority model and edge case handling
- Update README files with recent fixes and implementation notes

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-06 16:10:13 -05:00
Cal Corum
25a8b55fca CLAUDE: Enhance /dropadd workflow and remove redundant commands
This commit implements significant improvements to the transaction management system:

**Major Changes:**
1. Enhanced /dropadd command workflow:
   - All responses are now ephemeral for better user privacy
   - Every call now shows the transaction builder (not just first move)
   - Improved autocomplete with team context prioritization (user's players first)

2. Added team ownership validation:
   - Prevents adding players from other teams (except Free Agents with abbrev='FA')
   - Enhanced error messages with specific team information
   - Changed _add_quick_move return type to tuple[bool, str] for better error handling

3. Removed redundant /transactionstatus command:
   - Command functionality fully replaced by /dropadd without parameters
   - Simplified workflow reduces user confusion
   - All related tests updated accordingly

**Technical Improvements:**
- Enhanced player autocomplete with team prioritization and better formatting
- Improved roster detection logic checking actual roster data vs team_id
- Better error handling with specific, actionable error messages
- Updated all test cases to handle new tuple return types
- Added comprehensive test coverage for team ownership validation

**Test Coverage:**
- All 30 tests passing (17 dropadd + 13 transaction embed tests)
- New tests for team ownership validation scenarios
- Updated existing tests for new return type patterns

The /dropadd command now serves as the single point of entry for all transaction operations while providing a cleaner, more intuitive user experience.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-02 11:33:53 -05:00
Cal Corum
13c61fd8ae Transactions cog in place 2025-09-24 09:32:04 -05:00