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

179 lines
3.6 KiB
TypeScript
Raw Normal View History

2024-04-22 15:50:04 +07:00
import { Entity, Column, ManyToOne, JoinColumn } from "typeorm";
import { EntityBase } from "./base/Base";
import { KpiUserEvaluation } from "./kpiUserEvaluation";
import { KpiPlan } from "./kpiPlan";
@Entity("kpiUserPlanned")
export class KpiUserPlanned extends EntityBase {
@Column({
nullable: true,
comment: "ค่าเป้าหมาย",
default: null,
})
target: string;
@Column({
nullable: true,
comment: "หน่วยนับ",
default: null,
})
unit: number;
@Column({
nullable: true,
comment: "น้ำหนัก",
default: null,
})
weight: number;
@Column({
nullable: true,
comment: "นิยามหรือความหมาย",
default: null,
})
meaning: string;
@Column({
nullable: true,
comment: "สูตรคำนวณ",
default: null,
})
formula: string;
@Column({
nullable: true,
length: 40,
comment: "คีย์นอก(FK)ของตาราง kpiUserEvaluation",
default: null,
})
kpiUserEvaluationId: string;
@ManyToOne(() => KpiUserEvaluation, (kpiUserEvaluation) => kpiUserEvaluation.kpiUserPlanneds)
@JoinColumn({ name: "kpiUserEvaluationId" })
2024-04-22 16:30:24 +07:00
kpiUserEvaluation: KpiUserEvaluation;
2024-04-22 15:50:04 +07:00
@Column({
nullable: true,
length: 40,
comment: "คีย์นอก(FK)ของตาราง kpiPlan",
default: null,
})
kpiPlanId: string;
@ManyToOne(() => KpiPlan, (kpiPlan) => kpiPlan.kpiUserPlanneds)
@JoinColumn({ name: "kpiPlanId" })
2024-04-22 16:30:24 +07:00
kpiPlan: KpiPlan;
2024-04-23 11:08:15 +07:00
@Column({
nullable: true,
comment: "ระดับคะแนน",
default: null,
})
point: number;
@Column({
type: "double",
nullable: true,
default: null,
comment: "ผลการประเมิน",
2024-04-23 11:08:15 +07:00
})
summary: number;
@Column({
nullable: true,
comment: "ข้อมูลเอกสารหลักฐาน",
default: null,
})
documentInfoEvidence: string;
@Column({
nullable: true,
type: "datetime",
comment: "ช่วงเวลาเริ่มเก็บข้อมูล",
default: null,
})
startDate: Date;
@Column({
nullable: true,
type: "datetime",
comment: "ช่วงเวลาสิ้นสุดเก็บข้อมูล",
default: null,
})
endDate: Date;
2024-05-08 10:04:33 +07:00
@Column({
nullable: true,
comment: "ผลสำเร็จของงาน 1",
default: null,
})
achievement1: string;
@Column({
nullable: true,
comment: "ผลสำเร็จของงาน 2",
default: null,
})
achievement2: string;
@Column({
nullable: true,
comment: "ผลสำเร็จของงาน 3",
default: null,
})
achievement3: string;
@Column({
nullable: true,
comment: "ผลสำเร็จของงาน 4",
default: null,
})
achievement4: string;
@Column({
nullable: true,
comment: "ผลสำเร็จของงาน 5",
default: null,
})
achievement5: string;
2024-04-22 15:50:04 +07:00
}
2024-04-22 18:13:30 +07:00
export class CreateKpiUserPlanned {
@Column()
target: string;
@Column()
unit: number;
@Column()
weight: number;
@Column()
meaning: string;
@Column()
formula: string;
@Column("uuid")
kpiUserEvaluationId: string;
@Column("uuid")
kpiPlanId: string;
}
export class UpdateKpiUserPlanned {
@Column()
target: string;
@Column()
unit: number;
@Column()
weight: number;
@Column()
meaning: string;
@Column()
formula: string;
2024-04-23 12:29:26 +07:00
@Column("uuid")
kpiUserEvaluationId: string;
@Column("uuid")
kpiPlanId: string;
2024-04-22 18:13:30 +07:00
}
2024-04-23 17:06:16 +07:00
export class KpiUserPlannedDataPoint {
id: string;
point: number;
}