hrms-api-org/src/entities/ProfileDevelopmentHistory.ts
2024-08-27 09:21:22 +07:00

114 lines
2.8 KiB
TypeScript

import { Entity, Column, ManyToOne, JoinColumn, OneToMany } from "typeorm";
import { EntityBase } from "./base/Base";
import { ProfileDevelopment } from "./ProfileDevelopment";
import { DevelopmentProject } from "./developmentProject";
@Entity("profileDevelopmentHistory")
export class ProfileDevelopmentHistory extends EntityBase {
@Column({
nullable: true,
comment: "ชื่อเรื่อง",
default: null,
})
name: string;
@Column({
nullable: true,
comment: "เป้าหมาย",
default: null,
})
target: string;
@Column({
type: "double",
nullable: true,
default: null,
comment: "ผลการประเมิน",
})
summary: number;
@Column({
nullable: true,
comment: "ระดับคะแนน",
default: null,
})
point: number;
@Column({
nullable: true,
comment: "เกณฑ์การประเมิน 10",
default: null,
})
achievement10: string;
@Column({
nullable: true,
comment: "เกณฑ์การประเมิน 5",
default: null,
})
achievement5: string;
@Column({
nullable: true,
comment: "เกณฑ์การประเมิน 0",
default: null,
})
achievement0: string;
@Column({
comment: "วิธีพัฒนา70",
default: false,
})
isDevelopment70: boolean;
@Column({
comment: "วิธีพัฒนา20",
default: false,
})
isDevelopment20: boolean;
@Column({
comment: "วิธีพัฒนา10",
default: false,
})
isDevelopment10: boolean;
@Column({
nullable: true,
comment: "รายละเอียดอื่นๆ 70 แผน",
default: null,
})
reasonDevelopment70: string;
@Column({
nullable: true,
comment: "รายละเอียดอื่นๆ 20 แผน",
default: null,
})
reasonDevelopment20: string;
@Column({
nullable: true,
comment: "รายละเอียดอื่นๆ 10 แผน",
default: null,
})
reasonDevelopment10: string;
@OneToMany(
() => DevelopmentProject,
(developmentHistoryProject: DevelopmentProject) => developmentHistoryProject.profileDevelopmentHistory,
)
developmentHistoryProjects: DevelopmentProject[];
@Column({
nullable: true,
length: 40,
comment: "คีย์นอก(FK)ของตาราง Profile",
default: null,
})
profileDevelopmentId: string;
@ManyToOne(() => ProfileDevelopment, (profileDevelopment) => profileDevelopment.profileDevelopmentHistories)
@JoinColumn({ name: "profileDevelopmentId" })
histories: ProfileDevelopment;
}