hrms-api-org/src/entities/ProfileActpositionHistory.ts
2025-01-27 10:23:28 +07:00

57 lines
1.3 KiB
TypeScript

import { Entity, Column, ManyToOne, JoinColumn } from "typeorm";
import { EntityBase } from "./base/Base";
import { ProfileActposition } from "./ProfileActposition";
@Entity("profileActpositionHistory")
export class ProfileActpositionHistory 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: "ตำแหน่งเลขที่",
default: null,
})
posNo: string;
@Column({
nullable: true,
comment: "ตำแหน่ง",
default: null,
})
position: string;
@Column({
comment: "สถานะ",
default: false,
})
status: boolean;
@Column({
nullable: true,
length: 40,
comment: "คีย์นอก(FK)ของตาราง ProfileActposition",
default: null,
})
profileActpositionId: string;
@ManyToOne(
() => ProfileActposition,
(profileActposition) => profileActposition.profileActpositionHistorys,
)
@JoinColumn({ name: "profileActpositionId" })
histories: ProfileActposition;
}