const { DataTypes } = require('sequelize');
const sequelize = require('./db');

const Registration = sequelize.define('Registration', {
  id: {
    type: DataTypes.INTEGER,
    primaryKey: true,
    autoIncrement: true
  },
  activityId: {
    type: DataTypes.INTEGER,
    allowNull: false
  },
  name: {
    type: DataTypes.STRING,
    allowNull: false
  },
  phone: {
    type: DataTypes.STRING,
    allowNull: false
  },
  carModel: DataTypes.STRING,
  carNumber: DataTypes.STRING,
  peopleCount: {
    type: DataTypes.INTEGER,
    defaultValue: 1
  },
  status: {
    type: DataTypes.ENUM('pending', 'approved', 'rejected'),
    defaultValue: 'pending'
  },
  note: DataTypes.TEXT,
  checkInStatus: {
    type: DataTypes.BOOLEAN,
    defaultValue: false
  },
  checkInTime: DataTypes.DATE
});

module.exports = Registration;
