feat: implement table assignment and distribution for tournament matches
All checks were successful
Deploy tt-tagebuch / deploy (push) Successful in 44s

This commit is contained in:
Torsten Schulz (local)
2026-05-17 23:55:39 +02:00
parent 6c7ae6860b
commit 697e67d46e
16 changed files with 426 additions and 22 deletions

View File

@@ -247,6 +247,35 @@ export const getTournamentMatches = async (req, res) => {
}
};
// Setze Tischnummer für ein Spiel
export const setMatchTable = async (req, res) => {
const { authcode: token } = req.headers;
const { clubId, tournamentId, matchId } = req.params;
const { tableNumber } = req.body;
try {
const updated = await tournamentService.setMatchTable(token, clubId, tournamentId, matchId, tableNumber);
emitTournamentChanged(clubId, tournamentId);
res.status(200).json(updated);
} catch (error) {
console.error('[setMatchTable] Error:', error);
res.status(500).json({ error: error.message });
}
};
// Freie Tische verteilen (Batch)
export const distributeTables = async (req, res) => {
const { authcode: token } = req.headers;
const { clubId, tournamentId } = req.body;
try {
const updated = await tournamentService.distributeTables(token, clubId, tournamentId);
emitTournamentChanged(clubId, tournamentId);
res.status(200).json({ updated, message: 'Tische wurden verteilt.' });
} catch (error) {
console.error('[distributeTables] Error:', error);
res.status(500).json({ error: error.message });
}
};
// 11. Satz-Ergebnis speichern
export const addMatchResult = async (req, res) => {
const { authcode: token } = req.headers;