Assign Participants ({templateTeamCount} slots)
{/* For March Madness: group by round */}
{template.id === 'ncaa_68' ? (
<>
First Four (Play-in Games)
{/* 4 matchups, 8 slots with seed labels */}
Round of 64
{/* 28 direct assignments + 4 TBD from First Four */}
>
) : (
/* Simple linear assignment for other brackets */
)}
```
### Implementation Phases
**Phase 2.6: Template System Foundation**
- [ ] Define bracket template type and constants
- [ ] Add `isScoring` and `templateRound` to playoff_matches schema
- [ ] Add `bracketTemplateId` and `scoringStartsAtRound` to scoring_events
- [ ] Create database migration
- [ ] Update playoff-match model to support templates
**Phase 2.7: Simple Template Expansion (4, 8, 16, 32)**
- [ ] Create template definitions for 4, 8, 16, 32 team brackets
- [ ] Update `generateBracketFromTemplate()` function
- [ ] Update bracket generation UI to use template selector
- [ ] Test with 16-team and 32-team brackets
- [ ] Update scoring calculator for non-scoring rounds (0 points)
**Phase 2.8: March Madness Template (68 teams)**
- [ ] Create NCAA_68 template definition
- [ ] Build First Four matchup assignment UI
- [ ] Build Round of 64 with TBD slot handling
- [ ] Implement winner advancement from First Four to Round of 64
- [ ] Test complete 68-team bracket flow
- [ ] Verify Elite Eight scoring starts correctly
**Phase 2.9: NFL/NBA Templates**
- [ ] Create NFL_14 template (with bye weeks)
- [ ] Create NBA_16 template
- [ ] Handle bye week logic (teams skip first round)
- [ ] Test both templates
## Alternative Considered: Manual Match Creation
**Pros:**
- Maximum flexibility
- Works for any structure
**Cons:**
- Too complex for admins
- Error-prone (easy to miss connections)
- No validation of bracket structure
- Time-consuming for large brackets
**Verdict:** Not recommended. Templates provide better UX with flexibility where needed.
## Open Questions
1. **Custom Templates**: Should admins be able to save custom bracket templates for reuse?
- **Recommendation**: Not in initial implementation. Add if requested.
2. **Seed Validation**: Should system validate proper bracket structure (e.g., 1 seed plays 16 seed)?
- **Recommendation**: No. Allow flexible seeding for play-ins and special cases.
3. **Series Support**: Should we support best-of-7 series (NBA/NHL)?
- **Recommendation**: Not initially. Just track series winner for now.
4. **Bracket Visualization**: Show traditional bracket tree diagram?
- **Recommendation**: Phase 3 enhancement. Current table view sufficient for Phase 2.
## Success Criteria
✅ Admin can create 4, 8, 16, 32 team brackets
✅ Admin can create March Madness 68-team bracket with First Four
✅ Admin can assign any participant to any slot (flexible seeding)
✅ System correctly identifies which rounds score fantasy points
✅ Participants eliminated in non-scoring rounds get 0 points
✅ Elite Eight and beyond calculate placements correctly
✅ Winner advancement works across all bracket sizes