2024-03-21 10:10:22 +07:00
|
|
|
import { Entity, Column, OneToMany, JoinColumn, ManyToOne } from "typeorm";
|
2024-02-06 10:12:41 +07:00
|
|
|
import { EntityBase } from "./base/Base";
|
|
|
|
|
import { PosMaster } from "./PosMaster";
|
2024-02-07 11:17:01 +07:00
|
|
|
import { PosLevel } from "./PosLevel";
|
|
|
|
|
import { PosType } from "./PosType";
|
2024-02-23 14:19:39 +07:00
|
|
|
import { ProfileSalary } from "./ProfileSalary";
|
2024-03-12 14:53:15 +07:00
|
|
|
import { ProfileCertificate } from "./ProfileCertificate";
|
|
|
|
|
import { ProfileEducation } from "./ProfileEducation";
|
|
|
|
|
import { ProfileTraining } from "./ProfileTraining";
|
|
|
|
|
import { ProfileInsignia } from "./ProfileInsignia";
|
|
|
|
|
import { ProfileHonor } from "./ProfileHonor";
|
|
|
|
|
import { ProfileAssessment } from "./ProfileAssessment";
|
2024-03-12 17:33:22 +07:00
|
|
|
import { ProfileLeave } from "./ProfileLeave";
|
2024-03-12 17:52:22 +07:00
|
|
|
import { ProfileAbility } from "./ProfileAbility";
|
2024-03-13 15:33:02 +07:00
|
|
|
import { ProfileDuty } from "./ProfileDuty";
|
2024-03-13 10:43:50 +07:00
|
|
|
import { ProfileNopaid } from "./ProfileNopaid";
|
|
|
|
|
import { ProfileOther } from "./ProfileOther";
|
2024-05-14 17:26:06 +07:00
|
|
|
import { ProfileFamilyHistory } from "./ProfileFamily";
|
2024-03-20 16:16:44 +07:00
|
|
|
import { ProfileGovernment } from "./ProfileGovernment";
|
2024-03-26 23:07:55 +07:00
|
|
|
import { Province } from "./Province";
|
|
|
|
|
import { SubDistrict } from "./SubDistrict";
|
|
|
|
|
import { District } from "./District";
|
2024-05-14 15:29:05 +07:00
|
|
|
import { ProfileAvatar } from "./ProfileAvatar";
|
2024-05-14 17:39:32 +07:00
|
|
|
import { ProfileFamilyFather } from "./ProfileFamilyFather";
|
|
|
|
|
import { ProfileFamilyMother } from "./ProfileFamilyMother";
|
|
|
|
|
import { ProfileFamilyCouple } from "./ProfileFamilyCouple";
|
2024-05-14 17:26:06 +07:00
|
|
|
import { ProfileChildren } from "./ProfileChildren";
|
2024-05-14 17:24:38 +07:00
|
|
|
import { ProfileDiscipline } from "./ProfileDiscipline";
|
2024-02-06 10:12:41 +07:00
|
|
|
|
|
|
|
|
@Entity("profile")
|
|
|
|
|
export class Profile extends EntityBase {
|
2024-05-14 15:29:05 +07:00
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "รูปถ่าย",
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
avatar: string;
|
|
|
|
|
|
2024-05-15 15:29:23 +07:00
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "รูปถ่าย",
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
avatarName: string;
|
|
|
|
|
|
2024-03-26 23:07:55 +07:00
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "ยศ",
|
|
|
|
|
length: 40,
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
rank: string;
|
|
|
|
|
|
2024-02-06 10:12:41 +07:00
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "คำนำหน้าชื่อ",
|
|
|
|
|
length: 40,
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
prefix: string;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "ชื่อ",
|
|
|
|
|
length: 255,
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
firstName: string;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "นามสกุล",
|
|
|
|
|
length: 255,
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
lastName: string;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "เลขประจำตัวประชาชน",
|
|
|
|
|
default: null,
|
2024-02-06 15:44:16 +07:00
|
|
|
length: 13,
|
2024-02-06 10:12:41 +07:00
|
|
|
})
|
2024-02-06 11:02:29 +07:00
|
|
|
citizenId: string;
|
2024-02-06 10:12:41 +07:00
|
|
|
|
2024-02-07 11:17:01 +07:00
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "ตำแหน่ง",
|
|
|
|
|
default: null,
|
|
|
|
|
length: 255,
|
|
|
|
|
})
|
|
|
|
|
position: string;
|
|
|
|
|
|
|
|
|
|
@Column({
|
2024-02-07 11:24:08 +07:00
|
|
|
nullable: true,
|
2024-02-07 11:17:01 +07:00
|
|
|
length: 40,
|
|
|
|
|
comment: "ไอดีระดับตำแหน่ง",
|
|
|
|
|
})
|
2024-02-07 16:36:55 +07:00
|
|
|
posLevelId: string | null;
|
2024-02-07 11:17:01 +07:00
|
|
|
|
|
|
|
|
@Column({
|
2024-02-07 11:24:08 +07:00
|
|
|
nullable: true,
|
2024-02-07 11:17:01 +07:00
|
|
|
length: 40,
|
2024-02-08 09:52:18 +07:00
|
|
|
comment: "ไอดีประเภทตำแหน่ง",
|
2024-02-07 11:17:01 +07:00
|
|
|
})
|
2024-02-07 16:36:55 +07:00
|
|
|
posTypeId: string | null;
|
2024-02-07 11:17:01 +07:00
|
|
|
|
2024-02-16 12:07:37 +07:00
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
length: 255,
|
|
|
|
|
comment: "อีเมล",
|
|
|
|
|
})
|
|
|
|
|
email: string;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
length: 20,
|
|
|
|
|
comment: "เบอร์โทร",
|
|
|
|
|
})
|
|
|
|
|
phone: string;
|
|
|
|
|
|
2024-02-06 15:44:16 +07:00
|
|
|
// @Column({
|
|
|
|
|
// nullable: true,
|
|
|
|
|
// length: 40,
|
|
|
|
|
// comment:
|
|
|
|
|
// "คนครองปัจจุบัน เมื่อทำสำเนาโครงสร้างและตำแหน่งพร้อมกับคนครองมา คนครองจะอยู่ในฟิลด์นี้",
|
|
|
|
|
// default: null,
|
|
|
|
|
// unique: false,
|
|
|
|
|
// })
|
|
|
|
|
// current_holderId: string;
|
2024-02-06 10:12:41 +07:00
|
|
|
|
2024-02-06 15:44:16 +07:00
|
|
|
// @Column({
|
|
|
|
|
// nullable: true,
|
|
|
|
|
// length: 40,
|
|
|
|
|
// comment:
|
|
|
|
|
// "คนที่กำลังจะมาครอง ตอนปรับโครงสร้าง ถ้าเลือกให้ใครมาครอง ProfileId ของคนนั้นจะมาอยู่ในช่องนี้ รวมทั้งตอนเลือกตำแหน่งเพื่อบรรจุ แต่งตั้ง เลื่อน ย้าย ในระบบบรรจุแต่งตั้งด้วย",
|
|
|
|
|
// default: null,
|
|
|
|
|
// unique: false,
|
|
|
|
|
// })
|
|
|
|
|
// next_holderId: string;
|
2024-02-16 12:07:37 +07:00
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "id keycloak",
|
|
|
|
|
length: 40,
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
keycloak: string;
|
2024-02-06 15:44:16 +07:00
|
|
|
|
2024-02-22 15:44:40 +07:00
|
|
|
@Column({
|
|
|
|
|
comment: "ทดลองปฏิบัติหน้าที่",
|
|
|
|
|
default: false,
|
|
|
|
|
})
|
|
|
|
|
isProbation: boolean;
|
|
|
|
|
|
2024-03-26 09:47:17 +07:00
|
|
|
@Column({
|
|
|
|
|
comment: "เกษียณ",
|
|
|
|
|
default: false,
|
|
|
|
|
})
|
|
|
|
|
isLeave: boolean;
|
|
|
|
|
|
2024-03-08 14:54:24 +07:00
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
type: "datetime",
|
2024-05-14 17:54:17 +07:00
|
|
|
comment: "วันครบเกษียณอายุ",
|
2024-03-08 14:54:24 +07:00
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
dateRetire: Date;
|
|
|
|
|
|
2024-03-27 11:19:51 +07:00
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
type: "datetime",
|
|
|
|
|
comment: "วันที่บรรจุ",
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
dateAppoint: Date;
|
|
|
|
|
|
2024-05-14 17:54:17 +07:00
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
type: "datetime",
|
|
|
|
|
comment: "วันที่เกษียณอายุราชการตามกฏหมาย",
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
dateRetireLaw: Date;
|
|
|
|
|
|
2024-03-27 11:19:51 +07:00
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
type: "datetime",
|
|
|
|
|
comment: "วันที่เริ่มปฏิบัติราชการ",
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
dateStart: Date;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "ขาดราชการ",
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
govAgeAbsent: number;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "อายุราชการเกื้อกูล",
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
govAgePlus: number;
|
|
|
|
|
|
2024-03-11 14:19:26 +07:00
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
type: "datetime",
|
|
|
|
|
comment: "วันเกิด",
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
birthDate: Date;
|
2024-03-15 14:32:08 +07:00
|
|
|
|
2024-03-27 13:48:06 +07:00
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "เหตุผลกรณีวันไม่ตรงกัน",
|
|
|
|
|
length: 255,
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
reasonSameDate: string;
|
|
|
|
|
|
2024-03-21 10:10:22 +07:00
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "เชื้อชาติ",
|
|
|
|
|
length: 255,
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
ethnicity: string;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "เบอร์โทร",
|
|
|
|
|
length: 255,
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
telephoneNumber: string;
|
|
|
|
|
|
2024-03-26 09:16:09 +07:00
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "สัญชาติ",
|
|
|
|
|
length: 255,
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
nationality: string;
|
|
|
|
|
|
2024-03-21 10:10:22 +07:00
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "เพศ",
|
|
|
|
|
length: 40,
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
2024-03-26 23:07:55 +07:00
|
|
|
gender: string;
|
2024-03-21 10:10:22 +07:00
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "ความสัมพันธ์",
|
|
|
|
|
length: 40,
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
2024-03-26 23:07:55 +07:00
|
|
|
relationship: string;
|
2024-03-21 10:10:22 +07:00
|
|
|
|
2024-03-21 16:29:51 +07:00
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "ศาสนา",
|
|
|
|
|
length: 255,
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
2024-03-26 23:07:55 +07:00
|
|
|
religion: string;
|
2024-03-21 16:29:51 +07:00
|
|
|
|
2024-03-21 10:10:22 +07:00
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "กรุ๊ปเลือด",
|
|
|
|
|
length: 40,
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
2024-03-26 23:07:55 +07:00
|
|
|
bloodGroup: string;
|
2024-03-21 10:10:22 +07:00
|
|
|
|
2024-02-06 15:44:16 +07:00
|
|
|
@OneToMany(() => PosMaster, (posMaster) => posMaster.current_holder)
|
|
|
|
|
current_holders: PosMaster[];
|
2024-02-06 15:49:02 +07:00
|
|
|
|
2024-02-06 15:44:16 +07:00
|
|
|
@OneToMany(() => PosMaster, (posMaster) => posMaster.next_holder)
|
|
|
|
|
next_holders: PosMaster[];
|
2024-02-07 11:17:01 +07:00
|
|
|
|
2024-02-23 14:19:39 +07:00
|
|
|
@OneToMany(() => ProfileSalary, (profileSalary) => profileSalary.profile)
|
2024-03-08 14:54:24 +07:00
|
|
|
profileSalary: ProfileSalary[];
|
|
|
|
|
|
|
|
|
|
@OneToMany(() => ProfileDiscipline, (profileDiscipline) => profileDiscipline.profile)
|
2024-05-14 17:24:38 +07:00
|
|
|
profileDisciplines: ProfileDiscipline[];
|
2024-02-23 14:19:39 +07:00
|
|
|
|
2024-03-12 14:53:15 +07:00
|
|
|
@OneToMany(() => ProfileCertificate, (profileCertificate) => profileCertificate.profile)
|
|
|
|
|
profileCertificates: ProfileCertificate[];
|
|
|
|
|
|
|
|
|
|
@OneToMany(() => ProfileEducation, (profileEducation) => profileEducation.profile)
|
|
|
|
|
profileEducations: ProfileEducation[];
|
|
|
|
|
|
|
|
|
|
@OneToMany(() => ProfileTraining, (profileTraining) => profileTraining.profile)
|
|
|
|
|
profileTrainings: ProfileTraining[];
|
|
|
|
|
|
|
|
|
|
@OneToMany(() => ProfileInsignia, (profileInsignia) => profileInsignia.profile)
|
|
|
|
|
profileInsignias: ProfileInsignia[];
|
|
|
|
|
|
|
|
|
|
@OneToMany(() => ProfileHonor, (profileHonor) => profileHonor.profile)
|
|
|
|
|
profileHonors: ProfileHonor[];
|
|
|
|
|
|
|
|
|
|
@OneToMany(() => ProfileAssessment, (profileAssessment) => profileAssessment.profile)
|
|
|
|
|
profileAssessments: ProfileAssessment[];
|
|
|
|
|
|
2024-03-12 17:33:22 +07:00
|
|
|
@OneToMany(() => ProfileLeave, (profileLeave) => profileLeave.profile)
|
|
|
|
|
profileLeaves: ProfileLeave[];
|
|
|
|
|
|
2024-03-12 17:52:22 +07:00
|
|
|
@OneToMany(() => ProfileAbility, (profileAbility) => profileAbility.profile)
|
|
|
|
|
profileAbilities: ProfileAbility[];
|
|
|
|
|
|
2024-03-13 10:43:50 +07:00
|
|
|
@OneToMany(() => ProfileDuty, (profileDuty) => profileDuty.profile)
|
|
|
|
|
profileDutys: ProfileDuty[];
|
|
|
|
|
|
|
|
|
|
@OneToMany(() => ProfileNopaid, (profileNopaid) => profileNopaid.profile)
|
|
|
|
|
profileNopaids: ProfileNopaid[];
|
2024-03-15 14:32:08 +07:00
|
|
|
|
2024-03-13 10:43:50 +07:00
|
|
|
@OneToMany(() => ProfileOther, (profileOther) => profileOther.profile)
|
|
|
|
|
profileOthers: ProfileOther[];
|
|
|
|
|
|
2024-05-14 15:29:05 +07:00
|
|
|
@OneToMany(() => ProfileAvatar, (profileAvatar) => profileAvatar.profile)
|
|
|
|
|
profileAvatars: ProfileAvatar[];
|
|
|
|
|
|
2024-03-19 18:03:10 +07:00
|
|
|
@OneToMany(() => ProfileFamilyHistory, (profileFamily) => profileFamily.profile)
|
|
|
|
|
profileFamily: ProfileFamilyHistory[];
|
|
|
|
|
|
2024-05-14 10:29:05 +07:00
|
|
|
@OneToMany(() => ProfileChildren, (profileChildren) => profileChildren.profile)
|
2024-05-14 17:26:06 +07:00
|
|
|
profileChildrens: ProfileChildren[];
|
2024-05-14 10:29:05 +07:00
|
|
|
|
2024-03-20 16:16:44 +07:00
|
|
|
@OneToMany(() => ProfileGovernment, (profileGovernment) => profileGovernment.profile)
|
|
|
|
|
profileGovernment: ProfileGovernment[];
|
|
|
|
|
|
2024-03-21 10:10:22 +07:00
|
|
|
@OneToMany(() => ProfileHistory, (v) => v.profile)
|
|
|
|
|
histories: ProfileHistory[];
|
|
|
|
|
|
2024-05-14 17:39:32 +07:00
|
|
|
@OneToMany(() => ProfileFamilyFather, (v) => v.profile)
|
|
|
|
|
profileFamilyFather: ProfileFamilyFather[];
|
|
|
|
|
|
|
|
|
|
@OneToMany(() => ProfileFamilyMother, (v) => v.profile)
|
|
|
|
|
profileFamilyMother: ProfileFamilyMother[];
|
|
|
|
|
|
2024-05-14 17:54:17 +07:00
|
|
|
@OneToMany(() => ProfileFamilyCouple, (v) => v.profile)
|
2024-05-14 17:39:32 +07:00
|
|
|
profileFamilyCouple: ProfileFamilyCouple[];
|
|
|
|
|
|
2024-03-15 14:32:08 +07:00
|
|
|
@ManyToOne(() => PosLevel, (posLevel) => posLevel.profiles)
|
2024-02-07 11:17:01 +07:00
|
|
|
@JoinColumn({ name: "posLevelId" })
|
2024-02-07 12:43:49 +07:00
|
|
|
posLevel: PosLevel;
|
2024-02-07 11:17:01 +07:00
|
|
|
|
2024-03-15 14:32:08 +07:00
|
|
|
@ManyToOne(() => PosType, (posType) => posType.profiles)
|
2024-02-07 11:17:01 +07:00
|
|
|
@JoinColumn({ name: "posTypeId" })
|
2024-02-07 12:43:49 +07:00
|
|
|
posType: PosType;
|
2024-03-26 09:47:17 +07:00
|
|
|
|
|
|
|
|
// calculateRetireYear(): number {
|
|
|
|
|
// return calculateRetireYear(this.birthDate);
|
|
|
|
|
// }
|
2024-03-26 23:07:55 +07:00
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "ที่อยู่ตามทะเบียนบ้าน",
|
|
|
|
|
default: null,
|
|
|
|
|
length: 255,
|
|
|
|
|
})
|
|
|
|
|
registrationAddress: string;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "จังหวัดตามทะเบียนบ้าน",
|
|
|
|
|
length: 255,
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
registrationProvinceId: string;
|
|
|
|
|
|
|
|
|
|
@ManyToOne(() => Province, (v) => v.registrationProvinces)
|
|
|
|
|
registrationProvince: Province;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "เขตตามทะเบียนบ้าน",
|
|
|
|
|
length: 255,
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
registrationDistrictId: string;
|
|
|
|
|
|
|
|
|
|
@ManyToOne(() => District, (v) => v.registrationDistricts)
|
|
|
|
|
registrationDistrict: District;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "แขวงตามทะเบียนบ้าน",
|
|
|
|
|
length: 255,
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
registrationSubDistrictId: string;
|
|
|
|
|
|
|
|
|
|
@ManyToOne(() => SubDistrict, (v) => v.registrationSubDistricts)
|
|
|
|
|
registrationSubDistrict: SubDistrict;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "รหัสไปรษณีย์ตามทะเบียนบ้าน",
|
|
|
|
|
default: null,
|
|
|
|
|
length: 5,
|
|
|
|
|
})
|
|
|
|
|
registrationZipCode: string;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "ที่อยู่ตามปัจจุบัน",
|
|
|
|
|
default: null,
|
|
|
|
|
length: 255,
|
|
|
|
|
})
|
|
|
|
|
currentAddress: string;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "จังหวัดตามปัจจุบัน",
|
|
|
|
|
length: 255,
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
currentProvinceId: string;
|
|
|
|
|
|
|
|
|
|
@ManyToOne(() => Province, (v) => v.currentProvinces)
|
|
|
|
|
currentProvince: Province;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "เขตตามปัจจุบัน",
|
|
|
|
|
length: 255,
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
currentDistrictId: string;
|
|
|
|
|
|
|
|
|
|
@ManyToOne(() => District, (v) => v.currentDistricts)
|
|
|
|
|
currentDistrict: District;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "แขวงตามปัจจุบัน",
|
|
|
|
|
length: 255,
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
currentSubDistrictId: string;
|
|
|
|
|
|
|
|
|
|
@ManyToOne(() => SubDistrict, (v) => v.currentSubDistricts)
|
|
|
|
|
currentSubDistrict: SubDistrict;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "รหัสไปรษณีย์ตามปัจจุบัน",
|
|
|
|
|
default: null,
|
|
|
|
|
length: 5,
|
|
|
|
|
})
|
|
|
|
|
currentZipCode: string;
|
2024-03-21 10:10:22 +07:00
|
|
|
}
|
2024-03-20 09:09:42 +07:00
|
|
|
|
2024-03-21 10:10:22 +07:00
|
|
|
@Entity("profileHistory")
|
|
|
|
|
export class ProfileHistory extends Profile {
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
length: 40,
|
|
|
|
|
comment: "คีย์นอก(FK)ของตาราง ProfileInformation",
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
profileId: string;
|
|
|
|
|
|
|
|
|
|
@ManyToOne(() => Profile, (v) => v.histories, { onDelete: "CASCADE" })
|
|
|
|
|
profile: Profile;
|
2024-02-06 10:12:41 +07:00
|
|
|
}
|
|
|
|
|
|
2024-03-26 23:07:55 +07:00
|
|
|
@Entity("profileAddressHistory")
|
|
|
|
|
export class ProfileAddressHistory extends EntityBase {
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
length: 40,
|
|
|
|
|
comment: "คีย์นอก(FK)ของตาราง ProfileInformation",
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
profileId: string;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "ที่อยู่ตามทะเบียนบ้าน",
|
|
|
|
|
default: null,
|
|
|
|
|
length: 255,
|
|
|
|
|
})
|
|
|
|
|
registrationAddress: string;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "จังหวัดตามทะเบียนบ้าน",
|
|
|
|
|
length: 255,
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
registrationProvinceId: string;
|
|
|
|
|
|
|
|
|
|
@ManyToOne(() => Province, (v) => v.registrationProvinces)
|
|
|
|
|
registrationProvince: Province;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "เขตตามทะเบียนบ้าน",
|
|
|
|
|
length: 255,
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
registrationDistrictId: string;
|
|
|
|
|
|
|
|
|
|
@ManyToOne(() => District, (v) => v.registrationDistricts)
|
|
|
|
|
registrationDistrict: District;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "แขวงตามทะเบียนบ้าน",
|
|
|
|
|
length: 255,
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
registrationSubDistrictId: string;
|
|
|
|
|
|
|
|
|
|
@ManyToOne(() => SubDistrict, (v) => v.registrationSubDistricts)
|
|
|
|
|
registrationSubDistrict: SubDistrict;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "รหัสไปรษณีย์ตามทะเบียนบ้าน",
|
|
|
|
|
default: null,
|
|
|
|
|
length: 5,
|
|
|
|
|
})
|
|
|
|
|
registrationZipCode: string;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "ที่อยู่ตามปัจจุบัน",
|
|
|
|
|
default: null,
|
|
|
|
|
length: 255,
|
|
|
|
|
})
|
|
|
|
|
currentAddress: string;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "จังหวัดตามปัจจุบัน",
|
|
|
|
|
length: 255,
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
currentProvinceId: string;
|
|
|
|
|
|
|
|
|
|
@ManyToOne(() => Province, (v) => v.currentProvinces)
|
|
|
|
|
currentProvince: Province;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "เขตตามปัจจุบัน",
|
|
|
|
|
length: 255,
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
currentDistrictId: string;
|
|
|
|
|
|
|
|
|
|
@ManyToOne(() => District, (v) => v.currentDistricts)
|
|
|
|
|
currentDistrict: District;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "แขวงตามปัจจุบัน",
|
|
|
|
|
length: 255,
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
currentSubDistrictId: string;
|
|
|
|
|
|
|
|
|
|
@ManyToOne(() => SubDistrict, (v) => v.currentSubDistricts)
|
|
|
|
|
currentSubDistrict: SubDistrict;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "รหัสไปรษณีย์ตามปัจจุบัน",
|
|
|
|
|
default: null,
|
|
|
|
|
length: 5,
|
|
|
|
|
})
|
|
|
|
|
currentZipCode: string;
|
|
|
|
|
|
|
|
|
|
@ManyToOne(() => Profile, (v) => v.histories, { onDelete: "CASCADE" })
|
|
|
|
|
profile: Profile;
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-06 10:12:41 +07:00
|
|
|
export class CreateProfile {
|
2024-03-26 23:07:55 +07:00
|
|
|
rank: string;
|
2024-02-06 10:12:41 +07:00
|
|
|
prefix: string;
|
|
|
|
|
firstName: string;
|
|
|
|
|
lastName: string;
|
2024-02-08 10:56:03 +07:00
|
|
|
position: string;
|
2024-03-29 09:44:09 +07:00
|
|
|
// email: string | null;
|
|
|
|
|
// phone: string | null;
|
|
|
|
|
// isProbation: boolean | null;
|
|
|
|
|
// dateRetire: Date | null;
|
2024-03-21 10:10:22 +07:00
|
|
|
birthDate: Date | null;
|
2024-03-29 09:44:09 +07:00
|
|
|
// ethnicity: string | null;
|
|
|
|
|
// telephoneNumber: string | null;
|
|
|
|
|
// nationality: string | null;
|
2024-03-21 10:10:22 +07:00
|
|
|
citizenId: string;
|
2024-03-29 09:44:09 +07:00
|
|
|
// religion: string | null;
|
2024-02-08 10:56:03 +07:00
|
|
|
posLevelId: string | null;
|
|
|
|
|
posTypeId: string | null;
|
2024-03-29 09:44:09 +07:00
|
|
|
// gender: string | null;
|
|
|
|
|
// relationship: string | null;
|
|
|
|
|
// bloodGroup: string | null;
|
2024-02-06 10:12:41 +07:00
|
|
|
}
|
|
|
|
|
|
2024-05-02 21:09:29 +07:00
|
|
|
export class CreateProfileAllFields {
|
2024-05-07 14:49:39 +07:00
|
|
|
rank: string | null;
|
2024-05-02 21:09:29 +07:00
|
|
|
prefix: string;
|
|
|
|
|
firstName: string;
|
|
|
|
|
lastName: string;
|
|
|
|
|
citizenId: string;
|
2024-05-07 14:49:39 +07:00
|
|
|
position: string | null;
|
2024-05-02 21:09:29 +07:00
|
|
|
posLevelId: string | null;
|
|
|
|
|
posTypeId: string | null;
|
2024-05-07 14:49:39 +07:00
|
|
|
email: string | null;
|
2024-05-14 15:29:05 +07:00
|
|
|
phone: string | null;
|
2024-05-07 14:49:39 +07:00
|
|
|
keycloak: string | null;
|
|
|
|
|
isProbation: boolean | null;
|
2024-05-14 15:29:05 +07:00
|
|
|
isLeave: boolean | null;
|
|
|
|
|
dateRetire: Date | null;
|
|
|
|
|
dateAppoint: Date | null;
|
|
|
|
|
dateStart: Date | null;
|
2024-05-07 14:49:39 +07:00
|
|
|
govAgeAbsent: number | null;
|
|
|
|
|
govAgePlus: number | null;
|
2024-05-02 21:09:29 +07:00
|
|
|
birthDate: Date | null;
|
2024-05-14 15:29:05 +07:00
|
|
|
reasonSameDate: Date | null;
|
|
|
|
|
ethnicity: string | null;
|
|
|
|
|
telephoneNumber: string | null;
|
|
|
|
|
nationality: string | null;
|
|
|
|
|
gender: string | null;
|
|
|
|
|
relationship: string | null;
|
|
|
|
|
religion: string | null;
|
|
|
|
|
bloodGroup: string | null;
|
|
|
|
|
registrationAddress: string | null;
|
|
|
|
|
registrationProvinceId: string | null;
|
2024-05-07 14:49:39 +07:00
|
|
|
registrationDistrictId: string | null;
|
2024-05-14 15:29:05 +07:00
|
|
|
registrationSubDistrictId: string | null;
|
|
|
|
|
registrationZipCode: string | null;
|
|
|
|
|
currentAddress: string | null;
|
|
|
|
|
currentProvinceId: string | null;
|
|
|
|
|
currentDistrictId: string | null;
|
|
|
|
|
currentSubDistrictId: string | null;
|
|
|
|
|
currentZipCode: string | null;
|
|
|
|
|
}
|
2024-05-02 21:09:29 +07:00
|
|
|
|
2024-03-21 10:10:22 +07:00
|
|
|
export type UpdateProfile = {
|
2024-03-26 23:07:55 +07:00
|
|
|
rank?: string | null;
|
2024-03-21 10:10:22 +07:00
|
|
|
prefix?: string | null;
|
|
|
|
|
firstName?: string | null;
|
|
|
|
|
lastName?: string | null;
|
2024-03-29 09:44:09 +07:00
|
|
|
// position?: string | null;
|
2024-03-21 10:10:22 +07:00
|
|
|
email?: string | null;
|
|
|
|
|
phone?: string | null;
|
2024-03-29 09:44:09 +07:00
|
|
|
// keycloak?: string | null;
|
|
|
|
|
// isProbation?: boolean | null;
|
|
|
|
|
// dateRetire?: Date | null;
|
2024-03-21 10:10:22 +07:00
|
|
|
birthDate?: Date | null;
|
|
|
|
|
ethnicity?: string | null;
|
|
|
|
|
telephoneNumber?: string | null;
|
2024-03-26 09:16:09 +07:00
|
|
|
nationality?: string | null;
|
2024-03-21 10:10:22 +07:00
|
|
|
citizenId?: string | null;
|
2024-03-26 23:07:55 +07:00
|
|
|
religion: string | null;
|
2024-03-21 10:10:22 +07:00
|
|
|
posLevelId?: string | null;
|
|
|
|
|
posTypeId?: string | null;
|
2024-03-26 23:07:55 +07:00
|
|
|
gender?: string | null;
|
|
|
|
|
relationship?: string | null;
|
|
|
|
|
bloodGroup?: string | null;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export type UpdateProfileAddress = {
|
|
|
|
|
registrationAddress?: string | null;
|
|
|
|
|
registrationProvinceId?: string | null;
|
|
|
|
|
registrationDistrictId?: string | null;
|
|
|
|
|
registrationSubDistrictId?: string | null;
|
|
|
|
|
registrationZipCode?: string | null;
|
|
|
|
|
currentAddress?: string | null;
|
|
|
|
|
currentProvinceId?: string | null;
|
|
|
|
|
currentDistrictId?: string | null;
|
|
|
|
|
currentSubDistrictId?: string | null;
|
|
|
|
|
currentZipCode?: string | null;
|
2024-03-21 10:10:22 +07:00
|
|
|
};
|