feat: add tournament type and team support to tournament APIs

Update tournament APIs to support:
- tournamentType field (individual/team)
- Team creation for team tournaments
- Even number validation for team tournaments
- Automatic pairing of consecutive players into teams
This commit is contained in:
2026-04-03 19:27:31 -07:00
parent a75d7d3cc6
commit c3b0466092
3 changed files with 107 additions and 3 deletions
+2
View File
@@ -144,6 +144,7 @@ export async function PUT(request: Request, { params }: RouteParams) {
description,
eventDate,
eventType,
tournamentType,
format,
status,
maxParticipants,
@@ -166,6 +167,7 @@ export async function PUT(request: Request, { params }: RouteParams) {
description: description || null,
eventDate: eventDate ? new Date(eventDate) : null,
eventType: eventType || "tournament",
tournamentType: tournamentType || "individual",
format: format || "round_robin",
maxParticipants: maxParticipants ? parseInt(maxParticipants) : null,
targetScore: targetScore ? parseInt(targetScore) : null,