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

@Entity('mock_templates')
export class MockTemplates {
  @PrimaryGeneratedColumn()
  id: number;

  @Column()
  role_id: number;

  @Column({ length: 255 })
  title: string;

  @Column({ default: 10 })
  total_questions: number;

  @Column({ default: 30 })
  duration_minutes: number;

  @Column('json', { nullable: true })
  allowed_difficulty: string[];

  @Column('json', { nullable: true })
  required_skill_ids: number[];

  @Column({ type: 'tinyint', default: 1 })
  is_active: boolean;

  @Column({ nullable: true })
  created_by: number;

  @CreateDateColumn()
  created_at: Date;

  @UpdateDateColumn()
  updated_at: Date;
}
