diff --git a/lib/config/config.dart b/lib/config/config.dart index 483138d6..ee22edf4 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -21,14 +21,14 @@ 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://uat.hmgwebservices.com/'; // var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'http://10.201.204.103/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; -// var BASE_URL = 'https://webservices.hmg.com/'; +var BASE_URL = 'https://webservices.hmg.com/'; // var BASE_URL = 'http://10.50.100.198:4422/'; @@ -357,7 +357,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 = 20.1; +var VERSION_ID = 20.5; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 30d5958a..30d72f87 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -189,7 +189,7 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; //0560717232 - // body['PatientID'] = 4773715; //4609100 + // body['PatientID'] = 4773929; //4609100 // body['TokenID'] = "@dm!n"; // Patient ID: 3027574 diff --git a/lib/core/service/feedback/feedback_service.dart b/lib/core/service/feedback/feedback_service.dart index 89e0d111..9efa4372 100644 --- a/lib/core/service/feedback/feedback_service.dart +++ b/lib/core/service/feedback/feedback_service.dart @@ -22,10 +22,10 @@ class FeedbackService extends BaseService { _requestInsertCOCItem.details = details; _requestInsertCOCItem.cOCTypeName = cOCTypeName; _requestInsertCOCItem.formTypeID = cOCTypeName; - _requestInsertCOCItem.mobileNo = "966" + Utils.getPhoneNumberWithoutZero(user.mobileNumber!); + _requestInsertCOCItem.mobileNo = user.mobileNumber !=null ? "966" + Utils.getPhoneNumberWithoutZero(user.mobileNumber!) :""; _requestInsertCOCItem.isUserLoggedIn = true; _requestInsertCOCItem.projectID = user.projectID; - _requestInsertCOCItem.patientName = user.firstName! + " " + user.lastName!; + _requestInsertCOCItem.patientName =user.firstName!=null ? (user.firstName! + " " + user.lastName!):""; _requestInsertCOCItem.fileName = ""; _requestInsertCOCItem.appVersion = VERSION_ID; _requestInsertCOCItem.uILanguage = languageID; //TODO Change it to be dynamic @@ -34,7 +34,7 @@ class FeedbackService extends BaseService { _requestInsertCOCItem.resolution = "400x847"; _requestInsertCOCItem.projectID = 0; _requestInsertCOCItem.tokenID = "C0c@@dm!n?T&A&A@Barcha202029582948"; - _requestInsertCOCItem.identificationNo = int.parse(user.patientIdentificationNo!); + _requestInsertCOCItem.identificationNo = user.patientIdentificationNo!=null ? int.parse(user.patientIdentificationNo!) :0; if (BASE_URL.contains('uat')) { _requestInsertCOCItem.forDemo = true; } else { diff --git a/lib/models/Authentication/check_activation_code_request.dart b/lib/models/Authentication/check_activation_code_request.dart index b81c0670..8330420c 100644 --- a/lib/models/Authentication/check_activation_code_request.dart +++ b/lib/models/Authentication/check_activation_code_request.dart @@ -84,12 +84,8 @@ class CheckActivationCodeReq { Map toJson() { final Map data = new Map(); data['PatientMobileNumber'] = this.patientMobileNumber; - if (this.patientMobileNumberOthers != null) { - data['PatientMobileNumber_Others'] = this.patientMobileNumberOthers; - // Don't include MobileNo for Others country - } else { - data['MobileNo'] = this.mobileNo; - } + data['PatientMobileNumber_Others'] = this.patientMobileNumberOthers; + data['MobileNo'] = this.mobileNo; data['DeviceToken'] = this.deviceToken; data['ProjectOutSA'] = this.projectOutSA; data['LoginType'] = this.loginType; diff --git a/lib/models/Authentication/send_activation_request.dart b/lib/models/Authentication/send_activation_request.dart index 8f9caa60..167fe2c0 100644 --- a/lib/models/Authentication/send_activation_request.dart +++ b/lib/models/Authentication/send_activation_request.dart @@ -30,6 +30,7 @@ class SendActivationRequest { int? status; int? familyRegionID; bool? isPatientExcluded; + String ? notificationCenterAppSeviceGUID; SendActivationRequest( {this.patientMobileNumber, this.patientMobileNumberOthers, @@ -61,7 +62,8 @@ class SendActivationRequest { this.responseID, this.status, this.familyRegionID, - this.isPatientExcluded + this.isPatientExcluded, + this.notificationCenterAppSeviceGUID, }); SendActivationRequest.fromJson(Map json) { @@ -96,6 +98,7 @@ class SendActivationRequest { status = json['Status']; familyRegionID = json['FamilyRegionID']; isPatientExcluded = json['IsPatientExcluded']; + notificationCenterAppSeviceGUID = json['NotificationCenterAppSeviceGUID']; } Map toJson() { @@ -131,6 +134,7 @@ class SendActivationRequest { data['Status'] = status; data['FamilyRegionID'] = familyRegionID; data['IsPatientExcluded'] = isPatientExcluded; + data['NotificationCenterAppSeviceGUID'] = notificationCenterAppSeviceGUID; return data; } } diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index d30cfbaa..d567d9a4 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -657,6 +657,7 @@ class _BookConfirmState extends State { Widget showInfo(String title, String des) { return Container( child: Row( + crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( title + ": ", @@ -667,13 +668,15 @@ class _BookConfirmState extends State { letterSpacing: -0.4, ), ), - Text( - des, - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.w600, - color: Colors.black, - letterSpacing: -0.48, + Expanded( + child: Text( + des, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + color: Colors.black, + letterSpacing: -0.48, + ), ), ), ], diff --git a/lib/pages/MyAppointments/SchedulePage.dart b/lib/pages/MyAppointments/SchedulePage.dart index dd8c59b5..b343fde0 100644 --- a/lib/pages/MyAppointments/SchedulePage.dart +++ b/lib/pages/MyAppointments/SchedulePage.dart @@ -247,289 +247,3 @@ class _SchedulePageState extends State { // ); } } - -// import 'package:hmg_patient_app/models/Appointments/DoctorListResponse.dart'; -// import 'package:hmg_patient_app/pages/MyAppointments/AppointmentDetails.dart'; -// -// import 'package:hmg_patient_app/pages/MyAppointments/models/DoctorScheduleResponse.dart'; -// import 'package:hmg_patient_app/pages/MyAppointments/widgets/indicator.dart'; -// import 'package:hmg_patient_app/services/appointment_services/GetDoctorsList.dart'; -// import 'package:hmg_patient_app/uitl/translations_delegate_base.dart'; -// import 'package:hmg_patient_app/widgets/others/app_scaffold_widget.dart'; -// import 'package:hmg_patient_app/uitl/date_uitl.dart'; -// import 'package:hmg_patient_app/widgets/transitions/fade_page.dart'; -// import 'package:flutter/material.dart'; -// import 'package:hmg_patient_app/widgets/data_display/text.dart'; -// import 'package:hmg_patient_app/core/viewModels/medical/medical_view_model.dart'; -// import 'package:hmg_patient_app/pages/base/base_view.dart'; -// import 'package:hmg_patient_app/uitl/app_shared_preferences.dart'; -// import 'package:hmg_patient_app/config/shared_pref_kay.dart'; -// import 'package:hmg_patient_app/models/Appointments/AppoimentAllHistoryResultList.dart'; -// import 'package:hmg_patient_app/uitl/app_toast.dart'; -// import 'package:hmg_patient_app/uitl/date_uitl.dart'; -// import 'package:hmg_patient_app/core/viewModels/project_view_model.dart'; -// import 'package:provider/provider.dart'; -// import 'package:hmg_patient_app/core/enum/viewstate.dart'; -// -// class SchedulePage extends StatefulWidget { -// DoctorList doctorList; -// AppoitmentAllHistoryResultList appo; -// SchedulePage({ -// this.appo, -// this.doctorList, -// }); -// @override -// _SchedulePageState createState() => _SchedulePageState(); -// } -// -// class _SchedulePageState extends State { -// DoctorsListService service; -// PageController _pageController = PageController(); -// double currentPage = 0; -// int selectedindex = 0; -// List weeks = []; -// List doctorScheduleResponse = []; -// int weekMS = 604800 * 1000; -// DoctorList doctorList; -// List freeSlots = []; -// bool isPageChange = false; -// -// AppSharedPreferences sharedPref = AppSharedPreferences(); -// @override -// void initState() { -// this.doctorList = widget.doctorList; -// -// super.initState(); -// } -// -// @override -// Widget build(BuildContext context) { -// ProjectViewModel projectViewModel = Provider.of(context); -// return BaseView( -// onModelReady: (model) => model.getDoctorSchedule(doctorList), -// allowAny: true, -// builder: (_, model, widget) => BaseView( -// onModelReady: (model2) => model2.getFreeSlots(doctorList), -// allowAny: true, -// builder: (_, model2, widget2) { -// if (model2.freeSlots.length > 0 && isPageChange == false && model2.state == ViewState.Idle) { -// this.freeSlots = model2.freeSlots; -// this.doctorScheduleResponse = model.getDoctorScheduleList; -// -// this.generateWeeksSchedules(); -// } else if (model2.freeSlots.length == 0 && model2.state == ViewState.Idle) { -// AppToast.showErrorToast(message: TranslationBase.of(context).emptySchedule); -// Navigator.pop(context); -// } -// return AppScaffold( -// appBarTitle: TranslationBase.of(context).schedule, -// showNewAppBar: true, -// showNewAppBarTitle: true, -// isShowAppBar: true, -// backgroundColor: Color(0xffF7F7F7), -// baseViewModel: model2, -// isShowDecPage: false, -// body: Column( -// children: [ -// SizedBox(height: 21), -// PageViewIndicator( -// isActive: true, -// currentPage: this.currentPage, -// length: weeks.length, -// ), -// Expanded( -// child: PageView.builder( -// controller: _pageController, -// itemCount: weeks.length, -// onPageChanged: (index) { -// setState(() { -// isPageChange = true; -// this.currentPage = index.toDouble(); -// }); -// }, -// itemBuilder: (context, index) { -// return ListView.separated( -// itemCount: weeks[index].length, -// padding: EdgeInsets.all(21), -// separatorBuilder: (context, index) => SizedBox(height: 12), -// itemBuilder: (context, index2) { -// bool isToday = DateUtil.convertStringToDate(weeks[index][index2]['Date']).toString().substring(0, 10) == DateTime.now().toString().substring(0, 10); -// Color toDayColor = isToday ? Color(0xff359846) : Colors.white; -// return InkWell( -// onTap: () { -// openBookAppointment(weeks[index][index2]); -// }, -// child: Row( -// crossAxisAlignment: CrossAxisAlignment.start, -// children: [ -// Expanded( -// flex: 1, -// child: Column( -// mainAxisSize: MainAxisSize.min, -// crossAxisAlignment: CrossAxisAlignment.start, -// children: [ -// Text( -// weeks[index][index2]['DayName'], -// style: TextStyle( -// fontSize: 13, -// fontWeight: FontWeight.w600, -// color: Color(0xff2E303A), -// letterSpacing: -0.52, -// ), -// ), -// Text( -// getDayMonths(DateUtil.convertStringToDate(weeks[index][index2]['Date'])), -// style: TextStyle( -// fontSize: 18, -// fontWeight: FontWeight.w700, -// color: Color(0xff2E303A), -// letterSpacing: -0.72, -// ), -// ), -// ], -// ), -// ), -// Expanded( -// flex: 3, -// child: Container( -// decoration: BoxDecoration( -// color: toDayColor, -// borderRadius: BorderRadius.all( -// Radius.circular(10.0), -// ), -// boxShadow: [ -// BoxShadow( -// color: Color(0xff000000).withOpacity(.05), -// blurRadius: 27, -// offset: Offset(0, -3), -// ), -// ], -// ), -// child: Container( -// margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 6, right: projectViewModel.isArabic ? 6 : 0), -// padding: EdgeInsets.symmetric(vertical: 14, horizontal: 12), -// decoration: BoxDecoration( -// color: Colors.white, -// border: Border.all(color: Colors.white, width: 1), -// borderRadius: BorderRadius.only( -// bottomRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0), -// topRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0), -// bottomLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0), -// topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0), -// ), -// ), -// child: Row( -// crossAxisAlignment: CrossAxisAlignment.center, -// children: [ -// Expanded( -// child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ -// if (isToday) -// Text( -// TranslationBase.of(context).today, -// style: TextStyle( -// fontSize: 12, -// fontWeight: FontWeight.w600, -// color: toDayColor, -// letterSpacing: -0.48, -// ), -// ), -// Row( -// children: [ -// Expanded( -// child: Text( -// weeks[index][index2]['WorkingHours'], -// style: TextStyle( -// fontSize: 13, -// fontWeight: FontWeight.w600, -// color: Color(0xff2E303A), -// letterSpacing: -0.56, -// ), -// ), -// ), -// ], -// ) -// ]), -// ), -// Icon(Icons.arrow_forward, color: Color(0xff2B353E)), -// ], -// ), -// ), -// ), -// ), -// ], -// ), -// ); -// }); -// }, -// ), -// ), -// ], -// ), -// ); -// }), -// ); -// } -// -// generateWeeksSchedules() { -// this.weeks.clear(); -// for (var i = 0; i < 8; i++) { -// var weekSchedule = generateNewWeekSchedule(i); -// this.markWeekFreeDays(weekSchedule); -// this.weeks.add(weekSchedule); -// } -// //print(this.weeks); -// } -// -// markWeekFreeDays(schedule) { -// for (var workDay in schedule) { -// workDay['fullDay'] = !this.hasFreeSlot(workDay['Date']); -// } -// } -// -// generateNewWeekSchedule(weekIndex) { -// var weekMSOffset = weekIndex * weekMS; -// -// var newWeekSchedule = []; -// for (var workDay in this.doctorScheduleResponse) { -// Map newWorkDay = Map(); -// newWorkDay['Date'] = DateUtil.convertDateMSToJsonDate(DateUtil.convertStringToDate(workDay.date).millisecondsSinceEpoch + weekMSOffset); -// newWorkDay['DayName'] = workDay.dayName; -// newWorkDay['WorkingHours'] = workDay.workingHours; -// newWeekSchedule.add(newWorkDay); -// } -// return newWeekSchedule; -// } -// -// hasFreeSlot(String jsonDate) { -// var date = DateUtil.convertStringToDate(jsonDate); -// var scheduleDay = date; -// for (var event in this.freeSlots) { -// var date = DateUtil.convertStringToDate(event); -// var nDate = DateTime(date.year, date.month, date.day); -// -// if (nDate.millisecondsSinceEpoch == scheduleDay.millisecondsSinceEpoch) { -// return true; -// } -// } -// return false; -// } -// -// String getDayMonths(DateTime dateTime) { -// String dateFormat = '${dateTime.day} ${DateUtil.getMonth(dateTime.month).toString().substring(0, 3)}'; -// return dateFormat; -// } -// -// openBookAppointment(selectedDate) { -// //sharedPref.setObject(DOCTOR_SCHEDULE_DATE_SEL, selectedDate); -// Navigator.of(context).pop(selectedDate); -// // Navigator.push( -// // context, -// // FadePage( -// // page: AppointmentDetails( -// // appo: widget.appo, -// // doctorSchedule: selectedDate, -// // ), -// // ), -// // ); -// } -// } diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index b8445db2..d427b284 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -181,7 +181,7 @@ class _ConfirmLogin extends State { // user!.editedOn != null // ? DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(user!.editedOn!)) // : - user!.createdOn != null ? DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(user!.createdOn!)) : '--', + user!.createdOn != null && user!.createdOn !='null' ? DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(user!.createdOn!)) : '--', style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48), ), ], @@ -214,7 +214,7 @@ class _ConfirmLogin extends State { // user!.editedOn!), // false) // : - user!.createdOn != null ? DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(user!.createdOn!), false) : '--', + user!.createdOn != null && user!.createdOn != 'null' ? DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(user!.createdOn!), false) : '--', style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.48), ), ], @@ -544,8 +544,28 @@ class _ConfirmLogin extends State { this.registerd_data = await CheckPatientAuthenticationReq.fromJson(await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN)); } - this.mobileNumberOthers = this.registerd_data != null ? this.registerd_data.patientMobileNumberOthers : this.user!.mobile; - this.mobileNumber = this.registerd_data != null ? this.registerd_data.patientMobileNumber : int.parse(this.user!.mobile!); + // Handle Others country mobile number (string) vs KSA/UAE (int) + if (this.registerd_data != null) { + this.mobileNumberOthers = this.registerd_data.patientMobileNumberOthers; + this.mobileNumber = this.registerd_data.patientMobileNumber; + } else if (this.user != null) { + this.mobileNumberOthers = this.user!.mobile; + // Parse mobile number only if it's not null and not empty + if (this.user!.mobile != null && this.user!.mobile!.isNotEmpty) { + try { + this.mobileNumber = int.parse(this.user!.mobile!); + } catch (e) { + // If parsing fails, it might be an Others country number (string format) + this.mobileNumberOthers = this.user!.mobile; + this.mobileNumber = 0; // Set a default value + } + } else { + this.mobileNumber = 0; + } + } else { + this.mobileNumber = 0; + this.mobileNumberOthers = ""; + } this.zipCode = this.registerd_data != null ? this.registerd_data.zipCode @@ -587,13 +607,17 @@ class _ConfirmLogin extends State { getCommonRequest({type}) { var request = SendActivationRequest(); - request.patientMobileNumber = this.mobileNumber; if(this.zipCode=='0'){ + // For Others country, use string mobile number request.patientMobileNumberOthers = this.mobileNumberOthers; request.mobileNo = this.mobileNumberOthers; + request.patientMobileNumber = null; // Don't send int mobile number for Others }else { + // For KSA/UAE, use int mobile number + request.patientMobileNumber = this.mobileNumber; request.mobileNo = '0' + this.mobileNumber.toString(); + request.patientMobileNumberOthers = null; // Don't send string mobile number for KSA/UAE } request.deviceToken = this.deviceToken; request.projectOutSA = this.patientOutSA == true ? true : false; diff --git a/lib/services/authentication/auth_provider.dart b/lib/services/authentication/auth_provider.dart index 1db329b2..f6146e7a 100644 --- a/lib/services/authentication/auth_provider.dart +++ b/lib/services/authentication/auth_provider.dart @@ -46,6 +46,10 @@ const SEND_ACTIVATION_CODE_REGISTER = 'Services/Authentication.svc/REST/SendActi const CHECK_ACTIVATION_CODE = 'Services/Authentication.svc/REST/CheckActivationCode'; const CHECK_ACTIVATION_CODE_OTHERS = 'Services/Authentication.svc/REST/CheckActivationCode_Others'; const CHECK_ACTIVATION_CODE_REGISTER = 'Services/Authentication.svc/REST/CheckActivationCodeForRegistration'; +const NOTIFICATION_CENTER_APP_GUID = 'SzFwWjI0TjhmSjZreDVsNmc3SDRSdWlxUG1h'; +const NOTIFICATION_CENTER_APP_SEVICE_GUID_LOGIN = 'D8BD5C76-4B50-4122-81D0-C3AA25DB08A2'; +const NOTIFICATION_CENTER_APP_SEVICE_GUID_REGISTRATION = '690D3595-A1E1-489A-B9AB-6270E83AD6ED'; +const NOTIFICATION_CENTER_APP_SEVICE_GUID_FORGOT_PASSWORD = '5CCCC2C9-EEA0-4207-9BE9-EE1FBBFFE8D0'; const FORGOT_PASSWORD = 'Services/Authentication.svc/REST/CheckActivationCodeForSendFileNo'; const CHECK_PATIENT_FOR_REGISTRATION = "Services/Authentication.svc/REST/CheckPatientForRegisteration"; @@ -97,6 +101,12 @@ class AuthProvider with ChangeNotifier { } } + Map _buildActivationRequestBody(dynamic request) { + final body = request.toJson(); + body['NotificationCenterAppGUID'] = NOTIFICATION_CENTER_APP_GUID; + return body; + } + // Future login(UserModel userInfo) async { // try { // dynamic localRes; @@ -262,6 +272,7 @@ class AuthProvider with ChangeNotifier { request.deviceTypeID = Platform.isIOS ? 1 : 2; request.patientOutSA = request.zipCode == '966' ? 0 : 1; request.isDentalAllowedBackend = false; + request.notificationCenterAppSeviceGUID = NOTIFICATION_CENTER_APP_SEVICE_GUID_LOGIN; dynamic localRes; await new BaseAppClient().post(SEND_ACTIVATION_CODE, onSuccess: (dynamic response, int statusCode) { @@ -269,7 +280,7 @@ class AuthProvider with ChangeNotifier { authenticatedUser = CheckActivationCode.fromJson(localRes); }, onFailure: (String error, int statusCode) { throw error; - }, body: request.toJson()); + }, body: _buildActivationRequestBody(request)); return Future.value(localRes); } @@ -284,6 +295,7 @@ class AuthProvider with ChangeNotifier { request.deviceTypeID = Platform.isIOS ? 1 : 2; request.patientOutSA = 1; // Always 1 for Others (outside KSA/UAE) request.isDentalAllowedBackend = false; + request.notificationCenterAppSeviceGUID = NOTIFICATION_CENTER_APP_SEVICE_GUID_LOGIN; dynamic localRes; await new BaseAppClient().post(SEND_ACTIVATION_CODE_OTHERS, onSuccess: (dynamic response, int statusCode) { @@ -291,7 +303,7 @@ class AuthProvider with ChangeNotifier { authenticatedUser = CheckActivationCode.fromJson(localRes); }, onFailure: (String error, int statusCode) { throw error; - }, body: request.toJson()); + }, body: _buildActivationRequestBody(request)); return Future.value(localRes); } @@ -304,6 +316,7 @@ class AuthProvider with ChangeNotifier { request.deviceTypeID = Platform.isIOS ? 1 : 2; request.patientOutSA = request.zipCode == '966' ? 0 : 1; request.isDentalAllowedBackend = false; + request.notificationCenterAppSeviceGUID = NOTIFICATION_CENTER_APP_SEVICE_GUID_REGISTRATION; dynamic localRes; await new BaseAppClient().post(SEND_ACTIVATION_CODE_REGISTER, onSuccess: (dynamic response, int statusCode) { @@ -311,7 +324,7 @@ class AuthProvider with ChangeNotifier { authenticatedUser = CheckActivationCode.fromJson(localRes); }, onFailure: (String error, int statusCode) { throw error; - }, body: request.toJson()); + }, body: _buildActivationRequestBody(request)); return Future.value(localRes); } @@ -1834,6 +1847,8 @@ class AuthProvider with ChangeNotifier { request['generalid'] = GENERAL_ID; request['DeviceTypeID'] = Platform.isIOS ? 1 : 2; request['LanguageID'] = (languageID == 'ar' ? 1 : 2); + request['NotificationCenterAppGUID'] = NOTIFICATION_CENTER_APP_GUID; + request['NotificationCenterAppSeviceGUID'] = NOTIFICATION_CENTER_APP_SEVICE_GUID_FORGOT_PASSWORD; dynamic localRes; try { diff --git a/lib/services/family_files/family_files_provider.dart b/lib/services/family_files/family_files_provider.dart index 7081e0cd..6d25663d 100644 --- a/lib/services/family_files/family_files_provider.dart +++ b/lib/services/family_files/family_files_provider.dart @@ -27,6 +27,8 @@ const String CHECK_ACTIVATION_CODE = 'Services/Authentication.svc/REST/CheckActi const String UPDATE_FILE_STATUS = 'Services/Authentication.svc/REST/Update_FileStatus'; const String REMOVE_FILE_STATUS = 'Services/Authentication.svc/REST/ActiveDeactive_PatientFile'; +const NOTIFICATION_CENTER_APP_GUID_FAMILY = 'SzFwWjI0TjhmSjZreDVsNmc3SDRSdWlxUG1h'; +const NOTIFICATION_CENTER_APP_SEVICE_GUID_FAMILY = '420D7C25-9CEF-4BCB-9963-27D9ECF8484C'; const String ACTIVATION_CODE_URL = "Services/Authentication.svc/REST/CheckActivationCode"; const String SENT_REQUEST_URL = 'Services/Authentication.svc/REST/GetAllSharedRecordsByStatus'; const String RECEVIED_REQUEST_URL = 'Services/Authentication.svc/REST/GetAllPendingRecordsByResponseId'; @@ -157,12 +159,15 @@ class FamilyFilesProvider with ChangeNotifier { request.status = 2; request.familyRegionID = zipCode == '966' ? 1 : 2; request.isPatientExcluded = isExcluded; + request.notificationCenterAppSeviceGUID = NOTIFICATION_CENTER_APP_SEVICE_GUID_FAMILY; + final body = request.toJson(); + body['NotificationCenterAppGUID'] = NOTIFICATION_CENTER_APP_GUID_FAMILY; await new BaseAppClient().post(SEND_FAMILY_FILE_ACTIVATION, onSuccess: (dynamic response, int statusCode) { localRes = response; }, onFailure: (String error, int statusCode) { AppToast.showErrorToast(message: error); throw error; - }, body: request.toJson()); + }, body: body); return Future.value(localRes); } catch (error) {