crud profile discip,duty,nopaid,other

This commit is contained in:
AdisakKanthawilang 2024-03-13 15:33:02 +07:00
parent 1d48bb06ee
commit 13fc7945e5
9 changed files with 706 additions and 5 deletions

View file

@ -1,104 +0,0 @@
import { Entity, Column, ManyToOne, JoinColumn, OneToMany } from "typeorm";
import { EntityBase } from "./base/Base";
import { Profile } from "./Profile";
import { ProfileDutyHistory } from "./ProfileDutyHistory";
@Entity("profileDuty")
export class ProfileDuty extends EntityBase {
@Column({
nullable: true,
length: 40,
comment: "คีย์นอก(FK)ของตาราง Profile",
default: null,
})
profileId: string;
@Column({
comment: "สถานะการใช้งาน",
default: false,
})
isActive: boolean;
@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;
@OneToMany(() => ProfileDutyHistory, (profileDutyHistory) => profileDutyHistory.histories)
profileDutyHistories: ProfileDutyHistory[];
@ManyToOne(() => Profile, (profile) => profile.profileDutys)
@JoinColumn({ name: "profileId" })
profile: Profile;
}
export class CreateProfileDuty {
@Column("uuid")
profileId: string | null;
@Column()
isActive: boolean;
@Column()
dateStart: Date | null;
@Column()
dateEnd: Date | null;
@Column()
detail: string | null;
@Column()
reference: string | null;
@Column()
refCommandDate: Date | null;
@Column()
refCommandNo: string | null;
}
export type UpdateProfileDuty = Partial<CreateProfileDuty>;