league
league copied to clipboard
Add two-point conversion and special teams touchdown fantasy points support
The current fantasy points calculation in player-fantasy-points-from-plays-column-definitions.mjs has TODO comments indicating missing support for:
- Two-point conversion fantasy points - Currently not being calculated for successful two-point conversion attempts
- Special teams touchdown fantasy points - Missing support for kick return touchdowns and punt return touchdowns
Current Implementation Analysis
The file currently handles:
- Passing scoring (
generate_passing_scoring_sql) - Rushing scoring (
generate_rushing_scoring_sql) - Receiving scoring (
generate_receiving_scoring_sql) - Fumble scoring (
generate_fumble_scoring_sql)
Missing Features
Two-Point Conversions
- Need to identify plays where
play_typeinvolves two-point conversion attempts - Add scoring for successful two-point conversions (typically 2 points)
- Consider different player roles (passer, rusher, receiver)
Special Teams Touchdowns
- Kick Return TDs: Player returns kickoff for touchdown
- Punt Return TDs: Player returns punt for touchdown
- These should be worth 6 points in standard scoring
Files to Modify
-
libs-server/data-views-column-definitions/player-fantasy-points-from-plays-column-definitions.mjs(lines 77-78 have the TODO comments)
Acceptance Criteria
- [ ] Two-point conversion attempts are identified and scored correctly
- [ ] Kick return touchdowns are identified and scored (6 points)
- [ ] Punt return touchdowns are identified and scored (6 points)
- [ ] All scoring integrates with existing scoring format system
- [ ] Tests verify the new scoring calculations work correctly