import { Entity, Column, OneToMany, ManyToOne, JoinColumn } from "typeorm"; import { EntityBase } from "./base/Base"; 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 { KpiUserRole } from "./kpiUserRole"; import { KpiUserPlanned } from "./kpiUserPlanned"; @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; @Column({ // PENDING = รอการประเมิน , INPROGRESS = กําลังประเมิน , DONE = ประเมินเสร็จสิ้น nullable: true, length: 40, comment: "สถานะการประเมินผล", default: null, }) evaluationStatus: string; @Column({ // PASSED = ผ่านการประเมิน , NOTPASSED = ไม่ผ่านการประเมิน nullable: true, length: 40, comment: "ผลการประเมิน", default: null, }) evaluationResults: string; @ManyToOne(() => KpiPeriod, (kpiPeriod) => kpiPeriod.kpiUserEvaluation) @JoinColumn({ name: "kpiPeriodId" }) kpiPeriod: KpiPeriod; @OneToMany(() => KpiUserHead, (kpiUserHead) => kpiUserHead.kpiUserEvaluations) kpiUserHeads: KpiUserHead[]; @OneToMany(() => KpiUserGroup, (kpiUserGroup) => kpiUserGroup.kpiUserEvaluations) 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[]; @OneToMany(() => KpiUserRole, (kpiUserRole) => kpiUserRole.kpiUserEvaluations) kpiUserRoles: KpiUserRole[]; @OneToMany(() => KpiUserSpecial, (kpiUserSpecial) => kpiUserSpecial.kpiUserEvaluations) kpiUserSpecials: KpiUserSpecial[]; } export class createKpiUserEvaluation { @Column() prefix: string; @Column() firstName: string; @Column() lastName: string; @Column() kpiPeriodId: string; @Column() profileId: string; @Column() evaluationStatus: string; @Column() evaluationResults: string; } export class updateKpiUserEvaluation { @Column() prefix: string; @Column() firstName: string; @Column() lastName: string; @Column() kpiPeriodId: string; @Column() profileId: string; @Column() evaluationStatus: string; @Column() evaluationResults: string; }