เพิ่ม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,11 @@
import { Entity, Column, ManyToOne, JoinColumn, OneToOne, OneToMany } from "typeorm";
import { EntityBase } from "./base/Base";
import { OrgRoot } from "./OrgRoot";
import { PosMaster } from "./PosMaster";
import { OrgChild1 } from "./OrgChild1";
import { OrgChild2 } from "./OrgChild2";
import { OrgChild3 } from "./OrgChild3";
import { OrgChild4 } from "./OrgChild4";
@Entity("orgRevision")
export class OrgRevision extends EntityBase {
@ -46,8 +51,23 @@ export class OrgRevision extends EntityBase {
})
orgRevisionIsDraft: boolean;
@OneToMany(() => PosMaster, (posMaster) => posMaster.orgRevision)
posMasters: PosMaster[];
@OneToMany(() => OrgRoot, (orgRoot) => orgRoot.orgRevision)
orgRoots: OrgRoot[];
@OneToMany(() => OrgChild1, (orgChild1) => orgChild1.orgRevision)
orgChild1s: OrgChild1[];
@OneToMany(() => OrgChild2, (orgChild2) => orgChild2.orgRevision)
orgChild2s: OrgChild2[];
@OneToMany(() => OrgChild3, (orgChild3) => orgChild3.orgRevision)
orgChild3s: OrgChild3[];
@OneToMany(() => OrgChild4, (orgChild4) => orgChild4.orgRevision)
orgChild4s: OrgChild4[];
}
export class CreateOrgRevision {