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

89 lines
2.1 KiB
TypeScript
Raw Normal View History

import { Column, Entity, ManyToOne, JoinColumn } from "typeorm";
2024-03-20 16:16:44 +07:00
import { EntityBase } from "./base/Base";
import { Profile } from "./Profile";
import { ProfileEmployee } from "./ProfileEmployee";
2024-03-20 16:16:44 +07:00
@Entity("profileGovernment")
export class ProfileGovernment extends EntityBase {
@Column({
nullable: true,
length: 40,
comment: "คีย์นอก(FK)ของตาราง Profile",
default: null,
})
profileId: string;
@Column({
nullable: true,
length: 40,
comment: "คีย์นอก(FK)ของตาราง ProfileEmployee",
default: null,
})
profileEmployeeId: string;
2024-03-20 16:16:44 +07:00
@Column({
nullable: true,
type: "datetime",
comment: "วันที่บรรจุ",
2024-03-20 16:16:44 +07:00
default: null,
})
dateAppoint: Date;
@Column({
nullable: true,
type: "datetime",
comment: "วันที่เริ่มปฏิบัติราชการ",
2024-03-20 16:16:44 +07:00
default: null,
})
dateStart: Date;
@Column({
nullable: true,
comment: "ขาดราชการ",
default: null,
})
govAgeAbsent: number;
2024-03-22 17:56:02 +07:00
@Column({
nullable: true,
comment: "อายุราชการเกื้อกูล",
2024-03-22 17:56:02 +07:00
default: null,
})
govAgePlus: number;
@Column({
nullable: true,
comment: "เหตุผลกรณีวันไม่ตรงกัน",
length: 255,
default: null,
})
reasonSameDate: string;
@ManyToOne(() => Profile, (v) => v.profileGovernment)
@JoinColumn({ name: "profileId" })
profile: Profile;
2024-05-14 16:20:18 +07:00
@ManyToOne(() => ProfileEmployee, (v) => v.profileGovernment)
@JoinColumn({ name: "profileEmployeeId" })
profileEmployee: ProfileEmployee;
2024-03-20 16:16:44 +07:00
}
2024-03-22 16:32:15 +07:00
2024-03-20 16:16:44 +07:00
export type CreateProfileGovernment = {
2024-03-22 17:56:02 +07:00
profileId: string;
dateAppoint?: Date | null;
dateStart?: Date | null;
reasonSameDate?: string | null;
2024-03-20 16:16:44 +07:00
};
export type CreateProfileEmployeeGovernment = {
profileEmployeeId: string;
dateAppoint?: Date | null;
dateStart?: Date | null;
reasonSameDate?: string | null;
};
2024-03-20 16:16:44 +07:00
export type UpdateProfileGovernment = {
dateAppoint?: Date | null;
dateStart?: Date | null;
reasonSameDate?: string | null;
2024-03-20 16:16:44 +07:00
};