Merge branch 'develop' of github.com:Frappet/bma-ehr-organization into develop

This commit is contained in:
Kittapath 2024-02-06 15:44:16 +07:00
commit 08f2c8753e
10 changed files with 265 additions and 85 deletions

View file

@ -1,4 +1,4 @@
import { Entity, Column, OneToMany, OneToOne, JoinColumn} from "typeorm";
import { Entity, Column, OneToMany, OneToOne, JoinColumn, ManyToMany } from "typeorm";
import { EntityBase } from "./base/Base";
import { PosMaster } from "./PosMaster";
@ -32,17 +32,34 @@ export class Profile extends EntityBase {
nullable: true,
comment: "เลขประจำตัวประชาชน",
default: null,
length: 13
length: 13,
})
citizenId: string;
@OneToOne(() => PosMaster)
@JoinColumn()
current_holder: PosMaster;
// @Column({
// nullable: true,
// length: 40,
// comment:
// "คนครองปัจจุบัน เมื่อทำสำเนาโครงสร้างและตำแหน่งพร้อมกับคนครองมา คนครองจะอยู่ในฟิลด์นี้",
// default: null,
// unique: false,
// })
// current_holderId: string;
@OneToOne(() => PosMaster)
@JoinColumn()
next_holder: PosMaster;
// @Column({
// nullable: true,
// length: 40,
// comment:
// "คนที่กำลังจะมาครอง ตอนปรับโครงสร้าง ถ้าเลือกให้ใครมาครอง ProfileId ของคนนั้นจะมาอยู่ในช่องนี้ รวมทั้งตอนเลือกตำแหน่งเพื่อบรรจุ แต่งตั้ง เลื่อน ย้าย ในระบบบรรจุแต่งตั้งด้วย",
// default: null,
// unique: false,
// })
// next_holderId: string;
@OneToMany(() => PosMaster, (posMaster) => posMaster.current_holder)
current_holders: PosMaster[];
@OneToMany(() => PosMaster, (posMaster) => posMaster.next_holder)
next_holders: PosMaster[];
}
export class CreateProfile {
@ -59,6 +76,4 @@ export class CreateProfile {
citizenId: string;
}
export type UpdateProfile = Partial<CreateProfile>;