93 lines
1.9 KiB
TypeScript
93 lines
1.9 KiB
TypeScript
|
|
import { Entity, Column, JoinColumn, ManyToOne } from "typeorm";
|
||
|
|
import { EntityBase } from "./base/Base";
|
||
|
|
import { Command } from "./Command";
|
||
|
|
import { Profile } from "./Profile";
|
||
|
|
|
||
|
|
@Entity("commandSend")
|
||
|
|
export class CommandSend extends EntityBase {
|
||
|
|
// EMAIL = อีเมล
|
||
|
|
// INBOX = กล่องข้อความ
|
||
|
|
@Column({
|
||
|
|
nullable: true,
|
||
|
|
comment: "ช่องทางการส่งสำเนา",
|
||
|
|
length: 20,
|
||
|
|
default: null,
|
||
|
|
})
|
||
|
|
sendCC: string;
|
||
|
|
|
||
|
|
@Column({
|
||
|
|
nullable: true,
|
||
|
|
comment: "เลขประจำตัวประชาชน",
|
||
|
|
length: 255,
|
||
|
|
default: null,
|
||
|
|
})
|
||
|
|
citizenId: string;
|
||
|
|
|
||
|
|
@Column({
|
||
|
|
nullable: true,
|
||
|
|
comment: "คำนำหน้า",
|
||
|
|
length: 255,
|
||
|
|
default: null,
|
||
|
|
})
|
||
|
|
prefix: string;
|
||
|
|
|
||
|
|
@Column({
|
||
|
|
nullable: true,
|
||
|
|
comment: "ชื่อ",
|
||
|
|
length: 255,
|
||
|
|
default: null,
|
||
|
|
})
|
||
|
|
fristName: string;
|
||
|
|
|
||
|
|
@Column({
|
||
|
|
nullable: true,
|
||
|
|
comment: "สกุล",
|
||
|
|
length: 255,
|
||
|
|
default: null,
|
||
|
|
})
|
||
|
|
lastName: string;
|
||
|
|
|
||
|
|
@Column({
|
||
|
|
nullable: true,
|
||
|
|
comment: "ตำแหน่ง",
|
||
|
|
length: 255,
|
||
|
|
default: null,
|
||
|
|
})
|
||
|
|
position: string;
|
||
|
|
|
||
|
|
@Column({
|
||
|
|
nullable: true,
|
||
|
|
comment: "หน่วยงาน",
|
||
|
|
length: 255,
|
||
|
|
default: null,
|
||
|
|
})
|
||
|
|
org: string;
|
||
|
|
|
||
|
|
@Column({
|
||
|
|
length: 40,
|
||
|
|
comment: "คีย์นอก(FK)ของตาราง command",
|
||
|
|
})
|
||
|
|
commandId: string;
|
||
|
|
|
||
|
|
@ManyToOne(() => Command, (command) => command.commandSends)
|
||
|
|
@JoinColumn({ name: "commandId" })
|
||
|
|
command: Command;
|
||
|
|
|
||
|
|
@Column({
|
||
|
|
length: 40,
|
||
|
|
comment: "คีย์นอก(FK)ของตาราง profile",
|
||
|
|
})
|
||
|
|
profileId: string;
|
||
|
|
|
||
|
|
@ManyToOne(() => Profile, (profile) => profile.commandSends)
|
||
|
|
@JoinColumn({ name: "profileId" })
|
||
|
|
profile: Profile;
|
||
|
|
}
|
||
|
|
|
||
|
|
export class CreateCommandSend {
|
||
|
|
@Column()
|
||
|
|
name: string;
|
||
|
|
}
|
||
|
|
|
||
|
|
// export type UpdateCommandSend = Partial<CreateCommandSend>;
|