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

56 lines
1.4 KiB
TypeScript

import { Entity, Column, OneToMany, ManyToOne, JoinColumn } from "typeorm";
import { EntityBase } from "./base/Base";
import { KpiPeriod } from "./kpiPeriod";
import { KpiUserSpecial } from "./kpiUserSpecial";
import { KpiUserRole } from "./kpiUserRole";
import { KpiUserPlanned } from "./kpiUserPlanned";
import { KpiUserCapacity } from "./kpiUserCapacity";
import { KpiUserEvaluation } from "./kpiUserEvaluation";
@Entity("kpiUserEvaluationReason")
export class KpiUserEvaluationReason extends EntityBase {
@Column({
nullable: true,
comment: "หมายเหตุ",
length: 255,
default: null,
})
reason: string;
@Column({
nullable: true,
comment: "หัวข้อ",
length: 255,
default: null,
})
topic: string;
@Column({
nullable: true,
comment: "ประเภท",
length: 255,
default: null,
})
type: string;
@Column({
nullable: true,
length: 40,
comment: "คีย์นอก(FK)ของตาราง kpiPeriodId",
default: null,
})
kpiUserEvaluationId: string;
@ManyToOne(
() => KpiUserEvaluation,
(kpiUserEvaluation) => kpiUserEvaluation.kpiUserEvaluationReasons,
)
@JoinColumn({ name: "kpiUserEvaluationId" })
kpiUserEvaluation: KpiUserEvaluation;
}
export class updateKpiUserReasonEvaluation {
@Column()
reason: string | null;
@Column()
topic: string | null;
}