major-domo-v2/models
Cal Corum 5f69d495ab CLAUDE: Fix draft list operations and improve add success display
Multiple fixes for draft list functionality:

1. **Model Fix (draft_list.py):**
   - API returns nested Team and Player objects, not just IDs
   - Changed team_id/player_id from fields to @property methods
   - Extract IDs from nested objects via properties
   - Fixes Pydantic validation errors on GET operations

2. **Service Fix (draft_list_service.py):**
   - Override _extract_items_and_count_from_response() for API quirk
   - GET returns items under 'picks' key (not 'draftlist')
   - Changed add_to_list() return type from single entry to full list
   - Return verification list instead of trying to create new DraftList
   - Fixes "Failed to add" error from validation issues

3. **Command Enhancement (list.py):**
   - Display full draft list on successful add (not just confirmation)
   - Show position where player was added
   - Reuse existing create_draft_list_embed() for consistency
   - Better UX - user sees complete context after adding player

API Response Format:
GET: {"count": N, "picks": [{team: {...}, player: {...}}]}
POST: {"count": N, "draft_list": [{team_id: X, player_id: Y}]}

This resolves:
- Empty list after adding player (Pydantic validation)
- "Add Failed" error despite successful operation
- Poor UX with minimal success feedback

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 19:35:50 -05:00
..
__init__.py CLAUDE: Initial commit for discord-app-v2 rebuild 2025-08-15 00:04:50 -05:00
base.py CLAUDE: Initial commit for discord-app-v2 rebuild 2025-08-15 00:04:50 -05:00
batting_stats.py CLAUDE: Major bot enhancements - Admin commands, player stats, standings, schedules 2025-08-28 15:32:38 -05:00
CLAUDE.md CLAUDE: Add comprehensive CLAUDE.md documentation files for AI agent guidance 2025-10-20 20:30:07 -05:00
current.py CLAUDE: Major bot enhancements - Admin commands, player stats, standings, schedules 2025-08-28 15:32:38 -05:00
custom_command.py CLAUDE: Add /jump command and improve dice rolling with team colors, plus admin and type safety fixes 2025-10-20 15:10:48 -05:00
decision.py CLAUDE: Add comprehensive scorecard submission system 2025-10-16 00:21:32 -05:00
division.py CLAUDE: Major bot enhancements - Admin commands, player stats, standings, schedules 2025-08-28 15:32:38 -05:00
draft_data.py CLAUDE: Fix draft channel configuration not persisting 2025-10-24 22:52:57 -05:00
draft_list.py CLAUDE: Fix draft list operations and improve add success display 2025-10-25 19:35:50 -05:00
draft_pick.py CLAUDE: Initial commit for discord-app-v2 rebuild 2025-08-15 00:04:50 -05:00
game.py CLAUDE: Major bot enhancements - Admin commands, player stats, standings, schedules 2025-08-28 15:32:38 -05:00
help_command.py CLAUDE: Implement custom help commands system 2025-10-10 13:14:13 -05:00
injury.py CLAUDE: Add toggleable stats to /player command and injury system improvements 2025-10-17 23:26:08 -05:00
manager.py CLAUDE: Major bot enhancements - Admin commands, player stats, standings, schedules 2025-08-28 15:32:38 -05:00
pitching_stats.py CLAUDE: Major bot enhancements - Admin commands, player stats, standings, schedules 2025-08-28 15:32:38 -05:00
play.py CLAUDE: Fix duplicate score display in key plays 2025-10-16 00:20:56 -05:00
player.py CLAUDE: Add comprehensive scorecard submission system 2025-10-16 00:21:32 -05:00
roster.py CLAUDE: Comprehensive bot improvements and test infrastructure 2025-10-02 11:35:26 -05:00
sbaplayer.py CLAUDE: Major bot enhancements - Admin commands, player stats, standings, schedules 2025-08-28 15:32:38 -05:00
standings.py CLAUDE: Major bot enhancements - Admin commands, player stats, standings, schedules 2025-08-28 15:32:38 -05:00
team.py Refactor x-check chart data 2025-10-22 20:41:21 -05:00
trade.py CLAUDE: Fix trade system issues and enhance documentation 2025-10-06 16:10:13 -05:00
transaction.py CLAUDE: Fix trade system issues and enhance documentation 2025-10-06 16:10:13 -05:00