relation posMaster to Root and Child1-4

This commit is contained in:
AdisakKanthawilang 2024-01-31 15:31:20 +07:00
parent afc97292d3
commit 8cb8b449b4
6 changed files with 47 additions and 2 deletions

View file

@ -1,10 +1,11 @@
import { Entity, Column, ManyToOne, JoinColumn, OneToOne } from "typeorm";
import { Entity, Column, ManyToOne, JoinColumn, OneToOne, OneToMany } from "typeorm";
import { EntityBase } from "./base/Base";
import { OrgRoot } from "./OrgRoot";
import { OrgChild1 } from "./OrgChild1";
import { OrgChild2 } from "./OrgChild2";
import { OrgChild3 } from "./OrgChild3";
import { OrgRevision } from "./OrgRevision";
import { PosMaster } from "./PosMaster";
// ENUM orgChild4Rank
enum OrgChild4Rank {
DEPARTMENT = "DEPARTMENT",
@ -136,6 +137,9 @@ export class OrgChild4 extends EntityBase {
@ManyToOne(() => OrgChild3, (orgChild3) => orgChild3.orgChild4s)
@JoinColumn({ name: "orgChild3Id" })
orgChild3: OrgChild3;
@OneToMany(() => PosMaster, (posMaster) => posMaster.orgChild4)
posMasters: PosMaster[]
}
export class CreateOrgChild4 {