import { AutoIncrement, Column, ForeignKey, Model, PrimaryKey, Table } from 'sequelize-typescript';
import { ScheduledDaysDAO } from './scheduledDays';

export interface TimeSlotDAOCreationAttributes {
    startTime: string;
    endTime: string;
    scheduledDayId: number;
}

@Table({ tableName: 'TimeSlots', timestamps: false })
export class TimeSlotDAO extends Model<TimeSlotDAO, TimeSlotDAOCreationAttributes> {
    @PrimaryKey
    @AutoIncrement
    @Column
    id!: number;

    @Column
    startTime!: string;

    @Column
    endTime!: string;

    @ForeignKey(() => ScheduledDaysDAO)
    @Column
    scheduledDayId!: number;
}
