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

@Index('ol_uid', ['ol_uid'], { unique: true })
@Index('visa_case_id', ['visa_case_id'], {})
@Index('course_preference_id', ['course_preference_id'], {})
@Entity('vms_case_offer_letters', { schema: DB_SCHEMA })
export class VmsCaseOfferLettersEntity {
  @PrimaryGeneratedColumn({ type: 'int', name: 'id' })
  id: number;

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

  @Column('tinyint', {
    name: 'supported_doc_type_id',
    comment: 'SUPPORTED_DOCUMENT_TYPE',
    default: () => "'11'",
  })
  supported_doc_type_id: number;

  @Column('varchar', {
    name: 'ol_uid',
    nullable: true,
    unique: true,
    length: 15,
  })
  ol_uid: string | null;

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

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

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

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

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

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

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

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

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

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

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

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

  @Column('datetime', { name: 'interview_detail_on', nullable: true })
  interview_detail_on: Date | null;

  @Column('tinyint', {
    name: 'ol_status',
    nullable: true,
    comment: 'VMS_CASE_OFFER_LETTER_STATUS',
  })
  ol_status: number | null;

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

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

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

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

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

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

  @Column('datetime', { name: 'ol_response_on', nullable: true })
  ol_response_on: Date | null;

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

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

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

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

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

  @Column('tinyint', {
    name: 'tuition_fees_payment_via',
    nullable: true,
    comment: 'VISA_TUITION_FEES_PAYMENT_VIA',
  })
  tuition_fees_payment_via: number | null;

  @Column('tinyint', {
    name: 'ol_conversion_status',
    comment: '1=Not Converted,2=Converted',
    default: () => "'1'",
  })
  ol_conversion_status: number;

  @Column('datetime', { name: 'ol_conversion_on', nullable: true })
  ol_conversion_on: Date | null;

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

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

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

  @Column('datetime', { name: 'ol_unconvert_on', nullable: true })
  ol_unconvert_on: Date | null;

  @Column('tinyint', {
    name: 'i20_status',
    nullable: true,
    comment: 'VMS_CASE_OFFER_LETTER_STATUS',
  })
  i20_status: number | null;

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

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

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

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

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

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

  @Column('datetime', { name: 'i20_response_on', nullable: true })
  i20_response_on: Date | 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;
}
