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

# Conflicts:
#	src/entities/Profile.ts
This commit is contained in:
Kittapath 2024-05-14 17:29:14 +07:00
commit 09b543763b
19 changed files with 140 additions and 234 deletions

View file

@ -4,7 +4,6 @@ import { PosMaster } from "./PosMaster";
import { PosLevel } from "./PosLevel";
import { PosType } from "./PosType";
import { ProfileSalary } from "./ProfileSalary";
import { ProfileDiscipline } from "./ProfileDiscipline";
import { ProfileCertificate } from "./ProfileCertificate";
import { ProfileEducation } from "./ProfileEducation";
import { ProfileTraining } from "./ProfileTraining";
@ -23,6 +22,7 @@ import { SubDistrict } from "./SubDistrict";
import { District } from "./District";
import { ProfileAvatar } from "./ProfileAvatar";
import { ProfileChildren } from "./ProfileChildren";
import { ProfileDiscipline } from "./ProfileDiscipline";
@Entity("profile")
export class Profile extends EntityBase {
@ -268,7 +268,7 @@ export class Profile extends EntityBase {
profileSalary: ProfileSalary[];
@OneToMany(() => ProfileDiscipline, (profileDiscipline) => profileDiscipline.profile)
profileDiscipline: ProfileDiscipline[];
profileDisciplines: ProfileDiscipline[];
@OneToMany(() => ProfileCertificate, (profileCertificate) => profileCertificate.profile)
profileCertificates: ProfileCertificate[];

View file

@ -75,7 +75,7 @@ export class ProfileDiscipline extends EntityBase {
)
profileDisciplineHistories: ProfileDisciplineHistory[];
@ManyToOne(() => Profile, (profile) => profile.profileDiscipline)
@ManyToOne(() => Profile, (profile) => profile.profileDisciplines)
@JoinColumn({ name: "profileId" })
profile: Profile;

View file

@ -1,106 +0,0 @@
import { Entity, Column, ManyToOne, JoinColumn, OneToMany } from "typeorm";
import { EntityBase } from "./base/Base";
import { ProfileEmployee } from "./ProfileEmployee";
import { ProfileDisciplineEmployeeHistory } from "./ProfileDisciplineEmployeeHistory";
@Entity("profileDisciplineEmployee")
export class ProfileDisciplineEmployee extends EntityBase {
@Column({
nullable: true,
type: "datetime",
comment: "วันที่",
default: null,
})
date: Date;
@Column({
length: 40,
comment: "ไอดีโปรไฟล์",
type: "uuid",
})
profileId: string;
@Column({
comment: "สถานะการใช้งาน",
default: false,
})
isActive: boolean;
@Column({
nullable: true,
comment: "ระดับความผิด",
type: "text",
default: null,
})
level: string;
@Column({
nullable: true,
comment: "รายละเอียด",
type: "text",
default: null,
})
detail: string;
@Column({
nullable: true,
type: "datetime",
comment: "เอกสารอ้างอิง (ลงวันที่)",
default: null,
})
refCommandDate: Date;
@Column({
nullable: true,
comment: "เอกสารอ้างอิง (เลขที่คำสั่ง)",
type: "text",
default: null,
})
refCommandNo: string;
@Column({
nullable: true,
comment: "ล้างมลทิน",
type: "text",
default: null,
})
unStigma: string;
@OneToMany(
() => ProfileDisciplineEmployeeHistory,
(profileDisciplineHistory) => profileDisciplineHistory.histories,
)
profileDisciplineHistories: ProfileDisciplineEmployeeHistory[];
@ManyToOne(() => ProfileEmployee, (profile) => profile.profileDiscipline)
@JoinColumn({ name: "profileId" })
profile: ProfileEmployee;
}
export class CreateProfileDisciplineEmployee {
@Column()
date: Date | null;
@Column()
profileId: string;
@Column()
isActive: boolean | null;
@Column()
level: string | null;
@Column()
detail: string | null;
@Column()
refCommandDate: Date | null;
@Column()
refCommandNo: string | null;
@Column()
unStigma: string | null;
}
export type UpdateProfileDisciplineEmployee = Partial<CreateProfileDisciplineEmployee>;

View file

@ -1,74 +0,0 @@
import { Entity, Column, ManyToOne, JoinColumn } from "typeorm";
import { EntityBase } from "./base/Base";
import { ProfileDisciplineEmployee } from "./ProfileDisciplineEmployee";
@Entity("profileDisciplineEmployeeHistory")
export class ProfileDisciplineEmployeeHistory extends EntityBase {
@Column({
nullable: true,
type: "datetime",
comment: "วันที่",
default: null,
})
date: Date;
@Column({
length: 40,
comment: "ล้างมลทิน",
type: "uuid",
})
profileDisciplineId: string;
@Column({
comment: "สถานะการใช้งาน",
default: false,
})
isActive: boolean;
@Column({
nullable: true,
comment: "ระดับความผิด",
type: "text",
default: null,
})
level: string;
@Column({
nullable: true,
comment: "รายละเอียด",
type: "text",
default: null,
})
detail: string;
@Column({
nullable: true,
type: "datetime",
comment: "เอกสารอ้างอิง (ลงวันที่)",
default: null,
})
refCommandDate: Date;
@Column({
nullable: true,
comment: "เอกสารอ้างอิง (เลขที่คำสั่ง)",
type: "text",
default: null,
})
refCommandNo: string;
@Column({
nullable: true,
comment: "ล้างมลทิน",
type: "text",
default: null,
})
unStigma: string;
@ManyToOne(
() => ProfileDisciplineEmployee,
(profileDiscipline) => profileDiscipline.profileDisciplineHistories,
)
@JoinColumn({ name: "profileDisciplineId" })
histories: ProfileDisciplineEmployee;
}

View file

@ -4,7 +4,6 @@ import { EmployeePosLevel } from "./EmployeePosLevel";
import { EmployeePosType } from "./EmployeePosType";
import { EmployeePosMaster } from "./EmployeePosMaster";
import { ProfileSalaryEmployee } from "./ProfileSalaryEmployee";
import { ProfileDisciplineEmployee } from "./ProfileDisciplineEmployee";
import { ProfileCertificate } from "./ProfileCertificate";
import { ProfileTraining } from "./ProfileTraining";
import { ProfileInsignia } from "./ProfileInsignia";
@ -217,9 +216,6 @@ export class ProfileEmployee extends EntityBase {
@OneToMany(() => ProfileSalaryEmployee, (v) => v.profile)
profileSalary: ProfileSalaryEmployee[];
@OneToMany(() => ProfileDisciplineEmployee, (v) => v.profile)
profileDiscipline: ProfileDisciplineEmployee[];
@OneToMany(() => ProfileCertificate, (v) => v.profileEmployee)
profileCertificates: ProfileCertificate[];