import { Entity, Column, PrimaryGeneratedColumn, CreateDateColumn } from 'typeorm';
import { ApiProperty } from '@nestjs/swagger';

@Entity('breach_password')
export class BreachedPassword {
  @ApiProperty({ description: 'Unique identifier' })
  @PrimaryGeneratedColumn()
  id: number;

  @ApiProperty({ description: 'Password from the breach', name: 'password' })
  @Column({ length: 255, name: 'password', unique: true })
  password: string;

  @ApiProperty({ description: 'Source of the breach data', name: 'source' })
  @Column({ length: 100, nullable: true, default: null, name: 'source' })
  source: string;

  @ApiProperty({ description: 'Date when the record was imported', name: 'imported_at' })
  @CreateDateColumn({ name: 'imported_at' })
  importedAt: Date;
}

