login notification center id added.

login_other_country
Sultan khan 2 weeks ago
parent daca4c1fae
commit cd65fc1ff4

@ -21,14 +21,14 @@ var PACKAGES_ORDERS = '/api/orders';
var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_ORDER_HISTORY = '/api/orders/items';
var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
// var BASE_URL = 'http://10.50.100.198:2018/'; // 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 = 'https://hmgwebservices.com/';
// var BASE_URL = 'http://10.201.204.103/'; // var BASE_URL = 'http://10.201.204.103/';
// var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/';
// var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/';
// var BASE_URL = 'https://vidamergeuat.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/'; // 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 CHANNEL = 3;
var GENERAL_ID = 'Cs2020@2016\$2958'; var GENERAL_ID = 'Cs2020@2016\$2958';
var IP_ADDRESS = '10.20.10.20'; var IP_ADDRESS = '10.20.10.20';
var VERSION_ID = 20.1; var VERSION_ID = 20.5;
var SETUP_ID = '91877'; var SETUP_ID = '91877';
var LANGUAGE = 2; var LANGUAGE = 2;
// var PATIENT_OUT_SA = 0; // var PATIENT_OUT_SA = 0;

@ -189,7 +189,7 @@ class BaseAppClient {
// body['IdentificationNo'] = 1023854217; // body['IdentificationNo'] = 1023854217;
// body['MobileNo'] = "531940021"; //0560717232 // body['MobileNo'] = "531940021"; //0560717232
// body['PatientID'] = 4773715; //4609100 // body['PatientID'] = 4773929; //4609100
// body['TokenID'] = "@dm!n"; // body['TokenID'] = "@dm!n";
// Patient ID: 3027574 // Patient ID: 3027574

@ -22,10 +22,10 @@ class FeedbackService extends BaseService {
_requestInsertCOCItem.details = details; _requestInsertCOCItem.details = details;
_requestInsertCOCItem.cOCTypeName = cOCTypeName; _requestInsertCOCItem.cOCTypeName = cOCTypeName;
_requestInsertCOCItem.formTypeID = 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.isUserLoggedIn = true;
_requestInsertCOCItem.projectID = user.projectID; _requestInsertCOCItem.projectID = user.projectID;
_requestInsertCOCItem.patientName = user.firstName! + " " + user.lastName!; _requestInsertCOCItem.patientName =user.firstName!=null ? (user.firstName! + " " + user.lastName!):"";
_requestInsertCOCItem.fileName = ""; _requestInsertCOCItem.fileName = "";
_requestInsertCOCItem.appVersion = VERSION_ID; _requestInsertCOCItem.appVersion = VERSION_ID;
_requestInsertCOCItem.uILanguage = languageID; //TODO Change it to be dynamic _requestInsertCOCItem.uILanguage = languageID; //TODO Change it to be dynamic
@ -34,7 +34,7 @@ class FeedbackService extends BaseService {
_requestInsertCOCItem.resolution = "400x847"; _requestInsertCOCItem.resolution = "400x847";
_requestInsertCOCItem.projectID = 0; _requestInsertCOCItem.projectID = 0;
_requestInsertCOCItem.tokenID = "C0c@@dm!n?T&A&A@Barcha202029582948"; _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')) { if (BASE_URL.contains('uat')) {
_requestInsertCOCItem.forDemo = true; _requestInsertCOCItem.forDemo = true;
} else { } else {

@ -84,12 +84,8 @@ class CheckActivationCodeReq {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['PatientMobileNumber'] = this.patientMobileNumber; data['PatientMobileNumber'] = this.patientMobileNumber;
if (this.patientMobileNumberOthers != null) { data['PatientMobileNumber_Others'] = this.patientMobileNumberOthers;
data['PatientMobileNumber_Others'] = this.patientMobileNumberOthers; data['MobileNo'] = this.mobileNo;
// Don't include MobileNo for Others country
} else {
data['MobileNo'] = this.mobileNo;
}
data['DeviceToken'] = this.deviceToken; data['DeviceToken'] = this.deviceToken;
data['ProjectOutSA'] = this.projectOutSA; data['ProjectOutSA'] = this.projectOutSA;
data['LoginType'] = this.loginType; data['LoginType'] = this.loginType;

@ -30,6 +30,7 @@ class SendActivationRequest {
int? status; int? status;
int? familyRegionID; int? familyRegionID;
bool? isPatientExcluded; bool? isPatientExcluded;
String ? notificationCenterAppSeviceGUID;
SendActivationRequest( SendActivationRequest(
{this.patientMobileNumber, {this.patientMobileNumber,
this.patientMobileNumberOthers, this.patientMobileNumberOthers,
@ -61,7 +62,8 @@ class SendActivationRequest {
this.responseID, this.responseID,
this.status, this.status,
this.familyRegionID, this.familyRegionID,
this.isPatientExcluded this.isPatientExcluded,
this.notificationCenterAppSeviceGUID,
}); });
SendActivationRequest.fromJson(Map<String, dynamic> json) { SendActivationRequest.fromJson(Map<String, dynamic> json) {
@ -96,6 +98,7 @@ class SendActivationRequest {
status = json['Status']; status = json['Status'];
familyRegionID = json['FamilyRegionID']; familyRegionID = json['FamilyRegionID'];
isPatientExcluded = json['IsPatientExcluded']; isPatientExcluded = json['IsPatientExcluded'];
notificationCenterAppSeviceGUID = json['NotificationCenterAppSeviceGUID'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -131,6 +134,7 @@ class SendActivationRequest {
data['Status'] = status; data['Status'] = status;
data['FamilyRegionID'] = familyRegionID; data['FamilyRegionID'] = familyRegionID;
data['IsPatientExcluded'] = isPatientExcluded; data['IsPatientExcluded'] = isPatientExcluded;
data['NotificationCenterAppSeviceGUID'] = notificationCenterAppSeviceGUID;
return data; return data;
} }
} }

@ -657,6 +657,7 @@ class _BookConfirmState extends State<BookConfirm> {
Widget showInfo(String title, String des) { Widget showInfo(String title, String des) {
return Container( return Container(
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
title + ": ", title + ": ",
@ -667,13 +668,15 @@ class _BookConfirmState extends State<BookConfirm> {
letterSpacing: -0.4, letterSpacing: -0.4,
), ),
), ),
Text( Expanded(
des, child: Text(
style: TextStyle( des,
fontSize: 14, style: TextStyle(
fontWeight: FontWeight.w600, fontSize: 14,
color: Colors.black, fontWeight: FontWeight.w600,
letterSpacing: -0.48, color: Colors.black,
letterSpacing: -0.48,
),
), ),
), ),
], ],

@ -247,289 +247,3 @@ class _SchedulePageState extends State<SchedulePage> {
// ); // );
} }
} }
// 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<SchedulePage> {
// DoctorsListService service;
// PageController _pageController = PageController();
// double currentPage = 0;
// int selectedindex = 0;
// List weeks = [];
// List<DoctorScheduleResponse> doctorScheduleResponse = [];
// int weekMS = 604800 * 1000;
// DoctorList doctorList;
// List<String> 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<MedicalViewModel>(
// onModelReady: (model) => model.getDoctorSchedule(doctorList),
// allowAny: true,
// builder: (_, model, widget) => BaseView<MedicalViewModel>(
// 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<String, dynamic> 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,
// // ),
// // ),
// // );
// }
// }

@ -181,7 +181,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
// user!.editedOn != null // user!.editedOn != null
// ? DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(user!.editedOn!)) // ? 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), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48),
), ),
], ],
@ -214,7 +214,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
// user!.editedOn!), // user!.editedOn!),
// false) // 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), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.48),
), ),
], ],
@ -544,8 +544,28 @@ class _ConfirmLogin extends State<ConfirmLogin> {
this.registerd_data = await CheckPatientAuthenticationReq.fromJson(await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN)); 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; // Handle Others country mobile number (string) vs KSA/UAE (int)
this.mobileNumber = this.registerd_data != null ? this.registerd_data.patientMobileNumber : int.parse(this.user!.mobile!); 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.zipCode = this.registerd_data != null
? this.registerd_data.zipCode ? this.registerd_data.zipCode
@ -587,13 +607,17 @@ class _ConfirmLogin extends State<ConfirmLogin> {
getCommonRequest({type}) { getCommonRequest({type}) {
var request = SendActivationRequest(); var request = SendActivationRequest();
request.patientMobileNumber = this.mobileNumber;
if(this.zipCode=='0'){ if(this.zipCode=='0'){
// For Others country, use string mobile number
request.patientMobileNumberOthers = this.mobileNumberOthers; request.patientMobileNumberOthers = this.mobileNumberOthers;
request.mobileNo = this.mobileNumberOthers; request.mobileNo = this.mobileNumberOthers;
request.patientMobileNumber = null; // Don't send int mobile number for Others
}else { }else {
// For KSA/UAE, use int mobile number
request.patientMobileNumber = this.mobileNumber;
request.mobileNo = '0' + this.mobileNumber.toString(); request.mobileNo = '0' + this.mobileNumber.toString();
request.patientMobileNumberOthers = null; // Don't send string mobile number for KSA/UAE
} }
request.deviceToken = this.deviceToken; request.deviceToken = this.deviceToken;
request.projectOutSA = this.patientOutSA == true ? true : false; request.projectOutSA = this.patientOutSA == true ? true : false;

@ -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 = 'Services/Authentication.svc/REST/CheckActivationCode';
const CHECK_ACTIVATION_CODE_OTHERS = 'Services/Authentication.svc/REST/CheckActivationCode_Others'; const CHECK_ACTIVATION_CODE_OTHERS = 'Services/Authentication.svc/REST/CheckActivationCode_Others';
const CHECK_ACTIVATION_CODE_REGISTER = 'Services/Authentication.svc/REST/CheckActivationCodeForRegistration'; 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 FORGOT_PASSWORD = 'Services/Authentication.svc/REST/CheckActivationCodeForSendFileNo';
const CHECK_PATIENT_FOR_REGISTRATION = "Services/Authentication.svc/REST/CheckPatientForRegisteration"; const CHECK_PATIENT_FOR_REGISTRATION = "Services/Authentication.svc/REST/CheckPatientForRegisteration";
@ -97,6 +101,12 @@ class AuthProvider with ChangeNotifier {
} }
} }
Map<String, dynamic> _buildActivationRequestBody(dynamic request) {
final body = request.toJson();
body['NotificationCenterAppGUID'] = NOTIFICATION_CENTER_APP_GUID;
return body;
}
// Future<dynamic> login(UserModel userInfo) async { // Future<dynamic> login(UserModel userInfo) async {
// try { // try {
// dynamic localRes; // dynamic localRes;
@ -262,6 +272,7 @@ class AuthProvider with ChangeNotifier {
request.deviceTypeID = Platform.isIOS ? 1 : 2; request.deviceTypeID = Platform.isIOS ? 1 : 2;
request.patientOutSA = request.zipCode == '966' ? 0 : 1; request.patientOutSA = request.zipCode == '966' ? 0 : 1;
request.isDentalAllowedBackend = false; request.isDentalAllowedBackend = false;
request.notificationCenterAppSeviceGUID = NOTIFICATION_CENTER_APP_SEVICE_GUID_LOGIN;
dynamic localRes; dynamic localRes;
await new BaseAppClient().post(SEND_ACTIVATION_CODE, onSuccess: (dynamic response, int statusCode) { await new BaseAppClient().post(SEND_ACTIVATION_CODE, onSuccess: (dynamic response, int statusCode) {
@ -269,7 +280,7 @@ class AuthProvider with ChangeNotifier {
authenticatedUser = CheckActivationCode.fromJson(localRes); authenticatedUser = CheckActivationCode.fromJson(localRes);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;
}, body: request.toJson()); }, body: _buildActivationRequestBody(request));
return Future.value(localRes); return Future.value(localRes);
} }
@ -284,6 +295,7 @@ class AuthProvider with ChangeNotifier {
request.deviceTypeID = Platform.isIOS ? 1 : 2; request.deviceTypeID = Platform.isIOS ? 1 : 2;
request.patientOutSA = 1; // Always 1 for Others (outside KSA/UAE) request.patientOutSA = 1; // Always 1 for Others (outside KSA/UAE)
request.isDentalAllowedBackend = false; request.isDentalAllowedBackend = false;
request.notificationCenterAppSeviceGUID = NOTIFICATION_CENTER_APP_SEVICE_GUID_LOGIN;
dynamic localRes; dynamic localRes;
await new BaseAppClient().post(SEND_ACTIVATION_CODE_OTHERS, onSuccess: (dynamic response, int statusCode) { 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); authenticatedUser = CheckActivationCode.fromJson(localRes);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;
}, body: request.toJson()); }, body: _buildActivationRequestBody(request));
return Future.value(localRes); return Future.value(localRes);
} }
@ -304,6 +316,7 @@ class AuthProvider with ChangeNotifier {
request.deviceTypeID = Platform.isIOS ? 1 : 2; request.deviceTypeID = Platform.isIOS ? 1 : 2;
request.patientOutSA = request.zipCode == '966' ? 0 : 1; request.patientOutSA = request.zipCode == '966' ? 0 : 1;
request.isDentalAllowedBackend = false; request.isDentalAllowedBackend = false;
request.notificationCenterAppSeviceGUID = NOTIFICATION_CENTER_APP_SEVICE_GUID_REGISTRATION;
dynamic localRes; dynamic localRes;
await new BaseAppClient().post(SEND_ACTIVATION_CODE_REGISTER, onSuccess: (dynamic response, int statusCode) { 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); authenticatedUser = CheckActivationCode.fromJson(localRes);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;
}, body: request.toJson()); }, body: _buildActivationRequestBody(request));
return Future.value(localRes); return Future.value(localRes);
} }
@ -1834,6 +1847,8 @@ class AuthProvider with ChangeNotifier {
request['generalid'] = GENERAL_ID; request['generalid'] = GENERAL_ID;
request['DeviceTypeID'] = Platform.isIOS ? 1 : 2; request['DeviceTypeID'] = Platform.isIOS ? 1 : 2;
request['LanguageID'] = (languageID == 'ar' ? 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; dynamic localRes;
try { try {

@ -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 UPDATE_FILE_STATUS = 'Services/Authentication.svc/REST/Update_FileStatus';
const String REMOVE_FILE_STATUS = 'Services/Authentication.svc/REST/ActiveDeactive_PatientFile'; 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 ACTIVATION_CODE_URL = "Services/Authentication.svc/REST/CheckActivationCode";
const String SENT_REQUEST_URL = 'Services/Authentication.svc/REST/GetAllSharedRecordsByStatus'; const String SENT_REQUEST_URL = 'Services/Authentication.svc/REST/GetAllSharedRecordsByStatus';
const String RECEVIED_REQUEST_URL = 'Services/Authentication.svc/REST/GetAllPendingRecordsByResponseId'; const String RECEVIED_REQUEST_URL = 'Services/Authentication.svc/REST/GetAllPendingRecordsByResponseId';
@ -157,12 +159,15 @@ class FamilyFilesProvider with ChangeNotifier {
request.status = 2; request.status = 2;
request.familyRegionID = zipCode == '966' ? 1 : 2; request.familyRegionID = zipCode == '966' ? 1 : 2;
request.isPatientExcluded = isExcluded; 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) { await new BaseAppClient().post(SEND_FAMILY_FILE_ACTIVATION, onSuccess: (dynamic response, int statusCode) {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
AppToast.showErrorToast(message: error); AppToast.showErrorToast(message: error);
throw error; throw error;
}, body: request.toJson()); }, body: body);
return Future.value(localRes); return Future.value(localRes);
} catch (error) { } catch (error) {

Loading…
Cancel
Save