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

@Entity('company_suggestions')
export class CompanySuggestions {
  @PrimaryGeneratedColumn({ type: 'bigint' })
  id: number;

  @Index()
  @Column({ type: 'varchar', length: 64, nullable: true })
  cin: string | null;

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

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

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

  @Column({ type: 'int', nullable: true })
  state_id: number | null;

  @Column({ type: 'int', nullable: true })
  organization_type_id: number | null;

  @Column({ type: 'varchar', length: 32, nullable: true })
  nic_code: string | null;

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

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