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

@Entity('temp_trainers')
export class TempTrainers {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({ name: 'full_name', type: 'varchar', length: 150 })
  fullName: string;

  @Column({ type: 'varchar', length: 150, unique: true })
  email: string;

  @Column({ type: 'varchar', length: 20 })
  phone: string;

  @Column({ name: 'trainer_type', type: 'enum', enum: ['tech', 'non-tech'] })
  trainerType: 'tech' | 'non-tech';

  @Column({ name: 'specialization_id', type: 'int', nullable: true })
  specializationId: number;

  @Column({ name: 'experience_years', type: 'int', default: 0 })
  experienceYears: number;

  @Column({ type: 'text', nullable: true })
  certifications: string;

  @Column({
    name: 'availability_type',
    type: 'enum',
    enum: ['full-time', 'part-time', 'freelance', 'online', 'offline'],
    default: 'full-time',
  })
  availabilityType: string;

  @Column({ name: 'trainer_profile', type: 'text', nullable: true })
  trainerProfile: string;

  @Column({ name: 'id_proof', type: 'varchar', length: 255, nullable: true })
  idProof: string;

  @Column({
    type: 'enum',
    enum: ['pending', 'approved', 'rejected'],
    default: 'pending',
  })
  status: 'pending' | 'approved' | 'rejected';

  @CreateDateColumn({ name: 'created_at' })
  createdAt: Date;

  @UpdateDateColumn({ name: 'updated_at' })
  updatedAt: Date;
}
