hrms-api-org/src/entities/PosExecutive.ts
2024-02-01 11:02:35 +07:00

38 lines
977 B
TypeScript

import { Entity, Column, ManyToOne, JoinColumn, OneToOne, OneToMany } from "typeorm";
import { EntityBase } from "./base/Base";
import { Position } from "./Position";
import { PosDict } from "./PosDict";
@Entity("posExecutive")
export class PosExecutive extends EntityBase {
@Column({
nullable: true,
comment: "ชื่อตำแหน่งทางการบริหาร",
length: 255,
default: null,
})
posExecutiveName: string;
@Column({
nullable: true,
comment: "ลำดับความสำคัญ",
default: null,
})
posExecutivePriority: number;
@OneToMany(() => Position, (position) => position.posExecutive)
positions: Position[];
@OneToMany(() => PosDict, (posDict) => posDict.posExecutive)
posDicts: PosDict[];
}
export class CreatePosExecutive {
@Column()
posExecutiveName: string;
@Column()
posExecutivePriority: number;
}
export type UpdatePosExecutive = Partial<CreatePosExecutive>;