This commit is contained in:
Kittapath 2024-04-19 09:44:46 +07:00
parent c4a975b503
commit a9dd103ff8
16 changed files with 1484 additions and 15 deletions

25
src/entities/kpiLink.ts Normal file
View file

@ -0,0 +1,25 @@
import { Entity, Column, ManyToOne, JoinColumn, ManyToMany, OneToMany } from "typeorm";
import { EntityBase } from "./base/Base";
import { KpiGroup } from "./kpiGroup";
import { KpiCapacity } from "./kpiCapacity";
import { Position } from "./position";
@Entity("kpiLink")
export class KpiLink extends EntityBase {
@Column({
nullable: true,
length: 40,
comment: "ไอดีกลุ่มงาน",
})
kpiGroupId: string | null;
@ManyToOne(() => KpiGroup, (kpiGroup) => kpiGroup.kpiLinks)
@JoinColumn({ name: "kpiGroupId" })
kpiGroup: KpiGroup;
@ManyToMany(() => KpiCapacity, (kpiCapacity) => kpiCapacity.kpiLinks)
kpiCapacitys: KpiCapacity[];
@OneToMany(() => Position, (position) => position.kpiLink)
positions: Position[];
}