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

@Entity('job_alerts')
export class JobAlert {
  @PrimaryGeneratedColumn()
  id: number;

  @Column()
  user_id: number;

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

  @Column({ type: 'varchar', length: 255 })
  title: string;

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

  @Column({ type: 'varchar', length: 100, default: 'Daily' })
  frequency: string;

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

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

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

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

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

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

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

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