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

49 lines
1 KiB
TypeScript
Raw Normal View History

2024-04-18 17:23:57 +07:00
import { Entity, Column, OneToMany, ManyToOne, JoinColumn } from "typeorm";
2024-04-18 15:42:30 +07:00
import { EntityBase } from "./base/Base";
import { KpiCapacity } from "./kpiCapacity";
@Entity("kpiCapacityDetail")
export class KpiCapacityDetail extends EntityBase {
@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;
@Column({
2024-04-18 17:23:57 +07:00
nullable: true,
2024-04-18 15:42:30 +07:00
comment: "ระดับ",
2024-04-18 17:23:57 +07:00
default: null,
2024-04-18 15:42:30 +07:00
})
2024-04-18 17:23:57 +07:00
level: string;
2024-04-18 15:42:30 +07:00
@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;
}