From b05e4e2a159f1b91d3d24a5e19bc02034c78608d Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 6 Oct 2025 10:30:04 +0300 Subject: [PATCH] Dental appointment booking flow implementation contd. --- .../book_appointments/book_appointments_repo.dart | 5 +++-- .../book_appointments/book_appointments_view_model.dart | 9 ++++++++- .../book_appointment/review_appointment_page.dart | 1 + 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/features/book_appointments/book_appointments_repo.dart b/lib/features/book_appointments/book_appointments_repo.dart index f15c5ea..82ca921 100644 --- a/lib/features/book_appointments/book_appointments_repo.dart +++ b/lib/features/book_appointments/book_appointments_repo.dart @@ -24,7 +24,7 @@ abstract class BookAppointmentsRepo { Future>> getDoctorProfile(int clinicID, int projectID, int doctorId, {Function(dynamic)? onSuccess, Function(String)? onError}); - Future>> getDoctorFreeSlots(int clinicID, int projectID, int doctorId, bool isBookingForLiveCare, {Function(dynamic)? onSuccess, Function(String)? onError}); + Future>> getDoctorFreeSlots(int clinicID, int projectID, int doctorId, bool isBookingForLiveCare, {bool continueDentalPlan = false, Function(dynamic)? onSuccess, Function(String)? onError}); Future>> cancelAppointment({required PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel}); @@ -229,7 +229,7 @@ class BookAppointmentsRepoImp implements BookAppointmentsRepo { //TODO: Implement the logic for Dental & laser clinics @override Future>> getDoctorFreeSlots(int clinicID, int projectID, int doctorId, bool isBookingForLiveCare, - {Function(dynamic)? onSuccess, Function(String)? onError}) async { + {bool continueDentalPlan = false, Function(dynamic)? onSuccess, Function(String)? onError}) async { Map mapDevice = { "DoctorID": doctorId, "IsBookingForLiveCare": isBookingForLiveCare, @@ -238,6 +238,7 @@ class BookAppointmentsRepoImp implements BookAppointmentsRepo { "OriginalClinicID": clinicID, "days": 0, "isReschadual": false, + "ContinueDentalPlan": continueDentalPlan }; try { diff --git a/lib/features/book_appointments/book_appointments_view_model.dart b/lib/features/book_appointments/book_appointments_view_model.dart index 5e0d424..a6c741f 100644 --- a/lib/features/book_appointments/book_appointments_view_model.dart +++ b/lib/features/book_appointments/book_appointments_view_model.dart @@ -378,7 +378,14 @@ class BookAppointmentsViewModel extends ChangeNotifier { final DateFormat dateFormatter = DateFormat('yyyy-MM-dd'); Map _eventsParsed; - final result = await bookAppointmentsRepo.getDoctorFreeSlots(selectedDoctor.clinicID ?? 0, selectedDoctor.projectID ?? 0, selectedDoctor.doctorID ?? 0, isBookingForLiveCare, onError: onError); + final result = await bookAppointmentsRepo.getDoctorFreeSlots( + selectedDoctor.clinicID ?? 0, + selectedDoctor.projectID ?? 0, + selectedDoctor.doctorID ?? 0, + isBookingForLiveCare, + continueDentalPlan: isContinueDentalPlan, + onError: onError, + ); result.fold( (failure) async { diff --git a/lib/presentation/book_appointment/review_appointment_page.dart b/lib/presentation/book_appointment/review_appointment_page.dart index 280c4ad..77cd249 100644 --- a/lib/presentation/book_appointment/review_appointment_page.dart +++ b/lib/presentation/book_appointment/review_appointment_page.dart @@ -229,6 +229,7 @@ class _ReviewAppointmentPageState extends State { }); }); } else { + //TODO: Add patient Derma package check API Here await bookAppointmentsViewModel.insertSpecificAppointment(onError: (err) { print(err.data["ErrorEndUserMessage"]); LoadingUtils.hideFullScreenLoader();