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

@Index('b2b_affiliate_account_id', ['b2b_affiliate_account_id'], {})
@Entity('b2b_affiliate_account_banks', {
  schema: DB_SCHEMA,
})
export class B2bAffiliateAccountBanksEntity {
  @PrimaryGeneratedColumn({ type: 'mediumint', name: 'id', unsigned: true })
  id: number;

  @Column('smallint', { name: 'b2b_affiliate_account_id', nullable: true })
  b2b_affiliate_account_id: number | null;

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

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

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

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

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

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

  @Column('tinyint', {
    name: 'status',
    comment: '1 => Active, 2 => Inactive',
    width: 1,
    default: () => "'1'",
  })
  status: boolean;

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

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

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