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

32 lines
758 B
TypeScript
Raw Normal View History

2024-09-13 15:34:01 +07:00
import { Entity, Column, JoinColumn, ManyToOne } from "typeorm";
import { EntityBase } from "./base/Base";
import { CommandSend } from "./CommandSend";
@Entity("commandSendCC")
export class CommandSendCC extends EntityBase {
@Column({
nullable: true,
comment: "เพศ",
length: 255,
default: null,
})
name: string;
@Column({
length: 40,
comment: "คีย์นอก(FK)ของตาราง commandSend",
})
commandSendId: string;
@ManyToOne(() => CommandSend, (commandSend) => commandSend.commandSendCCs)
@JoinColumn({ name: "commandSendId" })
commandSend: CommandSend;
}
export class CreateCommandSendCC {
@Column()
name: string;
}
export type UpdateCommandSendCC = Partial<CreateCommandSendCC>;