Merge branch 'fix_login' into 'development'

Fix login issue

See merge request Cloud_Solution/doctor_app_flutter!793
merge-requests/795/head
Mohammad Aljammal 5 years ago
commit fa9942ac24

@ -5,8 +5,8 @@ const ONLY_NUMBERS = "[0-9]";
const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_LETTERS = "[a-zA-Z &'\"]";
const ONLY_DATE = "[0-9/]"; const ONLY_DATE = "[0-9/]";
const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/';
const BASE_URL = 'https://hmgwebservices.com/'; // const BASE_URL = 'https://hmgwebservices.com/';
// const BASE_URL = 'https://uat.hmgwebservices.com/'; const BASE_URL = 'https://uat.hmgwebservices.com/';
const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh";
const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList";
const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient";

@ -1,15 +1,16 @@
final TOKEN = 'token'; const TOKEN = 'token';
final PROJECT_ID = 'projectID'; const PROJECT_ID = 'projectID';
final VIDA_AUTH_TOKEN_ID = 'VidaAuthTokenID'; const VIDA_AUTH_TOKEN_ID = 'VidaAuthTokenID';
final VIDA_REFRESH_TOKEN_ID = 'VidaRefreshTokenID'; const VIDA_REFRESH_TOKEN_ID = 'VidaRefreshTokenID';
final LOGIN_TOKEN_ID = 'LogInToken'; const LOGIN_TOKEN_ID = 'LogInToken';
final DOCTOR_ID = 'doctorID'; const DOCTOR_ID = 'doctorID';
final SLECTED_PATIENT_TYPE = 'slectedPatientType'; const SLECTED_PATIENT_TYPE = 'slectedPatientType';
final APP_Language = 'language'; const APP_Language = 'language';
final DOCTOR_PROFILE = 'doctorProfile'; const DOCTOR_PROFILE = 'doctorProfile';
final LIVE_CARE_PATIENT = 'livecare-patient-profile'; const LIVE_CARE_PATIENT = 'livecare-patient-profile';
final LOGGED_IN_USER = 'loggedUser'; const LOGGED_IN_USER = 'loggedUser';
final DASHBOARD_DATA = 'dashboard-data'; const EMPLOYEE_ID = 'EmployeeID';
final OTP_TYPE = 'otp-type'; const DASHBOARD_DATA = 'dashboard-data';
final LAST_LOGIN_USER = 'last-login-user'; const OTP_TYPE = 'otp-type';
final CLINIC_NAME = 'clinic-name'; const LAST_LOGIN_USER = 'last-login-user';
const CLINIC_NAME = 'clinic-name';

@ -1,6 +1,7 @@
class ActivationCodeModel { class ActivationCodeModel {
int channel; int channel;
int languageID; int languageID;
int loginDoctorID;
double versionID; double versionID;
int memberID; int memberID;
int facilityId; int facilityId;
@ -14,7 +15,7 @@ class ActivationCodeModel {
this.memberID, this.memberID,
this.facilityId, this.facilityId,
this.otpSendType, this.otpSendType,
this.generalid}); this.generalid,this.loginDoctorID});
ActivationCodeModel.fromJson(Map<String, dynamic> json) { ActivationCodeModel.fromJson(Map<String, dynamic> json) {
channel = json['Channel']; channel = json['Channel'];
@ -24,6 +25,7 @@ class ActivationCodeModel {
facilityId = json['facilityId']; facilityId = json['facilityId'];
otpSendType = json['OTP_SendType']; otpSendType = json['OTP_SendType'];
generalid = json['generalid']; generalid = json['generalid'];
loginDoctorID = json['LoginDoctorID'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -35,6 +37,7 @@ class ActivationCodeModel {
data['facilityId'] = this.facilityId; data['facilityId'] = this.facilityId;
data['OTP_SendType'] = otpSendType; data['OTP_SendType'] = otpSendType;
data['generalid'] = this.generalid; data['generalid'] = this.generalid;
data['LoginDoctorID'] = this.loginDoctorID;
return data; return data;
} }
} }

@ -3,6 +3,7 @@ class ActivationCodeForVerificationScreenModel {
String mobileNumber; String mobileNumber;
String zipCode; String zipCode;
int channel; int channel;
int loginDoctorID;
int languageID; int languageID;
double versionID; double versionID;
int memberID; int memberID;
@ -25,7 +26,7 @@ class ActivationCodeForVerificationScreenModel {
this.isMobileFingerPrint, this.isMobileFingerPrint,
this.vidaAuthTokenID, this.vidaAuthTokenID,
this.vidaRefreshTokenID, this.vidaRefreshTokenID,
this.iMEI}); this.iMEI,this.loginDoctorID});
ActivationCodeForVerificationScreenModel.fromJson(Map<String, dynamic> json) { ActivationCodeForVerificationScreenModel.fromJson(Map<String, dynamic> json) {
oTPSendType = json['OTP_SendType']; oTPSendType = json['OTP_SendType'];
@ -41,6 +42,7 @@ class ActivationCodeForVerificationScreenModel {
vidaAuthTokenID = json['VidaAuthTokenID']; vidaAuthTokenID = json['VidaAuthTokenID'];
vidaRefreshTokenID = json['VidaRefreshTokenID']; vidaRefreshTokenID = json['VidaRefreshTokenID'];
iMEI = json['IMEI']; iMEI = json['IMEI'];
loginDoctorID = json['LoginDoctorID'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -56,6 +58,7 @@ class ActivationCodeForVerificationScreenModel {
data['generalid'] = this.generalid; data['generalid'] = this.generalid;
data['IsMobileFingerPrint'] = this.isMobileFingerPrint; data['IsMobileFingerPrint'] = this.isMobileFingerPrint;
data['IMEI'] = this.iMEI; data['IMEI'] = this.iMEI;
data['LoginDoctorID'] = this.loginDoctorID;
return data; return data;
} }
} }

@ -3,6 +3,7 @@ class CheckActivationCodeRequestModel {
String zipCode; String zipCode;
int doctorID; int doctorID;
int memberID; int memberID;
int loginDoctorID;
String password; String password;
String facilityId; String facilityId;
String iPAdress; String iPAdress;
@ -32,7 +33,7 @@ class CheckActivationCodeRequestModel {
this.activationCode, this.activationCode,
this.vidaAuthTokenID, this.vidaAuthTokenID,
this.vidaRefreshTokenID, this.vidaRefreshTokenID,
this.oTPSendType,this.password,this.facilityId,this.memberID,this.isForSilentLogin=false,this.iMEI}); this.oTPSendType,this.password,this.facilityId,this.memberID,this.isForSilentLogin=false,this.iMEI,this.loginDoctorID});
CheckActivationCodeRequestModel.fromJson(Map<String, dynamic> json) { CheckActivationCodeRequestModel.fromJson(Map<String, dynamic> json) {
mobileNumber = json['MobileNumber']; mobileNumber = json['MobileNumber'];
@ -49,6 +50,7 @@ class CheckActivationCodeRequestModel {
vidaAuthTokenID = json['VidaAuthTokenID']; vidaAuthTokenID = json['VidaAuthTokenID'];
vidaRefreshTokenID = json['VidaRefreshTokenID']; vidaRefreshTokenID = json['VidaRefreshTokenID'];
oTPSendType = json['OTP_SendType']; oTPSendType = json['OTP_SendType'];
loginDoctorID = json['LoginDoctorID'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -72,6 +74,7 @@ class CheckActivationCodeRequestModel {
data['Password'] = this.password; data['Password'] = this.password;
data['IMEI'] = this.iMEI; data['IMEI'] = this.iMEI;
data['IsForSilentLogin'] = this.isForSilentLogin; data['IsForSilentLogin'] = this.isForSilentLogin;
data['LoginDoctorID'] = this.loginDoctorID;
return data; return data;
} }
} }

@ -142,6 +142,7 @@ class AuthenticationViewModel extends BaseViewModel {
iMEI: user.iMEI, iMEI: user.iMEI,
facilityId: user.projectID, facilityId: user.projectID,
memberID: user.doctorID, memberID: user.doctorID,
loginDoctorID: user.doctorID,
zipCode: user.outSA == true ? '971' : '966', zipCode: user.outSA == true ? '971' : '966',
mobileNumber: user.mobile, mobileNumber: user.mobile,
oTPSendType: authMethodType.getTypeIdService(), oTPSendType: authMethodType.getTypeIdService(),
@ -163,6 +164,7 @@ class AuthenticationViewModel extends BaseViewModel {
ActivationCodeModel activationCodeModel = ActivationCodeModel( ActivationCodeModel activationCodeModel = ActivationCodeModel(
facilityId: projectID, facilityId: projectID,
memberID: loggedUser.listMemberInformation[0].memberID, memberID: loggedUser.listMemberInformation[0].memberID,
loginDoctorID: loggedUser.listMemberInformation[0].employeeID,
otpSendType: authMethodType.getTypeIdService().toString(), otpSendType: authMethodType.getTypeIdService().toString(),
); );
await _authService.sendActivationCodeForDoctorApp(activationCodeModel); await _authService.sendActivationCodeForDoctorApp(activationCodeModel);
@ -196,6 +198,7 @@ class AuthenticationViewModel extends BaseViewModel {
facilityId:userInfo.projectID!=null? userInfo.projectID.toString():user.projectID.toString(), facilityId:userInfo.projectID!=null? userInfo.projectID.toString():user.projectID.toString(),
oTPSendType: await sharedPref.getInt(OTP_TYPE), oTPSendType: await sharedPref.getInt(OTP_TYPE),
iMEI: localToken, iMEI: localToken,
loginDoctorID:userInfo.userID!=null? int.parse(userInfo.userID):user.doctorID,// loggedUser.listMemberInformation[0].employeeID,
isForSilentLogin:isSilentLogin, isForSilentLogin:isSilentLogin,
generalid: "Cs2020@2016\$2958"); generalid: "Cs2020@2016\$2958");
await _authService.checkActivationCodeForDoctorApp(checkActivationCodeForDoctorApp); await _authService.checkActivationCodeForDoctorApp(checkActivationCodeForDoctorApp);

Loading…
Cancel
Save