add table employee

This commit is contained in:
Bright 2024-03-12 12:14:18 +07:00
parent 0f7edf5d15
commit bb3e8b435b
4 changed files with 176 additions and 0 deletions

View file

@ -0,0 +1,46 @@
import { Entity, Column, ManyToOne, JoinColumn, OneToMany } from "typeorm";
import { EntityBase } from "./base/Base";
import { EmployeePosDict } from "./EmployeePosDict";
import { EmployeePosType } from "./EmployeePosType";
@Entity("employeePosLevel")
export class EmployeePosLevel extends EntityBase {
@Column({
nullable: true,
comment: "ชื่อระดับชั้นงาน",
length: 255,
default: null,
})
posLevelName: string;
@Column({
comment: "ระดับของระดับชั้นงาน",
type: "int",
})
posLevelRank: number;
@Column({
length: 40,
comment: "คีย์นอก(FK)ของตาราง employeePosType",
})
employeePosTypeId: string;
@ManyToOne(() => EmployeePosType, (employeePosType) => employeePosType.employeePosLevels)
@JoinColumn({ name: "employeePosTypeId" })
employeePosType: EmployeePosType;
@OneToMany(() => EmployeePosDict, (employeePosDict) => employeePosDict.employeePosLevel)
employeePosDicts: EmployeePosDict[];
}
export class CreateEmployeePosLevel {
@Column()
posLevelName: string;
@Column()
posLevelRank: number;
}
export type UpdateEmployeePosLevel= Partial<CreateEmployeePosLevel>;