hrms-api-eva/src/entities/Evaluation.ts

559 lines
13 KiB
TypeScript

import { Entity, Column, OneToMany, ManyToMany, JoinTable } from "typeorm";
import { EntityBase } from "./base/Base";
import { EvaluationLogs } from "./EvaluationLogs";
import { Education } from "./Education";
import { Certificate } from "./Certificate";
import { Salary } from "./Salary";
import { Training } from "./Training";
import { Assessment } from "./Assessment";
import { Director } from "./Director";
import { Meeting } from "./Meeting";
@Entity("evaluation")
export class Evaluation extends EntityBase {
@Column({
comment: "Id ชื่อผู้ใช้งาน",
length: 40,
default: "00000000-0000-0000-0000-000000000000",
})
userId: string;
@Column({ nullable: true, comment: "รหัสบัตรประชาชน", length: 13 })
citizenId: string;
@Column({ nullable: true, comment: "คำนำหน้า" })
prefix: string;
@Column({ nullable: true, comment: "ชื่อ นามสกุล" })
fullName: string;
@Column({ nullable: true, comment: "ตำแหน่ง" })
position: string;
@Column({ nullable: true, comment: "สังกัด" })
oc: string;
@Column({ nullable: true, comment: "สำนักงานที่สังกัด" })
root: string;
@Column({ nullable: true, length: 255, comment: "ไอดีสำนักงานที่สังกัด" })
orgRootId: string;
@Column({
nullable: true,
comment: "root",
length: 255,
default: null,
})
rootId: string;
@Column({
nullable: true,
comment: "child1",
length: 255,
default: null,
})
child1Id: string;
@Column({
nullable: true,
comment: "child2",
length: 255,
default: null,
})
child2Id: string;
@Column({
nullable: true,
comment: "child3",
length: 255,
default: null,
})
child3Id: string;
@Column({
nullable: true,
comment: "child4",
length: 255,
default: null,
})
child4Id: string;
@Column({
nullable: true,
comment: "Dna root",
length: 255,
default: null,
})
rootDnaId: string;
@Column({
nullable: true,
comment: "Dna child1",
length: 255,
default: null,
})
child1DnaId: string;
@Column({
nullable: true,
comment: "Dna child2",
length: 255,
default: null,
})
child2DnaId: string;
@Column({
nullable: true,
comment: "Dna child3",
length: 255,
default: null,
})
child3DnaId: string;
@Column({
nullable: true,
comment: "Dna child4",
length: 255,
default: null,
})
child4DnaId: string;
@Column({ nullable: true, comment: "เงินเดือนปัจจุบัน" })
salary: string;
@Column({ nullable: true, comment: "ระดับปัจจุบัน" })
positionLevel: string;
@Column({ nullable: true, comment: "ตำแหน่งเลขที่" })
posNo: string;
@Column({ nullable: true, comment: "วันเดือนปีเกิด" })
birthDate: string;
@Column({ nullable: true, comment: "อายุราชการ" })
govAge: string;
@Column({ nullable: true, comment: "ประเภทแบบประเมิน" })
type: string;
@Column({ nullable: true, comment: "ชื่อสถานะการประเมิน" })
step: string;
@Column({ comment: "มีคุณวุฒิการศึกษา", default: false })
isEducationalQft: boolean;
@Column({ comment: "มีประวัติการรับราชการ", default: false })
isGovermantServiceHtr: boolean;
@Column({ comment: "มีประสบการณ์ในการปฏิบัติงาน", default: false })
isOperatingExp: boolean;
@Column({
comment: "มีระยะเวลาขั้นต่ำในการดำรงตำแหน่งในสายงานที่ขอเข้ารับการคัดเลือก",
default: false,
})
isMinPeriodOfTenure: boolean;
@Column({
comment: "มีคุณสมบัติตรงตามคุณสมบัติเฉพาะสำหรับตำแหน่งที่กำหนด ในมาตราฐานกำหนดตำแหน่ง",
default: false,
})
isHaveSpecificQft: boolean;
@Column({
comment:
"มีใบอนุญาตประกอบวิชาชีพของสายงานต่างๆ และ/หรือ คุณวุฒิเพิ่มเติมครบถ้วนตามที่ ก.ก. กำหนด (แพทย์พยาบาล วิศวกรโยธา สถาปนิก ฯลฯ)",
default: false,
})
isHaveProLicense: boolean;
@Column({
comment:
"มีระยะเวลาขั้นต่ำในการดำรงตำแหน่งหรือเคยดำรงตำแหน่งในสายงานที่จะคัดเลือกตามคุณวุฒิของบุคคลและระดับตำแหน่งที่จะคัดเลือก",
default: false,
})
isHaveMinPeriodOrHoldPos: boolean;
@Column({ nullable: true, comment: "เหตุผล" })
reason: string;
@Column({ nullable: true, comment: "ประสบการณ์ในการปฏิบัติงาน" })
experience: string;
@Column({ nullable: true, comment: "ชื่อ-นามสกุล ผู้บังคับบัญชาชั้นต้น" })
commanderFullname: string;
@Column({ nullable: true, comment: "ตำแหน่ง ผู้บังคับบัญชาชั้นต้น" })
commanderPosition: string;
@Column({ nullable: true, comment: "ชื่อ-นามสกุล ผู้บังคับบัญชาเหนือขึ้นไป 1 ระดับ" })
commanderAboveFullname: string;
@Column({ nullable: true, comment: "ตำแหน่ง ผู้บังคับบัญชาเหนือขึ้นไป 1 ระดับ" })
commanderAbovePosition: string;
@Column({ nullable: true, comment: "ชื่อ-นามสกุล ผู้บังคับบัญชาชั้นต้น (จัดเตรียมเอกสารเล่ม 2)" })
commanderFullnameDoc2: string;
@Column({ nullable: true, comment: "ตำแหน่ง ผู้บังคับบัญชาชั้นต้น (จัดเตรียมเอกสารเล่ม 2)" })
commanderPositionDoc2: string;
@Column({
nullable: true,
comment: "ชื่อ-นามสกุล ผู้บังคับบัญชาเหนือขึ้นไป 1 ระดับ (จัดเตรียมเอกสารเล่ม 2)",
})
commanderAboveFullnameDoc2: string;
@Column({
nullable: true,
comment: "ตำแหน่ง ผู้บังคับบัญชาเหนือขึ้นไป 1 ระดับ (จัดเตรียมเอกสารเล่ม 2)",
})
commanderAbovePositionDoc2: string;
@Column({ nullable: true, comment: "วันที่ประกาศบนเว็บไซต์" })
dateAnnounce: Date;
@Column({ nullable: true, comment: "วันที่จัดเตรียมเอกสารเล่ม 2" })
datePrepareDoc2: Date;
@Column({ nullable: true, comment: "ชื่อเจ้าของผลงาน" })
author: string;
@Column({ nullable: true, comment: "ชื่อผลงาน" })
subject: string;
@Column({ nullable: true, comment: "ชื่อเจ้าของผลงาน2" })
authorDoc2: string;
@Column({ nullable: true, comment: "ชื่อผลงาน2" })
subjectDoc2: string;
@Column({ nullable: true, comment: "ตำแหน่งที่ได้รับมอบหมาย" })
assignedPosition: string;
@Column({ nullable: true, comment: "ผลการประเมิน", default: "PENDING" }) //PENDING,PASS,NOTPASS
evaluationResult: string;
@OneToMany(() => EvaluationLogs, (evaluationLogs) => evaluationLogs.evaluation)
evaluationLogs: EvaluationLogs[];
@OneToMany(() => Education, (education) => education.evaluation)
education: Education[];
@OneToMany(() => Certificate, (certificate) => certificate.evaluation)
certificate: Certificate[];
@OneToMany(() => Salary, (salary) => salary.evaluation)
salaries: Salary[];
@OneToMany(() => Training, (training) => training.evaluation)
training: Training[];
@OneToMany(() => Assessment, (assessment) => assessment.evaluation)
assessment: Assessment[];
@ManyToMany(() => Director, (director) => director.evaluations)
@JoinTable()
directors: Director[];
@ManyToMany(() => Meeting, (meeting) => meeting.evaluations)
@JoinTable()
meetings: Meeting[];
}
export class CreateEvaluation {
@Column()
userId?: string;
@Column()
citizenId?: string;
@Column()
prefix?: string;
@Column()
fullName: string;
@Column()
position?: string | null;
@Column()
oc?: string | null;
@Column()
salary?: string | null;
@Column()
positionLevel?: string | null;
@Column()
posNo?: string | null;
@Column()
birthDate?: string | null;
@Column()
govAge?: string | null;
@Column()
type?: string | null;
@Column()
step?: string | null;
@Column()
isEducationalQft: boolean; //ReqField
@Column()
isGovermantServiceHtr: boolean; //ReqField
@Column()
isOperatingExp: boolean; //ReqField
@Column()
isMinPeriodOfTenure: boolean; //ReqField
@Column()
isHaveSpecificQft: boolean; //ReqField
@Column()
isHaveProLicense: boolean; //ReqField
@Column()
isHaveMinPeriodOrHoldPos: boolean; //ReqField
@Column()
reason?: string | null;
@Column()
educations?: CreateEducation[];
@Column()
certificates?: CreateCertificate[];
@Column()
salaries?: CreateSalary[];
@Column()
trainings?: CreateTraining[];
@Column()
assessments?: CreateAssessment[];
@Column()
root?: string | null;
@Column()
orgRootId?: string | null;
}
export class CreateEducation {
@Column()
educationLevel?: string | null;
@Column()
institute?: string | null;
@Column()
isDate?: boolean | null;
@Column()
startDate?: Date | null;
@Column()
endDate?: Date | null;
@Column()
finishDate?: Date | null;
@Column()
isEducation?: boolean | null;
@Column()
degree?: string | null;
@Column()
field?: string | null;
@Column()
fundName?: string | null;
@Column()
gpa?: string | null;
@Column()
country?: string | null;
@Column()
other?: string | null;
@Column()
duration?: string | null;
@Column()
durationYear?: string | null;
}
export class CreateCertificate {
@Column()
step?: string | null;
@Column()
certificateType?: string | null;
@Column()
issuer?: string | null;
@Column()
certificateNo?: string | null;
@Column()
issueDate?: Date | null;
@Column()
expireDate?: Date | null;
}
export class CreateSalary {
@Column()
step?: string | null;
@Column()
date?: Date | null;
@Column()
amount?: number | null;
@Column()
positionSalaryAmount?: number | null;
@Column()
mouthSalaryAmount?: number | null;
@Column()
position?: string | null;
@Column()
posNo?: string | null;
@Column()
salaryClass?: string | null;
@Column()
salaryRef?: string | null;
@Column()
refCommandNo?: string | null;
@Column()
refCommandDate?: Date | null;
@Column()
salaryStatus?: string | null;
}
export class CreateTraining {
@Column()
name?: string | null;
@Column()
topic?: string | null;
@Column()
startDate?: Date | null;
@Column()
endDate?: Date | null;
@Column()
yearly?: number | null;
@Column()
place?: string | null;
@Column()
duration?: string | null;
@Column()
department?: string | null;
@Column()
numberOrder?: string | null;
@Column()
dateOrder?: Date | null;
}
export class CreateAssessment {
@Column()
date?: Date | null;
@Column()
point1Total?: number | null;
@Column()
point1?: number | null;
@Column()
point2Total?: number | null;
@Column()
point2?: number | null;
@Column()
pointSumTotal?: number | null;
@Column()
pointSum?: number | null;
}
export class CreateEvaluationExpertise {
@Column()
author?: string | null;
@Column()
subject?: string | null;
@Column()
commanderFullname?: string | null;
@Column()
commanderPosition?: string | null;
@Column()
commanderAboveFullname?: string | null;
@Column()
commanderAbovePosition?: string | null;
@Column()
oc?: string | null;
@Column()
citizenId?: string | null;
@Column()
prefix?: string | null;
@Column()
fullName?: string | null;
@Column()
position?: string | null;
@Column()
salary?: string | null;
@Column()
positionLevel?: string | null;
@Column()
posNo?: string | null;
@Column()
birthDate?: string | null;
@Column()
govAge?: string | null;
}
export type UpdateEvaluation = Partial<Evaluation>;