import { AutoIncrement, Column, CreatedAt, DataType, DeletedAt, ForeignKey, Model, PrimaryKey, Table, UpdatedAt } from 'sequelize-typescript';
import { InstanceDAO } from '../../../instances/infrastructure/dataAccessObjects/instanceDAO';
import { TimeTrackingSettingForCreation } from '../../business/models/timeTrackingSetting';

@Table({ tableName: 'TimeTrackingSettings' })
export class TimeTrackingSettingDAO extends Model<TimeTrackingSettingDAO, TimeTrackingSettingForCreation> {
    @PrimaryKey
    @AutoIncrement
    @Column
    id!: number;

    @Column
    nightShiftAssignment!: string;

    @Column
    @ForeignKey(() => InstanceDAO)
    instanceId!: number;

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

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

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