This commit is contained in:
Kittapath 2024-05-08 13:31:43 +07:00
parent f22cddbeee
commit 2d126a76d2
5 changed files with 183 additions and 1 deletions

View file

@ -4,6 +4,20 @@ import { KpiUserEvaluation } from "./kpiUserEvaluation";
@Entity("kpiSpecial")
export class KpiSpecial extends EntityBase {
@Column({
nullable: true,
comment: "รอบ",
default: null,
})
period: string;
@Column({
nullable: true,
comment: "ปี",
default: null,
})
year: string;
@Column({
nullable: true,
comment: "รหัสตัวชี้วัด",

View file

@ -0,0 +1,124 @@
import { Entity, Column, ManyToOne, JoinColumn } from "typeorm";
import { EntityBase } from "./base/Base";
import { KpiUserEvaluation } from "./kpiUserEvaluation";
@Entity("kpiUserDevelopment")
export class KpiUserDevelopment extends EntityBase {
@Column({
nullable: true,
comment: "ชื่อเรื่อง",
default: null,
})
name: string;
@Column({
nullable: true,
comment: "เป้าหมาย",
default: null,
})
target: string;
@Column({
type: "double",
nullable: true,
default: null,
comment: "ผลการประเมิน",
})
summary: number;
@Column({
nullable: true,
comment: "เกณฑ์การประเมิน 10",
default: null,
})
achievement10: string;
@Column({
nullable: true,
comment: "เกณฑ์การประเมิน 5",
default: null,
})
achievement5: string;
@Column({
nullable: true,
comment: "เกณฑ์การประเมิน 0",
default: null,
})
achievement0: string;
@Column({
nullable: true,
length: 40,
comment: "คีย์นอก(FK)ของตาราง kpiUserEvaluation",
default: null,
})
kpiUserEvaluationId: string;
@ManyToOne(() => KpiUserEvaluation, (kpiUserEvaluation) => kpiUserEvaluation.kpiUserDevelopments)
@JoinColumn({ name: "kpiUserEvaluationId" })
kpiUserEvaluation: KpiUserEvaluation;
}
export class CreateKpiUserSpecial {
@Column()
including: string | null;
@Column()
includingName: string | null;
@Column()
achievement1: string | null;
@Column()
achievement2: string | null;
@Column()
achievement3: string | null;
@Column()
achievement4: string | null;
@Column()
achievement5: string | null;
@Column()
target: string;
@Column()
unit: number;
@Column()
weight: number;
@Column()
meaning: string;
@Column()
formula: string;
@Column("uuid")
kpiUserEvaluationId: string;
}
export class UpdateKpiUserSpecial {
@Column()
including: string | null;
@Column()
includingName: string | null;
@Column()
achievement1: string | null;
@Column()
achievement2: string | null;
@Column()
achievement3: string | null;
@Column()
achievement4: string | null;
@Column()
achievement5: string | null;
@Column()
target: string;
@Column()
unit: number;
@Column()
weight: number;
@Column()
meaning: string;
@Column()
formula: string;
@Column("uuid")
kpiUserEvaluationId: string;
}
export class KpiUserSpecialDataPoint {
id: string;
point: number;
}

View file

@ -6,6 +6,7 @@ import { KpiUserRole } from "./kpiUserRole";
import { KpiUserPlanned } from "./kpiUserPlanned";
import { KpiUserCapacity } from "./kpiUserCapacity";
import { KpiUserEvaluationReason } from "./kpiUserEvaluationReason";
import { KpiUserDevelopment } from "./kpiUserDevelopment";
@Entity("kpiUserEvaluation")
export class KpiUserEvaluation extends EntityBase {
@Column({
@ -69,7 +70,7 @@ export class KpiUserEvaluation extends EntityBase {
nullable: true,
length: 40,
comment:
"สถานะการประเมินผล ดังนี้ PENDING = รอดำเนินการ, INPROGRESS = กําลังดำเนินการ, DONE = ประเมินเสร็จสิ้น",
"สถานะการประเมินผล ดังนี้ NEW = รอดำเนินการ, INPROGRESS = กําลังดำเนินการ, DONE = ประเมินเสร็จสิ้น",
default: null,
})
evaluationStatus: string;
@ -140,6 +141,9 @@ export class KpiUserEvaluation extends EntityBase {
@OneToMany(() => KpiUserSpecial, (kpiUserSpecial) => kpiUserSpecial.kpiUserEvaluation)
kpiUserSpecials: KpiUserSpecial[];
@OneToMany(() => KpiUserDevelopment, (kpiUserDevelopment) => kpiUserDevelopment.kpiUserEvaluation)
kpiUserDevelopments: KpiUserDevelopment[];
@OneToMany(
() => KpiUserEvaluationReason,
(kpiUserEvaluationReason) => kpiUserEvaluationReason.kpiUserEvaluation,

View file

@ -4,6 +4,20 @@ import { KpiUserEvaluation } from "./kpiUserEvaluation";
@Entity("kpiUserSpecial")
export class KpiUserSpecial extends EntityBase {
@Column({
nullable: true,
comment: "รอบ",
default: null,
})
period: string;
@Column({
nullable: true,
comment: "ปี",
default: null,
})
year: string;
@Column({
nullable: true,
comment: "รหัสตัวชี้วัด",