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"; @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.kpiUserEvaluations) @JoinColumn({ name: "kpiPeriodId" }) kpiPeriod: KpiPeriod; @OneToMany(() => KpiUserCapacity, (kpiUserCapacity) => kpiUserCapacity.kpiUserEvaluation) kpiUserCapacitys: KpiUserCapacity[]; @OneToMany(() => KpiUserPlanned, (kpiUserPlanned) => kpiUserPlanned.kpiUserEvaluation) kpiUserPlanneds: KpiUserPlanned[]; @OneToMany(() => KpiUserRole, (kpiUserRole) => kpiUserRole.kpiUserEvaluation) kpiUserRoles: KpiUserRole[]; @OneToMany(() => KpiUserSpecial, (kpiUserSpecial) => kpiUserSpecial.kpiUserEvaluation) 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; }