entity สมถรรนะ
This commit is contained in:
parent
9e8ee365eb
commit
a009da25b7
6 changed files with 232 additions and 5 deletions
63
src/entities/kpiCapacity.ts
Normal file
63
src/entities/kpiCapacity.ts
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
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;
|
||||
}
|
||||
45
src/entities/kpiCapacityDetail.ts
Normal file
45
src/entities/kpiCapacityDetail.ts
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
import { Entity, Column, OneToMany, ManyToOne, JoinColumn} from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { KpiCapacity } from "./kpiCapacity";
|
||||
|
||||
@Entity("kpiCapacityDetail")
|
||||
export class KpiCapacityDetail extends EntityBase {
|
||||
@Column({
|
||||
type: "longtext",
|
||||
comment: "คำอธิบายระดับ",
|
||||
})
|
||||
description: string;
|
||||
|
||||
@Column({
|
||||
comment: "ระดับ",
|
||||
})
|
||||
level: Number;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 40,
|
||||
comment: "คีย์นอก(FK)ของตาราง kpiCapacity",
|
||||
default: null,
|
||||
})
|
||||
kpiCapacityId: string;
|
||||
|
||||
@ManyToOne(() => KpiCapacity, (kpiCapacity) => kpiCapacity.KpiCapacityDetails)
|
||||
@JoinColumn({ name: "kpiCapacityId" })
|
||||
kpiCapacitys: KpiCapacity;
|
||||
|
||||
}
|
||||
export class createKpiCapacityDetail {
|
||||
@Column()
|
||||
description: string;
|
||||
|
||||
@Column()
|
||||
level: Number;
|
||||
}
|
||||
|
||||
export class updateKpiCapacityDetail {
|
||||
@Column()
|
||||
description: string;
|
||||
|
||||
@Column()
|
||||
level: Number;
|
||||
}
|
||||
|
|
@ -7,18 +7,17 @@ export class KpiEvaluation extends EntityBase {
|
|||
type: "longtext",
|
||||
comment: "เกณฑ์การประเมิน",
|
||||
})
|
||||
name: string;
|
||||
description: string;
|
||||
|
||||
@Column({
|
||||
comment: "ระดับคะแนน",
|
||||
})
|
||||
level: Number;
|
||||
|
||||
}
|
||||
|
||||
export class createKpiEvaluation {
|
||||
@Column()
|
||||
name: string;
|
||||
description: string;
|
||||
|
||||
@Column()
|
||||
level: Number;
|
||||
|
|
@ -26,8 +25,8 @@ export class createKpiEvaluation {
|
|||
|
||||
export class updateKpiEvaluation {
|
||||
@Column()
|
||||
name: string;
|
||||
|
||||
description: string;
|
||||
|
||||
@Column()
|
||||
level: Number;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue