diff --git a/src/entity/emr/emr_registration_outpatient.ts b/src/entity/emr/emr_registration_outpatient.ts index a715e5a..542f99a 100644 --- a/src/entity/emr/emr_registration_outpatient.ts +++ b/src/entity/emr/emr_registration_outpatient.ts @@ -8,6 +8,7 @@ import { ManyToOne, OneToOne, JoinColumn, + OneToMany, } from "typeorm"; import { EmrRegistration } from "./emr_registration"; @@ -38,12 +39,10 @@ export class EmrRegistrationOutpatient { @JoinColumn() doctor: User; - /** Jika user pilih dari jadwal dokter, link ke slot tersebut */ @ManyToOne(() => DoctorSchedule, { onDelete: "SET NULL", nullable: true }) @JoinColumn() doctor_schedule: DoctorSchedule | null; - /** Contoh: "08:00-12:00" atau "Pagi" */ @Column({ nullable: true, length: 64 }) practice_hour: string; @@ -62,6 +61,10 @@ export class EmrRegistrationOutpatient { @Column({ nullable: true, length: 256 }) registration_number: string; + @ManyToOne(() => EmrRegistrationOutpatient, { onDelete: "SET NULL", nullable: true }) + @JoinColumn() + appointment_id: EmrRegistrationOutpatient | null; + @Column() @CreateDateColumn() created_at: Date;