hrms-api-kpi/src/entities/kpiCapacity.ts
2024-04-18 15:42:30 +07:00

63 lines
1.6 KiB
TypeScript

import { Entity, Column, OneToMany, ManyToOne} from "typeorm";
import { EntityBase } from "./base/Base";
import { KpiCapacityDetail } from "./kpiCapacityDetail";
enum CapacityType {
HEAD = "HEAD",
GROUP = "GROUP",
EXECUTIVE = "EXECUTIVE",
DIRECTOR = "DIRECTOR",
INSPECTOR = "INSPECTOR",
}
@Entity("kpiCapacity")
export class KpiCapacity extends EntityBase {
@Column({
nullable: true,
comment:
"ประเภทสมรรถนะดังนี้ HEAD = สมรรถนะหลัก, GROUP = สมรรถนะประจำกลุ่ม, EXECUTIVE = สมรรถนะประจำผู้บริหารกรุงเทพมหานคร, "+
"DIRECTOR = สมรรถนะเฉพาะสำหรับตำแหน่ง ผอ., INSPECTOR = สมรรถนะเฉพาะสำหรับตำแหน่งผู้ตรวจราชการ",
type: "enum",
enum: CapacityType,
default: null,
})
type: CapacityType;
@Column({
nullable: true,
comment: "ชื่อสมรรถนะ",
default: null,
})
name: string;
@Column({
type: "longtext",
comment: "คำจำกัดความ",
})
description: string;
@OneToMany(() => KpiCapacityDetail, (kpiCapacityDetail) => kpiCapacityDetail.kpiCapacitys)
KpiCapacityDetails: KpiCapacityDetail[];
}
export class createKpiCapacity {
@Column()
type: string;
@Column()
name: string;
@Column()
description: string;
}
export class updateKpiCapacity {
@Column()
type: string;
@Column()
name: string;
@Column()
description: string;
}