hrms-api-org/src/entities/ProfileDevelopment.ts

189 lines
4.6 KiB
TypeScript
Raw Normal View History

2024-08-27 09:21:22 +07:00
import { Entity, Column, OneToMany, ManyToOne, JoinColumn } from "typeorm";
import { EntityBase } from "./base/Base";
import { Profile } from "./Profile";
import { ProfileEmployee } from "./ProfileEmployee";
import { ProfileDevelopmentHistory } from "./ProfileDevelopmentHistory";
@Entity("profileDevelopment")
export class ProfileDevelopment extends EntityBase {
2024-08-27 13:21:13 +07:00
@Column({
nullable: true,
length: 40,
comment: "คีย์นอก(FK)ของตาราง Profile",
default: null,
})
profileId: string;
@Column({
nullable: true,
length: 40,
comment: "คีย์นอก(FK)ของตาราง ProfileEmployee",
default: null,
})
profileEmployeeId: string;
@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;
2024-08-27 17:30:19 +07:00
@Column({
nullable: true,
length: 40,
comment: "id kpi development",
default: null,
})
kpiDevelopmentId: string;
2024-08-27 13:21:13 +07:00
@OneToMany(
() => ProfileDevelopmentHistory,
(profileDevelopmentHistory) => profileDevelopmentHistory.histories,
)
2024-08-27 09:21:22 +07:00
profileDevelopmentHistories: ProfileDevelopmentHistory[];
@ManyToOne(() => Profile, (profile) => profile.profileDevelopments)
@JoinColumn({ name: "profileId" })
profile: Profile;
@ManyToOne(() => ProfileEmployee, (ProfileEmployee) => ProfileEmployee.profileDevelopments)
@JoinColumn({ name: "profileEmployeeId" })
profileEmployee: ProfileEmployee;
}
export class CreateProfileDevelopment {
profileId: string | null;
2024-09-25 11:17:38 +07:00
name: string | null;
2024-08-27 09:21:22 +07:00
target: string | null;
achievement10?: string | null;
achievement5?: string | null;
achievement0?: string | null;
2024-08-27 17:30:19 +07:00
kpiDevelopmentId?: string | null;
2024-09-25 11:17:38 +07:00
reasonDevelopment70?: string | null;
reasonDevelopment20?: string | null;
reasonDevelopment10?: string | null;
isDevelopment70: boolean | null;
isDevelopment20: boolean | null;
isDevelopment10: boolean | null;
summary?: number | null;
point?: number | null;
2024-08-27 09:21:22 +07:00
}
export class CreateProfileEmployeeDevelopment {
profileEmployeeId: string | null;
2024-09-25 11:17:38 +07:00
name: string | null;
2024-08-27 09:21:22 +07:00
target: string | null;
achievement10?: string | null;
achievement5?: string | null;
achievement0?: string | null;
2024-09-25 11:17:38 +07:00
kpiDevelopmentId?: string | null;
reasonDevelopment70?: string | null;
reasonDevelopment20?: string | null;
reasonDevelopment10?: string | null;
isDevelopment70: boolean | null;
isDevelopment20: boolean | null;
isDevelopment10: boolean | null;
summary?: number | null;
point?: number | null;
2024-08-27 09:21:22 +07:00
}
export type UpdateProfileDevelopment = {
2024-09-25 11:17:38 +07:00
name: string | null;
2024-08-27 13:21:13 +07:00
target: string | null;
achievement10?: string | null;
achievement5?: string | null;
achievement0?: string | null;
2024-09-25 11:17:38 +07:00
kpiDevelopmentId?: string | null;
reasonDevelopment70?: string | null;
reasonDevelopment20?: string | null;
reasonDevelopment10?: string | null;
isDevelopment70: boolean | null;
isDevelopment20: boolean | null;
isDevelopment10: boolean | null;
summary?: number | null;
point?: number | null;
2024-08-27 09:21:22 +07:00
};