feat(opd): add appointment id col

This commit is contained in:
avicenan
2026-03-11 16:19:21 +07:00
parent 7db7e5f1cb
commit e3d90532a9

View File

@ -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;