From b3adb67e4410e43999da21648866aa69b35e7a49 Mon Sep 17 00:00:00 2001 From: Kittapath Date: Wed, 8 May 2024 18:03:47 +0700 Subject: [PATCH] no message --- .../KpiUserEvaluationController.ts | 101 +++++++++--------- src/entities/kpiUserCapacity.ts | 9 +- src/entities/kpiUserDevelopment.ts | 9 +- src/entities/kpiUserEvaluation.ts | 7 -- src/entities/kpiUserEvaluationReason.ts | 56 ---------- .../kpiUserEvaluationReasonCapacity.ts | 83 ++++++++++++++ .../kpiUserEvaluationReasonDevelopment.ts | 83 ++++++++++++++ src/entities/kpiUserEvaluationReasonPlan.ts | 80 ++++++++++++++ src/entities/kpiUserEvaluationReasonRole.ts | 80 ++++++++++++++ .../kpiUserEvaluationReasonSpecial.ts | 83 ++++++++++++++ src/entities/kpiUserPlanned.ts | 9 +- src/entities/kpiUserRole.ts | 9 +- src/entities/kpiUserSpecial.ts | 9 +- 13 files changed, 497 insertions(+), 121 deletions(-) delete mode 100644 src/entities/kpiUserEvaluationReason.ts create mode 100644 src/entities/kpiUserEvaluationReasonCapacity.ts create mode 100644 src/entities/kpiUserEvaluationReasonDevelopment.ts create mode 100644 src/entities/kpiUserEvaluationReasonPlan.ts create mode 100644 src/entities/kpiUserEvaluationReasonRole.ts create mode 100644 src/entities/kpiUserEvaluationReasonSpecial.ts diff --git a/src/controllers/KpiUserEvaluationController.ts b/src/controllers/KpiUserEvaluationController.ts index 8ea7619..84e03f0 100644 --- a/src/controllers/KpiUserEvaluationController.ts +++ b/src/controllers/KpiUserEvaluationController.ts @@ -30,10 +30,6 @@ import { } from "../entities/kpiUserEvaluation"; import { Like, In, Brackets } from "typeorm"; import CallAPI from "../interfaces/call-api"; -import { - KpiUserEvaluationReason, - updateKpiUserReasonEvaluation, -} from "../entities/kpiUserEvaluationReason"; @Route("api/v1/kpi/user/evaluation") @Tags("kpiUserEvaluation") @@ -46,7 +42,6 @@ import { export class KpiUserEvaluationController extends Controller { private kpiPeriodRepository = AppDataSource.getRepository(KpiPeriod); private kpiUserEvalutionRepository = AppDataSource.getRepository(KpiUserEvaluation); - private kpiUserEvaluationReasonRepository = AppDataSource.getRepository(KpiUserEvaluationReason); /** * API @@ -195,56 +190,56 @@ export class KpiUserEvaluationController extends Controller { return new HttpSuccess(kpiUserEvaluation.id); } - /** - * API แก้ไขหมายเหตุ (USER) - * - * @summary แก้ไขหมายเหตุ (USER) - * - * @param {string} id Guid, *Id คนประเมิน (USER) - */ - @Put("{type}/{id}") - async updateKpiUserEvaluatorEvaluation( - @Path() id: string, - @Path() type: string, - @Body() requestBody: updateKpiUserReasonEvaluation, - @Request() request: { user: Record }, - ) { - const kpiUserEvaluation = await this.kpiUserEvalutionRepository.findOne({ - where: { id: id }, - }); - if (!kpiUserEvaluation) { - throw new HttpError( - HttpStatusCode.NOT_FOUND, - "ไม่พบข้อมูลรายการประเมินผลการปฏิบัติราชการระดับบุคคลนี้", - ); - } + // /** + // * API แก้ไขหมายเหตุ (USER) + // * + // * @summary แก้ไขหมายเหตุ (USER) + // * + // * @param {string} id Guid, *Id คนประเมิน (USER) + // */ + // @Put("{type}/{id}") + // async updateKpiUserEvaluatorEvaluation( + // @Path() id: string, + // @Path() type: string, + // @Body() requestBody: updateKpiUserReasonEvaluation, + // @Request() request: { user: Record }, + // ) { + // const kpiUserEvaluation = await this.kpiUserEvalutionRepository.findOne({ + // where: { id: id }, + // }); + // if (!kpiUserEvaluation) { + // throw new HttpError( + // HttpStatusCode.NOT_FOUND, + // "ไม่พบข้อมูลรายการประเมินผลการปฏิบัติราชการระดับบุคคลนี้", + // ); + // } - const kpiUserEvaluationReason = Object.assign(new KpiUserEvaluationReason(), requestBody); - kpiUserEvaluationReason.type = type.trim().toUpperCase(); - kpiUserEvaluationReason.kpiUserEvaluationId = id; - kpiUserEvaluationReason.createdUserId = request.user.sub; - kpiUserEvaluationReason.createdFullName = request.user.name; - kpiUserEvaluationReason.lastUpdateUserId = request.user.sub; - kpiUserEvaluationReason.lastUpdateFullName = request.user.name; - await this.kpiUserEvaluationReasonRepository.save(kpiUserEvaluationReason); - return new HttpSuccess(kpiUserEvaluation.id); - } + // const kpiUserEvaluationReason = Object.assign(new KpiUserEvaluationReason(), requestBody); + // kpiUserEvaluationReason.type = type.trim().toUpperCase(); + // kpiUserEvaluationReason.kpiUserEvaluationId = id; + // kpiUserEvaluationReason.createdUserId = request.user.sub; + // kpiUserEvaluationReason.createdFullName = request.user.name; + // kpiUserEvaluationReason.lastUpdateUserId = request.user.sub; + // kpiUserEvaluationReason.lastUpdateFullName = request.user.name; + // await this.kpiUserEvaluationReasonRepository.save(kpiUserEvaluationReason); + // return new HttpSuccess(kpiUserEvaluation.id); + // } - /** - * API list หมายเหตุ (USER) - * - * @summary list หมายเหตุ (USER) - * - * @param {string} id Guid, *Id คนประเมิน (USER) - */ - @Get("{type}/{id}") - async listKpiUserCommanderEvaluation(@Path() id: string, @Path() type: string) { - const kpiUserEvaluationReason = await this.kpiUserEvaluationReasonRepository.find({ - where: { kpiUserEvaluationId: id, type: type.trim().toUpperCase() }, - order: { createdAt: "ASC" }, - }); - return new HttpSuccess(kpiUserEvaluationReason); - } + // /** + // * API list หมายเหตุ (USER) + // * + // * @summary list หมายเหตุ (USER) + // * + // * @param {string} id Guid, *Id คนประเมิน (USER) + // */ + // @Get("{type}/{id}") + // async listKpiUserCommanderEvaluation(@Path() id: string, @Path() type: string) { + // const kpiUserEvaluationReason = await this.kpiUserEvaluationReasonRepository.find({ + // where: { kpiUserEvaluationId: id, type: type.trim().toUpperCase() }, + // order: { createdAt: "ASC" }, + // }); + // return new HttpSuccess(kpiUserEvaluationReason); + // } /** * API แก้ไขรายการประเมินผลการปฏิบัติราชการระดับบุคคล (USER) diff --git a/src/entities/kpiUserCapacity.ts b/src/entities/kpiUserCapacity.ts index 6a5d405..46f33c4 100644 --- a/src/entities/kpiUserCapacity.ts +++ b/src/entities/kpiUserCapacity.ts @@ -2,6 +2,7 @@ import { Entity, Column, OneToMany, ManyToOne, JoinColumn } from "typeorm"; import { EntityBase } from "./base/Base"; import { KpiCapacity } from "./kpiCapacity"; import { KpiUserEvaluation } from "./kpiUserEvaluation"; +import { KpiUserEvaluationReasonCapacity } from "./kpiUserEvaluationReasonCapacity"; @Entity("kpiUserCapacity") export class KpiUserCapacity extends EntityBase { @@ -57,9 +58,15 @@ export class KpiUserCapacity extends EntityBase { @ManyToOne(() => KpiCapacity, (kpiCapacity) => kpiCapacity.kpiUserCapacitys) @JoinColumn({ name: "kpiCapacityId" }) kpiCapacity: KpiCapacity; + + @OneToMany( + () => KpiUserEvaluationReasonCapacity, + (kpiUserEvaluationReasonCapacity) => kpiUserEvaluationReasonCapacity.kpiUserCapacity, + ) + kpiUserEvaluationReasonCapacitys: KpiUserEvaluationReasonCapacity[]; } export class KpiUserCapacityDataPoint { id: string; point: number; -} \ No newline at end of file +} diff --git a/src/entities/kpiUserDevelopment.ts b/src/entities/kpiUserDevelopment.ts index 3650569..bf15964 100644 --- a/src/entities/kpiUserDevelopment.ts +++ b/src/entities/kpiUserDevelopment.ts @@ -1,6 +1,7 @@ -import { Entity, Column, ManyToOne, JoinColumn } from "typeorm"; +import { Entity, Column, ManyToOne, JoinColumn, OneToMany } from "typeorm"; import { EntityBase } from "./base/Base"; import { KpiUserEvaluation } from "./kpiUserEvaluation"; +import { KpiUserEvaluationReasonDevelopment } from "./kpiUserEvaluationReasonDevelopment"; @Entity("kpiUserDevelopment") export class KpiUserDevelopment extends EntityBase { @@ -76,6 +77,12 @@ export class KpiUserDevelopment extends EntityBase { @ManyToOne(() => KpiUserEvaluation, (kpiUserEvaluation) => kpiUserEvaluation.kpiUserDevelopments) @JoinColumn({ name: "kpiUserEvaluationId" }) kpiUserEvaluation: KpiUserEvaluation; + + @OneToMany( + () => KpiUserEvaluationReasonDevelopment, + (kpiUserEvaluationReasonDevelopment) => kpiUserEvaluationReasonDevelopment.kpiUserDevelopment, + ) + kpiUserEvaluationReasonDevelopments: KpiUserEvaluationReasonDevelopment[]; } export class CreateKpiUserDevelopment { diff --git a/src/entities/kpiUserEvaluation.ts b/src/entities/kpiUserEvaluation.ts index 81ae81c..354359e 100644 --- a/src/entities/kpiUserEvaluation.ts +++ b/src/entities/kpiUserEvaluation.ts @@ -5,7 +5,6 @@ import { KpiUserSpecial } from "./kpiUserSpecial"; import { KpiUserRole } from "./kpiUserRole"; import { KpiUserPlanned } from "./kpiUserPlanned"; import { KpiUserCapacity } from "./kpiUserCapacity"; -import { KpiUserEvaluationReason } from "./kpiUserEvaluationReason"; import { KpiUserDevelopment } from "./kpiUserDevelopment"; @Entity("kpiUserEvaluation") export class KpiUserEvaluation extends EntityBase { @@ -149,12 +148,6 @@ export class KpiUserEvaluation extends EntityBase { @OneToMany(() => KpiUserDevelopment, (kpiUserDevelopment) => kpiUserDevelopment.kpiUserEvaluation) kpiUserDevelopments: KpiUserDevelopment[]; - - @OneToMany( - () => KpiUserEvaluationReason, - (kpiUserEvaluationReason) => kpiUserEvaluationReason.kpiUserEvaluation, - ) - kpiUserEvaluationReasons: KpiUserEvaluationReason[]; } export class createKpiUserEvaluation { diff --git a/src/entities/kpiUserEvaluationReason.ts b/src/entities/kpiUserEvaluationReason.ts deleted file mode 100644 index 94e545b..0000000 --- a/src/entities/kpiUserEvaluationReason.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { Entity, Column, OneToMany, ManyToOne, JoinColumn } from "typeorm"; -import { EntityBase } from "./base/Base"; -import { KpiPeriod } from "./kpiPeriod"; -import { KpiUserSpecial } from "./kpiUserSpecial"; -import { KpiUserRole } from "./kpiUserRole"; -import { KpiUserPlanned } from "./kpiUserPlanned"; -import { KpiUserCapacity } from "./kpiUserCapacity"; -import { KpiUserEvaluation } from "./kpiUserEvaluation"; -@Entity("kpiUserEvaluationReason") -export class KpiUserEvaluationReason extends EntityBase { - @Column({ - nullable: true, - comment: "หมายเหตุ", - length: 255, - default: null, - }) - reason: string; - - @Column({ - nullable: true, - comment: "หัวข้อ", - length: 255, - default: null, - }) - topic: string; - - @Column({ - nullable: true, - comment: "ประเภท", - length: 255, - default: null, - }) - type: string; - - @Column({ - nullable: true, - length: 40, - comment: "คีย์นอก(FK)ของตาราง kpiPeriodId", - default: null, - }) - kpiUserEvaluationId: string; - - @ManyToOne( - () => KpiUserEvaluation, - (kpiUserEvaluation) => kpiUserEvaluation.kpiUserEvaluationReasons, - ) - @JoinColumn({ name: "kpiUserEvaluationId" }) - kpiUserEvaluation: KpiUserEvaluation; -} - -export class updateKpiUserReasonEvaluation { - @Column() - reason: string | null; - @Column() - topic: string | null; -} diff --git a/src/entities/kpiUserEvaluationReasonCapacity.ts b/src/entities/kpiUserEvaluationReasonCapacity.ts new file mode 100644 index 0000000..f46ffa1 --- /dev/null +++ b/src/entities/kpiUserEvaluationReasonCapacity.ts @@ -0,0 +1,83 @@ +import { Entity, Column, ManyToOne, JoinColumn } from "typeorm"; +import { EntityBase } from "./base/Base"; +import { KpiUserCapacity } from "./kpiUserCapacity"; +@Entity("kpiUserEvaluationReasonCapacity") +export class KpiUserEvaluationReasonCapacity extends EntityBase { + @Column({ + nullable: true, + comment: "หัวข้อ", + length: 255, + default: null, + }) + topic: string; + + @Column({ + nullable: true, + comment: "หมายเหตุ", + length: 255, + default: null, + }) + reason: string; + + @Column({ + nullable: true, + comment: "หมายเหตุ ผู้ประเมิน", + length: 255, + default: null, + }) + reasonEvaluator: string; + + @Column({ + nullable: true, + comment: "หมายเหตุ ผู้บังคับบัญชาเหนือขึ้นไป", + length: 255, + default: null, + }) + reasonCommander: string; + + @Column({ + nullable: true, + comment: "หมายเหตุ ผู้บังคับบัญชาเหนือขึ้นไปอีกชั้นหนึ่ง", + length: 255, + default: null, + }) + reasonCommanderHigh: string; + + @Column({ + nullable: true, + comment: "สถานะ DRAFT EVALUATOR COMMANDER COMMANDERHIGH", + length: 255, + default: "DRAFT", + }) + status: string; + + @Column({ + nullable: true, + comment: "ประเภท PROGRESS PROBLEM", + length: 255, + default: null, + }) + type: string; + + @Column({ + nullable: true, + length: 40, + comment: "คีย์นอก(FK)ของตาราง kpiUserCapacity", + default: null, + }) + kpiUserCapacityId: string; + + @ManyToOne( + () => KpiUserCapacity, + (kpiUserCapacity) => kpiUserCapacity.kpiUserEvaluationReasonCapacitys, + ) + @JoinColumn({ name: "kpiUserCapacityId" }) + kpiUserCapacity: KpiUserCapacity; +} + +export class updateKpiUserReasonEvaluation { + @Column() + reason: string | null; + @Column() + topic: string | null; +} diff --git a/src/entities/kpiUserEvaluationReasonDevelopment.ts b/src/entities/kpiUserEvaluationReasonDevelopment.ts new file mode 100644 index 0000000..1272beb --- /dev/null +++ b/src/entities/kpiUserEvaluationReasonDevelopment.ts @@ -0,0 +1,83 @@ +import { Entity, Column, ManyToOne, JoinColumn } from "typeorm"; +import { EntityBase } from "./base/Base"; +import { KpiUserDevelopment } from "./kpiUserDevelopment"; +@Entity("kpiUserEvaluationReasonDevelopment") +export class KpiUserEvaluationReasonDevelopment extends EntityBase { + @Column({ + nullable: true, + comment: "หัวข้อ", + length: 255, + default: null, + }) + topic: string; + + @Column({ + nullable: true, + comment: "หมายเหตุ", + length: 255, + default: null, + }) + reason: string; + + @Column({ + nullable: true, + comment: "หมายเหตุ ผู้ประเมิน", + length: 255, + default: null, + }) + reasonEvaluator: string; + + @Column({ + nullable: true, + comment: "หมายเหตุ ผู้บังคับบัญชาเหนือขึ้นไป", + length: 255, + default: null, + }) + reasonCommander: string; + + @Column({ + nullable: true, + comment: "หมายเหตุ ผู้บังคับบัญชาเหนือขึ้นไปอีกชั้นหนึ่ง", + length: 255, + default: null, + }) + reasonCommanderHigh: string; + + @Column({ + nullable: true, + comment: "สถานะ DRAFT EVALUATOR COMMANDER COMMANDERHIGH", + length: 255, + default: "DRAFT", + }) + status: string; + + @Column({ + nullable: true, + comment: "ประเภท PROGRESS PROBLEM", + length: 255, + default: null, + }) + type: string; + + @Column({ + nullable: true, + length: 40, + comment: "คีย์นอก(FK)ของตาราง kpiUserDevelopment", + default: null, + }) + kpiUserDevelopmentId: string; + + @ManyToOne( + () => KpiUserDevelopment, + (kpiUserDevelopment) => kpiUserDevelopment.kpiUserEvaluationReasonDevelopments, + ) + @JoinColumn({ name: "kpiUserDevelopmentId" }) + kpiUserDevelopment: KpiUserDevelopment; +} + +export class updateKpiUserReasonEvaluation { + @Column() + reason: string | null; + @Column() + topic: string | null; +} diff --git a/src/entities/kpiUserEvaluationReasonPlan.ts b/src/entities/kpiUserEvaluationReasonPlan.ts new file mode 100644 index 0000000..e9b9ad7 --- /dev/null +++ b/src/entities/kpiUserEvaluationReasonPlan.ts @@ -0,0 +1,80 @@ +import { Entity, Column, ManyToOne, JoinColumn } from "typeorm"; +import { EntityBase } from "./base/Base"; +import { KpiUserPlanned } from "./kpiUserPlanned"; +@Entity("kpiUserEvaluationReasonPlan") +export class KpiUserEvaluationReasonPlan extends EntityBase { + @Column({ + nullable: true, + comment: "หัวข้อ", + length: 255, + default: null, + }) + topic: string; + + @Column({ + nullable: true, + comment: "หมายเหตุ", + length: 255, + default: null, + }) + reason: string; + + @Column({ + nullable: true, + comment: "หมายเหตุ ผู้ประเมิน", + length: 255, + default: null, + }) + reasonEvaluator: string; + + @Column({ + nullable: true, + comment: "หมายเหตุ ผู้บังคับบัญชาเหนือขึ้นไป", + length: 255, + default: null, + }) + reasonCommander: string; + + @Column({ + nullable: true, + comment: "หมายเหตุ ผู้บังคับบัญชาเหนือขึ้นไปอีกชั้นหนึ่ง", + length: 255, + default: null, + }) + reasonCommanderHigh: string; + + @Column({ + nullable: true, + comment: "สถานะ DRAFT EVALUATOR COMMANDER COMMANDERHIGH", + length: 255, + default: "DRAFT", + }) + status: string; + + @Column({ + nullable: true, + comment: "ประเภท PROGRESS PROBLEM", + length: 255, + default: null, + }) + type: string; + + @Column({ + nullable: true, + length: 40, + comment: "คีย์นอก(FK)ของตาราง kpiUserPlan", + default: null, + }) + kpiUserPlannedId: string; + + @ManyToOne(() => KpiUserPlanned, (kpiUserPlanned) => kpiUserPlanned.kpiUserEvaluationReasonPlans) + @JoinColumn({ name: "kpiUserPlanId" }) + kpiUserPlanned: KpiUserPlanned; +} + +export class updateKpiUserReasonEvaluation { + @Column() + reason: string | null; + @Column() + topic: string | null; +} diff --git a/src/entities/kpiUserEvaluationReasonRole.ts b/src/entities/kpiUserEvaluationReasonRole.ts new file mode 100644 index 0000000..1e13c9a --- /dev/null +++ b/src/entities/kpiUserEvaluationReasonRole.ts @@ -0,0 +1,80 @@ +import { Entity, Column, ManyToOne, JoinColumn } from "typeorm"; +import { EntityBase } from "./base/Base"; +import { KpiUserRole } from "./kpiUserRole"; +@Entity("kpiUserEvaluationReasonRole") +export class KpiUserEvaluationReasonRole extends EntityBase { + @Column({ + nullable: true, + comment: "หัวข้อ", + length: 255, + default: null, + }) + topic: string; + + @Column({ + nullable: true, + comment: "หมายเหตุ", + length: 255, + default: null, + }) + reason: string; + + @Column({ + nullable: true, + comment: "หมายเหตุ ผู้ประเมิน", + length: 255, + default: null, + }) + reasonEvaluator: string; + + @Column({ + nullable: true, + comment: "หมายเหตุ ผู้บังคับบัญชาเหนือขึ้นไป", + length: 255, + default: null, + }) + reasonCommander: string; + + @Column({ + nullable: true, + comment: "หมายเหตุ ผู้บังคับบัญชาเหนือขึ้นไปอีกชั้นหนึ่ง", + length: 255, + default: null, + }) + reasonCommanderHigh: string; + + @Column({ + nullable: true, + comment: "สถานะ DRAFT EVALUATOR COMMANDER COMMANDERHIGH", + length: 255, + default: "DRAFT", + }) + status: string; + + @Column({ + nullable: true, + comment: "ประเภท PROGRESS PROBLEM", + length: 255, + default: null, + }) + type: string; + + @Column({ + nullable: true, + length: 40, + comment: "คีย์นอก(FK)ของตาราง kpiUserRole", + default: null, + }) + kpiUserRoleId: string; + + @ManyToOne(() => KpiUserRole, (kpiUserRole) => kpiUserRole.kpiUserEvaluationReasonRoles) + @JoinColumn({ name: "kpiUserRoleId" }) + kpiUserRole: KpiUserRole; +} + +export class updateKpiUserReasonEvaluation { + @Column() + reason: string | null; + @Column() + topic: string | null; +} diff --git a/src/entities/kpiUserEvaluationReasonSpecial.ts b/src/entities/kpiUserEvaluationReasonSpecial.ts new file mode 100644 index 0000000..900c46c --- /dev/null +++ b/src/entities/kpiUserEvaluationReasonSpecial.ts @@ -0,0 +1,83 @@ +import { Entity, Column, ManyToOne, JoinColumn } from "typeorm"; +import { EntityBase } from "./base/Base"; +import { KpiUserSpecial } from "./kpiUserSpecial"; +@Entity("kpiUserEvaluationReasonSpecial") +export class KpiUserEvaluationReasonSpecial extends EntityBase { + @Column({ + nullable: true, + comment: "หัวข้อ", + length: 255, + default: null, + }) + topic: string; + + @Column({ + nullable: true, + comment: "หมายเหตุ", + length: 255, + default: null, + }) + reason: string; + + @Column({ + nullable: true, + comment: "หมายเหตุ ผู้ประเมิน", + length: 255, + default: null, + }) + reasonEvaluator: string; + + @Column({ + nullable: true, + comment: "หมายเหตุ ผู้บังคับบัญชาเหนือขึ้นไป", + length: 255, + default: null, + }) + reasonCommander: string; + + @Column({ + nullable: true, + comment: "หมายเหตุ ผู้บังคับบัญชาเหนือขึ้นไปอีกชั้นหนึ่ง", + length: 255, + default: null, + }) + reasonCommanderHigh: string; + + @Column({ + nullable: true, + comment: "สถานะ DRAFT EVALUATOR COMMANDER COMMANDERHIGH", + length: 255, + default: "DRAFT", + }) + status: string; + + @Column({ + nullable: true, + comment: "ประเภท PROGRESS PROBLEM", + length: 255, + default: null, + }) + type: string; + + @Column({ + nullable: true, + length: 40, + comment: "คีย์นอก(FK)ของตาราง kpiUserSpecial", + default: null, + }) + kpiUserSpecialId: string; + + @ManyToOne( + () => KpiUserSpecial, + (kpiUserSpecial) => kpiUserSpecial.kpiUserEvaluationReasonSpecials, + ) + @JoinColumn({ name: "kpiUserSpecialId" }) + kpiUserSpecial: KpiUserSpecial; +} + +export class updateKpiUserReasonEvaluation { + @Column() + reason: string | null; + @Column() + topic: string | null; +} diff --git a/src/entities/kpiUserPlanned.ts b/src/entities/kpiUserPlanned.ts index ecd9875..92e52cc 100644 --- a/src/entities/kpiUserPlanned.ts +++ b/src/entities/kpiUserPlanned.ts @@ -1,7 +1,8 @@ -import { Entity, Column, ManyToOne, JoinColumn } from "typeorm"; +import { Entity, Column, ManyToOne, JoinColumn, OneToMany } from "typeorm"; import { EntityBase } from "./base/Base"; import { KpiUserEvaluation } from "./kpiUserEvaluation"; import { KpiPlan } from "./kpiPlan"; +import { KpiUserEvaluationReasonPlan } from "./kpiUserEvaluationReasonPlan"; @Entity("kpiUserPlanned") export class KpiUserPlanned extends EntityBase { @@ -136,6 +137,12 @@ export class KpiUserPlanned extends EntityBase { default: null, }) achievement5: string; + + @OneToMany( + () => KpiUserEvaluationReasonPlan, + (kpiUserEvaluationReasonPlan) => kpiUserEvaluationReasonPlan.kpiUserPlanned, + ) + kpiUserEvaluationReasonPlans: KpiUserEvaluationReasonPlan[]; } export class CreateKpiUserPlanned { diff --git a/src/entities/kpiUserRole.ts b/src/entities/kpiUserRole.ts index fd2419f..d9b2ede 100644 --- a/src/entities/kpiUserRole.ts +++ b/src/entities/kpiUserRole.ts @@ -1,8 +1,9 @@ -import { Entity, Column, ManyToOne, JoinColumn } from "typeorm"; +import { Entity, Column, ManyToOne, JoinColumn, OneToMany } from "typeorm"; import { EntityBase } from "./base/Base"; import { KpiUserEvaluation } from "./kpiUserEvaluation"; import { KpiRole } from "./kpiRole"; import { Double } from "typeorm/browser"; +import { KpiUserEvaluationReasonRole } from "./kpiUserEvaluationReasonRole"; @Entity("kpiUserRole") export class KpiUserRole extends EntityBase { @@ -137,6 +138,12 @@ export class KpiUserRole extends EntityBase { default: null, }) achievement5: string; + + @OneToMany( + () => KpiUserEvaluationReasonRole, + (kpiUserEvaluationReasonRole) => kpiUserEvaluationReasonRole.kpiUserRole, + ) + kpiUserEvaluationReasonRoles: KpiUserEvaluationReasonRole[]; } export class CreateKpiUserRole { diff --git a/src/entities/kpiUserSpecial.ts b/src/entities/kpiUserSpecial.ts index 83a7d0e..dc302df 100644 --- a/src/entities/kpiUserSpecial.ts +++ b/src/entities/kpiUserSpecial.ts @@ -1,6 +1,7 @@ -import { Entity, Column, ManyToOne, JoinColumn } from "typeorm"; +import { Entity, Column, ManyToOne, JoinColumn, OneToMany } from "typeorm"; import { EntityBase } from "./base/Base"; import { KpiUserEvaluation } from "./kpiUserEvaluation"; +import { KpiUserEvaluationReasonSpecial } from "./kpiUserEvaluationReasonSpecial"; @Entity("kpiUserSpecial") export class KpiUserSpecial extends EntityBase { @@ -158,6 +159,12 @@ export class KpiUserSpecial extends EntityBase { @ManyToOne(() => KpiUserEvaluation, (kpiUserEvaluation) => kpiUserEvaluation.kpiUserSpecials) @JoinColumn({ name: "kpiUserEvaluationId" }) kpiUserEvaluation: KpiUserEvaluation; + + @OneToMany( + () => KpiUserEvaluationReasonSpecial, + (kpiUserEvaluationReasonSpecial) => kpiUserEvaluationReasonSpecial.kpiUserSpecial, + ) + kpiUserEvaluationReasonSpecials: KpiUserEvaluationReasonSpecial[]; } export class CreateKpiUserSpecial {