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

98 lines
2 KiB
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 { PosExecutive } from "./PosExecutive";
import { PosType } from "./PosType";
import { PosLevel } from "./PosLevel";
@Entity("posDict")
export class PosDict extends EntityBase {
@Column({
nullable: true,
comment: "ชื่อตำแหน่งในสายงาน (ชื่อตำแหน่ง)",
length: 255,
2024-02-01 11:02:35 +07:00
default: null,
})
posDictName: string;
@Column({
nullable: true,
comment: "สายงาน",
length: 255,
2024-02-01 11:02:35 +07:00
default: null,
})
posDictField: string;
@Column({
length: 40,
comment: "ตำแหน่งประเภท",
})
posTypeId: string;
@Column({
length: 40,
comment: "ระดับตำแหน่ง",
})
posLevelId: string;
@Column({
nullable: true,
length: 40,
comment: "ตำแหน่งทางการบริหาร",
2024-02-01 11:02:35 +07:00
default: null,
})
posExecutiveId: string;
@Column({
nullable: true,
length: 255,
comment: "ด้านทางการบริหาร",
2024-02-01 11:02:35 +07:00
default: null,
})
posDictExecutiveField: string;
@Column({
nullable: true,
length: 255,
comment: "ด้าน/สาขา",
2024-02-01 11:02:35 +07:00
default: null,
})
posDictArea: string;
2024-01-30 16:39:22 +07:00
2024-01-31 14:29:39 +07:00
@ManyToOne(() => PosExecutive, (posExecutive) => posExecutive)
@JoinColumn({ name: "posExecutiveId" })
posExecutive: PosExecutive;
@ManyToOne(() => PosType, (posType) => posType)
@JoinColumn({ name: "posTypeId" })
posType: PosType;
@ManyToOne(() => PosLevel, (posLevel) => posLevel)
@JoinColumn({ name: "posLevelId" })
posLevel: PosLevel;
2024-01-30 16:39:22 +07:00
}
export class CreatePosDict {
@Column()
posDictName: string;
@Column()
posDictField: string;
@Column()
posTypeId: string;
@Column()
posLevelId: string;
@Column()
2024-02-07 12:01:12 +07:00
posExecutiveId?: string | null;
2024-01-30 16:39:22 +07:00
@Column()
posDictExecutiveField: string;
@Column()
posDictArea: string;
}
2024-01-30 16:39:22 +07:00
export type UpdatePosDict = Partial<CreatePosDict>;