hrms-api-development/src/entities/DevelopmentHistory.ts

199 lines
4.5 KiB
TypeScript
Raw Normal View History

import { Entity, Column, ManyToOne, JoinColumn } from "typeorm";
import { EntityBase } from "./base/Base";
import { PosLevel } from "./PosLevel";
import { PosType } from "./PosType";
import { Development } from "./Development";
import { EmployeePosType } from "./EmployeePosType";
import { EmployeePosLevel } from "./EmployeePosLevel";
@Entity("developmentHistory")
export class DevelopmentHistory extends EntityBase {
@Column({
nullable: true,
comment: "ประเภทราชการ",
length: 40,
default: null,
})
type: string;
@Column({
nullable: true,
comment: "ยศ",
length: 40,
default: null,
})
rank: string;
@Column({
nullable: true,
comment: "คำนำหน้าชื่อ",
length: 40,
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,
comment: "เลขประจำตัวประชาชน",
default: null,
length: 13,
})
citizenId: string;
@Column({
nullable: true,
comment: "ตำแหน่ง",
default: null,
length: 255,
})
position: string;
@Column({
nullable: true,
comment: "ชื่อตำแหน่งทางการบริหาร",
length: 255,
default: null,
})
posExecutive: string;
@Column({
nullable: true,
length: 40,
comment: "ไอดีระดับตำแหน่ง",
})
posLevelId: string | null;
@ManyToOne(() => PosLevel, (posLevel) => posLevel.developmentHistorys)
@JoinColumn({ name: "posLevelId" })
posLevel: PosLevel;
@Column({
nullable: true,
length: 40,
comment: "ไอดีประเภทตำแหน่ง",
})
posTypeId: string | null;
@ManyToOne(() => PosType, (posType) => posType.developmentHistorys)
@JoinColumn({ name: "posTypeId" })
posType: PosType;
@Column({
nullable: true,
length: 40,
comment: "ไอดีระดับตำแหน่ง",
})
employeePosLevelId: string | null;
@ManyToOne(() => EmployeePosLevel, (employeePosLevel) => employeePosLevel.developmentHistorys)
@JoinColumn({ name: "employeePosLevelId" })
employeePosLevel: EmployeePosLevel;
@Column({
nullable: true,
length: 40,
comment: "ไอดีประเภทตำแหน่ง",
})
employeePosTypeId: string | null;
@ManyToOne(() => EmployeePosType, (employeePosType) => employeePosType.developmentHistorys)
@JoinColumn({ name: "employeePosTypeId" })
employeePosType: EmployeePosType;
@Column({
nullable: true,
comment: "โครงการ/หลักสูตรการฝึกอบรม",
default: null,
})
developmentId: string;
@ManyToOne(() => Development, (development: Development) => development.developmentHistorys)
@JoinColumn({ name: "developmentId" })
development: Development;
@Column({
nullable: true,
comment: "เลขที่คำสั่ง/เลขที่หนังสืออนุมัติ",
default: null,
length: 255,
})
order: string;
@Column({
nullable: true,
2024-04-03 16:14:00 +07:00
type: "datetime",
comment: "คำสั่งลงวันที่/หนังสืออนุมัติลงวันที่",
default: null,
})
2024-04-03 16:14:00 +07:00
dateOrder: Date;
}
export class CreateDevelopmentHistory {
@Column()
rank: string | null;
@Column()
prefix: string | null;
@Column()
firstName: string | null;
@Column()
lastName: string | null;
@Column()
citizenId: string;
@Column()
position: string | null;
@Column()
posExecutive: string | null;
@Column()
posLevelId: string | null;
@Column()
posTypeId: string | null;
@Column()
developmentId: string;
@Column()
order: string | null;
@Column()
2024-04-03 16:14:00 +07:00
dateOrder: Date | null;
}
export class UpdateDevelopmentHistory {
@Column()
rank: string | null;
@Column()
prefix: string | null;
@Column()
firstName: string | null;
@Column()
lastName: string | null;
@Column()
citizenId: string;
@Column()
position: string | null;
@Column()
posExecutive: string | null;
@Column()
posLevelId: string | null;
@Column()
posTypeId: string | null;
@Column()
developmentId: string;
@Column()
order: string | null;
@Column()
2024-04-03 16:14:00 +07:00
dateOrder: Date | null;
}