24 lines
611 B
TypeScript
24 lines
611 B
TypeScript
import { Entity, Column, OneToMany, ManyToMany, ManyToOne, JoinColumn } from "typeorm";
|
|
import { EntityBase } from "./base/Base";
|
|
import { KpiLink } from "./kpiLink";
|
|
|
|
@Entity("position")
|
|
export class Position extends EntityBase {
|
|
@Column({
|
|
nullable: true,
|
|
comment: "ชื่อตำแหน่ง",
|
|
default: null,
|
|
})
|
|
name: string;
|
|
|
|
@Column({
|
|
nullable: true,
|
|
length: 40,
|
|
comment: "ไอดีเชื่อมโยง",
|
|
})
|
|
kpiLinkId: string | null;
|
|
|
|
@ManyToOne(() => KpiLink, (kpiLink) => kpiLink.positions)
|
|
@JoinColumn({ name: "kpiLinkId" })
|
|
kpiLink: KpiLink;
|
|
}
|