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

100 lines
2.2 KiB
TypeScript
Raw Normal View History

2024-03-13 10:43:50 +07:00
import { Entity, Column, ManyToOne, JoinColumn, OneToMany } from "typeorm";
import { EntityBase } from "./base/Base";
import { Profile } from "./Profile";
2024-03-13 10:43:50 +07:00
import { ProfileDisciplineHistory } from "./ProfileDisciplineHistory";
@Entity("profileDiscipline")
export class ProfileDiscipline extends EntityBase {
@Column({
nullable: true,
type: "datetime",
comment: "วันที่",
default: null,
})
date: Date;
@Column({
length: 40,
comment: "ไอดีโปรไฟล์",
type: "uuid",
})
profileId: string;
2024-03-13 10:43:50 +07:00
@Column({
comment: "สถานะการใช้งาน",
default: false,
})
isActive: boolean;
@Column({
nullable: true,
comment: "ระดับความผิด",
type: "text",
default: null,
})
level: string;
@Column({
nullable: true,
comment: "รายละเอียด",
type: "text",
default: null,
})
detail: string;
2024-03-18 17:23:59 +07:00
2024-03-13 10:43:50 +07:00
@Column({
nullable: true,
type: "datetime",
comment: "เอกสารอ้างอิง (ลงวันที่)",
default: null,
})
refCommandDate: Date;
@Column({
nullable: true,
comment: "เอกสารอ้างอิง (เลขที่คำสั่ง)",
type: "text",
default: null,
})
refCommandNo: string;
@Column({
nullable: true,
comment: "ล้างมลทิน",
type: "text",
default: null,
})
unStigma: string;
2024-03-18 17:23:59 +07:00
@OneToMany(
() => ProfileDisciplineHistory,
(profileDisciplineHistory) => profileDisciplineHistory.histories,
)
2024-03-13 10:43:50 +07:00
profileDisciplineHistories: ProfileDisciplineHistory[];
@ManyToOne(() => Profile, (profile) => profile.profileDiscipline)
@JoinColumn({ name: "profileId" })
profile: Profile;
}
2024-03-13 15:33:02 +07:00
export class CreateProfileDiscipline {
date: Date | null;
profileId: string;
isActive: boolean | null;
2024-03-18 17:23:59 +07:00
level: string | null;
2024-03-13 15:33:02 +07:00
detail: string | null;
refCommandDate: Date | null;
refCommandNo: string | null;
unStigma: string | null;
}
2024-03-18 17:23:59 +07:00
export type UpdateProfileDiscipline = {
date?: Date | null;
isActive?: boolean | null;
level?: string | null;
detail?: string | null;
2024-03-18 17:23:59 +07:00
refCommandDate?: Date | null;
refCommandNo?: string | null;
unStigma?: string | null;
2024-03-18 17:23:59 +07:00
};