diff --git a/server/src/domain/entities/IPrescription.ts b/server/src/domain/entities/IPrescription.ts new file mode 100644 index 00000000..5b5ee55b --- /dev/null +++ b/server/src/domain/entities/IPrescription.ts @@ -0,0 +1,25 @@ +export enum PrescriptionStatus { + PENDING = 'pending', + ISSUED = 'issued', + CANCELLED = 'cancelled', +} + +export default interface IPrescription { + readonly _id?: string; + readonly appointmentId?: string; + readonly doctorId?: string; + readonly patientId?: string; + readonly createdAt?: Date; + readonly updatedAt?: Date; + readonly medications?: IMedication[]; + readonly status?: PrescriptionStatus; + readonly notes?: string; +} + +export interface IMedication { + readonly name: string; + readonly dosage: string; // e.g., '2 tablets' + readonly frequency: string; // e.g., 'twice a day' + readonly duration: string; // e.g., '5 days' + readonly additionalInstructions?: string; +} diff --git a/server/src/domain/interface/repositories/IPrescriptionRepository.ts b/server/src/domain/interface/repositories/IPrescriptionRepository.ts new file mode 100644 index 00000000..a021a850 --- /dev/null +++ b/server/src/domain/interface/repositories/IPrescriptionRepository.ts @@ -0,0 +1,6 @@ +import IPrescription from "../../entities/IPrescription"; +import IRepository from "./IRepository"; + +export default interface IPrescriptionRepository extends IRepository { + findByAppointmentId(appointmentId: string): Promise; +} diff --git a/server/src/domain/interface/repositories/IRepository.ts b/server/src/domain/interface/repositories/IRepository.ts new file mode 100644 index 00000000..84fb18e5 --- /dev/null +++ b/server/src/domain/interface/repositories/IRepository.ts @@ -0,0 +1,7 @@ +export default interface IRepository { + findById(id: string): Promise; + findAll(): Promise; + create(entity: T): Promise; + update(id: string, entity: T): Promise; + delete(id: string): Promise; +}