relation profileEmployee
This commit is contained in:
parent
9a7adc4eb5
commit
b1c6f5fead
5 changed files with 76 additions and 7 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
import { Entity, Column, ManyToOne, JoinColumn, OneToMany } from "typeorm";
|
import { Entity, Column, ManyToOne, JoinColumn, OneToMany } from "typeorm";
|
||||||
import { EntityBase } from "./base/Base";
|
import { EntityBase } from "./base/Base";
|
||||||
import { Profile } from "./Profile";
|
import { Profile } from "./Profile";
|
||||||
|
import { ProfileEmployee } from "./ProfileEmployee";
|
||||||
import { ProfileDisciplineHistory } from "./ProfileDisciplineHistory";
|
import { ProfileDisciplineHistory } from "./ProfileDisciplineHistory";
|
||||||
|
|
||||||
@Entity("profileDiscipline")
|
@Entity("profileDiscipline")
|
||||||
|
|
@ -20,6 +21,14 @@ export class ProfileDiscipline extends EntityBase {
|
||||||
})
|
})
|
||||||
profileId: string;
|
profileId: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
length: 40,
|
||||||
|
comment: "คีย์นอก(FK)ของตาราง ProfileEmployee",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
profileEmployeeId: string;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
comment: "ระดับความผิด",
|
comment: "ระดับความผิด",
|
||||||
|
|
@ -69,12 +78,16 @@ export class ProfileDiscipline extends EntityBase {
|
||||||
@ManyToOne(() => Profile, (profile) => profile.profileDiscipline)
|
@ManyToOne(() => Profile, (profile) => profile.profileDiscipline)
|
||||||
@JoinColumn({ name: "profileId" })
|
@JoinColumn({ name: "profileId" })
|
||||||
profile: Profile;
|
profile: Profile;
|
||||||
|
|
||||||
|
@ManyToOne(() => ProfileEmployee, (ProfileEmployee) => ProfileEmployee.profileDisciplines)
|
||||||
|
@JoinColumn({ name: "profileEmployeeId" })
|
||||||
|
profileEmployee: ProfileEmployee;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class CreateProfileDiscipline {
|
export class CreateProfileDiscipline {
|
||||||
date: Date | null;
|
date: Date | null;
|
||||||
profileId: string;
|
profileId?: string;
|
||||||
|
profileEmployeeId?: string | null;
|
||||||
level: string | null;
|
level: string | null;
|
||||||
detail: string | null;
|
detail: string | null;
|
||||||
refCommandDate: Date | null;
|
refCommandDate: Date | null;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import { Entity, Column, ManyToOne, JoinColumn, OneToMany } from "typeorm";
|
import { Entity, Column, ManyToOne, JoinColumn, OneToMany } from "typeorm";
|
||||||
import { EntityBase } from "./base/Base";
|
import { EntityBase } from "./base/Base";
|
||||||
import { Profile } from "./Profile";
|
import { Profile } from "./Profile";
|
||||||
|
import { ProfileEmployee } from "./ProfileEmployee";
|
||||||
import { ProfileDutyHistory } from "./ProfileDutyHistory";
|
import { ProfileDutyHistory } from "./ProfileDutyHistory";
|
||||||
|
|
||||||
@Entity("profileDuty")
|
@Entity("profileDuty")
|
||||||
|
|
@ -13,6 +14,14 @@ export class ProfileDuty extends EntityBase {
|
||||||
})
|
})
|
||||||
profileId: string;
|
profileId: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
length: 40,
|
||||||
|
comment: "คีย์นอก(FK)ของตาราง ProfileEmployee",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
profileEmployeeId: string;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
type: "datetime",
|
type: "datetime",
|
||||||
|
|
@ -67,11 +76,15 @@ export class ProfileDuty extends EntityBase {
|
||||||
@ManyToOne(() => Profile, (profile) => profile.profileDutys)
|
@ManyToOne(() => Profile, (profile) => profile.profileDutys)
|
||||||
@JoinColumn({ name: "profileId" })
|
@JoinColumn({ name: "profileId" })
|
||||||
profile: Profile;
|
profile: Profile;
|
||||||
|
|
||||||
|
@ManyToOne(() => ProfileEmployee, (ProfileEmployee) => ProfileEmployee.profileDutys)
|
||||||
|
@JoinColumn({ name: "profileEmployeeId" })
|
||||||
|
profileEmployee: ProfileEmployee;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class CreateProfileDuty {
|
export class CreateProfileDuty {
|
||||||
profileId: string | null;
|
profileId?: string | null;
|
||||||
|
profileEmployeeId?: string | null;
|
||||||
dateStart: Date | null;
|
dateStart: Date | null;
|
||||||
dateEnd: Date | null;
|
dateEnd: Date | null;
|
||||||
detail: string | null;
|
detail: string | null;
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,10 @@ import { ProfileTraining } from "./ProfileTraining";
|
||||||
import { ProfileInsignia } from "./ProfileInsignia";
|
import { ProfileInsignia } from "./ProfileInsignia";
|
||||||
import { ProfileHonor } from "./ProfileHonor";
|
import { ProfileHonor } from "./ProfileHonor";
|
||||||
import { ProfileAssessment } from "./ProfileAssessment";
|
import { ProfileAssessment } from "./ProfileAssessment";
|
||||||
|
import { ProfileLeave } from "./ProfileLeave";
|
||||||
|
import { ProfileDuty } from "./ProfileDuty";
|
||||||
|
import { ProfileNopaid } from "./ProfileNopaid";
|
||||||
|
import { ProfileDiscipline } from "./ProfileDiscipline";
|
||||||
@Entity("profileEmployee")
|
@Entity("profileEmployee")
|
||||||
export class ProfileEmployee extends EntityBase {
|
export class ProfileEmployee extends EntityBase {
|
||||||
@Column({
|
@Column({
|
||||||
|
|
@ -216,6 +220,18 @@ export class ProfileEmployee extends EntityBase {
|
||||||
@OneToMany(() => ProfileAssessment, (v) => v.profileEmployee)
|
@OneToMany(() => ProfileAssessment, (v) => v.profileEmployee)
|
||||||
profileAssessments: ProfileAssessment[];
|
profileAssessments: ProfileAssessment[];
|
||||||
|
|
||||||
|
@OneToMany(() => ProfileLeave, (v) => v.profileEmployee)
|
||||||
|
profileLeaves: ProfileLeave[];
|
||||||
|
|
||||||
|
@OneToMany(() => ProfileDuty, (v) => v.profileEmployee)
|
||||||
|
profileDutys: ProfileDuty[];
|
||||||
|
|
||||||
|
@OneToMany(() => ProfileNopaid, (v) => v.profileEmployee)
|
||||||
|
profileNopaids: ProfileNopaid[];
|
||||||
|
|
||||||
|
@OneToMany(() => ProfileDiscipline, (v) => v.profileEmployee)
|
||||||
|
profileDisciplines: ProfileNopaid[];
|
||||||
|
|
||||||
@ManyToOne(() => EmployeePosLevel, (v) => v.profiles)
|
@ManyToOne(() => EmployeePosLevel, (v) => v.profiles)
|
||||||
posLevel: EmployeePosLevel;
|
posLevel: EmployeePosLevel;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import { Entity, Column, ManyToOne, JoinColumn, OneToMany } from "typeorm";
|
import { Entity, Column, ManyToOne, JoinColumn, OneToMany } from "typeorm";
|
||||||
import { EntityBase } from "./base/Base";
|
import { EntityBase } from "./base/Base";
|
||||||
import { Profile } from "./Profile";
|
import { Profile } from "./Profile";
|
||||||
|
import { ProfileEmployee } from "./ProfileEmployee";
|
||||||
import { LeaveType } from "./LeaveType";
|
import { LeaveType } from "./LeaveType";
|
||||||
|
|
||||||
@Entity("profileLeave")
|
@Entity("profileLeave")
|
||||||
|
|
@ -13,6 +14,14 @@ export class ProfileLeave extends EntityBase {
|
||||||
})
|
})
|
||||||
profileId: string;
|
profileId: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
length: 40,
|
||||||
|
comment: "คีย์นอก(FK)ของตาราง ProfileEmployee",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
profileEmployeeId: string;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
length: 40,
|
length: 40,
|
||||||
|
|
@ -85,6 +94,10 @@ export class ProfileLeave extends EntityBase {
|
||||||
|
|
||||||
@ManyToOne(() => Profile, (v) => v.profileLeaves)
|
@ManyToOne(() => Profile, (v) => v.profileLeaves)
|
||||||
profile: Profile;
|
profile: Profile;
|
||||||
|
|
||||||
|
@ManyToOne(() => ProfileEmployee, (ProfileEmployee) => ProfileEmployee.profileLeaves)
|
||||||
|
@JoinColumn({ name: "profileEmployeeId" })
|
||||||
|
profileEmployee: ProfileEmployee;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Entity("profileLeaveHistory")
|
@Entity("profileLeaveHistory")
|
||||||
|
|
@ -102,8 +115,9 @@ export class ProfileLeaveHistory extends ProfileLeave {
|
||||||
}
|
}
|
||||||
|
|
||||||
export class CreateProfileLeave {
|
export class CreateProfileLeave {
|
||||||
profileId: string | null;
|
profileId?: string | null;
|
||||||
leaveTypeId: string;
|
leaveTypeId: string;
|
||||||
|
profileEmployeeId?: string | null;
|
||||||
dateLeaveStart: Date | null;
|
dateLeaveStart: Date | null;
|
||||||
dateLeaveEnd: Date | null;
|
dateLeaveEnd: Date | null;
|
||||||
leaveDays: number | null;
|
leaveDays: number | null;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import { Entity, Column, OneToMany, ManyToOne, JoinColumn } from "typeorm";
|
import { Entity, Column, OneToMany, ManyToOne, JoinColumn } from "typeorm";
|
||||||
import { EntityBase } from "./base/Base";
|
import { EntityBase } from "./base/Base";
|
||||||
import { Profile } from "./Profile";
|
import { Profile } from "./Profile";
|
||||||
|
import { ProfileEmployee } from "./ProfileEmployee";
|
||||||
import { ProfileNopaidHistory } from "./ProfileNopaidHistory";
|
import { ProfileNopaidHistory } from "./ProfileNopaidHistory";
|
||||||
|
|
||||||
@Entity("profileNopaid")
|
@Entity("profileNopaid")
|
||||||
|
|
@ -13,6 +14,14 @@ export class ProfileNopaid extends EntityBase {
|
||||||
})
|
})
|
||||||
profileId: string;
|
profileId: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
length: 40,
|
||||||
|
comment: "คีย์นอก(FK)ของตาราง ProfileEmployee",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
profileEmployeeId: string;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
type: "datetime",
|
type: "datetime",
|
||||||
|
|
@ -59,11 +68,15 @@ export class ProfileNopaid extends EntityBase {
|
||||||
@ManyToOne(() => Profile, (profile) => profile.profileNopaids)
|
@ManyToOne(() => Profile, (profile) => profile.profileNopaids)
|
||||||
@JoinColumn({ name: "profileId" })
|
@JoinColumn({ name: "profileId" })
|
||||||
profile: Profile;
|
profile: Profile;
|
||||||
|
|
||||||
|
@ManyToOne(() => ProfileEmployee, (ProfileEmployee) => ProfileEmployee.profileNopaids)
|
||||||
|
@JoinColumn({ name: "profileEmployeeId" })
|
||||||
|
profileEmployee: ProfileEmployee;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class CreateProfileNopaid {
|
export class CreateProfileNopaid {
|
||||||
profileId: string | null;
|
profileId?: string | null;
|
||||||
|
profileEmployeeId?: string | null;
|
||||||
date: Date | null;
|
date: Date | null;
|
||||||
detail: string | null;
|
detail: string | null;
|
||||||
reference: string | null;
|
reference: string | null;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue