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

38 lines
907 B
TypeScript
Raw Normal View History

import { Entity, Column, ManyToOne, JoinColumn, OneToMany } from "typeorm";
import { EntityBase } from "./base/Base";
import { ProfileChangePosition } from "./ProfileChangePosition";
@Entity("changePosition")
export class ChangePosition extends EntityBase {
@Column({
nullable: true,
comment: "ชื่อรอบการย้ายสับเปลี่ยนตำแหน่ง",
type: "text",
default: null,
})
name: string;
@Column({
nullable: true,
type: "datetime",
comment: "วันที่ดำเนินการ",
default: null,
})
date: Date;
@OneToMany(() => ProfileChangePosition, (x) => x.profile)
profileChangePosition: ProfileChangePosition[];
}
export class CreateChangePosition {
name: string;
date?: Date;
status?: string;
}
export type UpdateChangePosition = {
name: string;
date?: Date;
status?: string;
};