From b33a559305b208c3227239b2d88ddc8a6a47b0c1 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 8 Apr 2026 19:06:22 +0300 Subject: [PATCH] Dental workflow implemented --- lib/core/api_consts.dart | 3 ++- lib/features/book_appointments/book_appointments_repo.dart | 5 +++-- .../book_appointments/book_appointments_view_model.dart | 3 +-- lib/presentation/authentication/saved_login_screen.dart | 1 + 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/core/api_consts.dart b/lib/core/api_consts.dart index 9a16cdbc..d8fc9cc7 100644 --- a/lib/core/api_consts.dart +++ b/lib/core/api_consts.dart @@ -475,7 +475,8 @@ var GET_ACTIVE_APPOINTMENTS_LIST_URL = "Services/Doctors.svc/Rest/Dr_GetAppointm var GET_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/SearchDoctorsByTime"; //URL to dental doctors list -var GET_DENTAL_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/Dental_DoctorChiefComplaintMapping"; +// var GET_DENTAL_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/Dental_DoctorChiefComplaintMapping"; +var GET_DENTAL_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/Dental_DoctorChiefComplaintMapping_Nearest"; //URL to get doctor free slots var GET_DOCTOR_FREE_SLOTS = "Services/Doctors.svc/REST/GetDoctorFreeSlots"; diff --git a/lib/features/book_appointments/book_appointments_repo.dart b/lib/features/book_appointments/book_appointments_repo.dart index 7a984399..0db37274 100644 --- a/lib/features/book_appointments/book_appointments_repo.dart +++ b/lib/features/book_appointments/book_appointments_repo.dart @@ -86,7 +86,7 @@ abstract class BookAppointmentsRepo { {required int projectID, required int clinicID, required int patientID, Function(dynamic)? onSuccess, Function(String)? onError}); Future>>> getDentalChiefComplaintDoctorsList(int projectID, int chiefComplaintID, - {Function(dynamic)? onSuccess, Function(String)? onError}); + {bool isGetNearestAppointments, Function(dynamic)? onSuccess, Function(String)? onError}); Future>>> getLaserClinics(int laserCategoryID, int projectID, int languageID, {Function(dynamic)? onSuccess, Function(String)? onError}); @@ -877,12 +877,13 @@ class BookAppointmentsRepoImp implements BookAppointmentsRepo { @override Future>>> getDentalChiefComplaintDoctorsList(int projectID, int chiefComplaintID, - {Function(dynamic)? onSuccess, Function(String)? onError}) async { + {bool isGetNearestAppointments = false, Function(dynamic)? onSuccess, Function(String)? onError}) async { Map mapDevice = { "ProjectID": projectID, "ChiefComplaintID": chiefComplaintID, "isDentalAllowedBackend": true, "IsPublicRequest": true, + "IsGetNearAppointment": isGetNearestAppointments }; try { diff --git a/lib/features/book_appointments/book_appointments_view_model.dart b/lib/features/book_appointments/book_appointments_view_model.dart index 647b8632..7ac6ae45 100644 --- a/lib/features/book_appointments/book_appointments_view_model.dart +++ b/lib/features/book_appointments/book_appointments_view_model.dart @@ -1471,12 +1471,11 @@ class BookAppointmentsViewModel extends ChangeNotifier { } Future getDentalChiefComplaintDoctorsList({int projectID = 0, Function(dynamic)? onSuccess, Function(String)? onError}) async { - setIsNearestAppointmentSelected(false); doctorsList.clear(); notifyListeners(); projectID = currentlySelectedHospitalFromRegionFlow != null ? int.parse(currentlySelectedHospitalFromRegionFlow!) : projectID; - final result = await bookAppointmentsRepo.getDentalChiefComplaintDoctorsList(projectID, selectedChiefComplaintID); + final result = await bookAppointmentsRepo.getDentalChiefComplaintDoctorsList(projectID, selectedChiefComplaintID, isGetNearestAppointments: isNearestAppointmentSelected); result.fold( (failure) async { diff --git a/lib/presentation/authentication/saved_login_screen.dart b/lib/presentation/authentication/saved_login_screen.dart index 4659972e..ffa5f529 100644 --- a/lib/presentation/authentication/saved_login_screen.dart +++ b/lib/presentation/authentication/saved_login_screen.dart @@ -288,6 +288,7 @@ class _SavedLogin extends State { child: CustomButton( text: LocaleKeys.guest.tr(), onPressed: () { + authVm.setIsInitialLoginNavigated(true); Navigator.pushAndRemoveUntil( context, CustomPageRoute(