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 { KpiUserDevelopment } from "./kpiUserDevelopment"; @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, comment: "ตำแหน่ง", length: 255, default: null, }) position: string; @Column({ nullable: true, comment: "ประเภทตำแหน่ง", length: 100, default: null, }) posTypeName: string; @Column({ nullable: true, comment: "ระดับตำแหน่ง", length: 100, default: null, }) posLevelName: string; @Column({ nullable: true, comment: "ตำแหน่งทางการบริหาร", length: 255, default: null, }) posExecutiveName: string; @Column({ nullable: true, comment: "สังกัด", length: 255, default: null, }) org: string; @Column({ nullable: true, comment: "คำนำหน้าผู้ประเมิน", length: 255, default: null, }) prefixEvaluator: string; @Column({ nullable: true, comment: "ชื่อผู้ประเมิน", length: 255, default: null, }) firstNameEvaluator: string; @Column({ nullable: true, comment: "สกุลผู้ประเมิน", length: 255, default: null, }) lastNameEvaluator: string; @Column({ nullable: true, comment: "ตำแหน่งผู้ประเมิน", length: 255, default: null, }) positionEvaluator: string; @Column({ nullable: true, comment: "ประเภทตำแหน่งผู้ประเมิน", length: 100, default: null, }) posTypeNameEvaluator: string; @Column({ nullable: true, comment: "ระดับตำแหน่งผู้ประเมิน", length: 100, default: null, }) posLevelNameEvaluator: string; @Column({ nullable: true, comment: "สังกัดผู้ประเมิน", length: 255, default: null, }) orgEvaluator: string; @Column({ nullable: true, length: 40, comment: "ไอดีโปรไฟล์", default: null, }) profileId: string; @Column({ nullable: true, length: 40, comment: "ไอดีผู้ประเมิน", default: null, }) evaluatorId: string; @Column({ nullable: true, length: 40, comment: "ไอดีผู้บังคับบัญชาเหนือขึ้นไป", default: null, }) commanderId: string; @Column({ nullable: true, length: 40, comment: "ไอดีผู้บังคับบัญชาเหนือขึ้นไปอีกชั้นหนึ่ง", default: null, }) commanderHighId: string; @Column({ // "สถานะการประเมินผล ดังนี้ PENDING = รอดำเนินการ, INPROGRESS = กําลังดำเนินการ, DONE = ประเมินเสร็จสิ้น", nullable: true, length: 40, comment: "สถานะการประเมินผล ดังนี้ NEW = รอดำเนินการ, INPROGRESS = กําลังดำเนินการ, DONE = ประเมินเสร็จสิ้น", default: "NEW", }) evaluationStatus: string; @Column({ // "ผลการประเมิน ดังนี้ PENDING = รอดำเนินการ, PASSED = ผ่านการประเมิน, NOTPASSED = ไม่ผ่านการประเมิน", nullable: true, length: 40, comment: "ผลการประเมิน ดังนี้ PENDING = รอดำเนินการ, PASSED = ผ่านการประเมิน, NOTPASSED = ไม่ผ่านการประเมิน", default: "PENDING", }) evaluationResults: string; @Column({ nullable: true, length: 40, comment: "คำขอแก้ไข", default: null, }) evaluationReqEdit: string; @Column({ type: "double", nullable: true, default: 0, comment: "งานตามแผนปฏิบัติราชการประจำปี ร้อยละ", }) plannedPoint: number; @Column({ type: "double", nullable: true, default: 0, comment: "งานตามหน้าที่ความรับผิดชอบหลัก ร้อยละ", }) rolePoint: number; @Column({ type: "double", nullable: true, default: 0, comment: "งานที่ได้รับมอบหมายพิเศษ ร้อยละ", }) specialPoint: number; @Column({ type: "double", nullable: true, default: 0, comment: "สมรรถนะ ร้อยละ", }) capacityPoint: number; @Column({ type: "double", nullable: true, default: 0, comment: "คะแนนประเมินองค์ประกอบที่ 1", }) totalPoint1: number; @Column({ type: "double", nullable: true, default: 0, comment: "คะแนนประเมินองค์ประกอบที่ 2.1", }) totalPoint2_1: number; @Column({ type: "double", nullable: true, default: 0, comment: "คะแนนประเมินองค์ประกอบที่ 2.2", }) totalPoint2_2: number; @Column({ type: "double", nullable: true, default: 0, comment: "คะแนนประเมิน", }) summaryPoint: number; @Column({ type: "double", nullable: true, default: 0, comment: "คะแนนประเมินองค์ประกอบที่ 1", }) weightPoint1: number; @Column({ type: "double", nullable: true, default: 0, comment: "คะแนนประเมินองค์ประกอบที่ 2", }) weightPoint2: number; @Column({ type: "double", nullable: true, default: 0, comment: "คะแนนประเมิน", }) summaryWeight: number; @Column({ nullable: true, comment: "ชื่อเรื่อง/เนื้อหา/หัวข้อการพัฒนา", length: 255, default: null, }) topicEvaluator: string; @Column({ nullable: true, comment: "วิธีการพัฒนา", length: 255, default: null, }) developEvaluator: string; @Column({ nullable: true, comment: "ช่วงเวลาการพัฒนา", length: 255, default: null, }) timeEvaluator: string; @Column({ nullable: true, comment: "ความเห็นของผู้ประเมิน", length: 255, default: null, }) reasonEvaluator: string; @Column({ nullable: true, comment: "หมายเหตุ ผู้บังคับบัญชาเหนือขึ้นไป", default: false, }) isReasonCommander: boolean; @Column({ nullable: true, comment: "หมายเหตุ ผู้บังคับบัญชาเหนือขึ้นไป", length: 255, default: null, }) reasonCommander: string; @Column({ nullable: true, comment: "หมายเหตุ ผู้บังคับบัญชาเหนือขึ้นไปอีกชั้นหนึ่ง", default: false, }) isReasonCommanderHigh: boolean; @Column({ nullable: true, comment: "หมายเหตุ ผู้บังคับบัญชาเหนือขึ้นไปอีกชั้นหนึ่ง", length: 255, default: null, }) reasonCommanderHigh: string; @Column({ nullable: true, comment: "การรับทราบผลการประเมิน", default: false, }) isOpen: boolean; @Column({ nullable: true, type: "datetime", comment: "วันที่การรับทราบผลการประเมิน", default: null, }) openDate: Date | null; @Column({ nullable: true, length: 40, comment: "คีย์นอก(FK)ของตาราง kpiPeriodId", default: null, }) kpiPeriodId: 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[]; @OneToMany(() => KpiUserDevelopment, (kpiUserDevelopment) => kpiUserDevelopment.kpiUserEvaluation) kpiUserDevelopments: KpiUserDevelopment[]; } export class createKpiUserEvaluation { @Column() prefix?: string | null; @Column() firstName?: string | null; @Column() lastName?: string | null; @Column() position?: string | null; @Column() posTypeName?: string | null; @Column() posLevelName?: string | null; @Column() posExecutiveName?: string | null; @Column() kpiPeriodId: string; @Column() profileId?: string | null; @Column() evaluatorId: string | null; @Column() commanderId: string | null; @Column() commanderHighId: string | null; } export class updateKpiUserEvaluation { @Column() prefix: string; @Column() firstName: string; @Column() lastName: string; @Column() position: string | null; @Column() posTypeName: string | null; @Column() posLevelName: string | null; @Column() posExecutiveName: string | null; @Column() kpiPeriodId: string; @Column() profileId: string; } export class updateKpiUserCheckEvaluation { @Column() evaluatorId: string | null; @Column() commanderId: string | null; @Column() commanderHighId: string | null; } export class updateKpiUserPointEvaluation { @Column() totalPoint1?: number | null; @Column() totalPoint2_1?: number | null; @Column() totalPoint2_2?: number | null; @Column() summaryPoint?: number | null; } export class updateKpiUserReqEditEvaluation { @Column() status: string; } export class updateKpiUserStatusEvaluation { @Column() status: string; } export class updateKpiUserResultEvaluation { @Column() status: string; }