hrms-api-org/src/entities/ProfileDutyHistory.ts
2024-03-21 14:29:45 +07:00

67 lines
1.5 KiB
TypeScript

import { Entity, Column, ManyToOne, JoinColumn } from "typeorm";
import { EntityBase } from "./base/Base";
import { Profile } from "./Profile";
import { ProfileDuty } from "./ProfileDuty";
@Entity("profileDutyHistory")
export class ProfileDutyHistory extends EntityBase {
@Column({
nullable: true,
type: "datetime",
comment: "เริ่มต้น",
default: null,
})
dateStart: Date;
@Column({
nullable: true,
type: "datetime",
comment: "สิ้นสุด",
default: null,
})
dateEnd: Date;
@Column({
nullable: true,
comment: "รายละเอียด",
type: "text",
default: null,
})
detail: string;
@Column({
nullable: true,
comment: "เอกสารอ้างอิง",
type: "text",
default: null,
})
reference: string;
@Column({
nullable: true,
type: "datetime",
comment: "เอกสารอ้างอิง (ลงวันที่)",
default: null,
})
refCommandDate: Date;
@Column({
nullable: true,
comment: "เอกสารอ้างอิง (เลขที่คำสั่ง)",
type: "text",
default: null,
})
refCommandNo: string;
@Column({
nullable: true,
length: 40,
comment: "คีย์นอก(FK)ของตาราง ProfileDuty",
default: null,
})
profileDutyId: string;
@ManyToOne(() => ProfileDuty, (profileDuty) => profileDuty.profileDutyHistories)
@JoinColumn({ name: "profileDutyId" })
histories: ProfileDuty;
}