checkpoint

This commit is contained in:
AdisakKanthawilang 2024-01-25 10:13:36 +07:00
parent ba60192ec1
commit d737ecdf11
11 changed files with 452 additions and 49 deletions

View file

@ -83,19 +83,19 @@ export class OrgChild1 extends EntityBase {
@Column({
nullable: true,
type: "tinyint",
comment: "สถานะของหน่วยงาน", //ปกติ = 1 , ยุกเลิก = 0
default: true
})
orgChild1IsNormal: number;
orgChild1IsNormal: boolean;
@Column({
length: 40,
default: "00000000-0000-0000-0000-000000000000",
})
fkOrgRootId: string;
orgRootId: string;
@ManyToOne(() => OrgRoot, orgRoot => orgRoot.orgChild1s)
@JoinColumn({ name: "fkOrgRootId" })
@JoinColumn({ name: "orgRootId" })
orgRoot: OrgRoot;
//child table 2,3,4

View file

@ -83,29 +83,29 @@ export class OrgChild2 extends EntityBase {
@Column({
nullable: true,
type: "tinyint",
comment: "สถานะของหน่วยงาน", //ปกติ = 1 , ยุกเลิก = 0
default: true
})
orgChild2IsNormal: number;
orgChild2IsNormal: boolean;
@Column({
length: 40,
default: "00000000-0000-0000-0000-000000000000",
})
fkOrgRootId: string;
orgRootId: string;
@Column({
length: 40,
default: "00000000-0000-0000-0000-000000000000",
})
fkOrgChild1Id: string;
orgChild1Id: string;
// @ManyToOne(() => OrgRoot, orgRoot => orgRoot.orgChild2s)
// @JoinColumn({ name: "fkOrgRootId" })
// @JoinColumn({ name: "orgRootId" })
// orgRoot: OrgRoot;
@ManyToOne(() => OrgChild1, orgChild1 => orgChild1.orgChild2s)
@JoinColumn({ name: "fkOrgChild1Id" })
@JoinColumn({ name: "orgChild1Id" })
orgChild1: OrgChild1;
//child table 3,4

View file

@ -82,39 +82,39 @@ export class OrgChild3 extends EntityBase {
@Column({
nullable: true,
type: "tinyint",
comment: "สถานะของหน่วยงาน", //ปกติ = 1 , ยุกเลิก = 0
default: true
})
orgChild3IsNormal: number;
orgChild3IsNormal: boolean;
@Column({
length: 40,
default: "00000000-0000-0000-0000-000000000000",
})
fkOrgRootId: string;
orgRootId: string;
@Column({
length: 40,
default: "00000000-0000-0000-0000-000000000000",
})
fkOrgChild1Id: string;
orgChild1Id: string;
@Column({
length: 40,
default: "00000000-0000-0000-0000-000000000000",
})
fkOrgChild2Id: string;
orgChild2Id: string;
// @ManyToOne(() => OrgRoot, orgRoot => orgRoot.orgChild3s)
// @JoinColumn({ name: "fkOrgRootId" })
// @JoinColumn({ name: "orgRootId" })
// orgRoot: OrgRoot;
// @ManyToOne(() => OrgChild1, orgChild1 => orgChild1.orgChild3s)
// @JoinColumn({ name: "fkOrgChild1Id" })
// @JoinColumn({ name: "orgChild1Id" })
// orgChild1: OrgChild1;
@ManyToOne(() => OrgChild2, orgChild2 => orgChild2.orgChild3s)
@JoinColumn({ name: "fkOrgChild2Id" })
@JoinColumn({ name: "orgChild2Id" })
orgChild2: OrgChild2;
//child table 4

View file

@ -82,49 +82,49 @@ export class OrgChild4 extends EntityBase {
@Column({
nullable: true,
type: "tinyint",
comment: "สถานะของหน่วยงาน", //ปกติ = 1 , ยุกเลิก = 0
default: true
})
orgChild4IsNormal: number;
orgChild4IsNormal: boolean;
@Column({
length: 40,
default: "00000000-0000-0000-0000-000000000000",
})
fkOrgRootId: string;
orgRootId: string;
@Column({
length: 40,
default: "00000000-0000-0000-0000-000000000000",
})
fkOrgChild1Id: string;
orgChild1Id: string;
@Column({
length: 40,
default: "00000000-0000-0000-0000-000000000000",
})
fkOrgChild2Id: string;
orgChild2Id: string;
@Column({
length: 40,
default: "00000000-0000-0000-0000-000000000000",
})
fkOrgChild3Id: string;
orgChild3Id: string;
// @ManyToOne(() => OrgRoot, orgRoot => orgRoot.orgChild4s)
// @JoinColumn({ name: "fkOrgRootId" })
// @JoinColumn({ name: "orgRootId" })
// orgRoot: OrgRoot;
// @ManyToOne(() => OrgChild1, orgChild1 => orgChild1.orgChild4s)
// @JoinColumn({ name: "fkOrgChild1Id" })
// @JoinColumn({ name: "orgChild1Id" })
// orgChild1: OrgChild1;
// @ManyToOne(() => OrgChild2, orgChild2 => orgChild2.orgChild4s)
// @JoinColumn({ name: "fkOrgChild2Id" })
// @JoinColumn({ name: "orgChild2Id" })
// orgChild2: OrgChild2;
@ManyToOne(() => OrgChild3, orgChild3 => orgChild3.orgChild4s)
@JoinColumn({ name: "fkOrgChild3Id" })
@JoinColumn({ name: "orgChild3Id" })
orgChild3: OrgChild3;
}
export type UpdateOrgChild4 = Partial<OrgChild4>;

View file

@ -84,16 +84,16 @@ export class OrgRoot extends EntityBase {
@Column({
nullable: true,
type: "tinyint",
comment: "สถานะของหน่วยงาน", //ปกติ = 1 , ยุกเลิก = 0
default: true
})
orgRootIsNormal: number;
orgRootIsNormal: boolean;
@Column({
length: 40,
default: "00000000-0000-0000-0000-000000000000",
})
fkOrgRevisionId: string;
orgRevisionId: string;
//child table 1,2,3,4
@OneToMany(() => OrgChild1, orgChild1 => orgChild1.orgRoot)
@ -111,3 +111,34 @@ export class OrgRoot extends EntityBase {
}
export type UpdateOrgRoot = Partial<OrgRoot>;
export class CreateOrgRoot {
@Column()
orgRootName: string;
@Column()
orgRootShortName: string;
@Column()
orgRootCode: string;
@Column()
orgRootRank: OrgRootRank;
@Column()
orgRootOrder: number;
@Column()
orgRootPhoneEx: string;
@Column()
orgRootPhoneIn: string;
@Column()
orgRootFax: string;
@Column()
orgRootIsNormal: boolean;
}