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

/**
 * Maps to your existing `certificates` table in certification_db.
 * Column names match exactly what you have in phpMyAdmin
 * (including the spelling `orginally_reg`).
 */
@Entity('certificates')
export class Certificate {
  @PrimaryGeneratedColumn()
  id: number;

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

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

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

  @Column({ type: 'date', nullable: true })
  orginally_reg: string | null;

  @Column({ type: 'date', nullable: true })
  issue_date: string | null;

  @Column({ type: 'date', nullable: true })
  expire_date: string | null;

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