Template สำหรับลงในตำแหน่ง/เงินเดือน

This commit is contained in:
kittapath 2024-09-16 10:06:18 +07:00
parent 40440ca250
commit 9d755fc8ff
5 changed files with 285 additions and 18 deletions

View file

@ -0,0 +1,45 @@
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>;

View file

@ -7,6 +7,7 @@ import {
OneToMany,
} from "typeorm";
import { CommandType } from "./CommandType";
import { CommandSalary } from "./CommandSalary";
@Entity("commandSys")
export class CommandSys {
@ -60,6 +61,9 @@ export class CommandSys {
@OneToMany(() => CommandType, (commandType) => commandType.commandTypeSys)
commandTypes: CommandType[];
@OneToMany(() => CommandSalary, (commandSalary) => commandSalary.commandSalarySys)
commandSalarys: CommandSalary[];
}
export class CreateCommandSys {