|
|
|
|
@ -17,7 +17,7 @@ class LoginApiClient {
|
|
|
|
|
factory LoginApiClient() => _instance;
|
|
|
|
|
|
|
|
|
|
Future<GetMobileLoginInfoListModel?> getMobileLoginInfoNEW(String deviceToken, String deviceType) async {
|
|
|
|
|
String url = "${ApiConsts.erpRest}Mohemm_GetMobileLoginInfo_NEW";
|
|
|
|
|
String url = "${ApiConsts.authRest}Mohemm_GetMobileLoginInfo_NEW";
|
|
|
|
|
Map<String, dynamic> postParams = {};
|
|
|
|
|
postParams["DeviceToken"] = deviceToken;
|
|
|
|
|
postParams["DeviceType"] = deviceType;
|
|
|
|
|
@ -29,7 +29,7 @@ class LoginApiClient {
|
|
|
|
|
|
|
|
|
|
Future<GenericResponseModel?> insertMobileLoginInfoNEW(
|
|
|
|
|
String email, int sessionId, String employeeName, int loginType, String mobileNumber, String userName, String deviceToken, String deviceType) async {
|
|
|
|
|
String url = "${ApiConsts.erpRest}Mohemm_InsertMobileLoginInfo";
|
|
|
|
|
String url = "${ApiConsts.authRest}Mohemm_InsertMobileLoginInfo";
|
|
|
|
|
Map<String, dynamic> postParams = {
|
|
|
|
|
"MobileNumber": mobileNumber,
|
|
|
|
|
"P_USER_NAME": userName,
|
|
|
|
|
@ -52,14 +52,14 @@ class LoginApiClient {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<CheckMobileAppVersionModel> checkMobileAppVersion() async {
|
|
|
|
|
String url = "${ApiConsts.utilitiesRest}CheckMobileAppVersion";
|
|
|
|
|
String url = "${ApiConsts.utilitiesRest}CheckMobileAppVersion"; // todo @zahoor, not found in swagger
|
|
|
|
|
Map<String, dynamic> postParams = {};
|
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
|
return await ApiClient().postJsonForObject((json) => CheckMobileAppVersionModel.fromJson(json), url, postParams);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<MemberLoginListModel?> memberLogin(String username, String password) async {
|
|
|
|
|
String url = "${ApiConsts.erpRest}MemberLogin";
|
|
|
|
|
String url = "${ApiConsts.authRest}MemberLogin";
|
|
|
|
|
Map<String, dynamic> postParams = {"P_APP_VERSION": "CS", "P_LANGUAGE": "US", "P_PASSWORD": password, "P_USER_NAME": username};
|
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
|
return await ApiClient().postJsonForObject((json) {
|
|
|
|
|
@ -70,14 +70,14 @@ class LoginApiClient {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<BasicMemberInformationModel?> mohemmSendActivationCodeByOTPNotificationType(int isMobileFingerPrint, String? mobileNumber, int optSendType, String? pUserName) async {
|
|
|
|
|
String url = "${ApiConsts.erpRest}Mohemm_SendActivationCodebyOTPNotificationType";
|
|
|
|
|
String url = "${ApiConsts.authRest}Mohemm_SendActivationCodebyOTPNotificationType";
|
|
|
|
|
Map<String, dynamic> postParams = {"IsMobileFingerPrint": isMobileFingerPrint, "MobileNumber": mobileNumber, "OTP_SendType": optSendType, "P_USER_NAME": pUserName};
|
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
|
return await ApiClient().postJsonForObject((json) => GenericResponseModel.fromJson(json).basicMemberInformation, url, postParams);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<GenericResponseModel?> checkActivationCode(bool isDeviceNFC, String? mobileNumber, String activationCode, String? pUserName) async {
|
|
|
|
|
String url = "${ApiConsts.erpRest}CheckActivationCode";
|
|
|
|
|
String url = "${ApiConsts.authRest}CheckActivationCode";
|
|
|
|
|
Map<String, dynamic> postParams = {"IsDeviceNFC": isDeviceNFC, "MobileNumber": mobileNumber, "activationCode": activationCode, "P_USER_NAME": pUserName};
|
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
|
return await ApiClient().postJsonForObject((json) {
|
|
|
|
|
@ -97,14 +97,14 @@ class LoginApiClient {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<BasicMemberInformationModel?> getBasicUserInformation(String pAppVersion, String pUsername) async {
|
|
|
|
|
String url = "${ApiConsts.erpRest}Get_BasicUserInformation";
|
|
|
|
|
String url = "${ApiConsts.authRest}Get_BasicUserInformation";
|
|
|
|
|
Map<String, dynamic> postParams = {"P_APP_VERSION": pAppVersion, "P_USER_NAME": pUsername};
|
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
|
return await ApiClient().postJsonForObject((json) => GenericResponseModel.fromJson(json).basicMemberInformation, url, postParams);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<GenericResponseModel?> sendPublicActivationCode(String? mobileNumber, String? pUsername) async {
|
|
|
|
|
String url = "${ApiConsts.erpRest}SendPublicActivationCode";
|
|
|
|
|
String url = "${ApiConsts.erpRest}SendPublicActivationCode"; // todo @zahoor, not found in swagger
|
|
|
|
|
Map<String, dynamic> postParams = {"MobileNumber": mobileNumber, "P_MOBILE_NUMBER": mobileNumber, "P_USER_NAME": pUsername};
|
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
|
return await ApiClient().postJsonForObject((json) {
|
|
|
|
|
@ -115,7 +115,7 @@ class LoginApiClient {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<GenericResponseModel?> checkPublicActivationCode(String activationCode, String? pUserName) async {
|
|
|
|
|
String url = "${ApiConsts.erpRest}checkPublicActivationCode";
|
|
|
|
|
String url = "${ApiConsts.erpRest}checkPublicActivationCode"; // todo @zahoor, not found in swagger
|
|
|
|
|
Map<String, dynamic> postParams = {"activationCode": activationCode, "P_USER_NAME": pUserName};
|
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
|
return await ApiClient().postJsonForObject((json) {
|
|
|
|
|
@ -126,7 +126,7 @@ class LoginApiClient {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<GenericResponseModel?> changePasswordForget(String forgetPasswordTokenID, String pNewPassword, String pConfirmNewPassword, String? pUserName) async {
|
|
|
|
|
String url = "${ApiConsts.erpRest}ChangePassword_Forget";
|
|
|
|
|
String url = "${ApiConsts.erpRest}ChangePassword_Forget"; // todo @zahoor, not found in swagger
|
|
|
|
|
Map<String, dynamic> postParams = {"P_USER_NAME": pUserName, "ForgetPasswordTokenID": forgetPasswordTokenID, "P_Confirm_NEW_PASSWORD": pConfirmNewPassword, "P_NEW_PASSWORD": pNewPassword};
|
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
|
return await ApiClient().postJsonForObject((json) {
|
|
|
|
|
@ -147,7 +147,7 @@ class LoginApiClient {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<GenericResponseModel> changePasswordFromActiveDirectorySession(String password, String email) async {
|
|
|
|
|
String url = "${ApiConsts.authenticationRest}SetPassword";
|
|
|
|
|
String url = "${ApiConsts.authenticationRest}SetPassword"; // todo @zahoor, not found in swagger
|
|
|
|
|
Map<String, dynamic> postParams = {"EmailAddress": email, "Password": password, "generalid": "Cs2020@2016\$2958"};
|
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
|
postParams["LogInTokenID"] = "@acT!V3D!r3Ct0rY"; // hard code token for active directory
|
|
|
|
|
|