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

61 lines
1.5 KiB
TypeScript
Raw Normal View History

2024-04-22 15:50:04 +07:00
import { Entity, Column, OneToMany, ManyToOne, JoinColumn } from "typeorm";
import { EntityBase } from "./base/Base";
import { KpiCapacity } from "./kpiCapacity";
import { KpiUserEvaluation } from "./kpiUserEvaluation";
2024-04-22 16:30:24 +07:00
@Entity("kpiUserCapacity")
export class KpiUserCapacity extends EntityBase {
2024-04-23 11:15:53 +07:00
@Column({
nullable: true,
comment: "ระดับที่คาดหวัง",
default: null,
})
level: string;
@Column({
nullable: true,
comment: "น้ำหนัก",
default: null,
})
weight: number;
@Column({
nullable: true,
comment: "ระดับคะแนน",
default: null,
})
point: number;
@Column({
type: "double",
nullable: true,
default: null,
comment: "ผลการประเมิน",
})
summary: number;
2024-04-22 15:50:04 +07:00
@Column({
nullable: true,
length: 40,
comment: "คีย์นอก(FK)ของตาราง kpiUserEvaluation",
default: null,
})
kpiUserEvaluationId: string;
2024-04-22 16:30:24 +07:00
@ManyToOne(() => KpiUserEvaluation, (kpiUserEvaluation) => kpiUserEvaluation.kpiUserCapacitys)
2024-04-22 15:50:04 +07:00
@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)ของตาราง kpiCapacity",
default: null,
})
kpiCapacityId: string;
2024-04-22 16:30:24 +07:00
@ManyToOne(() => KpiCapacity, (kpiCapacity) => kpiCapacity.kpiUserCapacitys)
2024-04-22 15:50:04 +07:00
@JoinColumn({ name: "kpiCapacityId" })
2024-04-22 16:30:24 +07:00
kpiCapacity: KpiCapacity;
2024-04-22 15:50:04 +07:00
}