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

@Index('payment_mode_name', ['payment_mode_name'], { unique: true })
@Entity('payment_mode_master', { schema: DB_SCHEMA })
export class PaymentModeMasterEntity {
  @PrimaryGeneratedColumn({ type: 'tinyint', name: 'payment_mode_id' })
  payment_mode_id: number;

  @Column('varchar', { name: 'payment_mode_name', unique: true, length: 50 })
  payment_mode_name: string;

  @Column('tinytext', { name: 'payment_mode_desc', nullable: true })
  payment_mode_desc: string | null;

  @Column('tinyint', { name: 'active', nullable: true, width: 1 })
  active: boolean | null;

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

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

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