diff --git a/backend/services/tournamentService.js b/backend/services/tournamentService.js index 583130b..12b1c0b 100644 --- a/backend/services/tournamentService.js +++ b/backend/services/tournamentService.js @@ -202,20 +202,28 @@ class TournamentService { } // 4) Round‑Robin anlegen wie gehabt - NUR innerhalb jeder Gruppe + console.log(`[fillGroups] Erstelle Matches für ${groups.length} Gruppen`); for (const g of groups) { + console.log(`[fillGroups] Verarbeite Gruppe ${g.id}`); const gm = await TournamentMember.findAll({ where: { groupId: g.id } }); + console.log(`[fillGroups] Gruppe ${g.id} hat ${gm.length} Teilnehmer:`, gm.map(m => ({ id: m.id, name: m.member?.firstName + ' ' + m.member?.lastName }))); + if (gm.length < 2) { console.warn(`Gruppe ${g.id} hat nur ${gm.length} Teilnehmer - keine Matches erstellt`); continue; } + const rounds = this.generateRoundRobinSchedule(gm); + console.log(`[fillGroups] Gruppe ${g.id} hat ${rounds.length} Runden`); + for (let roundIndex = 0; roundIndex < rounds.length; roundIndex++) { + console.log(`[fillGroups] Runde ${roundIndex + 1} für Gruppe ${g.id}:`, rounds[roundIndex]); for (const [p1Id, p2Id] of rounds[roundIndex]) { // Prüfe, ob beide Spieler zur gleichen Gruppe gehören const p1 = gm.find(p => p.id === p1Id); const p2 = gm.find(p => p.id === p2Id); if (p1 && p2 && p1.groupId === p2.groupId && p1.groupId === g.id) { - await TournamentMatch.create({ + const match = await TournamentMatch.create({ tournamentId, groupId: g.id, round: 'group', @@ -223,6 +231,7 @@ class TournamentService { player2Id: p2Id, groupRound: roundIndex + 1 }); + console.log(`[fillGroups] Match erstellt: ${match.id} - Spieler ${p1Id} vs ${p2Id} in Gruppe ${g.id}`); } else { console.warn(`Spieler gehören nicht zur gleichen Gruppe: ${p1Id} (${p1?.groupId}) vs ${p2Id} (${p2?.groupId}) in Gruppe ${g.id}`); } diff --git a/frontend/src/assets/css/main.scss b/frontend/src/assets/css/main.scss index 39afe9c..d9d6ae8 100644 --- a/frontend/src/assets/css/main.scss +++ b/frontend/src/assets/css/main.scss @@ -369,8 +369,8 @@ th, td { th { background: linear-gradient(135deg, var(--primary-color), var(--primary-hover)); color: white; - font-weight: 600; - text-transform: uppercase; + font-weight: 700; + text-transform: none; font-size: 0.75rem; letter-spacing: 0.4px; }