import { Entity, Column, ManyToOne, JoinColumn } from "typeorm";
import { EntityBase } from "./base/Base";
import { ProfileFamilyCouple } from "./ProfileFamilyCouple";

@Entity("profileFamilyCoupleHistory")
export class ProfileFamilyCoupleHistory extends EntityBase {
  @Column({
    nullable: true,
    default: null,
    type: "boolean",
  })
  couple: boolean;

  @Column({
    nullable: true,
    default: null,
    comment: "คำนำหน้าคู่สมรส",
  })
  couplePrefix: string;

  @Column({
    nullable: true,
    default: null,
    comment: "ชื่อคู่สมรส",
  })
  coupleFirstName: string;

  @Column({
    nullable: true,
    default: null,
    comment: "นามสกุลคู่สมรส",
  })
  coupleLastName: string;

  @Column({
    nullable: true,
    default: null,
    comment: "นามสกุลคู่สมรส(เดิม)",
  })
  coupleLastNameOld: string;

  @Column({
    nullable: true,
    default: null,
    comment: "อาชีพคู่สมรส",
  })
  coupleCareer: string;

  @Column({
    nullable: true,
    default: null,
    length: 13,
    comment: "เลขที่บัตรประชาชนคู่สมรส",
  })
  coupleCitizenId: string;

  @Column({
    nullable: true,
    default: null,
    type: "boolean",
    comment: "มีชีวิตคู่สมรส",
  })
  coupleLive: boolean;

  @Column({
    nullable: true,
    comment: "ความสัมพันธ์",
    length: 40,
    default: null,
  })
  relationship: string;

  @Column({
    nullable: true,
    length: 40,
    comment: "คีย์นอก(FK)ของตาราง ProfileFamilyCouple",
    default: null,
  })
  profileFamilyCoupleId: string;

  @ManyToOne(() => ProfileFamilyCouple, (v) => v.histories)
  @JoinColumn({ name: "profileFamilyCoupleId" })
  profileFamilyCouple: ProfileFamilyCouple;
}
