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

65 lines
1.7 KiB
TypeScript
Raw Normal View History

2024-04-18 17:23:57 +07:00
import { Entity, Column, OneToMany, ManyToOne } from "typeorm";
2024-04-18 15:42:30 +07:00
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:
2024-04-18 17:23:57 +07:00
"ประเภทสมรรถนะดังนี้ HEAD = สมรรถนะหลัก, GROUP = สมรรถนะประจำกลุ่ม, EXECUTIVE = สมรรถนะประจำผู้บริหารกรุงเทพมหานคร, " +
2024-04-18 15:42:30 +07:00
"DIRECTOR = สมรรถนะเฉพาะสำหรับตำแหน่ง ผอ., INSPECTOR = สมรรถนะเฉพาะสำหรับตำแหน่งผู้ตรวจราชการ",
type: "enum",
enum: CapacityType,
default: null,
})
type: CapacityType;
@Column({
nullable: true,
comment: "ชื่อสมรรถนะ",
default: null,
})
name: string;
@Column({
2024-04-18 17:23:57 +07:00
nullable: true,
2024-04-18 15:42:30 +07:00
type: "longtext",
comment: "คำจำกัดความ",
2024-04-18 17:23:57 +07:00
default: null,
2024-04-18 15:42:30 +07:00
})
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;
}