import { TABLE_NAME } from 'src/core/strings/constants/table.constants';
import { Column, Entity } from 'typeorm';
import { PosLogEntity, PosLogType } from '../../domain/entities/pos-log.entity';
import { BaseCoreModel } from 'src/core/modules/data/model/base-core.model';

@Entity(TABLE_NAME.LOG_POS)
export class PosLogModel
  extends BaseCoreModel<PosLogEntity>
  implements PosLogEntity
{
  @Column('varchar', { name: 'type', default: PosLogType.cash_witdrawal })
  type: PosLogType;

  @Column('bigint', { name: 'pos_number', nullable: true })
  pos_number: number;

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

  @Column('decimal', { name: 'total_balance', nullable: true })
  total_balance: number;

  @Column('bigint', { name: 'created_at', nullable: true })
  created_at: number;

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

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

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

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