add entity org part 1
This commit is contained in:
parent
0f7edf5d15
commit
f36ff656ef
13 changed files with 1783 additions and 1 deletions
146
src/entities/ProfileTrainingHistory.ts
Normal file
146
src/entities/ProfileTrainingHistory.ts
Normal file
|
|
@ -0,0 +1,146 @@
|
|||
import { Entity, Column, ManyToOne, JoinColumn, OneToMany } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { Profile } from "./Profile";
|
||||
import { ProfileTraining } from "./ProfileTraining";
|
||||
|
||||
@Entity("profileTrainingHistory")
|
||||
export class ProfileTrainingHistory extends EntityBase {
|
||||
|
||||
@Column({
|
||||
comment: "สถานะการใช้งาน",
|
||||
default: false,
|
||||
})
|
||||
isActive: boolean;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "datetime",
|
||||
comment: "วันเริ่มต้นการฝึกอบรม/ดูงาน",
|
||||
default: null,
|
||||
})
|
||||
startDate: Date;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "datetime",
|
||||
comment: "วันสิ้นสุดการฝึกอบรม/ดูงาน",
|
||||
default: null,
|
||||
})
|
||||
endDate: Date;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 200,
|
||||
comment: "เลขที่คำสั่ง/เลขที่หนังสืออนุมัติ",
|
||||
default: null,
|
||||
})
|
||||
numberOrder: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 200,
|
||||
comment: "หัวข้อการฝึกอบรม/ดูงาน",
|
||||
default: null,
|
||||
})
|
||||
topic: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 200,
|
||||
comment: "สถานที่ฝึกอบรม/ดูงาน",
|
||||
default: null,
|
||||
})
|
||||
place: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "datetime",
|
||||
comment: "คำสั่งลงวันที่/หนังสืออนุมัติลงวันที่",
|
||||
default: null,
|
||||
})
|
||||
dateOrder: Date;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 200,
|
||||
comment: "หน่วยงานที่รับผิดชอบจัดการฝึกอบรม/ดูงาน",
|
||||
default: null,
|
||||
})
|
||||
department: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 200,
|
||||
comment: "รวมระยะเวลาในการฝึกอบรม/ดูงาน",
|
||||
default: null,
|
||||
})
|
||||
duration: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 200,
|
||||
comment: "ชื่อโครงการ/หลักสูตรการฝึกอบรม",
|
||||
default: null,
|
||||
})
|
||||
name: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ปีที่อบรม (พ.ศ.)",
|
||||
default: null,
|
||||
})
|
||||
yearly: number;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 40,
|
||||
comment: "คีย์นอก(FK)ของตาราง ProfileTraining",
|
||||
default: null,
|
||||
})
|
||||
profileTrainingId: string;
|
||||
|
||||
@ManyToOne(() => ProfileTraining, (profileTraining) => profileTraining.profileTrainingHistories)
|
||||
@JoinColumn({ name: "profileTrainingId" })
|
||||
histories: ProfileTraining;
|
||||
}
|
||||
|
||||
export class CreateProfileTrainingHistory {
|
||||
|
||||
@Column()
|
||||
isActive: boolean;
|
||||
|
||||
@Column()
|
||||
startDate: Date | null;
|
||||
|
||||
@Column()
|
||||
endDate: Date | null;
|
||||
|
||||
@Column()
|
||||
numberOrder: string | null;
|
||||
|
||||
@Column()
|
||||
topic: string | null;
|
||||
|
||||
@Column()
|
||||
place: string | null;
|
||||
|
||||
@Column()
|
||||
dateOrder: Date | null;
|
||||
|
||||
@Column()
|
||||
department: string | null;
|
||||
|
||||
@Column()
|
||||
duration: string | null;
|
||||
|
||||
@Column()
|
||||
name: string | null;
|
||||
|
||||
@Column()
|
||||
yearly: number | null;
|
||||
|
||||
@Column("uuid")
|
||||
profileTrainingId: string | null;
|
||||
}
|
||||
|
||||
export type UpdateProfileTrainingHistory = Partial<CreateProfileTrainingHistory>;
|
||||
Loading…
Add table
Add a link
Reference in a new issue