import { Column, Entity, PrimaryGeneratedColumn, Unique } from 'typeorm';

export enum DutyTypes {
    STANDARD = 'Standard',
    MEDIC = 'Medic',
    CORRECTIONAL = 'Correctional',
    SPECIAL = 'Special',
    ADMIN = 'Admin',
    TESTER = 'Tester',
    QUIET = 'Quiet Mode',
}

@Entity('duty_logs')
export class DutyLogsEntity {
    @PrimaryGeneratedColumn() id: number;
    @Column({ type: 'varchar', length: 32 }) character_name: string;
    @Column({ type: 'int' }) character_id: number;
    @Column({ type: 'int' }) account_id: number;
    @Column({ type: 'datetime', default: () => 'CURRENT_TIMESTAMP' }) start_time: Date;
    @Column({ type: 'datetime', nullable: true, default: null }) end_time: Date | null;
    @Column({ type: 'varchar', length: 32 }) duty_type: string;
    @Column({ type: 'int', nullable: true, default: null }) faction_id: number | null;
    @Column({ type: 'int', nullable: true, default: null }) company_id: number | null;
    @Column({ type: 'int', default: 0 }) tabbed_time: number;
    @Column({ type: 'int', default: 0 }) afk_time: number;
}
