Skip to content

Commit

Permalink
Appointment entitie date type changed
Browse files Browse the repository at this point in the history
  • Loading branch information
sinanptm committed Sep 22, 2024
1 parent 763a907 commit af4f7b9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions server/src/domain/entities/IAppointment.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import IDoctor from "./IDoctor";
import IPatient from "./IPatient";
import IPatient from "./IPatient";
import ISlot from "./ISlot";

export enum AppointmentStatus {
Expand All @@ -21,7 +21,7 @@ export default interface IAppointment {
readonly createdAt?: string;
readonly updatedAt?: string;
readonly appointmentType?: AppointmentType;
readonly appointmentDate?: string;
readonly appointmentDate?: string | Date;
readonly reason?: string;
readonly notes?: string;
readonly paymentId?: string;
Expand Down
4 changes: 2 additions & 2 deletions server/src/use_case/appointment/CreateAppointmentUseCase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default class AppointmentUseCase {

if (slot.status === "booked") {
const bookedAppointment = await this.appointmentRepository.findByDateAndSlot(
appointmentData.appointmentDate!,
appointmentData.appointmentDate! as string,
appointmentData.slotId!
);
if (bookedAppointment) throw new CustomError("Slot already booked", StatusCode.Conflict);
Expand Down Expand Up @@ -111,7 +111,7 @@ export default class AppointmentUseCase {
this.validatorService.validateIdFormat(slotId!);
this.validatorService.validateIdFormat(patientId!);
this.validatorService.validateEnum(appointmentType!, Object.values(AppointmentType));
this.validatorService.validateDateFormat(appointmentDate!);
this.validatorService.validateDateFormat(appointmentDate! as string);
this.validatorService.validateLength(reason!, 1, 255);

if (notes) this.validatorService.validateLength(notes, 0, 255);
Expand Down

1 comment on commit af4f7b9

@vercel
Copy link

@vercel vercel bot commented on af4f7b9 Sep 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.