Merge branch 'develop' into adiDev

This commit is contained in:
AdisakKanthawilang 2024-05-14 10:33:48 +07:00
commit a826726c80
14 changed files with 313 additions and 340 deletions

View file

@ -18,6 +18,7 @@ import { ProfileChangeName } from "./ProfileChangeName";
import { ProfileChildren, ProfileFamilyHistory } from "./ProfileFamily";
import { ProfileEducation } from "./ProfileEducation";
import { ProfileAbility } from "./ProfileAbility";
import { ProfileOther } from "./ProfileOther";
@Entity("profileEmployee")
export class ProfileEmployee extends EntityBase {
@Column({
@ -251,6 +252,9 @@ export class ProfileEmployee extends EntityBase {
@OneToMany(() => ProfileAbility, (v) => v.profileEmployee)
profileAbilities: ProfileAbility[];
@OneToMany(() => ProfileOther, (v) => v.profileEmployee)
profileOthers: ProfileOther[];
@ManyToOne(() => EmployeePosLevel, (v) => v.profiles)
posLevel: EmployeePosLevel;
@ -294,7 +298,7 @@ export class CreateProfileEmployee {
gender: string | null;
relationship: string | null;
bloodGroup: string | null;
email: string | null ;
email: string | null;
phone: string | null;
}

View file

@ -1,6 +1,7 @@
import { Entity, Column, OneToMany, ManyToOne, JoinColumn } from "typeorm";
import { EntityBase } from "./base/Base";
import { Profile } from "./Profile";
import { ProfileEmployee } from "./ProfileEmployee";
import { ProfileOtherHistory } from "./ProfileOtherHistory";
@Entity("profileOther")
@ -13,6 +14,14 @@ export class ProfileOther extends EntityBase {
})
profileId: string;
@Column({
nullable: true,
length: 40,
comment: "คีย์นอก(FK)ของตาราง ProfileEmployee",
default: null,
})
profileEmployeeId: string;
@Column({
nullable: true,
comment: "รายละเอียด",
@ -35,6 +44,10 @@ export class ProfileOther extends EntityBase {
@ManyToOne(() => Profile, (profile) => profile.profileOthers)
@JoinColumn({ name: "profileId" })
profile: Profile;
@ManyToOne(() => ProfileEmployee, (ProfileEmployee) => ProfileEmployee.profileOthers)
@JoinColumn({ name: "profileEmployeeId" })
profileEmployee: ProfileEmployee;
}
export class CreateProfileOther {
@ -43,6 +56,12 @@ export class CreateProfileOther {
date: Date | null;
}
export class CreateProfileEmployeeOther {
profileEmployeeId: string | null;
detail: string | null;
date: Date | null;
}
export type UpdateProfileOther = {
detail?: string | null;
date?: Date | null;