hrms-api-org/src/entities/CommandRecive.ts

90 lines
1.8 KiB
TypeScript
Raw Normal View History

2024-09-24 16:42:24 +07:00
import { Entity, Column, JoinColumn, ManyToOne, OneToMany } from "typeorm";
import { EntityBase } from "./base/Base";
import { Command } from "./Command";
import { Profile } from "./Profile";
@Entity("commandRecive")
export class CommandRecive extends EntityBase {
@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({
nullable: true,
comment: "ลำดับแสดงผล",
default: null,
})
order: number;
@Column({
length: 40,
comment: "คีย์นอก(FK)ของตาราง command",
})
commandId: string;
@ManyToOne(() => Command, (command) => command.commandRecives)
@JoinColumn({ name: "commandId" })
command: Command;
@Column({
length: 40,
comment: "คีย์นอก(FK)ของตาราง profile",
})
profileId: string;
@ManyToOne(() => Profile, (profile) => profile.commandRecives)
@JoinColumn({ name: "profileId" })
profile: Profile;
}
export class CreateCommandRecive {
@Column()
name: string;
}
// export type UpdateCommandRecive = Partial<CreateCommandRecive>;