import {
  Entity,
  PrimaryGeneratedColumn,
  Column,
  CreateDateColumn,
  UpdateDateColumn,
} from 'typeorm';

@Entity('job_post_ai_settings')
export class JobPostAiSettings {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({ type: 'int' })
  job_post_id: number;

  @Column({ type: 'tinyint', width: 1, default: 0 })
  ai_enabled: boolean;

  @Column({ type: 'int', nullable: true })
  ai_question_count: number;

  @Column({
    type: 'enum',
    enum: ['easy', 'medium', 'hard'],
    nullable: true,
  })
  ai_difficulty: 'easy' | 'medium' | 'hard';

  @Column({ type: 'int', nullable: true })
  ai_experience_level: number;

  @Column({ type: 'int', default: 7 })
  ai_validity_days: number;

  @Column({ type: 'time', default: '09:00:00' })
  ai_start_time: string;

  @Column({ type: 'time', default: '18:00:00' })
  ai_end_time: string;

  @Column({ type: 'json', nullable: true })
  ai_config: any;

  @Column({ type: 'tinyint', width: 1, default: 0 })
  ai_schedule_requires_approval: boolean;

  @Column({ type: 'int', default: 30 })
  ai_duration_minutes: number;

  @CreateDateColumn({ type: 'timestamp' })
  created_at: Date;

  @UpdateDateColumn({ type: 'timestamp' })
  updated_at: Date;
}
