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 { EntityBase } from "./base/Base";
|
||||
import { Profile } from "./Profile";
|
||||
import { ProfileEmployee } from "./ProfileEmployee";
|
||||
import { ProfileDutyHistory } from "./ProfileDutyHistory";
|
||||
|
||||
@Entity("profileDuty")
|
||||
|
|
@ -13,6 +14,14 @@ export class ProfileDuty extends EntityBase {
|
|||
})
|
||||
profileId: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 40,
|
||||
comment: "คีย์นอก(FK)ของตาราง ProfileEmployee",
|
||||
default: null,
|
||||
})
|
||||
profileEmployeeId: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "datetime",
|
||||
|
|
@ -67,11 +76,15 @@ export class ProfileDuty extends EntityBase {
|
|||
@ManyToOne(() => Profile, (profile) => profile.profileDutys)
|
||||
@JoinColumn({ name: "profileId" })
|
||||
profile: Profile;
|
||||
|
||||
@ManyToOne(() => ProfileEmployee, (ProfileEmployee) => ProfileEmployee.profileDutys)
|
||||
@JoinColumn({ name: "profileEmployeeId" })
|
||||
profileEmployee: ProfileEmployee;
|
||||
}
|
||||
|
||||
export class CreateProfileDuty {
|
||||
profileId: string | null;
|
||||
|
||||
profileId?: string | null;
|
||||
profileEmployeeId?: string | null;
|
||||
dateStart: Date | null;
|
||||
dateEnd: Date | null;
|
||||
detail: string | null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue