Commit Graph

139 Commits

Author SHA1 Message Date
Cal Corum
bbb4233b45 Replace hardcoded salary cap with dynamic Team.salary_cap
P2 Tasks completed:
- SWAR-002: Update draft.py cap check to use exceeds_salary_cap()
- SWAR-003: Update trade validation in transactions.py
- SWAR-004: Update first drop/add validation
- SWAR-005: Update second drop/add validation
- SWAR-006: Update legal command roster validation

Changes:
- Enhanced helper functions to support both dict and Pydantic models
- All error messages now show actual team cap value
- Added 4 additional tests for Pydantic model support (21 total)
- All salary cap checks now use centralized exceeds_salary_cap()

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 17:14:17 -06:00
Cal Corum
cd8cf0aee8 Add salary cap helper functions and unit tests
- Add DEFAULT_SALARY_CAP (32.0) and SALARY_CAP_TOLERANCE (0.001) constants
- Add get_team_salary_cap() for retrieving team cap with fallback
- Add exceeds_salary_cap() for centralized cap validation
- Add 17 unit tests covering all edge cases
- Update refactor plan marking P1 tasks complete

These helpers will be used by P2 tasks to replace hardcoded 32.0/32.001
values in draft.py and transactions.py

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 17:09:25 -06:00
Cal Corum
1aaf4ccb50 Add salary cap refactor plan
Tracks 8 tasks to replace hardcoded 32.0/32.001 salary cap values
with dynamic Team.salary_cap field across draft.py and transactions.py

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 17:02:58 -06:00
Cal Corum
bb3894d6f1 Add salary_cap field to Team model
Syncs with database schema change - new nullable float column for tracking team salary caps.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 16:53:27 -06:00
Cal Corum
4e71c33344 Reapply bug fixes to branch 2025-09-20 11:02:05 -05:00
Cal Corum
2b4b84e193 Schedule fix, transaction priority fix 2025-07-25 10:00:25 -05:00
Cal Corum
9bb84ce287 Post Draft fixes for season 12 2025-07-12 23:15:00 -05:00
Cal Corum
b4d84b6125 S12 draft updates plus dataclass overhaul 2025-06-07 23:53:32 -05:00
Cal Corum
afba7ce456 Update calls for /current to new Current class 2025-06-07 23:52:59 -05:00
Cal Corum
50d0f89c1d DraftPick, Player, Team, and DraftData dataclasses added along with tests 2025-06-07 23:49:13 -05:00
Cal Corum
fdf80fcdc1 Parameterize DB location
Optimize dockerfile for smaller builds
2025-06-07 23:47:22 -05:00
Cal Corum
8d9e2189a7 Cap check update in draft command 2025-05-25 16:44:38 -05:00
Cal Corum
ab4147a25f Season 12 Offseason Updates 2025-05-25 16:39:50 -05:00
Cal Corum
4363423876 Added support for expanded MiL 2025-04-06 12:11:47 -05:00
Cal Corum
32a2e1e8aa FTDH ping
Spider time
2025-03-01 06:44:07 -06:00
Cal Corum
f147a7a646 Baseball FTDH ping 2025-01-29 22:59:39 -06:00
Cal Corum
45fe08c29a /schedule defaults to current week; weather includes season and time of day 2025-01-29 22:33:44 -06:00
Cal Corum
81933e8329 Add error logging for failed transaction notifications 2025-01-18 07:24:51 -06:00
Cal Corum
f8716c69cb Set dem_week to 1 in the draft 2024-12-19 08:37:55 -06:00
Cal Corum
4945fb4680 Fix /schedule error 2024-12-17 18:23:02 -06:00
Cal Corum
3a1ec5e529 Turn off offseason flag 2024-12-16 09:04:30 -06:00
Cal Corum
44c5438afb New schedule command 2024-12-16 01:24:56 -06:00
Cal Corum
86eab613aa S11 prep 2024-12-14 11:25:18 -06:00
Cal Corum
9f157cadb3 Add !gib to draft alias list 2024-12-13 09:30:58 -06:00
Cal Corum
be72077af8 Fixed pitcher batting command 2024-12-12 10:47:47 -06:00
Cal Corum
274e3411be S11 draft updates 2024-12-11 16:47:02 -06:00
Cal Corum
e54cf885ad Migrated to rotating log handler
Added random_gif()
Moved back from exception-handler cog to local error handling
Updated !keepers to be season agnostic
Added new !sync param to update and clear local guild
Added error checking to !player command
2024-12-11 14:52:28 -06:00
Cal Corum
cb874c483c Set offseason flag 2024-12-03 15:19:13 -06:00
Cal Corum
feb69a3980 Update season to 11 2024-12-02 16:35:32 -06:00
Cal Corum
701a8b78d4 Update transactions.py
Clean up transaction failures
2024-10-05 22:27:18 -05:00
Cal Corum
e7d73470d1 Error fixes and career sheet link 2024-07-26 16:54:41 -05:00
Cal Corum
1a8f758e84 Add /running-calcs 2024-07-19 16:03:05 -05:00
Cal Corum
c21c966caa Added full_length param to /scorebug 2024-07-17 20:23:42 -05:00
cal
fb94827820 Shrunk fielding chart links 2024-07-17 16:00:46 -05:00
Cal Corum
af2baa493c Bug fixes 2024-07-14 13:23:49 -05:00
Cal Corum
6308d32f8e Migrate from PATCH /players to PUT 2024-07-03 11:20:03 -05:00
Cal Corum
8b6b783502 Season 10 Updates 2024-07-01 11:39:05 -05:00
Cal Corum
7b868696fa New Scorebug 2024-06-27 00:31:10 -05:00
Cal Corum
c24a71a4ee S10 Updates 2024-06-27 00:31:03 -05:00
Cal Corum
abeb2ecb0f S10 Draft Updates 2024-06-27 00:30:54 -05:00
Cal Corum
24ee04d7a1 Playoff Updates 2024-06-03 12:08:37 -05:00
Cal Corum
5abfc03555 COF e15 update 2024-04-27 07:47:22 -05:00
Cal Corum
b92bc0cbf9 Update helpers.py
Removed playoff stats from !player command for pre-s8 players
2024-04-08 14:47:03 -05:00
Cal Corum
b03e7ecb60
Merge pull request #4 from calcorum/fix-scorecard-link
Update scorecard url to point to new site /games endpoint
2024-02-10 21:05:03 -06:00
Peter
93dc7d40df Update scorecard url to point to new site /games endpoint 2024-02-10 18:43:30 -05:00
Cal Corum
00531f4708 Update transactions.py 2024-02-04 23:02:05 -06:00
Cal Corum
c729e4a122 Update transactions.py
Cleanup weekly_loop
2024-02-04 10:29:32 -06:00
Cal Corum
ecdfaf4c68
Merge pull request #3 from calcorum/fix-weekly-info-bug
Fix weekly info bug
2024-02-04 10:21:57 -06:00
Peter
95be95bf9c Remove weekly info update from end freeze path as its only needed when the week rolls over (begin freeze) 2024-02-04 09:30:36 -05:00
Peter
83e3cbd081 Simplify is_div_week logic and end all weeks with day game 2024-02-04 09:26:02 -05:00