diff --git a/lib/config/config.dart b/lib/config/config.dart index acf3859e..04f86877 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -21,8 +21,8 @@ var PACKAGES_ORDERS = '/api/orders'; var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var BASE_URL = 'http://10.50.100.198:2018/'; - // var BASE_URL = 'https://uat.hmgwebservices.com/'; -var BASE_URL = 'https://hmgwebservices.com/'; + var BASE_URL = 'https://uat.hmgwebservices.com/'; +// var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; @@ -352,7 +352,7 @@ var CAN_PAY_FOR_FOR_WALKIN_APPOINTMENT = 'Services/Doctors.svc/REST/CanPayForWal var CHANNEL = 3; var GENERAL_ID = 'Cs2020@2016\$2958'; var IP_ADDRESS = '10.20.10.20'; -var VERSION_ID = 17.3; +var VERSION_ID = 17.4; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; @@ -694,13 +694,15 @@ var GET_PROJECT_FROM_NFC = 'Services/OUTPs.svc/Rest/GetProjectByNFC'; var GET_PATIENT_OCCUPATION_LIST = 'Services/Authentication.svc/REST/GetPatientOccupation'; +var IS_DOCTOR_AVAILABLE_BY_CALENDAR_SCHEDULE = 'Services/OUTPs.svc/REST/HIS_IsDoctorAvailableByCalendarSchedule'; + //PAYFORT var getPayFortProjectDetails = "Services/PayFort_Serv.svc/REST/GetPayFortProjectDetails"; var addPayFortApplePayResponse = "Services/PayFort_Serv.svc/REST/AddResponse"; -var payFortEnvironment = FortEnvironment.production; -var applePayMerchantId = "merchant.com.hmgwebservices"; -// var payFortEnvironment = FortEnvironment.test; -// var applePayMerchantId = "merchant.com.hmgwebservices.uat"; +// var payFortEnvironment = FortEnvironment.production; +// var applePayMerchantId = "merchant.com.hmgwebservices"; +var payFortEnvironment = FortEnvironment.test; +var applePayMerchantId = "merchant.com.hmgwebservices.uat"; class AppGlobal { static var context; diff --git a/lib/core/service/medical/ask_doctor_services.dart b/lib/core/service/medical/ask_doctor_services.dart index 9491354a..95597955 100644 --- a/lib/core/service/medical/ask_doctor_services.dart +++ b/lib/core/service/medical/ask_doctor_services.dart @@ -29,6 +29,25 @@ class AskDoctorService extends BaseService { return Future.value(localRes); } + Future isDoctorAvailable({int? projectId, int? doctorId, int? clinicId}) async { + hasError = false; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + body['DoctorID'] = doctorId; + body['ProjectID'] = projectId; + body['ClinicID'] = clinicId; + + dynamic localRes; + + await baseAppClient.post(IS_DOCTOR_AVAILABLE_BY_CALENDAR_SCHEDULE, onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + return Future.value(localRes); + } + Future getCallRequestTypeLOV() async { hasError = false; Map body = Map(); diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart index cb1183ef..33a7cbd6 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart @@ -670,8 +670,8 @@ class _AnicllaryOrdersState extends State with SingleTic currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR", onFailed: (failureResult) async { GifLoaderDialogUtils.hideDialog(context); - log("failureResult: ${failureResult.toString()}"); - AppToast.showErrorToast(message: failureResult.toString()); + log("failureResult: ${failureResult.message.toString()}"); + AppToast.showErrorToast(message: failureResult.message.toString()); }, onSuccess: (successResult) async { log("Payfort: ${successResult.responseMessage}"); diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 61bcb977..f4df725b 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -712,8 +712,8 @@ class _BookSuccessState extends State { currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR", onFailed: (failureResult) async { GifLoaderDialogUtils.hideDialog(context); - log("failureResult: ${failureResult.toString()}"); - AppToast.showErrorToast(message: failureResult.toString()); + log("failureResult: ${failureResult.message.toString()}"); + AppToast.showErrorToast(message: failureResult.message.toString()); }, onSuccess: (successResult) async { log("Payfort: ${successResult.responseMessage}"); diff --git a/lib/pages/ErService/EROnlineCheckIn/EROnlineCheckInPaymentDetails.dart b/lib/pages/ErService/EROnlineCheckIn/EROnlineCheckInPaymentDetails.dart index a9873df4..69da5dfc 100644 --- a/lib/pages/ErService/EROnlineCheckIn/EROnlineCheckInPaymentDetails.dart +++ b/lib/pages/ErService/EROnlineCheckIn/EROnlineCheckInPaymentDetails.dart @@ -423,8 +423,9 @@ class _EROnlineCheckInPaymentDetailsState extends State { payfortProjectDetailsRespModel: payfortProjectDetailsRespModel, currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR", onFailed: (failureResult) async { - log("failureResult: ${failureResult.toString()}"); - GifLoaderDialogUtils.hideDialog(localContext!); - AppToast.showErrorToast(message: failureResult.toString()); + GifLoaderDialogUtils.hideDialog(context); + log("failureResult: ${failureResult.message.toString()}"); + AppToast.showErrorToast(message: failureResult.message.toString()); }, onSuccess: (successResult) async { GifLoaderDialogUtils.hideDialog(localContext!); diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index 1c17088b..b02674c7 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -351,7 +351,7 @@ class _ConfirmLogin extends State { // var whatsappStatus = await channel.isWhatsAppInstalled(); // if(whatsappStatus) { // print("whatapp is installed"); - channel.handleHandShake(); + channel.handleHandShake(); // }else{ // print("whatapp is not installed"); // } @@ -709,37 +709,37 @@ class _ConfirmLogin extends State { } checkIfUserAgreedBefore(CheckActivationCode result) { - // this.authService.checkIfUserAgreed().then((result) { - // if (result['IsPatientAlreadyAgreed']) { - // goToHome(); - // } else { - // this.authService.getUserAgreementContent().then((result) { - // GifLoaderDialogUtils.hideDialog(AppGlobal.context); - // Navigator.pushAndRemoveUntil( - // context, - // FadePage( - // page: UserLoginAgreementPage( - // userAgreementText: result['UserAgreementContent'], - // authenticatedUserObject: authenticatedUserObject, - // appointmentRateViewModel: appointmentRateViewModel, - // selectedOption: selectedOption, - // ), - // ), - // (r) => false); - // }).catchError((err) { - // GifLoaderDialogUtils.hideDialog(context); - // print(err); - // }); - // } - // }).catchError((err) { - // GifLoaderDialogUtils.hideDialog(context); - // print(err); - // }); + this.authService.checkIfUserAgreed().then((result) { + if (result['IsPatientAlreadyAgreed']) { + goToHome(); + } else { + this.authService.getUserAgreementContent().then((result) { + GifLoaderDialogUtils.hideDialog(AppGlobal.context); + Navigator.pushAndRemoveUntil( + context, + FadePage( + page: UserLoginAgreementPage( + userAgreementText: result['UserAgreementContent'], + authenticatedUserObject: authenticatedUserObject, + appointmentRateViewModel: appointmentRateViewModel, + selectedOption: selectedOption, + ), + ), + (r) => false); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + }); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + }); // if (result.isNeedUserAgreement == true) { - //move to agreement page. + // // move to agreement page. // } else { - goToHome(); + // goToHome(); // } } diff --git a/lib/pages/medical/ask_doctor/ask_doctor_page.dart b/lib/pages/medical/ask_doctor/ask_doctor_page.dart index ab032541..09db7ba5 100644 --- a/lib/pages/medical/ask_doctor/ask_doctor_page.dart +++ b/lib/pages/medical/ask_doctor/ask_doctor_page.dart @@ -80,21 +80,23 @@ class AskDoctorPage extends StatelessWidget { doctor: doctorList, isLiveCareAppointment: false, isShowFlag: false, - onTap: () { - GifLoaderDialogUtils.showMyDialog(context); - service.getCallInfoHoursResult(doctorId: _doctor.doctorID, projectId: _doctor.projectID).then((res) { - GifLoaderDialogUtils.hideDialog(context); - Navigator.push( - context, - FadePage( - page: RequestTypePage(doctorList: _doctor), - ), - ); - }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); - if (err != null) AppToast.showErrorToast(message: err.toString()); - print(err); - }); + onTap: () async { + if (await checkIfDoctorAvailable(_doctor, context)) { + GifLoaderDialogUtils.showMyDialog(context); + service.getCallInfoHoursResult(doctorId: _doctor.doctorID, projectId: _doctor.projectID).then((res) { + GifLoaderDialogUtils.hideDialog(context); + Navigator.push( + context, + FadePage( + page: RequestTypePage(doctorList: _doctor), + ), + ); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + if (err != null) AppToast.showErrorToast(message: err.toString()); + print(err); + }); + } }, ); }, @@ -106,6 +108,27 @@ class AskDoctorPage extends StatelessWidget { ); } + Future checkIfDoctorAvailable(DoctorList _doctor, BuildContext context) { + bool isAvailable = false; + GifLoaderDialogUtils.showMyDialog(context); + service.isDoctorAvailable(doctorId: _doctor.doctorID, projectId: _doctor.projectID, clinicId: _doctor.clinicID).then((res) { + GifLoaderDialogUtils.hideDialog(context); + print(res['IsDoctorAvailable']); + if (res['IsDoctorAvailable']) { + isAvailable = true; + } else { + isAvailable = false; + AppToast.showErrorToast(message: res['endUserMessage']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + if (err != null) AppToast.showErrorToast(message: err.toString()); + print(err); + }); + + return Future.value(isAvailable); + } + String getDate(String date) { DateTime dateObj = DateUtil.convertStringToDate(date); return DateUtil.getWeekDay(dateObj.weekday) + diff --git a/lib/pages/medical/balance/confirm_payment_page.dart b/lib/pages/medical/balance/confirm_payment_page.dart index da9570f2..0c0f354c 100644 --- a/lib/pages/medical/balance/confirm_payment_page.dart +++ b/lib/pages/medical/balance/confirm_payment_page.dart @@ -330,8 +330,8 @@ class _ConfirmPaymentPageState extends State { currency: projectViewModel.authenticatedUserObject.user.outSA == 1 ? "AED" : "SAR", onFailed: (failureResult) async { GifLoaderDialogUtils.hideDialog(context); - log("failureResult: ${failureResult.toString()}"); - AppToast.showErrorToast(message: failureResult.toString()); + log("failureResult: ${failureResult.message.toString()}"); + AppToast.showErrorToast(message: failureResult.message.toString()); }, onSuccess: (successResult) async { log("Payfort: ${successResult.responseMessage}"); diff --git a/pubspec.yaml b/pubspec.yaml index d163832b..5bad9780 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 4.5.079+4050079 +version: 4.6.080+4050080 environment: sdk: ">=3.0.0 <3.13.0"