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

@Entity('trainers')
export class Trainers {
  @PrimaryGeneratedColumn()
  id: number;

  @Column()
  user_id: number;

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

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

  @Column({ type: 'int', nullable: true })
  experience_years: 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:
    | 'full-time'
    | 'part-time'
    | 'freelance'
    | 'online'
    | 'offline';

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

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

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

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