import { Model, Table, Column, DataType, AutoIncrement, PrimaryKey, CreatedAt, UpdatedAt, DeletedAt, ForeignKey } from 'sequelize-typescript';
import { ShiftAssignedTimeSlotForCreation } from '../../../business/models/shiftManagement/shiftAssignedTimeSlot';
import { ShiftAssignedShiftDAO } from './shiftAssignedShifts';

@Table({ tableName: 'ShiftAssignedTimeSlots' })
export class ShiftAssignedTimeSlotDAO extends Model<ShiftAssignedTimeSlotDAO, ShiftAssignedTimeSlotForCreation> {
    @PrimaryKey
    @AutoIncrement
    @Column
    id!: number;

    @ForeignKey(() => ShiftAssignedShiftDAO)
    @Column
    assignedShiftId!: number;

    @Column
    startTime!: string;

    @Column
    endTime!: string;

    @CreatedAt
    @Column(DataType.DATE)
    createdAt!: Date;

    @UpdatedAt
    @Column(DataType.DATE)
    updatedAt!: Date;

    @DeletedAt
    @Column(DataType.DATE)
    deletedAt!: Date | null;
}
