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

@Entity('issuer_bank_accounts')
export class IssuerBankAccount {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({
    name: 'invoice_issuer_id',
    type: 'int',
    comment: 'FK to invoice_issuers (admin or recruiter)',
  })
  invoice_issuer_id: number;

  @Column({ type: 'varchar', length: 150 })
  account_name: string;

  @Column({ type: 'varchar', length: 100 })
  bank_name: string;

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

  @Column({ type: 'varchar', length: 50 })
  account_number: string;

  @Column({ type: 'varchar', length: 20 })
  ifsc_code: string;

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

  @Column({ type: 'tinyint', width: 1, default: 1 })
  is_default: number;

  @Column({ type: 'tinyint', width: 1, default: 1 })
  is_active: number;

  @CreateDateColumn()
  created_at: Date;

  @UpdateDateColumn()
  updated_at: Date;
}
