entity kpiUserEvaluation
This commit is contained in:
parent
0d8d5c28aa
commit
cda71e1099
3 changed files with 145 additions and 82 deletions
|
|
@ -2,6 +2,7 @@ import { Entity, Column, OneToMany } from "typeorm";
|
|||
import { EntityBase } from "./base/Base";
|
||||
import { KpiPlan } from "./kpiPlan";
|
||||
import { KpiRole } from "./kpiRole";
|
||||
import { KpiUserEvaluation } from "./kpiUserEvaluation";
|
||||
|
||||
@Entity("kpiPeriod")
|
||||
export class KpiPeriod extends EntityBase {
|
||||
|
|
@ -45,6 +46,9 @@ export class KpiPeriod extends EntityBase {
|
|||
|
||||
@OneToMany(() => KpiPlan, (kpiPlan) => kpiPlan.kpiPeriod)
|
||||
kpiPlans: KpiPlan[];
|
||||
|
||||
@OneToMany(() => KpiUserEvaluation, (kpiPlan) => kpiPlan.kpiPeriod)
|
||||
kpiUserEvaluation: KpiUserEvaluation[];
|
||||
}
|
||||
export class createKpiPeriod {
|
||||
@Column()
|
||||
|
|
|
|||
75
src/entities/kpiUserEvaluation.ts
Normal file
75
src/entities/kpiUserEvaluation.ts
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
import { Entity, Column, OneToMany, ManyToOne, JoinColumn } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { KpiPeriod } from "./kpiPeriod";
|
||||
@Entity("kpiUserEvaluation")
|
||||
export class KpiUserEvaluation extends EntityBase {
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "คำนำหน้า",
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
prefix: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ชื่อ",
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
firstName: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "สกุล",
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
lastName: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 40,
|
||||
comment: "คีย์นอก(FK)ของตาราง kpiPeriodId",
|
||||
default: null,
|
||||
})
|
||||
kpiPeriodId: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 40,
|
||||
comment: "ไอดีโปรไฟล์",
|
||||
default: null,
|
||||
})
|
||||
profileId: string;
|
||||
|
||||
@ManyToOne(() => KpiPeriod, (kpiPeriod) => kpiPeriod.kpiUserEvaluation)
|
||||
@JoinColumn({ name: "kpiPeriodId" })
|
||||
kpiPeriod: KpiPeriod;
|
||||
}
|
||||
|
||||
export class createKpiUserEvaluation {
|
||||
@Column()
|
||||
prefix: string;
|
||||
@Column()
|
||||
firstName: string;
|
||||
@Column()
|
||||
lastName: string;
|
||||
@Column()
|
||||
kpiPeriodId: string;
|
||||
@Column()
|
||||
profileId: string;
|
||||
}
|
||||
|
||||
export class updateKpiUserEvaluation {
|
||||
@Column()
|
||||
prefix: string;
|
||||
@Column()
|
||||
firstName: string;
|
||||
@Column()
|
||||
lastName: string;
|
||||
@Column()
|
||||
kpiPeriodId: string;
|
||||
@Column()
|
||||
profileId: string;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue