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

38 lines
984 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 | null;
}
export type UpdatePosExecutive = Partial<CreatePosExecutive>;