feat(tournament): add mini championship functionality and enhance tournament class handling

- Introduced addMiniChampionship method in tournamentService to create tournaments with predefined classes for mini championships.
- Updated getTournaments method to filter tournaments based on type, including support for mini championships.
- Enhanced TournamentClass model to include maxBirthYear for age class restrictions.
- Modified tournamentController and tournamentRoutes to support new mini championship endpoint.
- Updated frontend components to manage mini championship creation and display, including localization for new terms.
This commit is contained in:
Torsten Schulz (local)
2026-01-30 22:58:41 +01:00
parent 6cdcbfe0db
commit 85c26bc80d
10 changed files with 265 additions and 104 deletions

View File

@@ -39,6 +39,12 @@ const Tournament = sequelize.define('Tournament', {
allowNull: false,
defaultValue: false,
},
miniChampionshipYear: {
type: DataTypes.INTEGER,
allowNull: true,
field: 'mini_championship_year',
comment: 'Jahr der Minimeisterschaft; nur gesetzt bei Minimeisterschaften'
},
}, {
underscored: true,
tableName: 'tournament',

View File

@@ -44,6 +44,13 @@ const TournamentClass = sequelize.define('TournamentClass', {
defaultValue: null,
field: 'min_birth_year',
comment: 'Geboren im Jahr X oder später (>=)'
},
maxBirthYear: {
type: DataTypes.INTEGER,
allowNull: true,
defaultValue: null,
field: 'max_birth_year',
comment: 'Geboren im Jahr X oder früher (<=); für Altersklassen 12/10'
}
}, {
underscored: true,