Major Domo v2 - Discord bot for Strat-o-Matic Baseball Association
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>
|
||
|---|---|---|
| .gitlab | ||
| .vscode | ||
| api | ||
| commands | ||
| models | ||
| services | ||
| tasks | ||
| tests | ||
| utils | ||
| views | ||
| .dockerignore | ||
| .gitignore | ||
| .gitlab-ci.yml | ||
| .mcp.json | ||
| bot.py | ||
| BUILD_AND_PUSH.md | ||
| build-and-push.sh | ||
| CLAUDE.md | ||
| COMMAND_LIST.md | ||
| config.py | ||
| docker-compose.dev.yml | ||
| docker-compose.yml | ||
| DOCKER.md | ||
| Dockerfile | ||
| Dockerfile.versioned | ||
| exceptions.py | ||
| PRE_LAUNCH_ROADMAP.md | ||
| pyrightconfig.json | ||
| requirements.txt | ||
| test_real_data.py | ||