hrms-api-kpi/src/entities/kpiPlan.ts

408 lines
8.1 KiB
TypeScript

import { Entity, Column, OneToMany, ManyToOne, JoinColumn } from "typeorm";
import { EntityBase } from "./base/Base";
import { KpiLink } from "./kpiLink";
import { KpiPeriod } from "./kpiPeriod";
import { KpiUserPlanned } from "./kpiUserPlanned";
import { KpiPlanHistory } from "./kpiPlanHistory";
@Entity("kpiPlan")
export class KpiPlan extends EntityBase {
@Column({
nullable: true,
comment: "รอบ",
default: null,
})
period: string;
@Column({
nullable: true,
comment: "ปี",
default: null,
})
year: string;
@Column({
nullable: true,
comment: "ลำดับ/รหัสตัวชี้วัด",
default: null,
})
including: number;
@Column({
nullable: true,
comment: "ชื่อตัวชี้วัด",
default: null,
})
includingName: string;
@Column({
nullable: true,
comment: "ค่าเป้าหมาย",
default: null,
})
target: string;
@Column({
nullable: true,
comment: "หน่วยนับ",
default: null,
})
unit: string;
@Column({
nullable: true,
comment: "น้ำหนัก",
default: null,
})
weight: number;
@Column({
nullable: true,
comment: "ผลสำเร็จของงาน 1",
default: null,
})
achievement1: string;
@Column({
nullable: true,
comment: "ผลสำเร็จของงาน 2",
default: null,
})
achievement2: string;
@Column({
nullable: true,
comment: "ผลสำเร็จของงาน 3",
default: null,
})
achievement3: string;
@Column({
nullable: true,
comment: "ผลสำเร็จของงาน 4",
default: null,
})
achievement4: string;
@Column({
nullable: true,
comment: "ผลสำเร็จของงาน 5",
default: null,
})
achievement5: string;
@Column({
nullable: true,
comment: "นิยามหรือความหมาย",
default: null,
})
meaning: string;
@Column({
nullable: true,
comment: "สูตรคำนวณ",
default: null,
})
formula: string;
@Column({
nullable: true,
comment: "id หน่วยงาน",
default: null,
})
rootId: string;
@Column({
nullable: true,
comment: "ชื่อหน่วยงาน",
default: null,
})
root: string;
@Column({
nullable: true,
comment: "ชื่อย่อหน่วยงาน",
default: null,
})
rootShortName: string;
@Column({
nullable: true,
comment: "id หน่วยงาน child1",
default: null,
})
child1Id: string;
@Column({
nullable: true,
comment: "ชื่อหน่วยงาน child1",
default: null,
})
child1: string;
@Column({
nullable: true,
comment: "ชื่อย่อหน่วยงาน child1",
default: null,
})
child1ShortName: string;
@Column({
nullable: true,
comment: "id หน่วยงาน child2",
default: null,
})
child2Id: string;
@Column({
nullable: true,
comment: "ชื่อหน่วยงาน child2",
default: null,
})
child2: string;
@Column({
nullable: true,
comment: "ชื่อย่อหน่วยงาน child2",
default: null,
})
child2ShortName: string;
@Column({
nullable: true,
comment: "id หน่วยงาน child3",
default: null,
})
child3Id: string;
@Column({
nullable: true,
comment: "ชื่อหน่วยงาน child3",
default: null,
})
child3: string;
@Column({
nullable: true,
comment: "ชื่อย่อหน่วยงาน child3",
default: null,
})
child3ShortName: string;
@Column({
nullable: true,
comment: "id หน่วยงาน child4",
default: null,
})
child4Id: string;
@Column({
nullable: true,
comment: "ชื่อหน่วยงาน child4",
default: null,
})
child4: string;
@Column({
nullable: true,
comment: "ชื่อย่อหน่วยงาน child4",
default: null,
})
child4ShortName: string;
@Column({
nullable: true,
comment: "id revision",
default: null,
})
orgRevisionId: string;
@Column({
nullable: true,
length: 40,
comment: "คีย์นอก(FK)ของตาราง strategyChild1",
default: null,
})
strategyChild1Id: string;
@Column({
nullable: true,
comment: "ชื่อ strategyChild1",
default: null,
})
strategyChild1: string;
@Column({
nullable: true,
length: 40,
comment: "คีย์นอก(FK)ของตาราง strategyChild2",
default: null,
})
strategyChild2Id: string;
@Column({
nullable: true,
comment: "ชื่อ strategyChild2",
default: null,
})
strategyChild2: string;
@Column({
nullable: true,
length: 40,
comment: "คีย์นอก(FK)ของตาราง strategyChild3",
default: null,
})
strategyChild3Id: string;
@Column({
nullable: true,
comment: "ชื่อ strategyChild3",
default: null,
})
strategyChild3: string;
@Column({
nullable: true,
length: 40,
comment: "คีย์นอก(FK)ของตาราง strategyChild4",
default: null,
})
strategyChild4Id: string;
@Column({
nullable: true,
comment: "ชื่อ strategyChild4",
default: null,
})
strategyChild4: string;
@Column({
nullable: true,
length: 40,
comment: "คีย์นอก(FK)ของตาราง strategyChild5",
default: null,
})
strategyChild5Id: string;
@Column({
nullable: true,
comment: "ชื่อ strategyChild5",
default: null,
})
strategyChild5: string;
@Column({
nullable: true,
length: 40,
comment: "ไอดีรอบ",
default: null,
})
kpiPeriodId: string | null;
@Column({
nullable: true,
comment: "ข้อมูลเอกสารหลักฐาน",
default: null,
})
documentInfoEvidence: string;
@ManyToOne(() => KpiPeriod, (kpiPeriod) => kpiPeriod.kpiPlans)
@JoinColumn({ name: "kpiPeriodId" })
kpiPeriod: KpiPeriod;
@OneToMany(() => KpiUserPlanned, (kpiUserPlanned) => kpiUserPlanned.kpiPlan)
kpiUserPlanneds: KpiUserPlanned[];
@OneToMany(() => KpiPlanHistory, (kpiPlanHistory) => kpiPlanHistory.kpiPlan)
kpiPlanHistories: KpiPlanHistory[];
}
export class createKpiPlan {
// @Column()
// including: number | null;
@Column()
period: string | null;
@Column()
year: string | null;
@Column()
includingName: string | null;
@Column()
target: string | null;
@Column()
unit: string | null;
@Column()
weight: number | null;
@Column()
achievement1: string | null;
@Column()
achievement2: string | null;
@Column()
achievement3: string | null;
@Column()
achievement4: string | null;
@Column()
achievement5: string | null;
@Column()
meaning: string | null;
@Column()
formula: string | null;
@Column()
node: number;
@Column()
nodeId: string | null;
@Column()
orgRevisionId: string;
@Column()
strategy: number;
@Column()
strategyId: string | null;
// @Column()
// kpiPeriodId: string | null;
@Column()
documentInfoEvidence: string | null;
}
export class updateKpiPlan {
// @Column()
// including: number | null;
@Column()
period: string | null;
@Column()
year: string | null;
@Column()
includingName: string | null;
@Column()
target: string | null;
@Column()
unit: string | null;
@Column()
weight: number | null;
@Column()
achievement1: string | null;
@Column()
achievement2: string | null;
@Column()
achievement3: string | null;
@Column()
achievement4: string | null;
@Column()
achievement5: string | null;
@Column()
meaning: string | null;
@Column()
formula: string | null;
@Column()
node: number;
@Column()
nodeId: string | null;
@Column()
orgRevisionId: string;
@Column()
strategy: number;
@Column()
strategyId: string | null;
// @Column()
// kpiPeriodId: string | null;
@Column()
documentInfoEvidence: string | null;
}