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>
This commit is contained in:
Cal Corum 2025-12-09 17:02:58 -06:00
parent bb3894d6f1
commit 1aaf4ccb50

View File

@ -0,0 +1,102 @@
{
"project": "Dynamic Salary Cap Refactor",
"description": "Replace hardcoded salary cap values (32.0/32.001) with Team.salary_cap field",
"created": "2025-12-09",
"tasks": [
{
"id": "SWAR-001",
"name": "Add salary cap helper function",
"description": "Create a helper function in helpers.py that retrieves the salary cap for a team, with fallback to default 32.0 for backwards compatibility",
"files": ["helpers.py"],
"lines": null,
"priority": 1,
"completed": false,
"tested": false,
"notes": "This should be done first as other tasks will depend on it"
},
{
"id": "SWAR-002",
"name": "Update draft cap space check",
"description": "Replace hardcoded 32.00001 cap check in draft.py with team.salary_cap from the Team model",
"files": ["cogs/draft.py"],
"lines": [430, 442],
"priority": 2,
"completed": false,
"tested": false,
"notes": "Used during draft to validate team can afford player being drafted"
},
{
"id": "SWAR-003",
"name": "Update trade validation sWAR check",
"description": "Replace hardcoded 32.001 cap threshold in trade validation with team.salary_cap",
"files": ["cogs/transactions.py"],
"lines": [1283, 1291],
"priority": 2,
"completed": false,
"tested": false,
"notes": "Validates teams don't exceed cap during trade processing"
},
{
"id": "SWAR-004",
"name": "Update first drop/add validation",
"description": "Replace hardcoded 32.001 cap threshold in first drop/add validation block with team.salary_cap",
"files": ["cogs/transactions.py"],
"lines": [1768, 1776],
"priority": 2,
"completed": false,
"tested": false,
"notes": "First drop/add sWAR validation block"
},
{
"id": "SWAR-005",
"name": "Update second drop/add validation",
"description": "Replace hardcoded 32.001 cap threshold in second drop/add validation block with team.salary_cap",
"files": ["cogs/transactions.py"],
"lines": [2069, 2075],
"priority": 2,
"completed": false,
"tested": false,
"notes": "Second drop/add sWAR validation block"
},
{
"id": "SWAR-006",
"name": "Update roster validation error message",
"description": "Replace hardcoded '(cap 32.0)' in error message with actual team salary_cap value",
"files": ["cogs/transactions.py"],
"lines": [2218, 2219],
"priority": 2,
"completed": false,
"tested": false,
"notes": "Error message currently shows hardcoded cap value"
},
{
"id": "SWAR-007",
"name": "Add default salary cap constant",
"description": "Define DEFAULT_SALARY_CAP = 32.0 constant in helpers.py for use as fallback when team.salary_cap is None",
"files": ["helpers.py"],
"lines": null,
"priority": 1,
"completed": false,
"tested": false,
"notes": "Centralized constant for maintainability"
},
{
"id": "SWAR-008",
"name": "Verify Team model salary_cap field",
"description": "Confirm api_calls/team.py has salary_cap field properly defined and API returns this value",
"files": ["api_calls/team.py"],
"lines": [26],
"priority": 1,
"completed": false,
"tested": false,
"notes": "Field already added, need to verify API integration"
}
],
"completion_checklist": [
"All hardcoded 32.0/32.001 values replaced",
"Helper function created with fallback logic",
"All affected cogs tested manually",
"Unit tests added for salary cap validation",
"Error messages display correct cap values"
]
}