entity สมถรรนะ

This commit is contained in:
Bright 2024-04-18 15:42:30 +07:00
parent 9e8ee365eb
commit a009da25b7
6 changed files with 232 additions and 5 deletions

View 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;
}