สร้างโครงสร้าง

This commit is contained in:
Kittapath 2024-01-26 20:25:18 +07:00
parent 042422938c
commit 8184152ac0
16 changed files with 295 additions and 84 deletions

View file

@ -72,17 +72,16 @@ export class OrgChild1 extends EntityBase {
orgChild1Fax: string;
@Column({
nullable: true,
comment: "สถานะของหน่วยงาน",
default: true,
length: 40,
default: "00000000-0000-0000-0000-000000000000",
})
orgChild1IsNormal: boolean;
orgRootId: string;
@Column({
length: 40,
default: "00000000-0000-0000-0000-000000000000",
})
orgRootId: string;
orgRevisionId: string;
@Column({
length: 40,

View file

@ -81,13 +81,6 @@ export class OrgChild2 extends EntityBase {
})
orgChild2Fax: string;
@Column({
nullable: true,
comment: "สถานะของหน่วยงาน", //ปกติ = 1 , ยุกเลิก = 0
default: true,
})
orgChild2IsNormal: boolean;
@Column({
length: 40,
default: "00000000-0000-0000-0000-000000000000",
@ -100,6 +93,12 @@ export class OrgChild2 extends EntityBase {
})
orgChild1Id: string;
@Column({
length: 40,
default: "00000000-0000-0000-0000-000000000000",
})
orgRevisionId: string;
@Column({
length: 40,
default: "00000000-0000-0000-0000-000000000000",

View file

@ -71,13 +71,6 @@ export class OrgChild3 extends EntityBase {
})
orgChild3Fax: string;
@Column({
nullable: true,
comment: "สถานะของหน่วยงาน",
default: true,
})
orgChild3IsNormal: boolean;
@Column({
length: 40,
default: "00000000-0000-0000-0000-000000000000",
@ -96,6 +89,12 @@ export class OrgChild3 extends EntityBase {
})
orgChild2Id: string;
@Column({
length: 40,
default: "00000000-0000-0000-0000-000000000000",
})
orgRevisionId: string;
@Column({
length: 40,
default: "00000000-0000-0000-0000-000000000000",

View file

@ -80,13 +80,6 @@ export class OrgChild4 extends EntityBase {
})
orgChild4Fax: string;
@Column({
nullable: true,
comment: "สถานะของหน่วยงาน", //ปกติ = 1 , ยุกเลิก = 0
default: true,
})
orgChild4IsNormal: boolean;
@Column({
length: 40,
default: "00000000-0000-0000-0000-000000000000",
@ -111,6 +104,12 @@ export class OrgChild4 extends EntityBase {
})
orgChild3Id: string;
@Column({
length: 40,
default: "00000000-0000-0000-0000-000000000000",
})
orgRevisionId: string;
@Column({
length: 40,
default: "00000000-0000-0000-0000-000000000000",

View file

@ -4,12 +4,12 @@ import { OrgRoot } from "./OrgRoot";
@Entity("orgRevision")
export class OrgRevision extends EntityBase {
@Column({
comment: "",
length: 40,
default: "00000000-0000-0000-0000-000000000000",
})
orgRevisionId: string;
// @Column({
// comment: "",
// length: 40,
// default: "00000000-0000-0000-0000-000000000000",
// })
// orgRevisionId: string;
@Column({
comment: "",
@ -21,7 +21,7 @@ export class OrgRevision extends EntityBase {
@Column({
nullable: true,
comment: "",
default: false
default: false,
})
orgRevisionIsCurrent: boolean;
@ -35,7 +35,7 @@ export class OrgRevision extends EntityBase {
@Column({
nullable: true,
comment: "",
default: false
default: false,
})
orgRevisionIsDraft: boolean;
@ -43,5 +43,14 @@ export class OrgRevision extends EntityBase {
orgRoots: OrgRoot[];
}
export class CreateOrgRevision {
@Column()
orgRevisionName: string;
@Column()
typeDraft: string;
@Column("uuid")
orgRevisionId?: string;
}
export type UpdateOrgRevision = Partial<OrgRevision>;

View file

@ -74,11 +74,10 @@ export class OrgRoot extends EntityBase {
orgRootFax: string;
@Column({
nullable: true,
comment: "สถานะของหน่วยงาน", //ปกติ = 1 , ยุกเลิก = 0
default: false,
length: 40,
default: "00000000-0000-0000-0000-000000000000",
})
orgRootIsNormal: boolean;
isAncestorDNA: string;
@Column({
length: 40,
@ -86,22 +85,14 @@ export class OrgRoot extends EntityBase {
})
orgRevisionId: string;
@Column({
length: 40,
default: "00000000-0000-0000-0000-000000000000",
})
isAncestorDNA: string;
@ManyToOne(() => OrgRevision, orgRevision => orgRevision.orgRoots)
@ManyToOne(() => OrgRevision, (orgRevision) => orgRevision.orgRoots)
@JoinColumn({ name: "orgRevisionId" })
orgRevision: OrgRevision;
@OneToMany(() => OrgChild1, (orgChild1) => orgChild1.orgRoot)
orgChild1s: OrgChild1[];
}
export class CreateOrgRoot {
@Column()
orgRootName: string;
@ -123,11 +114,9 @@ export class CreateOrgRoot {
@Column()
orgRootFax?: string;
@Column('uuid')
@Column("uuid")
orgRevisionId: string;
}
export type UpdateOrgRoot = Partial<CreateOrgRoot> & { orgRootRank?: OrgRootRank };