empAddress and fix durationYear
This commit is contained in:
parent
da4eb54a59
commit
ffb5b38936
6 changed files with 274 additions and 7 deletions
|
|
@ -26,6 +26,7 @@ import { ProfileFamilyMother } from "./ProfileFamilyMother";
|
|||
import { ProfileFamilyCouple } from "./ProfileFamilyCouple";
|
||||
import { ProfileChildren } from "./ProfileChildren";
|
||||
import { ProfileDiscipline } from "./ProfileDiscipline";
|
||||
import { ProfileEmployee } from "./ProfileEmployee";
|
||||
|
||||
@Entity("profile")
|
||||
export class Profile extends EntityBase {
|
||||
|
|
@ -580,6 +581,18 @@ export class ProfileAddressHistory extends EntityBase {
|
|||
|
||||
@ManyToOne(() => Profile, (v) => v.histories, { onDelete: "CASCADE" })
|
||||
profile: Profile;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 40,
|
||||
comment: "คีย์นอก(FK)ของตาราง ProfileEmployee",
|
||||
default: null,
|
||||
})
|
||||
profileEmployeeId: string;
|
||||
|
||||
@ManyToOne(() => ProfileEmployee, (ProfileEmployee) => ProfileEmployee.profileAddressHistories)
|
||||
@JoinColumn({ name: "profileEmployeeId" })
|
||||
profileEmployee: ProfileEmployee;
|
||||
}
|
||||
|
||||
export class CreateProfile {
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@ export class CreateProfileEducation {
|
|||
country: string | null;
|
||||
degree: string | null;
|
||||
duration: string | null;
|
||||
durationYear: number;
|
||||
durationYear?: number | null;
|
||||
field: string | null;
|
||||
finishDate: Date | null;
|
||||
fundName: string | null;
|
||||
|
|
@ -212,7 +212,7 @@ export class CreateProfileEducationEmployee {
|
|||
country: string | null;
|
||||
degree: string | null;
|
||||
duration: string | null;
|
||||
durationYear: number;
|
||||
durationYear?: number | null;
|
||||
field: string | null;
|
||||
finishDate: Date | null;
|
||||
fundName: string | null;
|
||||
|
|
@ -234,7 +234,7 @@ export type UpdateProfileEducation = {
|
|||
country?: string | null;
|
||||
degree?: string | null;
|
||||
duration?: string | null;
|
||||
durationYear?: number;
|
||||
durationYear?: number | null;
|
||||
field?: string | null;
|
||||
finishDate?: Date | null;
|
||||
fundName?: string | null;
|
||||
|
|
|
|||
|
|
@ -25,6 +25,10 @@ import { ProfileFamilyMother } from "./ProfileFamilyMother";
|
|||
import { ProfileFamilyCouple } from "./ProfileFamilyCouple";
|
||||
|
||||
import { ProfileChildren } from "./ProfileChildren";
|
||||
import { Profile, ProfileAddressHistory } from "./Profile";
|
||||
import { Province } from "./Province";
|
||||
import { District } from "./District";
|
||||
import { SubDistrict } from "./SubDistrict";
|
||||
@Entity("profileEmployee")
|
||||
export class ProfileEmployee extends EntityBase {
|
||||
@Column({
|
||||
|
|
@ -285,6 +289,9 @@ export class ProfileEmployee extends EntityBase {
|
|||
@OneToMany(() => ProfileEmployeeHistory, (v) => v.profileEmployee)
|
||||
histories: ProfileEmployeeHistory[];
|
||||
|
||||
@OneToMany(() => ProfileAddressHistory, (v) => v.profileEmployee)
|
||||
profileAddressHistories: ProfileAddressHistory[];
|
||||
|
||||
@OneToMany(() => ProfileGovernment, (v) => v.profileEmployee)
|
||||
profileGovernment: ProfileGovernment[];
|
||||
|
||||
|
|
@ -296,6 +303,105 @@ export class ProfileEmployee extends EntityBase {
|
|||
|
||||
@OneToMany(() => ProfileFamilyCouple, (v) => v.profile)
|
||||
profileFamilyCouple: ProfileFamilyCouple[];
|
||||
|
||||
//ที่อยู่
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ที่อยู่ตามทะเบียนบ้าน",
|
||||
default: null,
|
||||
length: 255,
|
||||
})
|
||||
registrationAddress: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "จังหวัดตามทะเบียนบ้าน",
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
registrationProvinceId: string;
|
||||
|
||||
@ManyToOne(() => Province, (v) => v.registrationProvinces)
|
||||
registrationProvince: Province;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "เขตตามทะเบียนบ้าน",
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
registrationDistrictId: string;
|
||||
|
||||
@ManyToOne(() => District, (v) => v.registrationDistricts)
|
||||
registrationDistrict: District;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "แขวงตามทะเบียนบ้าน",
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
registrationSubDistrictId: string;
|
||||
|
||||
@ManyToOne(() => SubDistrict, (v) => v.registrationSubDistricts)
|
||||
registrationSubDistrict: SubDistrict;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "รหัสไปรษณีย์ตามทะเบียนบ้าน",
|
||||
default: null,
|
||||
length: 5,
|
||||
})
|
||||
registrationZipCode: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ที่อยู่ตามปัจจุบัน",
|
||||
default: null,
|
||||
length: 255,
|
||||
})
|
||||
currentAddress: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "จังหวัดตามปัจจุบัน",
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
currentProvinceId: string;
|
||||
|
||||
@ManyToOne(() => Province, (v) => v.currentProvinces)
|
||||
currentProvince: Province;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "เขตตามปัจจุบัน",
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
currentDistrictId: string;
|
||||
|
||||
@ManyToOne(() => District, (v) => v.currentDistricts)
|
||||
currentDistrict: District;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "แขวงตามปัจจุบัน",
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
currentSubDistrictId: string;
|
||||
|
||||
@ManyToOne(() => SubDistrict, (v) => v.currentSubDistricts)
|
||||
currentSubDistrict: SubDistrict;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "รหัสไปรษณีย์ตามปัจจุบัน",
|
||||
default: null,
|
||||
length: 5,
|
||||
})
|
||||
currentZipCode: string;
|
||||
}
|
||||
|
||||
@Entity("profileEmployeeHistory")
|
||||
|
|
@ -357,3 +463,16 @@ export type UpdateProfileEmployee = {
|
|||
email: string | null;
|
||||
phone: string | null;
|
||||
};
|
||||
|
||||
export type UpdateProfileAddressEmployee = {
|
||||
registrationAddress?: string | null;
|
||||
registrationProvinceId?: string | null;
|
||||
registrationDistrictId?: string | null;
|
||||
registrationSubDistrictId?: string | null;
|
||||
registrationZipCode?: string | null;
|
||||
currentAddress?: string | null;
|
||||
currentProvinceId?: string | null;
|
||||
currentDistrictId?: string | null;
|
||||
currentSubDistrictId?: string | null;
|
||||
currentZipCode?: string | null;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue