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

74 lines
2 KiB
TypeScript
Raw Normal View History

2024-04-22 15:50:04 +07:00
import { Entity, Column, OneToMany, ManyToMany, JoinTable } from "typeorm";
2024-04-18 15:42:30 +07:00
import { EntityBase } from "./base/Base";
import { KpiCapacityDetail } from "./kpiCapacityDetail";
2024-04-19 09:44:46 +07:00
import { KpiLink } from "./kpiLink";
2024-04-22 16:30:24 +07:00
import { KpiUserCapacity } from "./kpiUserCapacity";
2024-04-18 15:42:30 +07:00
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;
2024-04-22 16:30:24 +07:00
@OneToMany(() => KpiCapacityDetail, (kpiCapacityDetail) => kpiCapacityDetail.kpiCapacity)
2024-04-22 15:50:04 +07:00
kpiCapacityDetails: KpiCapacityDetail[];
2024-04-19 09:44:46 +07:00
@ManyToMany(() => KpiLink, (kpiLink) => kpiLink.kpiCapacitys)
2024-04-19 10:24:11 +07:00
@JoinTable()
2024-04-19 09:44:46 +07:00
kpiLinks: KpiLink[];
2024-04-22 15:50:04 +07:00
2024-04-22 16:30:24 +07:00
@OneToMany(() => KpiUserCapacity, (kpiUserCapacity) => kpiUserCapacity.kpiCapacity)
kpiUserCapacitys: KpiUserCapacity[];
2024-04-18 15:42:30 +07:00
}
export class createKpiCapacity {
@Column()
type: string;
@Column()
name: string;
@Column()
description: string;
}
export class updateKpiCapacity {
@Column()
type: string;
@Column()
name: string;
@Column()
description: string;
}