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

39 lines
984 B
TypeScript
Raw Normal View History

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