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

67 lines
1.5 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-22 15:50:04 +07:00
}