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

284 lines
6.3 KiB
TypeScript
Raw Normal View History

2024-03-12 14:53:15 +07:00
import { Entity, Column, ManyToOne, JoinColumn, OneToMany } from "typeorm";
import { EntityBase } from "./base/Base";
import { Profile } from "./Profile";
import { ProfileEducationHistory } from "./ProfileEducationHistory";
2024-05-13 17:21:19 +07:00
import { ProfileEmployee } from "./ProfileEmployee";
2024-03-12 14:53:15 +07:00
@Entity("profileEducation")
export class ProfileEducation extends EntityBase {
@Column({
nullable: true,
length: 40,
comment: "คีย์นอก(FK)ของตาราง Profile",
default: null,
})
profileId: string;
@Column({
nullable: true,
comment: "ประเทศ",
length: 1000,
default: null,
})
country: string;
@Column({
nullable: true,
comment: "วุฒิการศึกษา",
length: 200,
default: null,
})
degree: string;
@Column({
nullable: true,
comment: "ระยะเวลา",
length: 1000,
default: null,
})
duration: string;
@Column({
comment: "ระยะเวลาหลักสูตร",
2024-05-15 18:06:28 +07:00
nullable: true,
2024-03-12 14:53:15 +07:00
})
durationYear: number;
@Column({
nullable: true,
comment: "สาขาวิชา/ทาง",
length: 200,
default: null,
})
field: string;
@Column({
nullable: true,
type: "datetime",
comment: "วันที่สำเร็จการศึกษา",
default: null,
})
finishDate: Date;
@Column({
nullable: true,
comment: "ทุน",
length: 1000,
default: null,
})
fundName: string;
@Column({
nullable: true,
comment: "เกรดเฉลี่ย",
length: 20,
default: null,
})
gpa: string;
@Column({
nullable: true,
comment: "สถานศึกษา",
length: 1000,
default: null,
})
institute: string;
@Column({
nullable: true,
comment: "ข้อมูลการติดต่อ",
length: 1000,
default: null,
})
other: string;
@Column({
nullable: true,
type: "datetime",
comment: "ตั้งแต่",
default: null,
})
startDate: Date;
@Column({
nullable: true,
type: "datetime",
comment: "ถึง",
default: null,
})
endDate: Date;
@Column({
nullable: true,
comment: "ระดับศึกษา",
2024-03-18 15:11:27 +07:00
type: "text", // ใช้ "text" แทน "string" เพื่อรองรับ long text
2024-03-12 14:53:15 +07:00
default: null,
})
educationLevel: string;
@Column({
nullable: true,
length: 40,
comment: "Id ระดับศึกษา",
default: null,
})
educationLevelId: string;
@Column({
nullable: true,
comment: "เป็นวุฒิการศึกษาในตำแหน่ง",
type: "text",
default: null,
})
positionPath: string;
2024-03-18 14:45:14 +07:00
@Column({
nullable: true,
comment: "หมายเหตุ",
default: null,
})
note: string;
2024-03-12 14:53:15 +07:00
@Column({
nullable: true,
length: 40,
comment: "Id เป็นวุฒิการศึกษาในตำแหน่ง",
default: null,
})
positionPathId: string;
@Column({
nullable: true,
comment: "ประเภทช่วงเวลาการศึกษา",
default: null,
})
isDate: boolean;
@Column({
nullable: true,
comment: "เป็นวุฒิศึกษาในตำแหน่ง",
default: null,
})
isEducation: boolean;
2024-03-18 15:11:27 +07:00
2025-03-07 18:09:29 +07:00
@Column({
nullable: true,
comment: "เป็นวุฒิศึกษาสูงสุด",
default: null,
})
isHigh: boolean;
2025-01-06 23:58:24 +07:00
@Column({
nullable: true,
comment: "ใช้ประวัติการศึกษา",
default: null,
})
isUse: boolean;
2024-05-13 17:21:19 +07:00
@Column({
nullable: true,
length: 40,
comment: "คีย์นอก(FK)ของตาราง ProfileEmployee",
default: null,
})
profileEmployeeId: string;
2025-01-06 17:19:14 +07:00
@Column({
nullable: true,
2025-02-18 10:49:58 +07:00
comment: "ลำดับ",
2025-01-06 17:19:14 +07:00
default: null,
})
level: number;
2025-05-21 08:16:21 +07:00
@Column({
comment: "ข้อมูลจาก Entry",
default: false,
})
isEntry: boolean;
2024-03-18 15:11:27 +07:00
@OneToMany(
() => ProfileEducationHistory,
(profileEducationHistory) => profileEducationHistory.histories,
)
2024-03-12 14:53:15 +07:00
profileEducationHistories: ProfileEducationHistory[];
@ManyToOne(() => Profile, (profile) => profile.profileEducations)
@JoinColumn({ name: "profileId" })
profile: Profile;
2024-05-13 17:21:19 +07:00
@ManyToOne(() => ProfileEmployee, (ProfileEmployee) => ProfileEmployee.profileEducations)
@JoinColumn({ name: "profileEmployeeId" })
profileEmployee: ProfileEmployee;
2024-03-12 14:53:15 +07:00
}
export class CreateProfileEducation {
profileId: string | null;
country: string | null;
degree: string | null;
duration: string | null;
2024-05-16 10:32:51 +07:00
durationYear?: number | null;
2024-05-14 10:29:05 +07:00
field: string | null;
finishDate: Date | null;
fundName: string | null;
gpa: string | null;
institute: string | null;
other: string | null;
startDate: Date | null;
endDate: Date | null;
educationLevel: string | null;
educationLevelId: string | null;
positionPath: string | null;
positionPathId: string | null;
isDate: boolean | null;
isEducation: boolean | null;
2025-03-11 10:36:59 +07:00
isHigh?: boolean | null;
2024-05-14 10:29:05 +07:00
note: string | null;
}
export class CreateProfileEducationEmployee {
profileEmployeeId: string | null;
country: string | null;
degree: string | null;
duration: string | null;
2024-05-16 10:32:51 +07:00
durationYear?: number | null;
2024-03-12 14:53:15 +07:00
field: string | null;
finishDate: Date | null;
fundName: string | null;
gpa: string | null;
institute: string | null;
other: string | null;
startDate: Date | null;
endDate: Date | null;
educationLevel: string | null;
educationLevelId: string | null;
positionPath: string | null;
positionPathId: string | null;
isDate: boolean | null;
isEducation: boolean | null;
2025-03-11 10:36:59 +07:00
isHigh?: boolean | null;
2024-03-18 15:11:17 +07:00
note: string | null;
2024-03-12 14:53:15 +07:00
}
export type UpdateProfileEducation = {
country?: string | null;
degree?: string | null;
duration?: string | null;
2024-05-16 10:32:51 +07:00
durationYear?: number | null;
field?: string | null;
finishDate?: Date | null;
fundName?: string | null;
gpa?: string | null;
institute?: string | null;
other?: string | null;
startDate?: Date | null;
endDate?: Date | null;
educationLevel?: string | null;
educationLevelId?: string | null;
positionPath?: string | null;
positionPathId?: string | null;
isDate?: boolean | null;
isEducation?: boolean | null;
2025-03-11 10:36:59 +07:00
isHigh?: boolean | null;
note?: string | null;
};