Major Domo v2 - Discord bot for Strat-o-Matic Baseball Association
Go to file
Cal Corum 8897b7fa5e CLAUDE: Add logged_command decorator and migrate Discord commands to reduce boilerplate
- Add @logged_command decorator in utils/decorators.py to eliminate try/catch/finally boilerplate
- Migrate all Discord commands to use new decorator pattern:
  * commands/league/info.py - /league command
  * commands/players/info.py - /player command
  * commands/teams/info.py - /team and /teams commands
  * commands/teams/roster.py - /roster command
- Fix PyLance type issues by making model IDs required for database entities
- Update Player and Team models to require id field since they come from database
- Fix test cases to provide required id values
- Add comprehensive test coverage for decorator functionality
- Add migration guide for applying decorator to additional commands
- Reduce codebase by ~100 lines of repetitive logging boilerplate

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-15 14:56:42 -05:00
api CLAUDE: Initial commit for discord-app-v2 rebuild 2025-08-15 00:04:50 -05:00
commands CLAUDE: Add logged_command decorator and migrate Discord commands to reduce boilerplate 2025-08-15 14:56:42 -05:00
models CLAUDE: Add logged_command decorator and migrate Discord commands to reduce boilerplate 2025-08-15 14:56:42 -05:00
services CLAUDE: Add logged_command decorator and migrate Discord commands to reduce boilerplate 2025-08-15 14:56:42 -05:00
tests CLAUDE: Add logged_command decorator and migrate Discord commands to reduce boilerplate 2025-08-15 14:56:42 -05:00
utils CLAUDE: Add logged_command decorator and migrate Discord commands to reduce boilerplate 2025-08-15 14:56:42 -05:00
views CLAUDE: Initial commit for discord-app-v2 rebuild 2025-08-15 00:04:50 -05:00
.gitignore CLAUDE: Initial commit for discord-app-v2 rebuild 2025-08-15 00:04:50 -05:00
bot.py CLAUDE: Initial commit for discord-app-v2 rebuild 2025-08-15 00:04:50 -05:00
config.py CLAUDE: Initial commit for discord-app-v2 rebuild 2025-08-15 00:04:50 -05:00
constants.py CLAUDE: Initial commit for discord-app-v2 rebuild 2025-08-15 00:04:50 -05:00
DECORATOR_MIGRATION_GUIDE.md CLAUDE: Add logged_command decorator and migrate Discord commands to reduce boilerplate 2025-08-15 14:56:42 -05:00
exceptions.py CLAUDE: Initial commit for discord-app-v2 rebuild 2025-08-15 00:04:50 -05:00
requirements.txt CLAUDE: Initial commit for discord-app-v2 rebuild 2025-08-15 00:04:50 -05:00
test_real_data.py CLAUDE: Initial commit for discord-app-v2 rebuild 2025-08-15 00:04:50 -05:00