feat(tournament): update mini championship creation to include location

- Modified addMiniChampionship method to accept location (ort) instead of tournament name.
- Updated frontend components to reflect the change, including new input for location and localization updates for German language support.
- Enhanced validation to ensure location is provided during mini championship creation.
This commit is contained in:
Torsten Schulz (local)
2026-01-30 23:01:41 +01:00
parent 85c26bc80d
commit 89f30f76f5
4 changed files with 21 additions and 8 deletions

View File

@@ -716,10 +716,15 @@ class TournamentService {
/**
* Minimeisterschaft anlegen: Turnier + 6 vorkonfigurierte Klassen (Jungen/Mädchen 12, 10, 8).
* Name wird generiert: "Minimeisterschaften <Jahr> Ortsentscheid <ort>".
* Jahr Y: 12 = in Y 11 oder 12 Jahre (Geburtsjahr Y-12 oder Y-11), 10 = 9/10 (Y-10, Y-9), 8 = 8 oder jünger (≥ Y-8).
*/
async addMiniChampionship(userToken, clubId, tournamentName, date, year, winningSets = 3) {
async addMiniChampionship(userToken, clubId, ort, date, year, winningSets = 3) {
await checkAccess(userToken, clubId);
const ortTrimmed = (ort || '').trim();
if (!ortTrimmed) {
throw new Error('Ort für die Minimeisterschaft fehlt');
}
const existing = await Tournament.findOne({ where: { clubId, date } });
if (existing) {
throw new Error('Ein Turnier mit diesem Datum existiert bereits');
@@ -728,6 +733,7 @@ class TournamentService {
if (!Number.isFinite(Y) || Y < 2000 || Y > 2100) {
throw new Error('Ungültiges Jahr für die Minimeisterschaft');
}
const tournamentName = `Minimeisterschaften ${Y} Ortsentscheid ${ortTrimmed}`;
const t = await Tournament.create({
name: tournamentName,
date,