import {
  Table,
  Model,
  Column,
  DataType,
  ForeignKey,
  BelongsTo,
} from 'sequelize-typescript';
import { RentalHirerChangeRequestModel } from './rental-hirer-change-request.entity';
import { IHirerChangeRequestNewHirerAttr } from '../interfaces/hirer-change-request-new-hirer-attr.interface';

@Table({
  tableName: 'hirerChangeRequest_NewHirer',
  timestamps: false,
})
export class HirerChangeRequestNewHirerModel
  extends Model
  implements IHirerChangeRequestNewHirerAttr
{
  @Column({
    primaryKey: true,
    allowNull: false,
    type: DataType.STRING(30),
  })
  NewHirerId: string;

  @ForeignKey(() => RentalHirerChangeRequestModel)
  @Column({
    allowNull: false,
    type: DataType.STRING(30),
  })
  RequestId: string;

  @Column({
    allowNull: false,
    type: DataType.STRING(200),
  })
  FullName: string;

  @Column({
    allowNull: false,
    type: DataType.STRING(100),
  })
  Email: string;

  @Column({
    allowNull: false,
    type: DataType.STRING(20),
  })
  IdType: string;

  @Column({
    allowNull: false,
    type: DataType.STRING(50),
  })
  IdNo: string;

  @Column({
    allowNull: false,
    type: DataType.STRING(20),
  })
  ContactNo: string;

  @Column({
    allowNull: false,
    type: DataType.STRING(20),
  })
  Relationship: string;

  @Column({
    allowNull: false,
    type: DataType.STRING(1000),
  })
  Address: string;

  @Column({
    allowNull: false,
    type: DataType.STRING(100),
  })
  City: string;

  @Column({
    allowNull: false,
    type: DataType.STRING(100),
  })
  State: string;

  @Column({
    allowNull: false,
    type: DataType.STRING(20),
  })
  Postcode: string;

  @Column({
    allowNull: false,
    type: DataType.STRING(100),
  })
  Country: string;

  @BelongsTo(() => RentalHirerChangeRequestModel)
  HirerChangeRequest: RentalHirerChangeRequestModel;
}
