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

@Entity('codebook')
export class Codebook {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({ nullable: true })
  eac_iaf_codes: string;

  @Column({ nullable: true })
  division: string;

  @Column({ nullable: true })
  group: string;

  @Column({ nullable: true })
  class: string;

  @Column({ nullable: true })
  nace_rev1: string;

  @Column({ nullable: true })
  nace_rev2_description: string;

  @Column({ nullable: true })
  risk: string;

  @Column({ nullable: true })
  note: string;

  // ✅ Separate color columns for each
  @Column({ type: 'varchar', length: 20, nullable: true })
  eac_color: string;

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

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

  @CreateDateColumn()
  created_at: Date;

  @UpdateDateColumn()
  updated_at: Date;
}
