เพิ่มlink relation

This commit is contained in:
Kittapath 2024-01-31 14:29:39 +07:00
parent a41e33c0d4
commit d74c3140fa
16 changed files with 416 additions and 139 deletions

View file

@ -1,6 +1,8 @@
import { Entity, Column, ManyToOne, JoinColumn, OneToOne, OneToMany } from "typeorm";
import { EntityBase } from "./base/Base";
import { PosType } from "./PosType";
import { Position } from "./Position";
import { PosDict } from "./PosDict";
// ENUM PosLevelAuthority
enum PosLevelAuthority {
HEAD = "HEAD",
@ -43,4 +45,9 @@ export class PosLevel extends EntityBase {
@JoinColumn({ name: "posTypeId" })
posType: PosType;
@OneToMany(() => Position, (position) => position.posLevel)
positions: Position[];
@OneToMany(() => PosDict, (posDict) => posDict.posLevel)
posDicts: PosDict[];
}