feat: Implement friendly match management features
All checks were successful
Deploy tt-tagebuch / deploy (push) Successful in 44s

- Added backend support for managing friendly matches including listing, creating, updating, and deleting matches.
- Introduced a new database table `friendly_match` with relevant fields for match details.
- Created a service layer to handle business logic related to friendly matches.
- Developed API routes for friendly match operations with appropriate authentication and authorization.
- Added a Vue component for managing participants in friendly matches, allowing selection of members and manual entry of names.
- Updated existing tournament editor screens to integrate friendly match functionalities.
This commit is contained in:
Torsten Schulz (local)
2026-05-18 00:43:42 +02:00
parent 040e758044
commit 5dfdcb63bc
16 changed files with 1551 additions and 87 deletions

View File

@@ -0,0 +1,132 @@
import { DataTypes } from 'sequelize';
import sequelize from '../database.js';
const FriendlyMatch = sequelize.define('FriendlyMatch', {
id: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true,
allowNull: false,
},
clubId: {
type: DataTypes.INTEGER,
allowNull: false,
field: 'club_id',
},
date: {
type: DataTypes.DATEONLY,
allowNull: false,
},
time: {
type: DataTypes.TIME,
allowNull: true,
},
homeTeamName: {
type: DataTypes.STRING(255),
allowNull: false,
field: 'home_team_name',
},
guestTeamName: {
type: DataTypes.STRING(255),
allowNull: false,
field: 'guest_team_name',
},
locationName: {
type: DataTypes.STRING(255),
allowNull: true,
field: 'location_name',
},
locationAddress: {
type: DataTypes.STRING(255),
allowNull: true,
field: 'location_address',
},
locationCity: {
type: DataTypes.STRING(255),
allowNull: true,
field: 'location_city',
},
locationZip: {
type: DataTypes.STRING(32),
allowNull: true,
field: 'location_zip',
},
matchSystem: {
type: DataTypes.STRING(120),
allowNull: false,
defaultValue: 'Braunschweiger System',
field: 'match_system',
},
singlesCount: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: 12,
field: 'singles_count',
},
doublesCount: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: 4,
field: 'doubles_count',
},
winningSets: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: 3,
field: 'winning_sets',
},
homeMatchPoints: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: 0,
field: 'home_match_points',
},
guestMatchPoints: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: 0,
field: 'guest_match_points',
},
isCompleted: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: false,
field: 'is_completed',
},
homeParticipants: {
type: DataTypes.JSON,
allowNull: true,
field: 'home_participants',
},
guestParticipants: {
type: DataTypes.JSON,
allowNull: true,
field: 'guest_participants',
},
resultDetails: {
type: DataTypes.JSON,
allowNull: true,
field: 'result_details',
},
playersReady: {
type: DataTypes.JSON,
allowNull: true,
field: 'players_ready',
},
playersPlanned: {
type: DataTypes.JSON,
allowNull: true,
field: 'players_planned',
},
playersPlayed: {
type: DataTypes.JSON,
allowNull: true,
field: 'players_played',
},
}, {
tableName: 'friendly_match',
underscored: true,
timestamps: true,
});
export default FriendlyMatch;

View File

@@ -57,6 +57,7 @@ import BillingRun from './BillingRun.js';
import BillingDocument from './BillingDocument.js';
import BillingDocumentValue from './BillingDocumentValue.js';
import BillingUserSetting from './BillingUserSetting.js';
import FriendlyMatch from './FriendlyMatch.js';
import MemberTtrHistory from './MemberTtrHistory.js';
import MemberPlayInterest from './MemberPlayInterest.js';
import ClickTtAccount from './ClickTtAccount.js';
@@ -451,6 +452,7 @@ export {
BillingDocument,
BillingDocumentValue,
BillingUserSetting,
FriendlyMatch,
MemberTtrHistory,
MemberPlayInterest,
ClickTtAccount,