-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
6 changes: 6 additions & 0 deletions
6
server/src/domain/interface/repositories/IPrescriptionRepository.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import IPrescription from "../../entities/IPrescription"; | ||
import IRepository from "./IRepository"; | ||
|
||
export default interface IPrescriptionRepository extends IRepository<IPrescription> { | ||
findByAppointmentId(appointmentId: string): Promise<IPrescription | null>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export default interface IRepository<T> { | ||
findById(id: string): Promise<T | null>; | ||
findAll(): Promise<T[]>; | ||
create(entity: T): Promise<T>; | ||
update(id: string, entity: T): Promise<T | null>; | ||
delete(id: string): Promise<void>; | ||
} |