ข้อมูลอื่นๆ
This commit is contained in:
parent
2d582be2a1
commit
be804c356a
3 changed files with 179 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue