hrms-api-kpi/src/entities/kpiUserEvaluation.ts

205 lines
5.6 KiB
TypeScript
Raw Normal View History

2024-04-22 10:22:14 +07:00
import { Entity, Column, OneToMany, ManyToOne, JoinColumn } from "typeorm";
import { EntityBase } from "./base/Base";
import { KpiPeriod } from "./kpiPeriod";
2024-04-22 15:50:04 +07:00
import { KpiUserSpecial } from "./kpiUserSpecial";
import { KpiUserRole } from "./kpiUserRole";
import { KpiUserPlanned } from "./kpiUserPlanned";
2024-04-22 16:30:24 +07:00
import { KpiUserCapacity } from "./kpiUserCapacity";
import { KpiUserEvaluationReason } from "./kpiUserEvaluationReason";
2024-05-08 13:31:43 +07:00
import { KpiUserDevelopment } from "./kpiUserDevelopment";
2024-04-22 10:22:14 +07:00
@Entity("kpiUserEvaluation")
export class KpiUserEvaluation extends EntityBase {
@Column({
nullable: true,
comment: "คำนำหน้า",
length: 255,
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,
length: 40,
comment: "ไอดีโปรไฟล์",
default: null,
})
profileId: string;
@Column({
nullable: true,
length: 40,
comment: "ไอดีผู้ประเมิน",
default: null,
})
evaluatorId: string;
@Column({
nullable: true,
length: 40,
comment: "ไอดีผู้บังคับบัญชาเหนือขึ้นไป",
default: null,
})
commanderId: string;
@Column({
nullable: true,
length: 40,
comment: "ไอดีผู้บังคับบัญชาเหนือขึ้นไปอีกชั้นหนึ่ง",
default: null,
})
commanderHighId: string;
2024-04-22 16:30:24 +07:00
@Column({
2024-04-22 17:10:37 +07:00
// "สถานะการประเมินผล ดังนี้ PENDING = รอดำเนินการ, INPROGRESS = กําลังดำเนินการ, DONE = ประเมินเสร็จสิ้น",
2024-04-22 16:30:24 +07:00
nullable: true,
2024-04-22 15:14:58 +07:00
length: 40,
comment:
2024-05-08 13:31:43 +07:00
"สถานะการประเมินผล ดังนี้ NEW = รอดำเนินการ, INPROGRESS = กําลังดำเนินการ, DONE = ประเมินเสร็จสิ้น",
2024-05-08 14:03:13 +07:00
default: "NEW",
2024-04-22 15:14:58 +07:00
})
evaluationStatus: string;
2024-04-22 16:30:24 +07:00
@Column({
2024-04-22 17:10:37 +07:00
// "ผลการประเมิน ดังนี้ PENDING = รอดำเนินการ, PASSED = ผ่านการประเมิน, NOTPASSED = ไม่ผ่านการประเมิน",
2024-04-22 16:30:24 +07:00
nullable: true,
2024-04-22 15:14:58 +07:00
length: 40,
comment:
"ผลการประเมิน ดังนี้ PENDING = รอดำเนินการ, PASSED = ผ่านการประเมิน, NOTPASSED = ไม่ผ่านการประเมิน",
2024-04-22 15:14:58 +07:00
default: null,
})
evaluationResults: string;
@Column({
type: "double",
nullable: true,
default: null,
comment: "งานตามแผนปฏิบัติราชการประจำปี ร้อยละ",
})
plannedPoint: number;
@Column({
type: "double",
nullable: true,
default: null,
comment: "งานตามหน้าที่ความรับผิดชอบหลัก ร้อยละ",
})
rolePoint: number;
@Column({
type: "double",
nullable: true,
default: null,
comment: "งานที่ได้รับมอบหมายพิเศษ ร้อยละ",
})
specialPoint: number;
@Column({
type: "double",
nullable: true,
default: null,
comment: "สมรรถนะ ร้อยละ",
})
capacityPoint: number;
@Column({
nullable: true,
length: 40,
comment: "คีย์นอก(FK)ของตาราง kpiPeriodId",
default: null,
})
kpiPeriodId: string;
2024-04-22 16:30:24 +07:00
@ManyToOne(() => KpiPeriod, (kpiPeriod) => kpiPeriod.kpiUserEvaluations)
2024-04-22 10:22:14 +07:00
@JoinColumn({ name: "kpiPeriodId" })
kpiPeriod: KpiPeriod;
2024-04-22 15:50:04 +07:00
2024-04-22 16:30:24 +07:00
@OneToMany(() => KpiUserCapacity, (kpiUserCapacity) => kpiUserCapacity.kpiUserEvaluation)
kpiUserCapacitys: KpiUserCapacity[];
2024-04-22 15:50:04 +07:00
2024-04-22 16:30:24 +07:00
@OneToMany(() => KpiUserPlanned, (kpiUserPlanned) => kpiUserPlanned.kpiUserEvaluation)
2024-04-22 15:50:04 +07:00
kpiUserPlanneds: KpiUserPlanned[];
2024-04-22 16:30:24 +07:00
@OneToMany(() => KpiUserRole, (kpiUserRole) => kpiUserRole.kpiUserEvaluation)
2024-04-22 15:50:04 +07:00
kpiUserRoles: KpiUserRole[];
2024-04-22 16:30:24 +07:00
@OneToMany(() => KpiUserSpecial, (kpiUserSpecial) => kpiUserSpecial.kpiUserEvaluation)
2024-04-22 15:50:04 +07:00
kpiUserSpecials: KpiUserSpecial[];
2024-05-08 13:31:43 +07:00
@OneToMany(() => KpiUserDevelopment, (kpiUserDevelopment) => kpiUserDevelopment.kpiUserEvaluation)
kpiUserDevelopments: KpiUserDevelopment[];
@OneToMany(
() => KpiUserEvaluationReason,
(kpiUserEvaluationReason) => kpiUserEvaluationReason.kpiUserEvaluation,
)
kpiUserEvaluationReasons: KpiUserEvaluationReason[];
2024-04-22 10:22:14 +07:00
}
export class createKpiUserEvaluation {
@Column()
prefix: string;
@Column()
firstName: string;
@Column()
lastName: string;
@Column()
kpiPeriodId: string;
@Column()
profileId: string;
@Column()
evaluatorId: string | null;
@Column()
commanderId: string | null;
@Column()
commanderHighId: string | null;
2024-04-22 10:22:14 +07:00
}
export class updateKpiUserEvaluation {
@Column()
prefix: string;
@Column()
firstName: string;
@Column()
lastName: string;
@Column()
kpiPeriodId: string;
@Column()
profileId: string;
}
export class updateKpiUserCheckEvaluation {
@Column()
evaluatorId: string | null;
@Column()
commanderId: string | null;
@Column()
commanderHighId: string | null;
}
export class updateKpiUserPointEvaluation {
@Column()
plannedPoint: number | null;
@Column()
rolePoint: number | null;
@Column()
specialPoint: number | null;
@Column()
capacityPoint: number | null;
}