46 lines
1,003 B
TypeScript
46 lines
1,003 B
TypeScript
|
|
import { Entity, Column, JoinColumn, ManyToOne } from "typeorm";
|
||
|
|
import { EntityBase } from "./base/Base";
|
||
|
|
import { CommandSys } from "./CommandSys";
|
||
|
|
|
||
|
|
@Entity("commandSalary")
|
||
|
|
export class CommandSalary extends EntityBase {
|
||
|
|
@Column({
|
||
|
|
nullable: true,
|
||
|
|
comment: "ชื่อคำสั่ง",
|
||
|
|
length: 255,
|
||
|
|
default: null,
|
||
|
|
})
|
||
|
|
name: string;
|
||
|
|
|
||
|
|
@Column({
|
||
|
|
comment: "สถานะการใช้งาน",
|
||
|
|
default: true,
|
||
|
|
})
|
||
|
|
isActive: boolean;
|
||
|
|
|
||
|
|
@Column({
|
||
|
|
nullable: true,
|
||
|
|
length: 255,
|
||
|
|
comment: "คีย์นอก(FK)ของตาราง CommandSys",
|
||
|
|
default: null,
|
||
|
|
})
|
||
|
|
commandSysId: string;
|
||
|
|
|
||
|
|
@ManyToOne(() => CommandSys, (commandSys) => commandSys.commandSalarys)
|
||
|
|
@JoinColumn({ name: "commandSysId" })
|
||
|
|
commandSalarySys: CommandSys;
|
||
|
|
}
|
||
|
|
|
||
|
|
export class CreateCommandSalary {
|
||
|
|
@Column()
|
||
|
|
name: string;
|
||
|
|
|
||
|
|
@Column()
|
||
|
|
isActive: boolean;
|
||
|
|
|
||
|
|
@Column()
|
||
|
|
commandSysId: string;
|
||
|
|
}
|
||
|
|
|
||
|
|
export type UpdateCommandSalary = Partial<CreateCommandSalary>;
|