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

118 lines
2.9 KiB
TypeScript
Raw Normal View History

2024-04-22 10:22:14 +07:00
import { Entity, Column, OneToMany, ManyToOne, JoinColumn } from "typeorm";
import { EntityBase } from "./base/Base";
import { KpiPeriod } from "./kpiPeriod";
2024-04-22 15:50:04 +07:00
import { KpiUserSpecial } from "./kpiUserSpecial";
import { KpiUserRole } from "./kpiUserRole";
import { KpiUserPlanned } from "./kpiUserPlanned";
2024-04-22 16:30:24 +07:00
import { KpiUserCapacity } from "./kpiUserCapacity";
2024-04-22 10:22:14 +07:00
@Entity("kpiUserEvaluation")
export class KpiUserEvaluation extends EntityBase {
@Column({
nullable: true,
comment: "คำนำหน้า",
length: 255,
default: null,
})
prefix: string;
@Column({
nullable: true,
comment: "ชื่อ",
length: 255,
default: null,
})
firstName: string;
@Column({
nullable: true,
comment: "สกุล",
length: 255,
default: null,
})
lastName: string;
@Column({
nullable: true,
length: 40,
comment: "คีย์นอก(FK)ของตาราง kpiPeriodId",
default: null,
})
kpiPeriodId: string;
@Column({
nullable: true,
length: 40,
comment: "ไอดีโปรไฟล์",
default: null,
})
profileId: string;
2024-04-22 16:30:24 +07:00
@Column({
// PENDING = รอการประเมิน , INPROGRESS = กําลังประเมิน , DONE = ประเมินเสร็จสิ้น
nullable: true,
2024-04-22 15:14:58 +07:00
length: 40,
2024-04-22 16:30:24 +07:00
comment: "สถานะการประเมินผล",
2024-04-22 15:14:58 +07:00
default: null,
})
evaluationStatus: string;
2024-04-22 16:30:24 +07:00
@Column({
// PASSED = ผ่านการประเมิน , NOTPASSED = ไม่ผ่านการประเมิน
nullable: true,
2024-04-22 15:14:58 +07:00
length: 40,
2024-04-22 16:30:24 +07:00
comment: "ผลการประเมิน",
2024-04-22 15:14:58 +07:00
default: null,
})
evaluationResults: string;
2024-04-22 16:30:24 +07:00
@ManyToOne(() => KpiPeriod, (kpiPeriod) => kpiPeriod.kpiUserEvaluations)
2024-04-22 10:22:14 +07:00
@JoinColumn({ name: "kpiPeriodId" })
kpiPeriod: KpiPeriod;
2024-04-22 15:50:04 +07:00
2024-04-22 16:30:24 +07:00
@OneToMany(() => KpiUserCapacity, (kpiUserCapacity) => kpiUserCapacity.kpiUserEvaluation)
kpiUserCapacitys: KpiUserCapacity[];
2024-04-22 15:50:04 +07:00
2024-04-22 16:30:24 +07:00
@OneToMany(() => KpiUserPlanned, (kpiUserPlanned) => kpiUserPlanned.kpiUserEvaluation)
2024-04-22 15:50:04 +07:00
kpiUserPlanneds: KpiUserPlanned[];
2024-04-22 16:30:24 +07:00
@OneToMany(() => KpiUserRole, (kpiUserRole) => kpiUserRole.kpiUserEvaluation)
2024-04-22 15:50:04 +07:00
kpiUserRoles: KpiUserRole[];
2024-04-22 16:30:24 +07:00
@OneToMany(() => KpiUserSpecial, (kpiUserSpecial) => kpiUserSpecial.kpiUserEvaluation)
2024-04-22 15:50:04 +07:00
kpiUserSpecials: KpiUserSpecial[];
2024-04-22 10:22:14 +07:00
}
export class createKpiUserEvaluation {
@Column()
prefix: string;
@Column()
firstName: string;
@Column()
lastName: string;
@Column()
kpiPeriodId: string;
@Column()
profileId: string;
2024-04-22 15:14:58 +07:00
@Column()
evaluationStatus: string;
@Column()
evaluationResults: string;
2024-04-22 10:22:14 +07:00
}
export class updateKpiUserEvaluation {
@Column()
prefix: string;
@Column()
firstName: string;
@Column()
lastName: string;
@Column()
kpiPeriodId: string;
@Column()
profileId: string;
2024-04-22 15:14:58 +07:00
@Column()
evaluationStatus: string;
@Column()
evaluationResults: string;
2024-04-22 10:22:14 +07:00
}