const { STRING, UUID, UUIDV4, TEXT, DATE, DECIMAL } = require('sequelize');

module.exports = (sequelize, DataTypes) => {
	const WorldConTickets = sequelize.define(
		'WorldConTickets',
		{
			id: {
				type: UUID,
				defaultValue: UUIDV4,
				allowNull: false,
				primaryKey: true,
			},
			title: {
				type: STRING,
				allowNull: false,
			},
			description: {
				type: TEXT,
				allowNull: true,
			},
			image: {
				type: STRING,
				allowNull: true,
			},
			location: {
				type: STRING,
				allowNull: true,
			},
			start_date: {
				type: DATE,
				allowNull: false,
			},
			end_date: {
				type: DATE,
				allowNull: false,
			},
			early_bird_price: {
				type: DECIMAL(10, 2),
				allowNull: true,
			},
			regular_price: {
				type: DECIMAL(10, 2),
				allowNull: true,
			},
			late_registration_price: {
				type: DECIMAL(10, 2),
				allowNull: true,
			},
			expiry_date: {
				type: DATE,
				allowNull: true,
			},
			registration_start: {
				type: DATE,
				allowNull: true,
			},
			early_bird_end: {
				type: DATE,
				allowNull: true,
			},
			regular_end: {
				type: DATE,
				allowNull: true,
			},
			registration_end: {
				type: DATE,
				allowNull: true,
			},
		},
		{
			tableName: 'world_con_tickets',
			timestamps: true,
		},
	);
	return WorldConTickets;
};
