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

const MemberPlayInterest = sequelize.define('MemberPlayInterest', {
  id: {
    type: DataTypes.INTEGER,
    primaryKey: true,
    autoIncrement: true,
    allowNull: false
  },
  clubId: {
    type: DataTypes.INTEGER,
    allowNull: false,
    field: 'club_id'
  },
  memberId: {
    type: DataTypes.INTEGER,
    allowNull: false,
    field: 'member_id'
  },
  seasonId: {
    type: DataTypes.INTEGER,
    allowNull: false,
    field: 'season_id'
  },
  lineupHalf: {
    type: DataTypes.ENUM('first_half', 'second_half'),
    allowNull: false,
    field: 'lineup_half'
  },
  interested: {
    type: DataTypes.BOOLEAN,
    allowNull: false,
    defaultValue: true
  }
}, {
  underscored: true,
  sequelize,
  modelName: 'MemberPlayInterest',
  tableName: 'member_play_interest',
  timestamps: true
});

export default MemberPlayInterest;
