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

68 lines
1.5 KiB
TypeScript
Raw Normal View History

2024-03-13 10:43:50 +07:00
import { Entity, Column, ManyToOne, JoinColumn } from "typeorm";
import { EntityBase } from "./base/Base";
import { Profile } from "./Profile";
2024-03-13 15:33:02 +07:00
import { ProfileDuty } from "./ProfileDuty";
2024-03-13 10:43:50 +07:00
@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;
}