From e3d90532a9615b29766d1d433d43c04840a59f9a Mon Sep 17 00:00:00 2001 From: avicenan Date: Wed, 11 Mar 2026 16:19:21 +0700 Subject: [PATCH] feat(opd): add appointment id col --- src/entity/emr/emr_registration_outpatient.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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;