import { Model, Table, Column, PrimaryKey, AutoIncrement, DataType, CreatedAt, UpdatedAt, DeletedAt, ForeignKey } from 'sequelize-typescript';
import { InstanceDAO } from '../../../../instances/infrastructure/dataAccessObjects/instanceDAO';
import { RegionDAO } from '../../../../regions/infrastructure/dataAccessObjects/regionDAO';
import { SiteDAO } from '../../../../regions/infrastructure/dataAccessObjects/siteDAO';
import { TimeTrackingFaceAssignmentForCreation } from '../../../business/models/timeTracking/timeTrackingFaceAssignments';

@Table({
    tableName: 'TimeTrackingFaceAssignments',
})
export class TimeTrackingFaceAssignmentDAO extends Model<TimeTrackingFaceAssignmentDAO, TimeTrackingFaceAssignmentForCreation> {
    @PrimaryKey
    @AutoIncrement
    @Column
    id!: number;

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

    @Column
    userId!: number;

    @ForeignKey(() => RegionDAO)
    @Column
    regionId!: number;

    @ForeignKey(() => SiteDAO)
    @Column
    siteId!: number;

    @Column(DataType.STRING)
    faceId!: string;

    @Column(DataType.STRING)
    source!: string;

    @Column(DataType.STRING)
    referenceImage!: string;

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

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

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