no message
This commit is contained in:
parent
65e1d682b1
commit
42264be4a2
16 changed files with 55 additions and 201 deletions
|
|
@ -2,11 +2,7 @@ import { Entity, Column, OneToMany, ManyToMany, JoinTable } from "typeorm";
|
||||||
import { EntityBase } from "./base/Base";
|
import { EntityBase } from "./base/Base";
|
||||||
import { KpiCapacityDetail } from "./kpiCapacityDetail";
|
import { KpiCapacityDetail } from "./kpiCapacityDetail";
|
||||||
import { KpiLink } from "./kpiLink";
|
import { KpiLink } from "./kpiLink";
|
||||||
import { KpiUserInspector } from "./kpiUserInspector";
|
import { KpiUserCapacity } from "./kpiUserCapacity";
|
||||||
import { KpiUserDirector } from "./kpiUserDirector";
|
|
||||||
import { KpiUserExecutive } from "./kpiUserExecutive";
|
|
||||||
import { KpiUserGroup } from "./kpiUserGroup";
|
|
||||||
import { KpiUserHead } from "./kpiUserHead";
|
|
||||||
|
|
||||||
enum CapacityType {
|
enum CapacityType {
|
||||||
HEAD = "HEAD",
|
HEAD = "HEAD",
|
||||||
|
|
@ -44,36 +40,15 @@ export class KpiCapacity extends EntityBase {
|
||||||
})
|
})
|
||||||
description: string;
|
description: string;
|
||||||
|
|
||||||
@OneToMany(() => KpiCapacityDetail, (kpiCapacityDetail) => kpiCapacityDetail.kpiCapacitys)
|
@OneToMany(() => KpiCapacityDetail, (kpiCapacityDetail) => kpiCapacityDetail.kpiCapacity)
|
||||||
kpiCapacityDetails: KpiCapacityDetail[];
|
kpiCapacityDetails: KpiCapacityDetail[];
|
||||||
|
|
||||||
@ManyToMany(() => KpiLink, (kpiLink) => kpiLink.kpiCapacitys)
|
@ManyToMany(() => KpiLink, (kpiLink) => kpiLink.kpiCapacitys)
|
||||||
@JoinTable()
|
@JoinTable()
|
||||||
kpiLinks: KpiLink[];
|
kpiLinks: KpiLink[];
|
||||||
|
|
||||||
// @OneToMany(() => KpiUserPlanned, (kpiUserPlanned) => kpiUserPlanned.kpiCapacitys)
|
@OneToMany(() => KpiUserCapacity, (kpiUserCapacity) => kpiUserCapacity.kpiCapacity)
|
||||||
// kpiUserPlanneds: KpiUserPlanned[];
|
kpiUserCapacitys: KpiUserCapacity[];
|
||||||
|
|
||||||
// @OneToMany(() => KpiUserPosition, (kpiUserPosition) => kpiUserPosition.kpiCapacitys)
|
|
||||||
// kpiUserPositions: KpiUserPosition[];
|
|
||||||
|
|
||||||
// @OneToMany(() => KpiUserSpecial, (kpiUserSpecial) => kpiUserSpecial.kpiCapacitys)
|
|
||||||
// kpiUserSpecials: KpiUserSpecial[];
|
|
||||||
|
|
||||||
@OneToMany(() => KpiUserHead, (kpiUserHead) => kpiUserHead.kpiCapacitys)
|
|
||||||
kpiUserHeads: KpiUserHead[];
|
|
||||||
|
|
||||||
@OneToMany(() => KpiUserGroup, (kpiUserGroup) => kpiUserGroup.kpiCapacitys)
|
|
||||||
kpiUserGroups: KpiUserGroup[];
|
|
||||||
|
|
||||||
@OneToMany(() => KpiUserExecutive, (kpiUserExecutive) => kpiUserExecutive.kpiCapacitys)
|
|
||||||
kpiUserExecutives: KpiUserExecutive[];
|
|
||||||
|
|
||||||
@OneToMany(() => KpiUserDirector, (kpiUserDirector) => kpiUserDirector.kpiCapacitys)
|
|
||||||
kpiUserDirectors: KpiUserDirector[];
|
|
||||||
|
|
||||||
@OneToMany(() => KpiUserInspector, (kpiUserInspector) => kpiUserInspector.kpiCapacitys)
|
|
||||||
kpiUserInspectors: KpiUserInspector[];
|
|
||||||
}
|
}
|
||||||
export class createKpiCapacity {
|
export class createKpiCapacity {
|
||||||
@Column()
|
@Column()
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
import { Entity, Column, OneToMany, ManyToOne, JoinColumn } from "typeorm";
|
import { Entity, Column, ManyToOne, JoinColumn } from "typeorm";
|
||||||
import { EntityBase } from "./base/Base";
|
import { EntityBase } from "./base/Base";
|
||||||
import { KpiCapacity } from "./kpiCapacity";
|
import { KpiCapacity } from "./kpiCapacity";
|
||||||
import { KpiUserHead } from "./kpiUserHead";
|
|
||||||
|
|
||||||
@Entity("kpiCapacityDetail")
|
@Entity("kpiCapacityDetail")
|
||||||
export class KpiCapacityDetail extends EntityBase {
|
export class KpiCapacityDetail extends EntityBase {
|
||||||
|
|
@ -30,7 +29,7 @@ export class KpiCapacityDetail extends EntityBase {
|
||||||
|
|
||||||
@ManyToOne(() => KpiCapacity, (kpiCapacity) => kpiCapacity.kpiCapacityDetails)
|
@ManyToOne(() => KpiCapacity, (kpiCapacity) => kpiCapacity.kpiCapacityDetails)
|
||||||
@JoinColumn({ name: "kpiCapacityId" })
|
@JoinColumn({ name: "kpiCapacityId" })
|
||||||
kpiCapacitys: KpiCapacity;
|
kpiCapacity: KpiCapacity;
|
||||||
}
|
}
|
||||||
export class createKpiCapacityDetail {
|
export class createKpiCapacityDetail {
|
||||||
@Column()
|
@Column()
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ export class KpiPeriod extends EntityBase {
|
||||||
kpiSpecials: KpiSpecial[];
|
kpiSpecials: KpiSpecial[];
|
||||||
|
|
||||||
@OneToMany(() => KpiUserEvaluation, (kpiPlan) => kpiPlan.kpiPeriod)
|
@OneToMany(() => KpiUserEvaluation, (kpiPlan) => kpiPlan.kpiPeriod)
|
||||||
kpiUserEvaluation: KpiUserEvaluation[];
|
kpiUserEvaluations: KpiUserEvaluation[];
|
||||||
}
|
}
|
||||||
export class createKpiPeriod {
|
export class createKpiPeriod {
|
||||||
@Column()
|
@Column()
|
||||||
|
|
|
||||||
|
|
@ -289,7 +289,7 @@ export class KpiPlan extends EntityBase {
|
||||||
@JoinColumn({ name: "kpiPeriodId" })
|
@JoinColumn({ name: "kpiPeriodId" })
|
||||||
kpiPeriod: KpiPeriod;
|
kpiPeriod: KpiPeriod;
|
||||||
|
|
||||||
@OneToMany(() => KpiUserPlanned, (kpiUserPlanned) => kpiUserPlanned.kpiPlans)
|
@OneToMany(() => KpiUserPlanned, (kpiUserPlanned) => kpiUserPlanned.kpiPlan)
|
||||||
kpiUserPlanneds: KpiUserPlanned[];
|
kpiUserPlanneds: KpiUserPlanned[];
|
||||||
}
|
}
|
||||||
export class createKpiPlan {
|
export class createKpiPlan {
|
||||||
|
|
|
||||||
|
|
@ -220,7 +220,7 @@ export class KpiRole extends EntityBase {
|
||||||
@JoinColumn({ name: "kpiPeriodId" })
|
@JoinColumn({ name: "kpiPeriodId" })
|
||||||
kpiPeriod: KpiPeriod;
|
kpiPeriod: KpiPeriod;
|
||||||
|
|
||||||
@OneToMany(() => KpiUserRole, (kpiUserRole) => kpiUserRole.kpiRoles)
|
@OneToMany(() => KpiUserRole, (kpiUserRole) => kpiUserRole.kpiRole)
|
||||||
kpiUserRoles: KpiUserRole[];
|
kpiUserRoles: KpiUserRole[];
|
||||||
}
|
}
|
||||||
export class createKpiRole {
|
export class createKpiRole {
|
||||||
|
|
|
||||||
|
|
@ -289,7 +289,7 @@ export class KpiSpecial extends EntityBase {
|
||||||
@JoinColumn({ name: "kpiPeriodId" })
|
@JoinColumn({ name: "kpiPeriodId" })
|
||||||
kpiPeriod: KpiPeriod;
|
kpiPeriod: KpiPeriod;
|
||||||
|
|
||||||
@OneToMany(() => KpiUserSpecial, (kpiUserSpecial) => kpiUserSpecial.kpiSpecials)
|
@OneToMany(() => KpiUserSpecial, (kpiUserSpecial) => kpiUserSpecial.kpiSpecial)
|
||||||
kpiUserSpecials: KpiUserSpecial[];
|
kpiUserSpecials: KpiUserSpecial[];
|
||||||
}
|
}
|
||||||
export class createKpiSpecial {
|
export class createKpiSpecial {
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@ import { EntityBase } from "./base/Base";
|
||||||
import { KpiCapacity } from "./kpiCapacity";
|
import { KpiCapacity } from "./kpiCapacity";
|
||||||
import { KpiUserEvaluation } from "./kpiUserEvaluation";
|
import { KpiUserEvaluation } from "./kpiUserEvaluation";
|
||||||
|
|
||||||
@Entity("kpiUserGroup")
|
@Entity("kpiUserCapacity")
|
||||||
export class KpiUserGroup extends EntityBase {
|
export class KpiUserCapacity extends EntityBase {
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
length: 40,
|
length: 40,
|
||||||
|
|
@ -13,9 +13,9 @@ export class KpiUserGroup extends EntityBase {
|
||||||
})
|
})
|
||||||
kpiUserEvaluationId: string;
|
kpiUserEvaluationId: string;
|
||||||
|
|
||||||
@ManyToOne(() => KpiUserEvaluation, (kpiUserEvaluation) => kpiUserEvaluation.kpiUserGroups)
|
@ManyToOne(() => KpiUserEvaluation, (kpiUserEvaluation) => kpiUserEvaluation.kpiUserCapacitys)
|
||||||
@JoinColumn({ name: "kpiUserEvaluationId" })
|
@JoinColumn({ name: "kpiUserEvaluationId" })
|
||||||
kpiUserEvaluations: KpiUserEvaluation;
|
kpiUserEvaluation: KpiUserEvaluation;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
|
|
@ -25,7 +25,7 @@ export class KpiUserGroup extends EntityBase {
|
||||||
})
|
})
|
||||||
kpiCapacityId: string;
|
kpiCapacityId: string;
|
||||||
|
|
||||||
@ManyToOne(() => KpiCapacity, (kpiCapacity) => kpiCapacity.kpiUserGroups)
|
@ManyToOne(() => KpiCapacity, (kpiCapacity) => kpiCapacity.kpiUserCapacitys)
|
||||||
@JoinColumn({ name: "kpiCapacityId" })
|
@JoinColumn({ name: "kpiCapacityId" })
|
||||||
kpiCapacitys: KpiCapacity;
|
kpiCapacity: KpiCapacity;
|
||||||
}
|
}
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
import { Entity, Column, OneToMany, ManyToOne, JoinColumn } from "typeorm";
|
|
||||||
import { EntityBase } from "./base/Base";
|
|
||||||
import { KpiCapacity } from "./kpiCapacity";
|
|
||||||
import { KpiUserEvaluation } from "./kpiUserEvaluation";
|
|
||||||
|
|
||||||
@Entity("kpiUserDirector")
|
|
||||||
export class KpiUserDirector extends EntityBase {
|
|
||||||
@Column({
|
|
||||||
nullable: true,
|
|
||||||
length: 40,
|
|
||||||
comment: "คีย์นอก(FK)ของตาราง kpiUserEvaluation",
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
kpiUserEvaluationId: string;
|
|
||||||
|
|
||||||
@ManyToOne(() => KpiUserEvaluation, (kpiUserEvaluation) => kpiUserEvaluation.kpiUserDirectors)
|
|
||||||
@JoinColumn({ name: "kpiUserEvaluationId" })
|
|
||||||
kpiUserEvaluations: KpiUserEvaluation;
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
nullable: true,
|
|
||||||
length: 40,
|
|
||||||
comment: "คีย์นอก(FK)ของตาราง kpiCapacity",
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
kpiCapacityId: string;
|
|
||||||
|
|
||||||
@ManyToOne(() => KpiCapacity, (kpiCapacity) => kpiCapacity.kpiUserDirectors)
|
|
||||||
@JoinColumn({ name: "kpiCapacityId" })
|
|
||||||
kpiCapacitys: KpiCapacity;
|
|
||||||
}
|
|
||||||
|
|
@ -1,14 +1,10 @@
|
||||||
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 { KpiPeriod } from "./kpiPeriod";
|
import { KpiPeriod } from "./kpiPeriod";
|
||||||
import { KpiUserHead } from "./kpiUserHead";
|
|
||||||
import { KpiUserGroup } from "./kpiUserGroup";
|
|
||||||
import { KpiUserExecutive } from "./kpiUserExecutive";
|
|
||||||
import { KpiUserDirector } from "./kpiUserDirector";
|
|
||||||
import { KpiUserInspector } from "./kpiUserInspector";
|
|
||||||
import { KpiUserSpecial } from "./kpiUserSpecial";
|
import { KpiUserSpecial } from "./kpiUserSpecial";
|
||||||
import { KpiUserRole } from "./kpiUserRole";
|
import { KpiUserRole } from "./kpiUserRole";
|
||||||
import { KpiUserPlanned } from "./kpiUserPlanned";
|
import { KpiUserPlanned } from "./kpiUserPlanned";
|
||||||
|
import { KpiUserCapacity } from "./kpiUserCapacity";
|
||||||
@Entity("kpiUserEvaluation")
|
@Entity("kpiUserEvaluation")
|
||||||
export class KpiUserEvaluation extends EntityBase {
|
export class KpiUserEvaluation extends EntityBase {
|
||||||
@Column({
|
@Column({
|
||||||
|
|
@ -51,7 +47,8 @@ export class KpiUserEvaluation extends EntityBase {
|
||||||
})
|
})
|
||||||
profileId: string;
|
profileId: string;
|
||||||
|
|
||||||
@Column({ // PENDING = รอการประเมิน , INPROGRESS = กําลังประเมิน , DONE = ประเมินเสร็จสิ้น
|
@Column({
|
||||||
|
// PENDING = รอการประเมิน , INPROGRESS = กําลังประเมิน , DONE = ประเมินเสร็จสิ้น
|
||||||
nullable: true,
|
nullable: true,
|
||||||
length: 40,
|
length: 40,
|
||||||
comment: "สถานะการประเมินผล",
|
comment: "สถานะการประเมินผล",
|
||||||
|
|
@ -59,7 +56,8 @@ export class KpiUserEvaluation extends EntityBase {
|
||||||
})
|
})
|
||||||
evaluationStatus: string;
|
evaluationStatus: string;
|
||||||
|
|
||||||
@Column({ // PASSED = ผ่านการประเมิน , NOTPASSED = ไม่ผ่านการประเมิน
|
@Column({
|
||||||
|
// PASSED = ผ่านการประเมิน , NOTPASSED = ไม่ผ่านการประเมิน
|
||||||
nullable: true,
|
nullable: true,
|
||||||
length: 40,
|
length: 40,
|
||||||
comment: "ผลการประเมิน",
|
comment: "ผลการประเมิน",
|
||||||
|
|
@ -67,32 +65,20 @@ export class KpiUserEvaluation extends EntityBase {
|
||||||
})
|
})
|
||||||
evaluationResults: string;
|
evaluationResults: string;
|
||||||
|
|
||||||
@ManyToOne(() => KpiPeriod, (kpiPeriod) => kpiPeriod.kpiUserEvaluation)
|
@ManyToOne(() => KpiPeriod, (kpiPeriod) => kpiPeriod.kpiUserEvaluations)
|
||||||
@JoinColumn({ name: "kpiPeriodId" })
|
@JoinColumn({ name: "kpiPeriodId" })
|
||||||
kpiPeriod: KpiPeriod;
|
kpiPeriod: KpiPeriod;
|
||||||
|
|
||||||
@OneToMany(() => KpiUserHead, (kpiUserHead) => kpiUserHead.kpiUserEvaluations)
|
@OneToMany(() => KpiUserCapacity, (kpiUserCapacity) => kpiUserCapacity.kpiUserEvaluation)
|
||||||
kpiUserHeads: KpiUserHead[];
|
kpiUserCapacitys: KpiUserCapacity[];
|
||||||
|
|
||||||
@OneToMany(() => KpiUserGroup, (kpiUserGroup) => kpiUserGroup.kpiUserEvaluations)
|
@OneToMany(() => KpiUserPlanned, (kpiUserPlanned) => kpiUserPlanned.kpiUserEvaluation)
|
||||||
kpiUserGroups: KpiUserGroup[];
|
|
||||||
|
|
||||||
@OneToMany(() => KpiUserExecutive, (kpiUserExecutive) => kpiUserExecutive.kpiUserEvaluations)
|
|
||||||
kpiUserExecutives: KpiUserExecutive[];
|
|
||||||
|
|
||||||
@OneToMany(() => KpiUserDirector, (kpiUserDirector) => kpiUserDirector.kpiUserEvaluations)
|
|
||||||
kpiUserDirectors: KpiUserDirector[];
|
|
||||||
|
|
||||||
@OneToMany(() => KpiUserInspector, (kpiUserInspector) => kpiUserInspector.kpiUserEvaluations)
|
|
||||||
kpiUserInspectors: KpiUserInspector[];
|
|
||||||
|
|
||||||
@OneToMany(() => KpiUserPlanned, (kpiUserPlanned) => kpiUserPlanned.kpiUserEvaluations)
|
|
||||||
kpiUserPlanneds: KpiUserPlanned[];
|
kpiUserPlanneds: KpiUserPlanned[];
|
||||||
|
|
||||||
@OneToMany(() => KpiUserRole, (kpiUserRole) => kpiUserRole.kpiUserEvaluations)
|
@OneToMany(() => KpiUserRole, (kpiUserRole) => kpiUserRole.kpiUserEvaluation)
|
||||||
kpiUserRoles: KpiUserRole[];
|
kpiUserRoles: KpiUserRole[];
|
||||||
|
|
||||||
@OneToMany(() => KpiUserSpecial, (kpiUserSpecial) => kpiUserSpecial.kpiUserEvaluations)
|
@OneToMany(() => KpiUserSpecial, (kpiUserSpecial) => kpiUserSpecial.kpiUserEvaluation)
|
||||||
kpiUserSpecials: KpiUserSpecial[];
|
kpiUserSpecials: KpiUserSpecial[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
import { Entity, Column, OneToMany, ManyToOne, JoinColumn } from "typeorm";
|
|
||||||
import { EntityBase } from "./base/Base";
|
|
||||||
import { KpiCapacity } from "./kpiCapacity";
|
|
||||||
import { KpiUserEvaluation } from "./kpiUserEvaluation";
|
|
||||||
|
|
||||||
@Entity("kpiUserExecutive")
|
|
||||||
export class KpiUserExecutive extends EntityBase {
|
|
||||||
@Column({
|
|
||||||
nullable: true,
|
|
||||||
length: 40,
|
|
||||||
comment: "คีย์นอก(FK)ของตาราง kpiUserEvaluation",
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
kpiUserEvaluationId: string;
|
|
||||||
|
|
||||||
@ManyToOne(() => KpiUserEvaluation, (kpiUserEvaluation) => kpiUserEvaluation.kpiUserExecutives)
|
|
||||||
@JoinColumn({ name: "kpiUserEvaluationId" })
|
|
||||||
kpiUserEvaluations: KpiUserEvaluation;
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
nullable: true,
|
|
||||||
length: 40,
|
|
||||||
comment: "คีย์นอก(FK)ของตาราง kpiCapacity",
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
kpiCapacityId: string;
|
|
||||||
|
|
||||||
@ManyToOne(() => KpiCapacity, (kpiCapacity) => kpiCapacity.kpiUserExecutives)
|
|
||||||
@JoinColumn({ name: "kpiCapacityId" })
|
|
||||||
kpiCapacitys: KpiCapacity;
|
|
||||||
}
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
import { Entity, Column, OneToMany, ManyToOne, JoinColumn } from "typeorm";
|
|
||||||
import { EntityBase } from "./base/Base";
|
|
||||||
import { KpiCapacity } from "./kpiCapacity";
|
|
||||||
import { KpiUserEvaluation } from "./kpiUserEvaluation";
|
|
||||||
|
|
||||||
@Entity("kpiUserHead")
|
|
||||||
export class KpiUserHead extends EntityBase {
|
|
||||||
@Column({
|
|
||||||
nullable: true,
|
|
||||||
length: 40,
|
|
||||||
comment: "คีย์นอก(FK)ของตาราง kpiUserEvaluation",
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
kpiUserEvaluationId: string;
|
|
||||||
|
|
||||||
@ManyToOne(() => KpiUserEvaluation, (kpiUserEvaluation) => kpiUserEvaluation.kpiUserHeads)
|
|
||||||
@JoinColumn({ name: "kpiUserEvaluationId" })
|
|
||||||
kpiUserEvaluations: KpiUserEvaluation;
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
nullable: true,
|
|
||||||
length: 40,
|
|
||||||
comment: "คีย์นอก(FK)ของตาราง kpiCapacity",
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
kpiCapacityId: string;
|
|
||||||
|
|
||||||
@ManyToOne(() => KpiCapacity, (kpiCapacity) => kpiCapacity.kpiUserHeads)
|
|
||||||
@JoinColumn({ name: "kpiCapacityId" })
|
|
||||||
kpiCapacitys: KpiCapacity;
|
|
||||||
}
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
import { Entity, Column, OneToMany, ManyToOne, JoinColumn } from "typeorm";
|
|
||||||
import { EntityBase } from "./base/Base";
|
|
||||||
import { KpiCapacity } from "./kpiCapacity";
|
|
||||||
import { KpiUserEvaluation } from "./kpiUserEvaluation";
|
|
||||||
|
|
||||||
@Entity("kpiUserInspector")
|
|
||||||
export class KpiUserInspector extends EntityBase {
|
|
||||||
@Column({
|
|
||||||
nullable: true,
|
|
||||||
length: 40,
|
|
||||||
comment: "คีย์นอก(FK)ของตาราง kpiUserEvaluation",
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
kpiUserEvaluationId: string;
|
|
||||||
|
|
||||||
@ManyToOne(() => KpiUserEvaluation, (kpiUserEvaluation) => kpiUserEvaluation.kpiUserInspectors)
|
|
||||||
@JoinColumn({ name: "kpiUserEvaluationId" })
|
|
||||||
kpiUserEvaluations: KpiUserEvaluation;
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
nullable: true,
|
|
||||||
length: 40,
|
|
||||||
comment: "คีย์นอก(FK)ของตาราง kpiCapacity",
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
kpiCapacityId: string;
|
|
||||||
|
|
||||||
@ManyToOne(() => KpiCapacity, (kpiCapacity) => kpiCapacity.kpiUserInspectors)
|
|
||||||
@JoinColumn({ name: "kpiCapacityId" })
|
|
||||||
kpiCapacitys: KpiCapacity;
|
|
||||||
}
|
|
||||||
|
|
@ -50,7 +50,7 @@ export class KpiUserPlanned extends EntityBase {
|
||||||
|
|
||||||
@ManyToOne(() => KpiUserEvaluation, (kpiUserEvaluation) => kpiUserEvaluation.kpiUserPlanneds)
|
@ManyToOne(() => KpiUserEvaluation, (kpiUserEvaluation) => kpiUserEvaluation.kpiUserPlanneds)
|
||||||
@JoinColumn({ name: "kpiUserEvaluationId" })
|
@JoinColumn({ name: "kpiUserEvaluationId" })
|
||||||
kpiUserEvaluations: KpiUserEvaluation;
|
kpiUserEvaluation: KpiUserEvaluation;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
|
|
@ -62,5 +62,5 @@ export class KpiUserPlanned extends EntityBase {
|
||||||
|
|
||||||
@ManyToOne(() => KpiPlan, (kpiPlan) => kpiPlan.kpiUserPlanneds)
|
@ManyToOne(() => KpiPlan, (kpiPlan) => kpiPlan.kpiUserPlanneds)
|
||||||
@JoinColumn({ name: "kpiPlanId" })
|
@JoinColumn({ name: "kpiPlanId" })
|
||||||
kpiPlans: KpiPlan;
|
kpiPlan: KpiPlan;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ export class KpiUserRole extends EntityBase {
|
||||||
|
|
||||||
@ManyToOne(() => KpiUserEvaluation, (kpiUserEvaluation) => kpiUserEvaluation.kpiUserRoles)
|
@ManyToOne(() => KpiUserEvaluation, (kpiUserEvaluation) => kpiUserEvaluation.kpiUserRoles)
|
||||||
@JoinColumn({ name: "kpiUserEvaluationId" })
|
@JoinColumn({ name: "kpiUserEvaluationId" })
|
||||||
kpiUserEvaluations: KpiUserEvaluation;
|
kpiUserEvaluation: KpiUserEvaluation;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
|
|
@ -62,5 +62,5 @@ export class KpiUserRole extends EntityBase {
|
||||||
|
|
||||||
@ManyToOne(() => KpiRole, (kpiRole) => kpiRole.kpiUserRoles)
|
@ManyToOne(() => KpiRole, (kpiRole) => kpiRole.kpiUserRoles)
|
||||||
@JoinColumn({ name: "kpiRoleId" })
|
@JoinColumn({ name: "kpiRoleId" })
|
||||||
kpiRoles: KpiRole;
|
kpiRole: KpiRole;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ export class KpiUserSpecial extends EntityBase {
|
||||||
|
|
||||||
@ManyToOne(() => KpiUserEvaluation, (kpiUserEvaluation) => kpiUserEvaluation.kpiUserSpecials)
|
@ManyToOne(() => KpiUserEvaluation, (kpiUserEvaluation) => kpiUserEvaluation.kpiUserSpecials)
|
||||||
@JoinColumn({ name: "kpiUserEvaluationId" })
|
@JoinColumn({ name: "kpiUserEvaluationId" })
|
||||||
kpiUserEvaluations: KpiUserEvaluation;
|
kpiUserEvaluation: KpiUserEvaluation;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
|
|
@ -62,5 +62,5 @@ export class KpiUserSpecial extends EntityBase {
|
||||||
|
|
||||||
@ManyToOne(() => KpiSpecial, (kpiSpecial) => kpiSpecial.kpiUserSpecials)
|
@ManyToOne(() => KpiSpecial, (kpiSpecial) => kpiSpecial.kpiUserSpecials)
|
||||||
@JoinColumn({ name: "kpiSpecialId" })
|
@JoinColumn({ name: "kpiSpecialId" })
|
||||||
kpiSpecials: KpiSpecial;
|
kpiSpecial: KpiSpecial;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
18
src/migration/1713778172793-add_table_kpiUserSpecial1.ts
Normal file
18
src/migration/1713778172793-add_table_kpiUserSpecial1.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||||
|
|
||||||
|
export class AddTableKpiUserSpecial11713778172793 implements MigrationInterface {
|
||||||
|
name = 'AddTableKpiUserSpecial11713778172793'
|
||||||
|
|
||||||
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`CREATE TABLE \`kpiUserCapacity\` (\`id\` varchar(36) NOT NULL, \`createdAt\` datetime(6) NOT NULL COMMENT 'สร้างข้อมูลเมื่อ' DEFAULT CURRENT_TIMESTAMP(6), \`createdUserId\` varchar(40) NOT NULL COMMENT 'User Id ที่สร้างข้อมูล' DEFAULT '00000000-0000-0000-0000-000000000000', \`lastUpdatedAt\` datetime(6) NOT NULL COMMENT 'แก้ไขข้อมูลล่าสุดเมื่อ' DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`lastUpdateUserId\` varchar(40) NOT NULL COMMENT 'User Id ที่แก้ไขข้อมูล' DEFAULT '00000000-0000-0000-0000-000000000000', \`createdFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่สร้างข้อมูล' DEFAULT 'string', \`lastUpdateFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่แก้ไขข้อมูลล่าสุด' DEFAULT 'string', \`kpiUserEvaluationId\` varchar(40) NULL COMMENT 'คีย์นอก(FK)ของตาราง kpiUserEvaluation', \`kpiCapacityId\` varchar(40) NULL COMMENT 'คีย์นอก(FK)ของตาราง kpiCapacity', PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`kpiUserCapacity\` ADD CONSTRAINT \`FK_1aef260bab99de5f8278082da55\` FOREIGN KEY (\`kpiUserEvaluationId\`) REFERENCES \`kpiUserEvaluation\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`kpiUserCapacity\` ADD CONSTRAINT \`FK_d0bfc0e85bc171bcc631c621266\` FOREIGN KEY (\`kpiCapacityId\`) REFERENCES \`kpiCapacity\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`ALTER TABLE \`kpiUserCapacity\` DROP FOREIGN KEY \`FK_d0bfc0e85bc171bcc631c621266\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`kpiUserCapacity\` DROP FOREIGN KEY \`FK_1aef260bab99de5f8278082da55\``);
|
||||||
|
await queryRunner.query(`DROP TABLE \`kpiUserCapacity\``);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue