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

@Index('ac_master_id', ['ac_master_id', 'scoringId', 'gradeId', 'active'], {})
@Entity('academy_proficiency_scoring', { schema: DB_SCHEMA })
export class AcademyProficiencyScoringEntity {
  @PrimaryGeneratedColumn({ type: 'smallint', name: 'acproficiencyScoringId' })
  acproficiencyScoringId: number;

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

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

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

  @Column('decimal', {
    name: 'overall_min_per',
    nullable: true,
    precision: 5,
    scale: 2,
  })
  overall_min_per: string | null;

  @Column('decimal', {
    name: 'overall_max_per',
    nullable: true,
    precision: 5,
    scale: 2,
  })
  overall_max_per: 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;
}
