import { DataTypes } from 'sequelize';
import sequelize from '../database.js';

const OfficialTournament = sequelize.define('OfficialTournament', {
  id: { type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true },
  clubId: { type: DataTypes.INTEGER, allowNull: false },
  title: { type: DataTypes.STRING, allowNull: true },
  eventDate: { type: DataTypes.STRING, allowNull: true },
  organizer: { type: DataTypes.STRING, allowNull: true },
  host: { type: DataTypes.STRING, allowNull: true },
  venues: { type: DataTypes.TEXT, allowNull: true }, // JSON.stringify(Array)
  competitionTypes: { type: DataTypes.TEXT, allowNull: true }, // JSON.stringify(Array)
  registrationDeadlines: { type: DataTypes.TEXT, allowNull: true }, // JSON.stringify(Array)
  entryFees: { type: DataTypes.TEXT, allowNull: true }, // JSON.stringify(Object) - Teilnahmegebühren pro Spielklasse
}, {
  tableName: 'official_tournaments',
  timestamps: true,
  underscored: true,
});

export default OfficialTournament;


