import { DB_SCHEMA } from 'src/utils';
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';

@Entity('company_bank_account', { schema: DB_SCHEMA })
export class CompanyBankAccountEntity {
  @PrimaryGeneratedColumn({ type: 'tinyint', name: 'bank_acc_id' })
  bank_acc_id: number;

  @Column('tinyint', { name: 'company_id' })
  company_id: number;

  @Column('varchar', { name: 'nick_name', length: 60 })
  nick_name: string;

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

  @Column('varchar', { name: 'acc_holder', length: 60 })
  acc_holder: string;

  @Column('varchar', { name: 'acc_number', length: 30 })
  acc_number: string;

  @Column('varchar', { name: 'ifsc_code', length: 15 })
  ifsc_code: string;

  @Column('varchar', { name: 'swift_code', length: 60 })
  swift_code: string;

  @Column('varchar', { name: 'branch_name', length: 100 })
  branch_name: string;

  @Column('smallint', { name: 'country_id' })
  country_id: number;

  @Column('smallint', { name: 'state_id' })
  state_id: number;

  @Column('mediumint', { name: 'city_id' })
  city_id: number;

  @Column('varchar', { name: 'qr_code', nullable: true, length: 255 })
  qr_code: string | null;

  @Column('tinyint', { name: 'active', default: () => "'1'" })
  active: number;

  @Column('smallint', { name: 'by_user' })
  by_user: number;

  @Column('timestamp', { name: 'created', default: () => 'CURRENT_TIMESTAMP' })
  created: Date;

  @Column('timestamp', {
    name: 'modified',
    default: () => "'0000-00-00 00:00:00'",
  })
  modified: Date;

  @Column('varchar', {
    name: 'company_bank_address',
    nullable: true,
    length: 255,
  })
  company_bank_address: string | null;
}
