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

@Entity('seeker_profiles')
export class SeekerProfiles {
  @PrimaryGeneratedColumn()
  id: number;

  @Column()
  @Index()
  user_id: number;

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

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

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

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

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

  @Column({ type: 'date', nullable: true })
  date_of_birth: Date;

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

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

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

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

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

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

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

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

  @CreateDateColumn({
    name: 'created_at',
    type: 'timestamp',
    default: () => 'CURRENT_TIMESTAMP',
  })
  created_at: Date;

  @UpdateDateColumn({
    name: 'updated_at',
    type: 'timestamp',
    default: () => 'CURRENT_TIMESTAMP',
    onUpdate: 'CURRENT_TIMESTAMP',
  })
  updated_at: Date;
}
