|  |  |  | @ -344,7 +344,14 @@ class AuthenticationViewModel extends ChangeNotifier { | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   Future<void> sendActivationCode( | 
		
	
		
			
				|  |  |  |  |       {required OTPTypeEnum otpTypeEnum, required String nationalIdOrFileNumber, required String phoneNumber, required bool isForRegister, dynamic payload, bool isComingFromResendOTP = false}) async { | 
		
	
		
			
				|  |  |  |  |       {required OTPTypeEnum otpTypeEnum, | 
		
	
		
			
				|  |  |  |  |       required String nationalIdOrFileNumber, | 
		
	
		
			
				|  |  |  |  |       required String phoneNumber, | 
		
	
		
			
				|  |  |  |  |       required bool isForRegister, | 
		
	
		
			
				|  |  |  |  |       dynamic payload, | 
		
	
		
			
				|  |  |  |  |       bool isComingFromResendOTP = false, | 
		
	
		
			
				|  |  |  |  |       bool isExcludedUser = false, | 
		
	
		
			
				|  |  |  |  |       int? responseID}) async { | 
		
	
		
			
				|  |  |  |  |     var request = RequestUtils.getCommonRequestSendActivationCode( | 
		
	
		
			
				|  |  |  |  |       otpTypeEnum: otpTypeEnum, | 
		
	
		
			
				|  |  |  |  |       mobileNumber: phoneNumber, | 
		
	
	
		
			
				
					|  |  |  | @ -360,6 +367,8 @@ class AuthenticationViewModel extends ChangeNotifier { | 
		
	
		
			
				|  |  |  |  |               ? false | 
		
	
		
			
				|  |  |  |  |               : true, | 
		
	
		
			
				|  |  |  |  |       payload: payload, | 
		
	
		
			
				|  |  |  |  |       isExcludedUser: isExcludedUser, | 
		
	
		
			
				|  |  |  |  |       responseID: responseID, | 
		
	
		
			
				|  |  |  |  |     ); | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |     // TODO: GET APP SMS SIGNATURE HERE | 
		
	
	
		
			
				
					|  |  |  | @ -369,7 +378,8 @@ class AuthenticationViewModel extends ChangeNotifier { | 
		
	
		
			
				|  |  |  |  |       _appState.setUserRegistrationPayload = RegistrationDataModelPayload.fromJson(payload); | 
		
	
		
			
				|  |  |  |  |     } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |     final resultEither = await _authenticationRepo.sendActivationCodeRepo(sendActivationCodeReq: request, isRegister: checkIsUserComingForRegister(request: payload), languageID: 'er'); | 
		
	
		
			
				|  |  |  |  |     final resultEither = | 
		
	
		
			
				|  |  |  |  |         await _authenticationRepo.sendActivationCodeRepo(sendActivationCodeReq: request, isRegister: checkIsUserComingForRegister(request: payload), languageID: 'er', isExcludedUser: isExcludedUser); | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |     resultEither.fold( | 
		
	
		
			
				|  |  |  |  |       (failure) async => await _errorHandlerService.handleError(failure: failure), | 
		
	
	
		
			
				
					|  |  |  | @ -384,7 +394,9 @@ class AuthenticationViewModel extends ChangeNotifier { | 
		
	
		
			
				|  |  |  |  |         } else { | 
		
	
		
			
				|  |  |  |  |           if (apiResponse.data != null && apiResponse.data['isSMSSent'] == true) { | 
		
	
		
			
				|  |  |  |  |             LoaderBottomSheet.hideLoader(); | 
		
	
		
			
				|  |  |  |  |             if (!isComingFromResendOTP) navigateToOTPScreen(otpTypeEnum: otpTypeEnum, phoneNumber: phoneNumber, isComingFromRegister: checkIsUserComingForRegister(request: payload), payload: payload); | 
		
	
		
			
				|  |  |  |  |             if (!isComingFromResendOTP) | 
		
	
		
			
				|  |  |  |  |               navigateToOTPScreen( | 
		
	
		
			
				|  |  |  |  |                   otpTypeEnum: otpTypeEnum, phoneNumber: phoneNumber, isComingFromRegister: checkIsUserComingForRegister(request: payload), payload: payload, isExcludedUser: isExcludedUser); | 
		
	
		
			
				|  |  |  |  |           } else { | 
		
	
		
			
				|  |  |  |  |             // TODO: Handle isSMSSent false | 
		
	
		
			
				|  |  |  |  |             // navigateToOTPScreen(otpTypeEnum: otpTypeEnum, phoneNumber: phoneNumber); | 
		
	
	
		
			
				
					|  |  |  | @ -403,7 +415,13 @@ class AuthenticationViewModel extends ChangeNotifier { | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   Future<void> checkActivationCode( | 
		
	
		
			
				|  |  |  |  |       {required String? activationCode, required OTPTypeEnum otpTypeEnum, required Function(String? message) onWrongActivationCode, Function()? onResendActivation}) async { | 
		
	
		
			
				|  |  |  |  |       {required String? activationCode, | 
		
	
		
			
				|  |  |  |  |       required OTPTypeEnum otpTypeEnum, | 
		
	
		
			
				|  |  |  |  |       required Function(String? message) onWrongActivationCode, | 
		
	
		
			
				|  |  |  |  |       Function()? onResendActivation, | 
		
	
		
			
				|  |  |  |  |       bool isExcludedUser = false, | 
		
	
		
			
				|  |  |  |  |       dynamic requestID, | 
		
	
		
			
				|  |  |  |  |       dynamic responseID}) async { | 
		
	
		
			
				|  |  |  |  |     bool isForRegister = (_appState.getUserRegistrationPayload.healthId != null || _appState.getUserRegistrationPayload.patientOutSa == true || _appState.getUserRegistrationPayload.patientOutSa == 1); | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |     final request = RequestUtils.getCommonRequestWelcome( | 
		
	
	
		
			
				
					|  |  |  | @ -429,6 +447,13 @@ class AuthenticationViewModel extends ChangeNotifier { | 
		
	
		
			
				|  |  |  |  |             //TODO: Error Here IN Zip Code. | 
		
	
		
			
				|  |  |  |  |             loginType: loginTypeEnum.toInt) | 
		
	
		
			
				|  |  |  |  |         .toJson(); | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |     if (isExcludedUser) { | 
		
	
		
			
				|  |  |  |  |       request['PatientShareRequestID'] = requestID; | 
		
	
		
			
				|  |  |  |  |       request['ResponseID'] = responseID; | 
		
	
		
			
				|  |  |  |  |       request['Status'] = 3; | 
		
	
		
			
				|  |  |  |  |     } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |     LoaderBottomSheet.showLoader(); | 
		
	
		
			
				|  |  |  |  |     if (isForRegister) { | 
		
	
		
			
				|  |  |  |  |       if (_appState.getUserRegistrationPayload.patientOutSa == 0) request['DOB'] = _appState.getUserRegistrationPayload.dob; | 
		
	
	
		
			
				
					|  |  |  | @ -464,7 +489,8 @@ class AuthenticationViewModel extends ChangeNotifier { | 
		
	
		
			
				|  |  |  |  |         } | 
		
	
		
			
				|  |  |  |  |       }); | 
		
	
		
			
				|  |  |  |  |     } else { | 
		
	
		
			
				|  |  |  |  |       final resultEither = await _authenticationRepo.checkActivationCodeRepo(newRequest: CheckActivationCodeRegisterReq.fromJson(request), activationCode: activationCode, isRegister: false); | 
		
	
		
			
				|  |  |  |  |       final resultEither = await _authenticationRepo.checkActivationCodeRepo( | 
		
	
		
			
				|  |  |  |  |           newRequest: CheckActivationCodeRegisterReq.fromJson(request), activationCode: activationCode, isRegister: false, isExcludedUser: isExcludedUser); | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |       resultEither.fold( | 
		
	
		
			
				|  |  |  |  |           (failure) async => await _errorHandlerService.handleError( | 
		
	
	
		
			
				
					|  |  |  | @ -573,12 +599,13 @@ class AuthenticationViewModel extends ChangeNotifier { | 
		
	
		
			
				|  |  |  |  |     _navigationService.pushAndReplace(AppRoutes.landingScreen); | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   Future<void> navigateToOTPScreen({required OTPTypeEnum otpTypeEnum, required String phoneNumber, required bool isComingFromRegister, dynamic payload}) async { | 
		
	
		
			
				|  |  |  |  |   Future<void> navigateToOTPScreen({required OTPTypeEnum otpTypeEnum, required String phoneNumber, required bool isComingFromRegister, dynamic payload, bool isExcludedUser = false}) async { | 
		
	
		
			
				|  |  |  |  |     _navigationService.pushToOtpScreen( | 
		
	
		
			
				|  |  |  |  |       phoneNumber: phoneNumber, | 
		
	
		
			
				|  |  |  |  |       checkActivationCode: (int activationCode) async { | 
		
	
		
			
				|  |  |  |  |         await checkActivationCode( | 
		
	
		
			
				|  |  |  |  |           activationCode: activationCode.toString(), | 
		
	
		
			
				|  |  |  |  |           isExcludedUser: isExcludedUser, | 
		
	
		
			
				|  |  |  |  |           otpTypeEnum: otpTypeEnum, | 
		
	
		
			
				|  |  |  |  |           onWrongActivationCode: (String? value) { | 
		
	
		
			
				|  |  |  |  |             onWrongActivationCode(message: value); | 
		
	
	
		
			
				
					|  |  |  | 
 |