2024-03-13 10:43:50 +07:00
|
|
|
import { Entity, Column, ManyToOne, JoinColumn, OneToMany } from "typeorm";
|
2024-03-08 14:54:24 +07:00
|
|
|
import { EntityBase } from "./base/Base";
|
|
|
|
|
import { Profile } from "./Profile";
|
2024-03-13 10:43:50 +07:00
|
|
|
import { ProfileDisciplineHistory } from "./ProfileDisciplineHistory";
|
2024-03-08 14:54:24 +07:00
|
|
|
|
|
|
|
|
@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[];
|
|
|
|
|
|
2024-03-08 14:54:24 +07:00
|
|
|
@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;
|
|
|
|
|
profileId: string;
|
|
|
|
|
isActive: boolean | null;
|
|
|
|
|
level: string | null;
|
|
|
|
|
detail: string | null;
|
|
|
|
|
refCommandDate?: Date | null;
|
|
|
|
|
refCommandNo: string | null;
|
|
|
|
|
unStigma: string | null;
|
|
|
|
|
};
|