api คำขอแก้ไข

This commit is contained in:
Kittapath 2024-07-19 11:08:47 +07:00
parent 0696672f86
commit 85c6093970
8 changed files with 546 additions and 30 deletions

View file

@ -27,6 +27,7 @@ import { ProfileFamilyCouple } from "./ProfileFamilyCouple";
import { ProfileChildren } from "./ProfileChildren";
import { ProfileDiscipline } from "./ProfileDiscipline";
import { ProfileEmployee } from "./ProfileEmployee";
import { ProfileEdit } from "./ProfileEdit";
@Entity("profile")
export class Profile extends EntityBase {
@ -340,6 +341,9 @@ export class Profile extends EntityBase {
@OneToMany(() => ProfileAvatar, (profileAvatar) => profileAvatar.profile)
profileAvatars: ProfileAvatar[];
@OneToMany(() => ProfileEdit, (profileEdit) => profileEdit.profile)
profileEdits: ProfileEdit[];
@OneToMany(() => ProfileFamilyHistory, (profileFamily) => profileFamily.profile)
profileFamily: ProfileFamilyHistory[];

View file

@ -0,0 +1,90 @@
import { Entity, Column, OneToMany, ManyToOne, JoinColumn } from "typeorm";
import { EntityBase } from "./base/Base";
import { Profile } from "./Profile";
import { ProfileEmployee } from "./ProfileEmployee";
@Entity("profileEdit")
export class ProfileEdit 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;
@Column({
nullable: true,
comment: "สถานะคำร้อง", //PENDING = รอดำเนินการ, COMPLETE = ดำเนินการแก้ไขแล้ว, REJECT = ไม่อนุมัตการแก้ไข
default: null,
})
status: string;
@Column({
nullable: true,
comment: "ชื่อเรื่อง",
default: null,
})
topic: string;
@Column({
nullable: true,
comment: "รายละเอียด",
type: "text",
default: null,
})
detail: string;
@Column({
nullable: true,
comment: "หมายเหตุ",
type: "text",
default: null,
})
remark: string;
@ManyToOne(() => Profile, (profile) => profile.profileEdits)
@JoinColumn({ name: "profileId" })
profile: Profile;
@ManyToOne(() => ProfileEmployee, (ProfileEmployee) => ProfileEmployee.profileEdits)
@JoinColumn({ name: "profileEmployeeId" })
profileEmployee: ProfileEmployee;
}
export class CreateProfileEdit {
topic: string | null;
detail: string | null;
}
export class EditProfileEdit {
topic?: string | null;
detail?: string | null;
remark?: string | null;
status?: string | null;
}
export class CreateProfileEmployeeEdit {
topic: string | null;
detail: string | null;
}
export class EditProfileEmployeeEdit {
topic?: string | null;
detail?: string | null;
remark?: string | null;
status?: string | null;
}
export type UpdateProfileEdit = {
detail?: string | null;
date?: Date | null;
};

View file

@ -28,8 +28,9 @@ import { Profile, ProfileAddressHistory } from "./Profile";
import { Province } from "./Province";
import { District } from "./District";
import { SubDistrict } from "./SubDistrict";
import { ProfileEmployeeInformationHistory } from "./ProfileEmployeeInformationHistory"
import { ProfileEmployeeEmployment } from "./ProfileEmployeeEmployment"
import { ProfileEmployeeInformationHistory } from "./ProfileEmployeeInformationHistory";
import { ProfileEmployeeEmployment } from "./ProfileEmployeeEmployment";
import { ProfileEdit } from "./ProfileEdit";
@Entity("profileEmployee")
export class ProfileEmployee extends EntityBase {
@ -501,70 +502,70 @@ export class ProfileEmployee extends EntityBase {
default: null,
})
positionEmployeeGroupId: string;
@Column({
nullable: true,
comment: "สายงาน",
default: null,
})
positionEmployeeLineId: string;
@Column({
nullable: true,
comment: "ชื่อตำแหน่งทางสายงาน",
default: null,
})
positionEmployeePositionId: string;
@Column({
nullable: true,
comment: "สังกัด",
default: null,
})
employeeOc: string;
@Column({
nullable: true,
comment: "ประเภทบุคคล",
default: null,
})
employeeTypeIndividual: string;
@Column({
nullable: true,
comment: "ค่าจ้าง",
default: null,
})
employeeWage: string;
@Column({
nullable: true,
comment: "เงินเพิ่มการครองชีพชั่วคราว",
default: null,
})
employeeMoneyIncrease: string;
@Column({
nullable: true,
comment: "เงินช่วยเหลือการครองชีพชั่วคราว",
default: null,
})
employeeMoneyAllowance: string;
@Column({
nullable: true,
comment: "เงินสมทบประกันสังคม(ลูกจ้าง)",
default: null,
})
employeeMoneyEmployee: string;
@Column({
nullable: true,
comment: "เงินสมทบประกันสังคม(นายจ้าง)",
default: null,
})
employeeMoneyEmployer: string;
@OneToMany(() => ProfileEmployeeInformationHistory, (v) => v.profileEmployeeInformation)
information_histories: ProfileEmployeeInformationHistory[];
@ -582,7 +583,7 @@ export class ProfileEmployee extends EntityBase {
@OneToMany(() => ProfileCertificate, (v) => v.profileEmployee)
profileCertificates: ProfileCertificate[];
@OneToMany(() => ProfileTraining, (v) => v.profileEmployee)
profileTrainings: ProfileTraining[];
@ -628,6 +629,9 @@ export class ProfileEmployee extends EntityBase {
@OneToMany(() => ProfileAvatar, (v) => v.profileEmployee)
profileAvatars: ProfileAvatar[];
@OneToMany(() => ProfileEdit, (v) => v.profileEmployee)
profileEdits: ProfileEdit[];
@ManyToOne(() => EmployeePosLevel, (v) => v.profiles)
posLevel: EmployeePosLevel;