entity สมถรรนะ
This commit is contained in:
parent
9e8ee365eb
commit
a009da25b7
6 changed files with 232 additions and 5 deletions
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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue