import { TABLE_NAME } from 'src/core/strings/constants/table.constants';
import { PaymentMethodEntity } from '../../domain/entities/payment-method.entity';
import { Column, Entity } from 'typeorm';
import { BaseStatusModel } from 'src/core/modules/data/model/base-status.model';
import { PaymentMethodType } from '../../constants';

@Entity(TABLE_NAME.PAYMENT_METHOD)
export class PaymentMethodModel
  extends BaseStatusModel<PaymentMethodEntity>
  implements PaymentMethodEntity
{
  @Column('varchar', { name: 'issuer_name' })
  issuer_name: string;

  @Column('varchar', { name: 'account_number', nullable: true })
  account_number: string;

  @Column('varchar', { name: 'account_name', nullable: true })
  account_name: string;

  @Column('varchar', { name: 'qr_image', nullable: true })
  qr_image: string;

  @Column('varchar', { name: 'note', nullable: true })
  note: string;

  @Column('enum', {
    name: 'type',
    enum: PaymentMethodType,
    default: PaymentMethodType.TRANSFER_BANK,
  })
  type: PaymentMethodType;
}
