2024-01-31 15:31:20 +07:00
|
|
|
import { Entity, Column, ManyToOne, JoinColumn, OneToOne, OneToMany } from "typeorm";
|
2024-01-24 16:08:34 +07:00
|
|
|
import { EntityBase } from "./base/Base";
|
|
|
|
|
import { OrgRoot } from "./OrgRoot";
|
|
|
|
|
import { OrgChild1 } from "./OrgChild1";
|
|
|
|
|
import { OrgChild2 } from "./OrgChild2";
|
|
|
|
|
import { OrgChild3 } from "./OrgChild3";
|
2024-01-31 14:29:39 +07:00
|
|
|
import { OrgRevision } from "./OrgRevision";
|
2024-01-31 15:31:20 +07:00
|
|
|
import { PosMaster } from "./PosMaster";
|
2024-02-01 11:02:35 +07:00
|
|
|
|
2024-01-24 16:08:34 +07:00
|
|
|
enum OrgChild4Rank {
|
2024-01-26 10:13:07 +07:00
|
|
|
DEPARTMENT = "DEPARTMENT",
|
|
|
|
|
OFFICE = "OFFICE",
|
|
|
|
|
DIVISION = "DIVISION",
|
|
|
|
|
SECTION = "SECTION",
|
2024-01-24 16:08:34 +07:00
|
|
|
}
|
2024-01-24 17:22:41 +07:00
|
|
|
@Entity("orgChild4")
|
2024-01-24 16:08:34 +07:00
|
|
|
export class OrgChild4 extends EntityBase {
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "ชื่อส่วนราชการ",
|
|
|
|
|
length: 255,
|
2024-02-01 11:02:35 +07:00
|
|
|
default: null,
|
2024-01-24 16:08:34 +07:00
|
|
|
})
|
|
|
|
|
orgChild4Name: string;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "ชื่อย่อส่วนราชการ",
|
|
|
|
|
length: 16,
|
2024-02-01 11:02:35 +07:00
|
|
|
default: null,
|
2024-01-24 16:08:34 +07:00
|
|
|
})
|
|
|
|
|
orgChild4ShortName: string;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "รหัสส่วนราชการ",
|
|
|
|
|
length: 8,
|
2024-02-01 11:02:35 +07:00
|
|
|
default: null,
|
2024-01-24 16:08:34 +07:00
|
|
|
})
|
|
|
|
|
orgChild4Code: string;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "ระดับส่วนราชการ",
|
|
|
|
|
type: "enum",
|
|
|
|
|
enum: OrgChild4Rank,
|
2024-02-01 11:02:35 +07:00
|
|
|
default: null,
|
2024-01-24 16:08:34 +07:00
|
|
|
})
|
|
|
|
|
orgChild4Rank: OrgChild4Rank;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "ลำดับที่ของส่วนราชการภายใน Child เดียวกัน",
|
2024-02-01 11:02:35 +07:00
|
|
|
default: null,
|
2024-01-24 16:08:34 +07:00
|
|
|
})
|
|
|
|
|
orgChild4Order: number;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
length: 64,
|
|
|
|
|
comment: "หมายเลขโทรศัพท์ที่ติดต่อจากภายนอก",
|
2024-02-01 11:02:35 +07:00
|
|
|
default: null,
|
2024-01-24 16:08:34 +07:00
|
|
|
})
|
|
|
|
|
orgChild4PhoneEx: string;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
length: 64,
|
|
|
|
|
comment: "หมายเลขโทรศัพท์ที่ติดต่อจากภายใน",
|
2024-02-01 11:02:35 +07:00
|
|
|
default: null,
|
2024-01-24 16:08:34 +07:00
|
|
|
})
|
|
|
|
|
orgChild4PhoneIn: string;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
length: 64,
|
|
|
|
|
comment: "หมายเลขโทรสาร",
|
2024-02-01 11:02:35 +07:00
|
|
|
default: null,
|
2024-01-24 16:08:34 +07:00
|
|
|
})
|
|
|
|
|
orgChild4Fax: string;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
length: 40,
|
|
|
|
|
})
|
2024-01-25 10:13:36 +07:00
|
|
|
orgRootId: string;
|
2024-01-24 16:08:34 +07:00
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
length: 40,
|
|
|
|
|
})
|
2024-01-25 10:13:36 +07:00
|
|
|
orgChild1Id: string;
|
2024-01-24 16:08:34 +07:00
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
length: 40,
|
|
|
|
|
})
|
2024-01-25 10:13:36 +07:00
|
|
|
orgChild2Id: string;
|
2024-01-24 16:08:34 +07:00
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
length: 40,
|
|
|
|
|
})
|
2024-01-25 10:13:36 +07:00
|
|
|
orgChild3Id: string;
|
2024-01-24 16:08:34 +07:00
|
|
|
|
2024-01-26 20:25:18 +07:00
|
|
|
@Column({
|
|
|
|
|
length: 40,
|
|
|
|
|
})
|
|
|
|
|
orgRevisionId: string;
|
|
|
|
|
|
2024-01-26 09:56:27 +07:00
|
|
|
@Column({
|
2024-02-01 11:02:35 +07:00
|
|
|
nullable: true,
|
2024-01-26 09:56:27 +07:00
|
|
|
length: 40,
|
2024-02-01 11:02:35 +07:00
|
|
|
default: null,
|
2024-01-26 09:56:27 +07:00
|
|
|
})
|
|
|
|
|
isAncestorDNA: string;
|
2024-01-26 17:09:28 +07:00
|
|
|
|
2024-01-31 14:29:39 +07:00
|
|
|
@ManyToOne(() => OrgRevision, (orgRevision) => orgRevision.orgChild4s)
|
|
|
|
|
@JoinColumn({ name: "orgRevisionId" })
|
|
|
|
|
orgRevision: OrgRevision;
|
|
|
|
|
|
|
|
|
|
@ManyToOne(() => OrgRoot, (orgRoot) => orgRoot.orgChild4s)
|
|
|
|
|
@JoinColumn({ name: "orgRootId" })
|
|
|
|
|
orgRoot: OrgRoot;
|
|
|
|
|
|
|
|
|
|
@ManyToOne(() => OrgChild1, (orgChild1) => orgChild1.orgChild4s)
|
|
|
|
|
@JoinColumn({ name: "orgChild1Id" })
|
|
|
|
|
orgChild1: OrgChild1;
|
|
|
|
|
|
|
|
|
|
@ManyToOne(() => OrgChild2, (orgChild2) => orgChild2.orgChild4s)
|
|
|
|
|
@JoinColumn({ name: "orgChild2Id" })
|
|
|
|
|
orgChild2: OrgChild2;
|
|
|
|
|
|
2024-01-26 17:09:28 +07:00
|
|
|
@ManyToOne(() => OrgChild3, (orgChild3) => orgChild3.orgChild4s)
|
2024-01-25 10:13:36 +07:00
|
|
|
@JoinColumn({ name: "orgChild3Id" })
|
2024-01-24 16:08:34 +07:00
|
|
|
orgChild3: OrgChild3;
|
2024-01-31 15:31:20 +07:00
|
|
|
|
|
|
|
|
@OneToMany(() => PosMaster, (posMaster) => posMaster.orgChild4)
|
2024-02-01 11:02:35 +07:00
|
|
|
posMasters: PosMaster[];
|
2024-01-24 16:08:34 +07:00
|
|
|
}
|
2024-01-26 09:56:27 +07:00
|
|
|
|
|
|
|
|
export class CreateOrgChild4 {
|
|
|
|
|
@Column()
|
|
|
|
|
orgChild4Name: string;
|
|
|
|
|
|
|
|
|
|
@Column()
|
|
|
|
|
orgChild4ShortName: string;
|
|
|
|
|
|
|
|
|
|
@Column()
|
|
|
|
|
orgChild4Code: string;
|
2024-01-26 17:09:28 +07:00
|
|
|
|
2024-01-26 09:56:27 +07:00
|
|
|
@Column()
|
|
|
|
|
orgChild4Rank: string;
|
|
|
|
|
|
|
|
|
|
@Column()
|
2024-01-26 17:09:28 +07:00
|
|
|
orgChild4PhoneEx?: string;
|
2024-01-26 09:56:27 +07:00
|
|
|
|
|
|
|
|
@Column()
|
2024-01-26 17:09:28 +07:00
|
|
|
orgChild4PhoneIn?: string;
|
2024-01-26 09:56:27 +07:00
|
|
|
|
|
|
|
|
@Column()
|
2024-01-26 17:09:28 +07:00
|
|
|
orgChild4Fax?: string;
|
2024-01-26 09:56:27 +07:00
|
|
|
|
2024-01-26 17:09:28 +07:00
|
|
|
@Column("uuid")
|
|
|
|
|
orgChild3Id: string;
|
2024-01-26 09:56:27 +07:00
|
|
|
}
|
2024-01-24 16:08:34 +07:00
|
|
|
export type UpdateOrgChild4 = Partial<OrgChild4>;
|