diff --git a/lib/api/api_client.dart b/lib/api/api_client.dart index 7298135..3aa9e94 100644 --- a/lib/api/api_client.dart +++ b/lib/api/api_client.dart @@ -391,11 +391,11 @@ class ApiResponse { String toRawJson() => json.encode(toJson()); factory ApiResponse.fromJson(Map json) => ApiResponse( - totalItemsCount: json["TotalItemsCount"], - data: json["Data"], - messageStatus: json["MessageStatus"], - errorMessage: json["ErrorMessage"], - errorEndUserMessage: json["ErrorEndUserMessage"], + totalItemsCount: json["TotalItemsCount"] ?? json["totalItemsCount"] , + data: json["Data"] ?? json["data"], + messageStatus: json["MessageStatus"] ?? json["messageStatus"], + errorMessage: json["ErrorMessage"] ?? json["errorMessage"], + errorEndUserMessage: json["ErrorEndUserMessage"] ?? json["errorEndUserMessage"], ); Map toJson() => { @@ -471,7 +471,7 @@ class ApiClient { if (!kReleaseMode) { print("Url:$url"); var bodyJson = json.encode(jsonObject); - print("body:$bodyJson"); + printLongLog("body:$bodyJson"); } var response = await postJsonForResponse(url, jsonObject, token: token, queryParameters: queryParameters, headers: _headers, retryTimes: retryTimes, isFormData: isFormData); @@ -494,15 +494,29 @@ class ApiClient { if (apiResponse.isSuccess) { return factoryConstructor(jsonData); } else { - throw APIException( - APIException.BAD_REQUEST, - error: APIError( - null, - apiResponse.errorEndUserMessage ?? apiResponse.errorMessage, - null, - response.statusCode, - ), - ); + if(apiResponse.messageStatus == null || apiResponse.messageStatus != 1) { + + logger.i(apiResponse.errorMessage); + throw APIException( + APIException.OTHER, + error: APIError( + null, + apiResponse.errorEndUserMessage ?? apiResponse.errorMessage, + null, + response.statusCode, + ), + ); + }else { + throw APIException( + APIException.BAD_REQUEST, + error: APIError( + null, + apiResponse.errorEndUserMessage ?? apiResponse.errorMessage, + null, + response.statusCode, + ), + ); + } } } @@ -560,6 +574,7 @@ class ApiClient { url = url + '?' + queryString; } + var response = await _post( Uri.parse(url), body: requestBody, @@ -795,4 +810,9 @@ class ApiClient { body: body, encoding: encoding, )); + + void printLongLog(String text) { + var pattern = RegExp('.{1,1000}'); // Break into 1000-char chunks + pattern.allMatches(text.replaceAll('\n', ' ')).forEach((match) => debugPrint(match.group(0))); + } } diff --git a/lib/api/api_mapper_class.dart b/lib/api/api_mapper_class.dart index 2750134..23a60cd 100644 --- a/lib/api/api_mapper_class.dart +++ b/lib/api/api_mapper_class.dart @@ -9,7 +9,9 @@ import 'package:mohem_flutter_app/models/check_activation_code_model.dart'; import 'package:mohem_flutter_app/models/check_mobile_app_version_model.dart'; import 'package:mohem_flutter_app/models/dashboard/get_accrual_balances_list_model.dart'; import 'package:mohem_flutter_app/models/dashboard/get_attendance_tracking_list_model.dart'; +import 'package:mohem_flutter_app/models/dashboard/get_open_missing_swipe.dart'; import 'package:mohem_flutter_app/models/dashboard/itg_forms_model.dart'; +import 'package:mohem_flutter_app/models/dashboard/menu_entries.dart'; import 'package:mohem_flutter_app/models/eit/get_eit_transaction_model.dart'; import 'package:mohem_flutter_app/models/generic_mapper_model.dart'; import 'package:mohem_flutter_app/models/generic_response_model.dart'; @@ -25,7 +27,7 @@ class ApiClassMapper { return MemberLoginListModel.fromRawJson(jsonEncode(jsonData)); case 'Mohemm_SendActivationCodebyOTPNotificationType': BasicMemberInformationModel response = BasicMemberInformationModel.fromRawJson(jsonEncode(jsonData)); - AppState().postParamsObject?.setLogInTokenID = response.logInTokenId; + // AppState().postParamsObject?.setLogInTokenID = response.logInTokenId; return response; case 'CheckActivationCode': CheckActivationCodeModel responseData = CheckActivationCodeModel.fromRawJson(jsonEncode(jsonData)); @@ -37,10 +39,10 @@ class ApiClassMapper { AppState().postParamsObject?.pUserName = AppState().getUserName; AppState().postParamsObject?.pSelectedEmployeeNumber = AppState().getUserName; AppState().postParamsObject?.setPLegislationCode = responseData.basicMemberInformation!.pLegislationCode; - AppState().postParamsObject?.setPayrollCodeStr = responseData.memberInformationList!.first.pAYROLLCODE; + AppState().postParamsObject?.setPayrollCodeStr = responseData.memberInformationList!.first.payrolLCode; AppState().setBusinessCardPrivilege = responseData.memberInformationList!.first.businessCardPrivilege ?? false; // AppState().postParamsObject!.logInTokenID = responseData.authenticationTokenId; - responseData.errorMessage = errorMessage; + //responseData.errorMessage = errorMessage; return responseData; case 'RefreshToken': return; @@ -53,13 +55,13 @@ class ApiClassMapper { return false; } case 'Mohemm_GetMobileLoginInfo_NEW': - GetMobileLoginInfoListModel response = GetMobileLoginInfoListModel.fromJson(jsonData); + GetMobileLoginInfoListModel response = GetMobileLoginInfoListModel.fromJson(jsonData.first); return response; case 'ChangePassword_FromActiveSession': return; case 'Get_BasicUserInformation': - - return; + BasicMemberInformationModel response = BasicMemberInformationModel.fromJson(jsonData); + return response; case 'SendPublicActivationCode': return; case 'CheckPublicActivationCode': @@ -68,6 +70,8 @@ class ApiClassMapper { return; case 'CheckMobileAppVersion': return CheckMobileAppVersionModel.fromRawJson(jsonData); + case 'GET_MENU': + return CheckMobileAppVersionModel.fromRawJson(jsonData); // COCWS endpoints case 'Mohemm_ITG_GetCategories': return; @@ -264,11 +268,11 @@ class ApiClassMapper { case 'ErrorCount_Get': return; case 'GET_Menu_Entries': - return; + return GetMenuEntriesList.fromRawJson(jsonData);; case 'GET_Open_Notifications': - return GenericResponseModel(); + return GenericResponseModel.fromJson(jsonData); case 'Get_Open_Missing_Swipes': - return; + return GetOpenMissingSwipes.fromRawJson(jsonData); case 'GET_CONTACT_COLS_STRUCTURE': return; case 'GET_EMPLOYEE_ADDRESS': @@ -386,7 +390,8 @@ class ApiClassMapper { case 'INSERT_GL_JOURNALS_INTO_STG': return; case 'GET_Attendance_Tracking': - return GetAttendanceTracking(); + GetAttendanceTracking response = GetAttendanceTracking.fromJson(jsonData); + return response; case 'GET_OPEN_NOTIFICATIONS': return GenericResponseModel(); case 'GET_ABSENCE_TRANSACTIONS': diff --git a/lib/api/chat/chat_api_client.dart b/lib/api/chat/chat_api_client.dart index 510f6fa..702d343 100644 --- a/lib/api/chat/chat_api_client.dart +++ b/lib/api/chat/chat_api_client.dart @@ -33,7 +33,7 @@ class ChatApiClient { Response response = await ApiClient().postJsonForResponse( "${ApiConsts.chatLoginTokenUrl}externaluserlogin", { - "employeeNumber": AppState().memberInformationList!.eMPLOYEENUMBER.toString(), + "employeeNumber": AppState().memberInformationList!.employeENumber.toString(), "password": "FxIu26rWIKoF8n6mpbOmAjDLphzFGmpG", "isMobile": true, "platform": Platform.isIOS ? "ios" : "android", diff --git a/lib/api/dashboard_api_client.dart b/lib/api/dashboard_api_client.dart index e87d602..dc0d75b 100644 --- a/lib/api/dashboard_api_client.dart +++ b/lib/api/dashboard_api_client.dart @@ -2,13 +2,16 @@ import 'dart:async'; import 'dart:convert'; import 'package:mohem_flutter_app/api/api_client.dart'; +import 'package:mohem_flutter_app/api/api_mapper_class.dart'; import 'package:mohem_flutter_app/app_state/app_state.dart'; import 'package:mohem_flutter_app/classes/consts.dart'; import 'package:mohem_flutter_app/classes/date_uitl.dart'; import 'package:mohem_flutter_app/models/dashboard/get_accrual_balances_list_model.dart'; import 'package:mohem_flutter_app/models/dashboard/get_attendance_tracking_list_model.dart'; +import 'package:mohem_flutter_app/models/dashboard/get_open_missing_swipe.dart'; import 'package:mohem_flutter_app/models/dashboard/itg_forms_model.dart'; import 'package:mohem_flutter_app/models/dashboard/list_menu.dart'; +import 'package:mohem_flutter_app/models/dashboard/menu_entries.dart'; import 'package:mohem_flutter_app/models/generic_response_model.dart'; import 'package:mohem_flutter_app/models/itg/itg_main_response.dart'; import 'package:mohem_flutter_app/models/itg/itg_response_model.dart'; @@ -26,25 +29,30 @@ class DashboardApiClient { String url = "${ApiConsts.erpRest}GET_Attendance_Tracking"; Map postParams = {}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json["Data"]); - return responseData.getAttendanceTrackingList; - }, url, postParams); + + dynamic response = await ApiClient().postJsonForObject((json) => json, url, postParams, token: AppState().postParamsObject!.tokenID); + ApiResponse res = ApiResponse.fromJson(response); + GetAttendanceTracking ress = await ApiClassMapper().handleApiEndpoint(endpoint: "GET_Attendance_Tracking", jsonData: res.data); + return ress; + } Future getOpenNotifications() async { String url = "${ApiConsts.erpRest}GET_OPEN_NOTIFICATIONS"; Map postParams = {}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json["Data"]); - return responseData; - }, url, postParams); + + dynamic response = await ApiClient().postJsonForObject((json) => json, url, postParams, token: AppState().postParamsObject!.tokenID); + ApiResponse res = ApiResponse.fromJson(response); + GenericResponseModel ress = await ApiClassMapper().handleApiEndpoint(endpoint: "GET_OPEN_NOTIFICATIONS", jsonData: res); + return ress; + + } Future getCOCNotifications() async { String url = "${ApiConsts.cocRest}Mohemm_ITG_ReviewerAdmin_Pending_Tasks"; - Map postParams = {"Date": DateUtil.getISODateFormat(DateTime.now()), "EmployeeNumber": AppState().memberInformationList?.eMPLOYEENUMBER}; + Map postParams = {"Date": DateUtil.getISODateFormat(DateTime.now()), "EmployeeNumber": AppState().memberInformationList?.employeENumber}; postParams.addAll(AppState().postParamsJson); return await ApiClient().postJsonForObject((json) { GenericResponseModel responseData = GenericResponseModel.fromJson(json); @@ -64,23 +72,25 @@ class DashboardApiClient { Future> getAccrualBalances(String effectiveDate, {String? empID}) async { String url = "${ApiConsts.erpRest}GET_ACCRUAL_BALANCES"; - Map postParams = {"P_EFFECTIVE_DATE": effectiveDate}; + Map postParams = {"p_EFFECTIVE_DATE": effectiveDate}; postParams.addAll(AppState().postParamsJson); - if (empID != null) postParams["P_SELECTED_EMPLOYEE_NUMBER"] = empID; - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json["Data"]); - return responseData.getAccrualBalancesList ?? []; - }, url, postParams); + if (empID != null) postParams["p_SELECTED_EMPLOYEE_NUMBER"] = empID; + dynamic response = await ApiClient().postJsonForObject((json) => json, url, postParams, token: AppState().postParamsObject!.tokenID); + ApiResponse res = ApiResponse.fromJson(response); + List ress = await ApiClassMapper().handleApiEndpoint(endpoint: "GET_ACCRUAL_BALANCES", jsonData: res.data); + return ress; } - Future getOpenMissingSwipes() async { + Future getOpenMissingSwipes() async { String url = "${ApiConsts.erpRest}GET_OPEN_MISSING_SWIPES"; Map postParams = {}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json["Data"]); - return responseData; - }, url, postParams); + + dynamic response = await ApiClient().postJsonForObject((json) => json, url, postParams, token: AppState().postParamsObject!.tokenID); + ApiResponse res = ApiResponse.fromJson(response); + GetOpenMissingSwipes ress = await ApiClassMapper().handleApiEndpoint(endpoint: "GET_OPEN_MISSING_SWIPES", jsonData: res.data); + return ress; + } //Menus List @@ -88,21 +98,25 @@ class DashboardApiClient { String url = "${ApiConsts.erpRest}GET_MENU"; Map postParams = {}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json["Data"]); - return responseData.listMenu ?? []; - }, url, postParams); + dynamic response = await ApiClient().postJsonForObject((json) => json, url, postParams, token: AppState().postParamsObject!.tokenID); + ApiResponse res = ApiResponse.fromJson(response); + List ress = await ApiClassMapper().handleApiEndpoint(endpoint: "GET_MENU", jsonData: res.data); + return ress; } //GET_MENU_ENTRIES - Future getGetMenuEntries() async { + Future> getGetMenuEntries() async { String url = "${ApiConsts.erpRest}GET_MENU_ENTRIES"; - Map postParams = {"P_SELECTED_RESP_ID": -999, "P_MENU_TYPE": "E"}; + Map postParams = {"p_SELECTED_RESP_ID": -999, "p_MENU_TYPE": "E"}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData; - }, url, postParams); + + dynamic response = await ApiClient().postJsonForObject((json) => json, url, postParams, token: AppState().postParamsObject!.tokenID); + ApiResponse res = ApiResponse.fromJson(response); + List ress = await ApiClassMapper().handleApiEndpoint(endpoint: "GET_MENU_ENTRIES", jsonData: res.data); + return ress; + + + } //Mark Attendance @@ -143,7 +157,7 @@ class DashboardApiClient { "QRValue": '', "NFCValue": sourceName == 'NFC' ? sourceName : '', "WifiValue": sourceName == 'WIFI' ? sourceName : '', - "EmployeeID": AppState().memberInformationList!.eMPLOYEENUMBER, + "EmployeeID": AppState().memberInformationList!.employeENumber, }; postParams.addAll(AppState().postParamsJson); return await ApiClient().postJsonForObject((json) { @@ -162,12 +176,11 @@ class DashboardApiClient { "ItgServiceName": "Login" }; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json["Data"]); - MohemmItgResponseItem res = MohemmItgResponseItem.fromJson(jsonDecode(responseData.mohemmITGResponseItem ?? "")); - // var jsonDecodedData = jsonDecode(jsonDecode(responseData.mohemmITGResponseItem!)['result']['data']); - return res; - }, url, postParams); + dynamic response = await ApiClient().postJsonForObject((json) => json, url, postParams, token: AppState().postParamsObject!.tokenID); + ApiResponse res = ApiResponse.fromJson(response); + MohemmItgResponseItem ress = await ApiClassMapper().handleApiEndpoint(endpoint: "Mohemm_ITG_GetPageNotification", jsonData: res.data); + return ress; + } //Submit ITG @@ -207,7 +220,7 @@ class DashboardApiClient { Map postParams = { "ItgNotificationMasterId": masterID, - "EmployeeNumber": AppState().memberInformationList!.eMPLOYEENUMBER.toString(), + "EmployeeNumber": AppState().memberInformationList!.employeENumber.toString(), "ItgAdvertisementId": advertisementId, "ItgAcknowledgment": ackValue, // "ItgAdvertisement": {"ItgAdvertisementId": advertisementId, "ItgAcknowledgment": ackValue} //Mobile Id diff --git a/lib/api/items_for_sale/items_for_sale_api_client.dart b/lib/api/items_for_sale/items_for_sale_api_client.dart index a04651e..c63e74b 100644 --- a/lib/api/items_for_sale/items_for_sale_api_client.dart +++ b/lib/api/items_for_sale/items_for_sale_api_client.dart @@ -20,7 +20,7 @@ class ItemsForSaleApiClient { List getSaleCategoriesList = []; String url = "${ApiConsts.cocRest}Mohemm_ITG_GetItemSaleCategory"; - Map postParams = {"EmployeeNumber": AppState().memberInformationList?.eMPLOYEENUMBER, "ItgPageSize": 10, "ItgPageNo": 1}; + Map postParams = {"EmployeeNumber": AppState().memberInformationList?.employeENumber, "ItgPageSize": 10, "ItgPageNo": 1}; postParams.addAll(AppState().postParamsJson); return await ApiClient().postJsonForObject((response) { @@ -48,7 +48,7 @@ class ItemsForSaleApiClient { String url = "${ApiConsts.cocRest}Mohemm_ITG_GetItemForSale"; Map postParams = { - "EmployeeNumber": AppState().memberInformationList?.eMPLOYEENUMBER, + "EmployeeNumber": AppState().memberInformationList?.employeENumber, "ItgPageSize": 10, "ItgPageNo": itgPageNo, "ItgStatus": "Approved", @@ -81,9 +81,9 @@ class ItemsForSaleApiClient { // request.fields['employeeNumber'] = empNum; Map postParams = { - "EmployeeNumber": AppState().memberInformationList?.eMPLOYEENUMBER, - "employeeNumber": AppState().memberInformationList?.eMPLOYEENUMBER, - "MobileNo": AppState().memberInformationList?.eMPLOYEEMOBILENUMBER, + "EmployeeNumber": AppState().memberInformationList?.employeENumber, + "employeeNumber": AppState().memberInformationList?.employeENumber, + "MobileNo": AppState().memberInformationList?.employeEMobileNumber, "itemSaleID": itemSaleID.toString(), "Channel": "31", "isActive": "false", @@ -105,7 +105,7 @@ class ItemsForSaleApiClient { List employeePostedAdsList = []; String url = "${ApiConsts.cocRest}Mohemm_ITG_GetItemForSaleByEmployee"; - Map postParams = {"EmployeeNumber": AppState().memberInformationList?.eMPLOYEENUMBER, "ItgEmployeeNumber": AppState().memberInformationList?.eMPLOYEENUMBER}; + Map postParams = {"EmployeeNumber": AppState().memberInformationList?.employeENumber, "ItgEmployeeNumber": AppState().memberInformationList?.employeENumber}; postParams.addAll(AppState().postParamsJson); return await ApiClient().postJsonForObject((response) { @@ -121,7 +121,7 @@ class ItemsForSaleApiClient { Future> getRegions() async { String url = "${ApiConsts.cocRest}Mohemm_ITG_GetRegion"; List getRegionsList = []; - Map postParams = {"EmployeeNumber": AppState().memberInformationList?.eMPLOYEENUMBER, "ItgEmployeeNumber": AppState().memberInformationList?.eMPLOYEENUMBER}; + Map postParams = {"EmployeeNumber": AppState().memberInformationList?.employeENumber, "ItgEmployeeNumber": AppState().memberInformationList?.employeENumber}; postParams.addAll(AppState().postParamsJson); return await ApiClient().postJsonForObject((response) { var body = json.decode(response['Mohemm_ITG_ResponseItem']); @@ -145,8 +145,8 @@ class ItemsForSaleApiClient { "ItgQuotePrice": itemReviewModel.itemPrice, "RegionID": itemReviewModel.selectedRegion!.regionID, "ItgIsActive": true, - "EmployeeNumber": AppState().memberInformationList?.eMPLOYEENUMBER, - "employeeNumber": AppState().memberInformationList?.eMPLOYEENUMBER, + "EmployeeNumber": AppState().memberInformationList?.employeENumber, + "employeeNumber": AppState().memberInformationList?.employeENumber, "ItgStatus": itemReviewModel.itemCondition }; postParams.addAll(AppState().postParamsJson); diff --git a/lib/api/login_api_client.dart b/lib/api/login_api_client.dart index bee4f98..e149ef1 100644 --- a/lib/api/login_api_client.dart +++ b/lib/api/login_api_client.dart @@ -25,37 +25,38 @@ class LoginApiClient { Map postParams = {}; postParams["DeviceToken"] = deviceToken; postParams["DeviceType"] = deviceType; - return await ApiClient().postJsonForObject((json) { + // return await ApiClient().postJsonForObject((json) { // GenericResponseModel? responseData = GenericResponseModel.fromJson(json); - print(jsonDecode(json["Data"].first)); - GetMobileLoginInfoListModel? modelData= GetMobileLoginInfoListModel.fromRawJson(jsonDecode(json["Data"].first)); - print("getMobileLoginInfoNEW: ${modelData.toJson()}"); - // return (responseData.mohemmGetMobileLoginInfoList?.length ?? 0) > 0 ? (responseData.mohemmGetMobileLoginInfoList!.first) : null; - return modelData; - }, url, postParams); + // print(jsonDecode(json["data"].first)); + // GetMobileLoginInfoListModel? modelData= GetMobileLoginInfoListModel.fromRawJson(jsonDecode(json["data"].first)); + // print("getMobileLoginInfoNEW: ${modelData.toJson()}"); + // // return (responseData.mohemmGetMobileLoginInfoList?.length ?? 0) > 0 ? (responseData.mohemmGetMobileLoginInfoList!.first) : null; + // return modelData; + // }, url, postParams); - // dynamic response = await ApiClient().postJsonForObject((json) => json, url, postParams, token: AppState().postParamsObject!.tokenID); - // ApiResponse res = ApiResponse.fromJson(response); - // dynamic ress = await ApiClassMapper().handleApiEndpoint(endpoint: "Mohemm_GetMobileLoginInfo_NEW", jsonData: res.data); - // return ress; + dynamic response = await ApiClient().postJsonForObject((json) => json, url, postParams, token: AppState().postParamsObject!.tokenID); + ApiResponse res = ApiResponse.fromJson(response); + GetMobileLoginInfoListModel ress = await ApiClassMapper().handleApiEndpoint(endpoint: "Mohemm_GetMobileLoginInfo_NEW", jsonData: res.data); + return ress; } Future insertMobileLoginInfoNEW(String email, int sessionId, String employeeName, int loginType, String mobileNumber, String userName, String deviceToken, String deviceType) async { - String url = "${ApiConsts.authRest}Mohemm_Insert_MobileDeviceInfo"; - // String url = "${ApiConsts.authRest}Mohemm_InsertMobileLoginInfo"; + //String url = "${ApiConsts.authRest}Mohemm_Insert_MobileDeviceInfo"; + String url = "${ApiConsts.authRest}Mohemm_InsertMobileLoginInfo"; Map postParams = { "MobileNumber": mobileNumber, - "P_USER_NAME": userName, - "UserName": userName, - "CompanyID": 1, // todo 'sikander' @discuss umer for companyID - "DeviceToken": deviceToken, - "LoginType": loginType, - "EmployeeName": employeeName, - "P_SESSION_ID": sessionId, - "P_EMAIL_ADDRESS": email + "p_USER_NAME": userName, + "userName": userName, + "companyID": 1, // todo 'sikander' @discuss umer for companyID + "deviceToken": deviceToken, + "loginType": loginType, + "employeeName": employeeName, + "p_EMAIL_ADDRESS": email, + "gender":1, //todo + }; - postParams["DeviceToken"] = deviceToken; - postParams["DeviceType"] = deviceType; + postParams["deviceToken"] = deviceToken; + postParams["deviceType"] = deviceType; postParams.addAll(AppState().postParamsJson); dynamic response = await ApiClient().postJsonForObject((json) => json, url, postParams, token: AppState().postParamsObject!.tokenID); ApiResponse res = ApiResponse.fromJson(response); @@ -97,10 +98,11 @@ class LoginApiClient { String url = "${ApiConsts.authRest}Mohemm_SendActivationCodebyOTPNotificationType"; Map postParams = {"IsMobileFingerPrint": isMobileFingerPrint, "MobileNumber": mobileNumber, "OTP_SendType": optSendType, "P_USER_NAME": pUserName}; postParams.addAll(AppState().postParamsJson); - postParams["LogInTokenID"] = AppState().postParamsObject?.getLogInTokenID; + postParams["logInTokenID"] = AppState().postParamsObject?.getLogInTokenID; print(postParams); dynamic response = await ApiClient().postJsonForObject((json) => json, url, postParams); ApiResponse res = ApiResponse.fromJson(response); + AppState().postParamsObject?.setLogInTokenID = res.data["logInTokenID"] ?? AppState().postParamsObject?.getLogInTokenID; return await ApiClassMapper().handleApiEndpoint(endpoint: "Mohemm_SendActivationCodebyOTPNotificationType", jsonData: res.data); } @@ -108,9 +110,10 @@ class LoginApiClient { String url = "${ApiConsts.authRest}CheckActivationCode"; Map postParams = {"IsDeviceNFC": isDeviceNFC, "MobileNumber": mobileNumber, "ActivationCode": activationCode, "P_USER_NAME": pUserName}; postParams.addAll(AppState().postParamsJson); - postParams["LogInTokenID"] = AppState().postParamsObject?.getLogInTokenID; + postParams["logInTokenID"] = AppState().postParamsObject?.getLogInTokenID; dynamic response = await ApiClient().postJsonForObject((json) => json, url, postParams); ApiResponse res = ApiResponse.fromJson(response); + AppState().isLogged =true; return await ApiClassMapper().handleApiEndpoint(endpoint: "CheckActivationCode", jsonData: res.data); } @@ -125,19 +128,21 @@ class LoginApiClient { } Future sendPublicActivationCode(String? mobileNumber, String? pUsername) async { - String url = "${ApiConsts.erpRest}SendPublicActivationCode"; // todo @zahoor, not found in swagger - Map postParams = {"MobileNumber": mobileNumber, "P_MOBILE_NUMBER": mobileNumber, "P_USER_NAME": pUsername}; + String url = "${ApiConsts.authRest}SendPublicActivationCode"; // todo @zahoor, not found in swagger + Map postParams = {"mobileNumber": mobileNumber, "p_MOBILE_NUMBER": mobileNumber, "p_USER_NAME": pUsername, }; postParams.addAll(AppState().postParamsJson); return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - AppState().postParamsObject?.setLogInTokenID = responseData.logInTokenID; + ApiResponse res = ApiResponse.fromJson(json); + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + AppState().postParamsObject?.setLogInTokenID = res.data['logInTokenID'] ?? AppState().postParamsObject?.getLogInTokenID; return responseData; }, url, postParams); } Future checkPublicActivationCode(String activationCode, String? pUserName) async { - String url = "${ApiConsts.erpRest}checkPublicActivationCode"; // todo @zahoor, not found in swagger + String url = "${ApiConsts.authRest}checkPublicActivationCode"; // todo @zahoor, not found in swagger Map postParams = {"activationCode": activationCode, "P_USER_NAME": pUserName}; + postParams.addAll(AppState().postParamsJson); return await ApiClient().postJsonForObject((json) { GenericResponseModel responseData = GenericResponseModel.fromJson(json); diff --git a/lib/api/marathon/marathon_api_client.dart b/lib/api/marathon/marathon_api_client.dart index d9021c6..3a396c0 100644 --- a/lib/api/marathon/marathon_api_client.dart +++ b/lib/api/marathon/marathon_api_client.dart @@ -86,9 +86,9 @@ class MarathonApiClient { Future joinMarathonAsParticipant() async { Map jsonObject = { - "employeeNumber": AppState().memberInformationList!.eMPLOYEENUMBER ?? "", - "employeeNameAr": AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEAr ?? AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEEn ?? "", - "employeeNameEn": AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEEn ?? AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEAr ?? "", + "employeeNumber": AppState().memberInformationList!.employeENumber ?? "", + "employeeNameAr": AppState().memberInformationList!.employeENameAr ?? AppState().memberInformationList!.employeEDisplayNameAr ?? "", + "employeeNameEn": AppState().memberInformationList!.employeeNameEn ?? AppState().memberInformationList!.employeeDisplayNameEn ?? "", "marathonId": AppState().getMarathonProjectId!, }; diff --git a/lib/api/mowadhafhi/mowadhafhi_api_client.dart b/lib/api/mowadhafhi/mowadhafhi_api_client.dart index d724c67..460c870 100644 --- a/lib/api/mowadhafhi/mowadhafhi_api_client.dart +++ b/lib/api/mowadhafhi/mowadhafhi_api_client.dart @@ -23,7 +23,7 @@ class MowadhafhiApiClient { Future> getTicketsByEmployee() async { String url = "${ApiConsts.cocRest}Mohemm_ITG_GetTicketsByEmployee"; - Map postParams = {"EmployeeNumber": AppState().memberInformationList?.eMPLOYEENUMBER, "ItgPageSize": 10, "ItgPageNo": 1}; + Map postParams = {"EmployeeNumber": AppState().memberInformationList?.employeENumber, "ItgPageSize": 10, "ItgPageNo": 1}; postParams.addAll(AppState().postParamsJson); return await ApiClient().postJsonForObject((json) { @@ -34,7 +34,7 @@ class MowadhafhiApiClient { Future> getTicketDetailsByEmployee(String? itgTicketID) async { String url = "${ApiConsts.cocRest}Mohemm_ITG_GetTicketDetails"; - Map postParams = {"EmployeeNumber": AppState().memberInformationList?.eMPLOYEENUMBER, "ItgTicketId": itgTicketID}; + Map postParams = {"EmployeeNumber": AppState().memberInformationList?.employeENumber, "ItgTicketId": itgTicketID}; postParams.addAll(AppState().postParamsJson); return await ApiClient().postJsonForObject((json) { @@ -45,7 +45,7 @@ class MowadhafhiApiClient { Future> getTicketTransactions(String? itgTicketID) async { String url = "${ApiConsts.cocRest}Mohemm_ITG_GetTicketTransaction"; - Map postParams = {"EmployeeNumber": AppState().memberInformationList?.eMPLOYEENUMBER, "ItgTicketId": itgTicketID}; + Map postParams = {"EmployeeNumber": AppState().memberInformationList?.employeENumber, "ItgTicketId": itgTicketID}; postParams.addAll(AppState().postParamsJson); return await ApiClient().postJsonForObject((json) { @@ -56,7 +56,7 @@ class MowadhafhiApiClient { Future getTransactionAttachments(int? attachmentID) async { String url = "${ApiConsts.cocRest}Mohemm_ITG_GetTicketAttachment"; - Map postParams = {"EmployeeNumber": AppState().memberInformationList?.eMPLOYEENUMBER, "ItgAttachmentId": attachmentID}; + Map postParams = {"EmployeeNumber": AppState().memberInformationList?.employeENumber, "ItgAttachmentId": attachmentID}; postParams.addAll(AppState().postParamsJson); return await ApiClient().postJsonForObject((json) { @@ -68,7 +68,7 @@ class MowadhafhiApiClient { Future> getTicketTypes() async { String url = "${ApiConsts.cocRest}Mohemm_ITG_GetTicketTypes"; - Map postParams = {"EmployeeNumber": AppState().memberInformationList?.eMPLOYEENUMBER}; + Map postParams = {"EmployeeNumber": AppState().memberInformationList?.employeENumber}; postParams.addAll(AppState().postParamsJson); return await ApiClient().postJsonForObject((json) { @@ -79,7 +79,7 @@ class MowadhafhiApiClient { Future> getProjects() async { String url = "${ApiConsts.cocRest}Mohemm_ITG_GetProjects"; - Map postParams = {"EmployeeNumber": AppState().memberInformationList?.eMPLOYEENUMBER, "ItgProjectCode": AppState().memberInformationList?.pAYROLLCODE}; + Map postParams = {"EmployeeNumber": AppState().memberInformationList?.employeENumber, "ItgProjectCode": AppState().memberInformationList?.payrolLCode}; postParams.addAll(AppState().postParamsJson); return await ApiClient().postJsonForObject((json) { @@ -90,7 +90,7 @@ class MowadhafhiApiClient { Future> getProjectDepartments(int projectID) async { String url = "${ApiConsts.cocRest}Mohemm_ITG_GetProjectDepartments"; - Map postParams = {"EmployeeNumber": AppState().memberInformationList?.eMPLOYEENUMBER, "ItgProjectId": projectID}; + Map postParams = {"EmployeeNumber": AppState().memberInformationList?.employeENumber, "ItgProjectId": projectID}; postParams.addAll(AppState().postParamsJson); return await ApiClient().postJsonForObject((json) { @@ -102,7 +102,7 @@ class MowadhafhiApiClient { Future> getDepartmentSections(int? projectDepartmentID) async { String url = "${ApiConsts.cocRest}Mohemm_ITG_GetDepartmentSections"; Map postParams = { - "EmployeeNumber": AppState().memberInformationList?.eMPLOYEENUMBER, + "EmployeeNumber": AppState().memberInformationList?.employeENumber, "ItgDepartmentSectionId": projectDepartmentID, "ItgProjectDepartmentId": projectDepartmentID }; @@ -116,7 +116,7 @@ class MowadhafhiApiClient { Future> getSectionTopics(int? departmentSectionID) async { String url = "${ApiConsts.cocRest}Mohemm_ITG_GetSectionTopics"; - Map postParams = {"EmployeeNumber": AppState().memberInformationList?.eMPLOYEENUMBER, "ItgDepartmentSectionId": departmentSectionID}; + Map postParams = {"EmployeeNumber": AppState().memberInformationList?.employeENumber, "ItgDepartmentSectionId": departmentSectionID}; postParams.addAll(AppState().postParamsJson); return await ApiClient().postJsonForObject((json) { @@ -128,12 +128,12 @@ class MowadhafhiApiClient { Future submitRequest(int? departmentID, String description, int? projectID, String? sectionID, String? sectionTopicID, int? ticketTypeID, List> attachmentList) async { String url = "${ApiConsts.cocRest}Mohemm_ITG_CreateTicketMobile"; Map postParams = { - "EmployeeNumber": AppState().memberInformationList?.eMPLOYEENUMBER, + "EmployeeNumber": AppState().memberInformationList?.employeENumber, "ItgImageCollList": attachmentList, "channelId": 3, "departmentId": departmentID, "description": description, - "employeeNumber": AppState().memberInformationList?.eMPLOYEENUMBER, + "employeeNumber": AppState().memberInformationList?.employeENumber, "projectId": projectID, "sectionId": sectionID, "sectionTopicId": sectionTopicID, diff --git a/lib/api/my_attendance_api_client.dart b/lib/api/my_attendance_api_client.dart index 37bf9e8..0227daa 100644 --- a/lib/api/my_attendance_api_client.dart +++ b/lib/api/my_attendance_api_client.dart @@ -167,7 +167,7 @@ class MyAttendanceApiClient { Future reSubmitEitTransaction(String itemKey, var notifID, List> list) async { String url = "${ApiConsts.erpRest}RESUBMIT_EIT_TRANSACTION"; - Map postParams = {"P_NOTIFICATION_ID": notifID, "P_ITEM_KEY": itemKey, "P_EMAIL_ADDRESS": AppState().memberInformationList!.eMPLOYEEEMAILADDRESS, "EITTransactionTBL": list}; + Map postParams = {"P_NOTIFICATION_ID": notifID, "P_ITEM_KEY": itemKey, "P_EMAIL_ADDRESS": AppState().memberInformationList!.employeEEmailAddress, "EITTransactionTBL": list}; postParams.addAll(AppState().postParamsJson); return await ApiClient().postJsonForObject((json) { GenericResponseModel responseData = GenericResponseModel.fromJson(json); diff --git a/lib/api/offers_and_discounts_api_client.dart b/lib/api/offers_and_discounts_api_client.dart index 8c92539..83a0393 100644 --- a/lib/api/offers_and_discounts_api_client.dart +++ b/lib/api/offers_and_discounts_api_client.dart @@ -17,7 +17,7 @@ class OffersAndDiscountsApiClient { List getSaleCategoriesList = []; String url = "${ApiConsts.cocRest}Mohemm_ITG_GetCategories"; - Map postParams = {"EmployeeNumber": AppState().memberInformationList?.eMPLOYEENUMBER, "ItgPageSize": 100, "ItgPageNo": 1, "ItgIsActive": true}; + Map postParams = {"EmployeeNumber": AppState().memberInformationList?.employeENumber, "ItgPageSize": 100, "ItgPageNo": 1, "ItgIsActive": true}; postParams.addAll(AppState().postParamsJson); return await ApiClient().postJsonForObject( @@ -48,12 +48,12 @@ class OffersAndDiscountsApiClient { List getSaleCategoriesList = []; String url = "${ApiConsts.cocRest}GetOfferDiscountsConfigData"; - Map postParams = {"EmployeeNumber": AppState().memberInformationList?.eMPLOYEENUMBER, "ItgPageSize": pageSize, "ItgPageNo": 1, "ItgCategoryID": categoryID}; + Map postParams = {"EmployeeNumber": AppState().memberInformationList?.employeENumber, "ItgPageSize": pageSize, "ItgPageNo": 1, "ItgCategoryID": categoryID}; postParams.addAll(AppState().postParamsJson); return await ApiClient().postJsonForObject( (response) { - var body = json.decode(response['Mohemm_ITG_ResponseItem']); + var body = json.decode(response['data']); var bodyData = body['result']['data']; diff --git a/lib/api/pending_transactions_api_client.dart b/lib/api/pending_transactions_api_client.dart index 44b2363..42cff6e 100644 --- a/lib/api/pending_transactions_api_client.dart +++ b/lib/api/pending_transactions_api_client.dart @@ -41,7 +41,7 @@ class PendingTransactionsApiClient { Future getAnnouncements(int itgAwarenessID, int itgPageNo, int itgRowID) async { String url = "${ApiConsts.cocRest}GetAnnouncementDiscountsConfigData"; - Map postParams = {"EmployeeNumber": AppState().memberInformationList?.eMPLOYEENUMBER.toString(), "ItgAwarenessID": itgAwarenessID, "ItgPageNo": itgPageNo, "ItgPageSize": 5, "ItgRowID": itgRowID}; + Map postParams = {"EmployeeNumber": AppState().memberInformationList?.employeENumber.toString(), "ItgAwarenessID": itgAwarenessID, "ItgPageNo": itgPageNo, "ItgPageSize": 5, "ItgRowID": itgRowID}; postParams.addAll(AppState().postParamsJson); return await ApiClient().postJsonForObject((json) { GenericResponseModel? responseData = GenericResponseModel.fromJson(json); @@ -51,7 +51,7 @@ class PendingTransactionsApiClient { Future getAnnouncementDetails(int itgAwarenessID, int itgPageNo, int itgRowID) async { String url = "${ApiConsts.cocRest}GetAnnouncementDiscountsConfigData"; - Map postParams = {"EmployeeNumber": AppState().memberInformationList?.eMPLOYEENUMBER.toString(), "ItgAwarenessID": itgAwarenessID, "ItgPageNo": itgPageNo, "ItgPageSize": 5, "ItgRowID": itgRowID}; + Map postParams = {"EmployeeNumber": AppState().memberInformationList?.employeENumber.toString(), "ItgAwarenessID": itgAwarenessID, "ItgPageNo": itgPageNo, "ItgPageSize": 5, "ItgRowID": itgRowID}; postParams.addAll(AppState().postParamsJson); return await ApiClient().postJsonForObject((json) { GenericResponseModel? responseData = GenericResponseModel.fromJson(json); diff --git a/lib/main.dart b/lib/main.dart index a1a0a67..83afec9 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -26,7 +26,7 @@ import 'package:sizer/sizer.dart'; Logger logger = Logger( // filter: null, // Use the default LogFilter (-> only log in debug mode) printer: PrettyPrinter( - lineLength: 0, + lineLength:200, ), // Use the PrettyPrinter to format and print log // output: null, // U ); @@ -98,6 +98,7 @@ class MyApp extends StatelessWidget { builder: (context, orientation, deviceType) { PostParamsModel? obj = AppState().postParamsObject; obj?.languageID = EasyLocalization.of(context)?.locale.languageCode == "ar" ? 1 : 2; + obj?.language = EasyLocalization.of(context)?.locale.languageCode == "ar" ? "ar" : "us"; AppState().setPostParamsModel(obj!); List> delegates = context.localizationDelegates; // delegates.add(GlobalMaterialLocalizations.delegate); diff --git a/lib/models/basic_member_information_model.dart b/lib/models/basic_member_information_model.dart index 04839ca..187dc1b 100644 --- a/lib/models/basic_member_information_model.dart +++ b/lib/models/basic_member_information_model.dart @@ -22,20 +22,20 @@ class BasicMemberInformationModel { String toRawJson() => json.encode(toJson()); factory BasicMemberInformationModel.fromJson(Map json) => BasicMemberInformationModel( - pReturnStatus: json["P_RETURN_STATUS"], - pReturnMsg: json["P_RETURN_MSG"], - pMobileNumber: json["P_MOBILE_NUMBER"], - pEmailAddress: json["P_EMAIL_ADDRESS"], - pLegislationCode: json["P_LEGISLATION_CODE"], - logInTokenId: json["LogInTokenID"], + pReturnStatus: json["p_RETURN_STATUS"], + pReturnMsg: json["p_RETURN_MSG"], + pMobileNumber: json["p_MOBILE_NUMBER"], + pEmailAddress: json["p_EMAIL_ADDRESS"], + pLegislationCode: json["p_LEGISLATION_CODE"], + logInTokenId: json["logInTokenID"], ); Map toJson() => { - "P_RETURN_STATUS": pReturnStatus, - "P_RETURN_MSG": pReturnMsg, - "P_MOBILE_NUMBER": pMobileNumber, - "P_EMAIL_ADDRESS": pEmailAddress, - "P_LEGISLATION_CODE": pLegislationCode, - "LogInTokenID": logInTokenId, + "p_RETURN_STATUS": pReturnStatus, + "p_RETURN_MSG": pReturnMsg, + "p_MOBILE_NUMBER": pMobileNumber, + "p_EMAIL_ADDRESS": pEmailAddress, + "p_LEGISLATION_CODE": pLegislationCode, + "logInTokenID": logInTokenId, }; } diff --git a/lib/models/check_activation_code_model.dart b/lib/models/check_activation_code_model.dart index cfef8a6..385ed0a 100644 --- a/lib/models/check_activation_code_model.dart +++ b/lib/models/check_activation_code_model.dart @@ -1,8 +1,6 @@ import 'dart:convert'; -import 'package:mohem_flutter_app/models/basic_member_information_model.dart'; import 'package:mohem_flutter_app/models/member_information_list_model.dart'; -import 'package:mohem_flutter_app/models/privilege_list_model.dart'; class CheckActivationCodeModel { String? authenticationTokenId; @@ -15,20 +13,19 @@ class CheckActivationCodeModel { String? companyImageDescription; String? companyBadge; String? companyMainCompany; - dynamic bcLogo; - dynamic bcDomain; - dynamic businessGroupName; + dynamic bCLogo; + dynamic bCDomain; + dynamic businesSGroupName; String? pReturnStatus; String? pReturnMsg; List? memberInformationList; - BasicMemberInformationModel? basicMemberInformation; + BasicMemberInformation? basicMemberInformation; dynamic mohemmItgResponseItem; int? pSessionId; String? tokenId; String? refreshToken; - String? errorMessage; DateTime? expiry; - List? privilegeList; + List? privilegeList; CheckActivationCodeModel({ this.authenticationTokenId, @@ -41,9 +38,9 @@ class CheckActivationCodeModel { this.companyImageDescription, this.companyBadge, this.companyMainCompany, - this.bcLogo, - this.bcDomain, - this.businessGroupName, + this.bCLogo, + this.bCDomain, + this.businesSGroupName, this.pReturnStatus, this.pReturnMsg, this.memberInformationList, @@ -52,7 +49,6 @@ class CheckActivationCodeModel { this.pSessionId, this.tokenId, this.refreshToken, - this.errorMessage, this.expiry, this.privilegeList, }); @@ -62,56 +58,450 @@ class CheckActivationCodeModel { String toRawJson() => json.encode(toJson()); factory CheckActivationCodeModel.fromJson(Map json) => CheckActivationCodeModel( - authenticationTokenId: json["AuthenticationTokenID"], - pPassowrdExpired: json["P_PASSOWRD_EXPIRED"], - pPasswordExpiredMsg: json["P_PASSWORD_EXPIRED_MSG"], - pInvalidLoginMsg: json["P_INVALID_LOGIN_MSG"], - mohemmWifiSsid: json["Mohemm_Wifi_SSID"], - mohemmWifiPassword: json["Mohemm_Wifi_Password"], - companyImageUrl: json["CompanyImageURL"], - companyImageDescription: json["CompanyImageDescription"], - companyBadge: json["CompanyBadge"], - companyMainCompany: json["CompanyMainCompany"], - bcLogo: json["BC_Logo"], - bcDomain: json["BC_Domain"], - businessGroupName: json["BUSINESS_GROUP_NAME"], - pReturnStatus: json["P_RETURN_STATUS"], - pReturnMsg: json["P_RETURN_MSG"], - memberInformationList: json["MemberInformationList"] == null ? [] : List.from(json["MemberInformationList"]!.map((x) => MemberInformationListModel.fromJson(x))), - basicMemberInformation: json["BasicMemberInformation"] == null ? null : BasicMemberInformationModel.fromJson(json["BasicMemberInformation"]), - mohemmItgResponseItem: json["Mohemm_ITG_ResponseItem"], - pSessionId: json["P_SESSION_ID"], - tokenId: json["TokenId"], - refreshToken: json["RefreshToken"], - errorMessage: json["ErrorMessage"], - expiry: json["Expiry"] == null ? null : DateTime.parse(json["Expiry"]), - privilegeList: json["Privilege_List"] == null ? [] : List.from(json["Privilege_List"]!.map((x) => PrivilegeListModel.fromJson(x))), + authenticationTokenId: json["authenticationTokenID"], + pPassowrdExpired: json["p_PASSOWRD_EXPIRED"], + pPasswordExpiredMsg: json["p_PASSWORD_EXPIRED_MSG"], + pInvalidLoginMsg: json["p_INVALID_LOGIN_MSG"], + mohemmWifiSsid: json["mohemm_Wifi_SSID"], + mohemmWifiPassword: json["mohemm_Wifi_Password"], + companyImageUrl: json["companyImageURL"], + companyImageDescription: json["companyImageDescription"], + companyBadge: json["companyBadge"], + companyMainCompany: json["companyMainCompany"], + bCLogo: json["bC_Logo"], + bCDomain: json["bC_Domain"], + businesSGroupName: json["businesS_GROUP_NAME"], + pReturnStatus: json["p_RETURN_STATUS"], + pReturnMsg: json["p_RETURN_MSG"], + memberInformationList: json["memberInformationList"] == null ? [] : List.from(json["memberInformationList"]!.map((x) => MemberInformationListModel.fromJson(x))), + basicMemberInformation: json["basicMemberInformation"] == null ? null : BasicMemberInformation.fromJson(json["basicMemberInformation"]), + mohemmItgResponseItem: json["mohemm_ITG_ResponseItem"], + pSessionId: json["p_SESSION_ID"], + tokenId: json["tokenId"], + refreshToken: json["refreshToken"], + expiry: json["expiry"] == null ? null : DateTime.parse(json["expiry"]), + privilegeList: json["privilege_List"] == null ? [] : List.from(json["privilege_List"]!.map((x) => PrivilegeList.fromJson(x))), ); Map toJson() => { - "AuthenticationTokenID": authenticationTokenId, - "P_PASSOWRD_EXPIRED": pPassowrdExpired, - "P_PASSWORD_EXPIRED_MSG": pPasswordExpiredMsg, - "P_INVALID_LOGIN_MSG": pInvalidLoginMsg, - "Mohemm_Wifi_SSID": mohemmWifiSsid, - "Mohemm_Wifi_Password": mohemmWifiPassword, - "CompanyImageURL": companyImageUrl, - "CompanyImageDescription": companyImageDescription, - "CompanyBadge": companyBadge, - "CompanyMainCompany": companyMainCompany, - "BC_Logo": bcLogo, - "BC_Domain": bcDomain, - "BUSINESS_GROUP_NAME": businessGroupName, - "P_RETURN_STATUS": pReturnStatus, - "P_RETURN_MSG": pReturnMsg, - "MemberInformationList": memberInformationList == null ? [] : List.from(memberInformationList!.map((x) => x.toJson())), - "BasicMemberInformation": basicMemberInformation?.toJson(), - "Mohemm_ITG_ResponseItem": mohemmItgResponseItem, - "P_SESSION_ID": pSessionId, - "TokenId": tokenId, - "RefreshToken": refreshToken, - "ErrorMessage": errorMessage, - "Expiry": expiry?.toIso8601String(), - "Privilege_List": privilegeList == null ? [] : List.from(privilegeList!.map((x) => x.toJson())), + "authenticationTokenID": authenticationTokenId, + "p_PASSOWRD_EXPIRED": pPassowrdExpired, + "p_PASSWORD_EXPIRED_MSG": pPasswordExpiredMsg, + "p_INVALID_LOGIN_MSG": pInvalidLoginMsg, + "mohemm_Wifi_SSID": mohemmWifiSsid, + "mohemm_Wifi_Password": mohemmWifiPassword, + "companyImageURL": companyImageUrl, + "companyImageDescription": companyImageDescription, + "companyBadge": companyBadge, + "companyMainCompany": companyMainCompany, + "bC_Logo": bCLogo, + "bC_Domain": bCDomain, + "businesS_GROUP_NAME": businesSGroupName, + "p_RETURN_STATUS": pReturnStatus, + "p_RETURN_MSG": pReturnMsg, + "memberInformationList": memberInformationList == null ? [] : List.from(memberInformationList!.map((x) => x.toJson())), + "basicMemberInformation": basicMemberInformation?.toJson(), + "mohemm_ITG_ResponseItem": mohemmItgResponseItem, + "p_SESSION_ID": pSessionId, + "tokenId": tokenId, + "refreshToken": refreshToken, + "expiry": expiry?.toIso8601String(), + "privilege_List": privilegeList == null ? [] : List.from(privilegeList!.map((x) => x.toJson())), + }; +} + +class BasicMemberInformation { + String? pReturnStatus; + dynamic pReturnMsg; + String? pMobileNumber; + String? pEmailAddress; + String? pLegislationCode; + + BasicMemberInformation({ + this.pReturnStatus, + this.pReturnMsg, + this.pMobileNumber, + this.pEmailAddress, + this.pLegislationCode, + }); + + factory BasicMemberInformation.fromRawJson(String str) => BasicMemberInformation.fromJson(json.decode(str)); + + String toRawJson() => json.encode(toJson()); + + factory BasicMemberInformation.fromJson(Map json) => BasicMemberInformation( + pReturnStatus: json["p_RETURN_STATUS"], + pReturnMsg: json["p_RETURN_MSG"], + pMobileNumber: json["p_MOBILE_NUMBER"], + pEmailAddress: json["p_EMAIL_ADDRESS"], + pLegislationCode: json["p_LEGISLATION_CODE"], + ); + + Map toJson() => { + "p_RETURN_STATUS": pReturnStatus, + "p_RETURN_MSG": pReturnMsg, + "p_MOBILE_NUMBER": pMobileNumber, + "p_EMAIL_ADDRESS": pEmailAddress, + "p_LEGISLATION_CODE": pLegislationCode, + }; +} +// +// class MemberInformationListModel { +// int? businesSGroupId; +// int? persoNId; +// int? persoNTypeId; +// int? assignmenTId; +// String? assignmenTStartDate; +// String? assignmenTEndDate; +// String? primarYFlag; +// String? currenTEmployeeFlag; +// int? assignmenTStatusTypeId; +// dynamic normaLHours; +// dynamic frequency; +// dynamic frequencYMeaning; +// String? employeENumber; +// String? nationaLIdentifier; +// String? systeMPersonType; +// String? persoNType; +// String? manuaLTimecardFlag; +// String? manuaLTimecardMeaning; +// String? swipeSExemptedFlag; +// String? swipeSExemptedMeaning; +// String? assignmenTNumber; +// dynamic uniTNumber; +// String? useRStatus; +// String? employmenTCategory; +// String? assignmenTType; +// String? employmenTCategoryMeaning; +// String? peRInformationCategory; +// String? nationalitYCode; +// String? nationalitYMeaning; +// String? hirEDate; +// String? roWNum; +// int? servicEYears; +// int? servicEDays; +// dynamic actuaLTerminationDate; +// String? employeEEmailAddress; +// int? joBId; +// int? positioNId; +// int? organizatioNId; +// int? locatioNId; +// int? payrolLId; +// dynamic gradEId; +// String? positioNName; +// String? organizatioNName; +// String? locatioNName; +// String? payrolLName; +// String? payrolLCode; +// dynamic gradEName; +// String? employeEMobileNumber; +// String? employeEWorkNumber; +// String? employeeQr; +// bool? businessCardPrivilege; +// String? businessCardQr; +// int? supervisoRId; +// dynamic supervisoRAssignmentId; +// String? supervisoRNumber; +// String? supervisoRName; +// String? supervisoRDisplayName; +// String? supervisoREmailAddress; +// String? supervisoRMobileNumber; +// String? supervisoRWorkNumber; +// String? employeEImage; +// int? tKPersonId; +// String? tKEmployeeNumber; +// String? tKEmployeeName; +// String? tKEmployeeDisplayName; +// String? tKEmailAddress; +// int? nOOfRows; +// int? froMRowNum; +// int? tORowNum; +// int? ledgeRId; +// int? servicEMonths; +// String? employeeNameEn; +// dynamic employeENameAr; +// String? jobNameEn; +// dynamic joBNameAr; +// String? employeeDisplayNameEn; +// dynamic employeEDisplayNameAr; +// String? mobileNumberWithZipCode; +// +// MemberInformationListModel({ +// this.businesSGroupId, +// this.persoNId, +// this.persoNTypeId, +// this.assignmenTId, +// this.assignmenTStartDate, +// this.assignmenTEndDate, +// this.primarYFlag, +// this.currenTEmployeeFlag, +// this.assignmenTStatusTypeId, +// this.normaLHours, +// this.frequency, +// this.frequencYMeaning, +// this.employeENumber, +// this.nationaLIdentifier, +// this.systeMPersonType, +// this.persoNType, +// this.manuaLTimecardFlag, +// this.manuaLTimecardMeaning, +// this.swipeSExemptedFlag, +// this.swipeSExemptedMeaning, +// this.assignmenTNumber, +// this.uniTNumber, +// this.useRStatus, +// this.employmenTCategory, +// this.assignmenTType, +// this.employmenTCategoryMeaning, +// this.peRInformationCategory, +// this.nationalitYCode, +// this.nationalitYMeaning, +// this.hirEDate, +// this.roWNum, +// this.servicEYears, +// this.servicEDays, +// this.actuaLTerminationDate, +// this.employeEEmailAddress, +// this.joBId, +// this.positioNId, +// this.organizatioNId, +// this.locatioNId, +// this.payrolLId, +// this.gradEId, +// this.positioNName, +// this.organizatioNName, +// this.locatioNName, +// this.payrolLName, +// this.payrolLCode, +// this.gradEName, +// this.employeEMobileNumber, +// this.employeEWorkNumber, +// this.employeeQr, +// this.businessCardPrivilege, +// this.businessCardQr, +// this.supervisoRId, +// this.supervisoRAssignmentId, +// this.supervisoRNumber, +// this.supervisoRName, +// this.supervisoRDisplayName, +// this.supervisoREmailAddress, +// this.supervisoRMobileNumber, +// this.supervisoRWorkNumber, +// this.employeEImage, +// this.tKPersonId, +// this.tKEmployeeNumber, +// this.tKEmployeeName, +// this.tKEmployeeDisplayName, +// this.tKEmailAddress, +// this.nOOfRows, +// this.froMRowNum, +// this.tORowNum, +// this.ledgeRId, +// this.servicEMonths, +// this.employeeNameEn, +// this.employeENameAr, +// this.jobNameEn, +// this.joBNameAr, +// this.employeeDisplayNameEn, +// this.employeEDisplayNameAr, +// this.mobileNumberWithZipCode, +// }); +// +// factory MemberInformationListModel.fromRawJson(String str) => MemberInformationListModel.fromJson(json.decode(str)); +// +// String toRawJson() => json.encode(toJson()); +// +// factory MemberInformationListModel.fromJson(Map json) => MemberInformationListModel( +// businesSGroupId: json["businesS_GROUP_ID"], +// persoNId: json["persoN_ID"], +// persoNTypeId: json["persoN_TYPE_ID"], +// assignmenTId: json["assignmenT_ID"], +// assignmenTStartDate: json["assignmenT_START_DATE"], +// assignmenTEndDate: json["assignmenT_END_DATE"], +// primarYFlag: json["primarY_FLAG"], +// currenTEmployeeFlag: json["currenT_EMPLOYEE_FLAG"], +// assignmenTStatusTypeId: json["assignmenT_STATUS_TYPE_ID"], +// normaLHours: json["normaL_HOURS"], +// frequency: json["frequency"], +// frequencYMeaning: json["frequencY_MEANING"], +// employeENumber: json["employeE_NUMBER"], +// nationaLIdentifier: json["nationaL_IDENTIFIER"], +// systeMPersonType: json["systeM_PERSON_TYPE"], +// persoNType: json["persoN_TYPE"], +// manuaLTimecardFlag: json["manuaL_TIMECARD_FLAG"], +// manuaLTimecardMeaning: json["manuaL_TIMECARD_MEANING"], +// swipeSExemptedFlag: json["swipeS_EXEMPTED_FLAG"], +// swipeSExemptedMeaning: json["swipeS_EXEMPTED_MEANING"], +// assignmenTNumber: json["assignmenT_NUMBER"], +// uniTNumber: json["uniT_NUMBER"], +// useRStatus: json["useR_STATUS"], +// employmenTCategory: json["employmenT_CATEGORY"], +// assignmenTType: json["assignmenT_TYPE"], +// employmenTCategoryMeaning: json["employmenT_CATEGORY_MEANING"], +// peRInformationCategory: json["peR_INFORMATION_CATEGORY"], +// nationalitYCode: json["nationalitY_CODE"], +// nationalitYMeaning: json["nationalitY_MEANING"], +// hirEDate: json["hirE_DATE"], +// roWNum: json["roW_NUM"], +// servicEYears: json["servicE_YEARS"], +// servicEDays: json["servicE_DAYS"], +// actuaLTerminationDate: json["actuaL_TERMINATION_DATE"], +// employeEEmailAddress: json["employeE_EMAIL_ADDRESS"], +// joBId: json["joB_ID"], +// positioNId: json["positioN_ID"], +// organizatioNId: json["organizatioN_ID"], +// locatioNId: json["locatioN_ID"], +// payrolLId: json["payrolL_ID"], +// gradEId: json["gradE_ID"], +// positioNName: json["positioN_NAME"], +// organizatioNName: json["organizatioN_NAME"], +// locatioNName: json["locatioN_NAME"], +// payrolLName: json["payrolL_NAME"], +// payrolLCode: json["payrolL_CODE"], +// gradEName: json["gradE_NAME"], +// employeEMobileNumber: json["employeE_MOBILE_NUMBER"], +// employeEWorkNumber: json["employeE_WORK_NUMBER"], +// employeeQr: json["employeeQR"], +// businessCardPrivilege: json["businessCardPrivilege"], +// businessCardQr: json["businessCardQR"], +// supervisoRId: json["supervisoR_ID"], +// supervisoRAssignmentId: json["supervisoR_ASSIGNMENT_ID"], +// supervisoRNumber: json["supervisoR_NUMBER"], +// supervisoRName: json["supervisoR_NAME"], +// supervisoRDisplayName: json["supervisoR_DISPLAY_NAME"], +// supervisoREmailAddress: json["supervisoR_EMAIL_ADDRESS"], +// supervisoRMobileNumber: json["supervisoR_MOBILE_NUMBER"], +// supervisoRWorkNumber: json["supervisoR_WORK_NUMBER"], +// employeEImage: json["employeE_IMAGE"], +// tKPersonId: json["tK_PERSON_ID"], +// tKEmployeeNumber: json["tK_EMPLOYEE_NUMBER"], +// tKEmployeeName: json["tK_EMPLOYEE_NAME"], +// tKEmployeeDisplayName: json["tK_EMPLOYEE_DISPLAY_NAME"], +// tKEmailAddress: json["tK_EMAIL_ADDRESS"], +// nOOfRows: json["nO_OF_ROWS"], +// froMRowNum: json["froM_ROW_NUM"], +// tORowNum: json["tO_ROW_NUM"], +// ledgeRId: json["ledgeR_ID"], +// servicEMonths: json["servicE_MONTHS"], +// employeeNameEn: json["EMPLOYEE_NAME_EN"], +// employeENameAr: json["employeE_NAME_AR"], +// jobNameEn: json["JOB_NAME_EN"], +// joBNameAr: json["joB_NAME_AR"], +// employeeDisplayNameEn: json["EMPLOYEE_DISPLAY_NAME_EN"], +// employeEDisplayNameAr: json["employeE_DISPLAY_NAME_AR"], +// mobileNumberWithZipCode: json["mobileNumberWithZipCode"], +// ); +// +// Map toJson() => { +// "businesS_GROUP_ID": businesSGroupId, +// "persoN_ID": persoNId, +// "persoN_TYPE_ID": persoNTypeId, +// "assignmenT_ID": assignmenTId, +// "assignmenT_START_DATE": assignmenTStartDate, +// "assignmenT_END_DATE": assignmenTEndDate, +// "primarY_FLAG": primarYFlag, +// "currenT_EMPLOYEE_FLAG": currenTEmployeeFlag, +// "assignmenT_STATUS_TYPE_ID": assignmenTStatusTypeId, +// "normaL_HOURS": normaLHours, +// "frequency": frequency, +// "frequencY_MEANING": frequencYMeaning, +// "employeE_NUMBER": employeENumber, +// "nationaL_IDENTIFIER": nationaLIdentifier, +// "systeM_PERSON_TYPE": systeMPersonType, +// "persoN_TYPE": persoNType, +// "manuaL_TIMECARD_FLAG": manuaLTimecardFlag, +// "manuaL_TIMECARD_MEANING": manuaLTimecardMeaning, +// "swipeS_EXEMPTED_FLAG": swipeSExemptedFlag, +// "swipeS_EXEMPTED_MEANING": swipeSExemptedMeaning, +// "assignmenT_NUMBER": assignmenTNumber, +// "uniT_NUMBER": uniTNumber, +// "useR_STATUS": useRStatus, +// "employmenT_CATEGORY": employmenTCategory, +// "assignmenT_TYPE": assignmenTType, +// "employmenT_CATEGORY_MEANING": employmenTCategoryMeaning, +// "peR_INFORMATION_CATEGORY": peRInformationCategory, +// "nationalitY_CODE": nationalitYCode, +// "nationalitY_MEANING": nationalitYMeaning, +// "hirE_DATE": hirEDate, +// "roW_NUM": roWNum, +// "servicE_YEARS": servicEYears, +// "servicE_DAYS": servicEDays, +// "actuaL_TERMINATION_DATE": actuaLTerminationDate, +// "employeE_EMAIL_ADDRESS": employeEEmailAddress, +// "joB_ID": joBId, +// "positioN_ID": positioNId, +// "organizatioN_ID": organizatioNId, +// "locatioN_ID": locatioNId, +// "payrolL_ID": payrolLId, +// "gradE_ID": gradEId, +// "positioN_NAME": positioNName, +// "organizatioN_NAME": organizatioNName, +// "locatioN_NAME": locatioNName, +// "payrolL_NAME": payrolLName, +// "payrolL_CODE": payrolLCode, +// "gradE_NAME": gradEName, +// "employeE_MOBILE_NUMBER": employeEMobileNumber, +// "employeE_WORK_NUMBER": employeEWorkNumber, +// "employeeQR": employeeQr, +// "businessCardPrivilege": businessCardPrivilege, +// "businessCardQR": businessCardQr, +// "supervisoR_ID": supervisoRId, +// "supervisoR_ASSIGNMENT_ID": supervisoRAssignmentId, +// "supervisoR_NUMBER": supervisoRNumber, +// "supervisoR_NAME": supervisoRName, +// "supervisoR_DISPLAY_NAME": supervisoRDisplayName, +// "supervisoR_EMAIL_ADDRESS": supervisoREmailAddress, +// "supervisoR_MOBILE_NUMBER": supervisoRMobileNumber, +// "supervisoR_WORK_NUMBER": supervisoRWorkNumber, +// "employeE_IMAGE": employeEImage, +// "tK_PERSON_ID": tKPersonId, +// "tK_EMPLOYEE_NUMBER": tKEmployeeNumber, +// "tK_EMPLOYEE_NAME": tKEmployeeName, +// "tK_EMPLOYEE_DISPLAY_NAME": tKEmployeeDisplayName, +// "tK_EMAIL_ADDRESS": tKEmailAddress, +// "nO_OF_ROWS": nOOfRows, +// "froM_ROW_NUM": froMRowNum, +// "tO_ROW_NUM": tORowNum, +// "ledgeR_ID": ledgeRId, +// "servicE_MONTHS": servicEMonths, +// "EMPLOYEE_NAME_EN": employeeNameEn, +// "employeE_NAME_AR": employeENameAr, +// "JOB_NAME_EN": jobNameEn, +// "joB_NAME_AR": joBNameAr, +// "EMPLOYEE_DISPLAY_NAME_EN": employeeDisplayNameEn, +// "employeE_DISPLAY_NAME_AR": employeEDisplayNameAr, +// "mobileNumberWithZipCode": mobileNumberWithZipCode, +// }; +// } + +class PrivilegeList { + int? id; + String? serviceName; + bool? previlege; + bool? previlegeHmg; + + PrivilegeList({ + this.id, + this.serviceName, + this.previlege, + this.previlegeHmg, + }); + + factory PrivilegeList.fromRawJson(String str) => PrivilegeList.fromJson(json.decode(str)); + + String toRawJson() => json.encode(toJson()); + + factory PrivilegeList.fromJson(Map json) => PrivilegeList( + id: json["id"], + serviceName: json["serviceName"], + previlege: json["previlege"], + previlegeHmg: json["previlege_HMG"], + ); + + Map toJson() => { + "id": id, + "serviceName": serviceName, + "previlege": previlege, + "previlege_HMG": previlegeHmg, }; } diff --git a/lib/models/dashboard/get_attendance_tracking_list_model.dart b/lib/models/dashboard/get_attendance_tracking_list_model.dart index fb415b0..e2e0b1d 100644 --- a/lib/models/dashboard/get_attendance_tracking_list_model.dart +++ b/lib/models/dashboard/get_attendance_tracking_list_model.dart @@ -1,55 +1,61 @@ +import 'dart:convert'; + class GetAttendanceTracking { + String? pSwipesExemptedFlag; + String? pShtName; + String? pScheduledHours; + String? pBreakHours; + String? pSpentHours; + String? pRemainingHours; + String? pLateInHours; + String? pSwipeIn; + String? pSwipeOut; + String? pReturnStatus; + String? pReturnMsg; + GetAttendanceTracking({ - this.pBreakHours, - this.pLateInHours, - this.pRemainingHours, - this.pReturnMsg, - this.pReturnStatus, - this.pScheduledHours, + this.pSwipesExemptedFlag, this.pShtName, + this.pScheduledHours, + this.pBreakHours, this.pSpentHours, - this.pSwipesExemptedFlag, + this.pRemainingHours, + this.pLateInHours, this.pSwipeIn, this.pSwipeOut, + this.pReturnStatus, + this.pReturnMsg, }); - String? pBreakHours; - String? pLateInHours; - String? pRemainingHours; - String? pReturnMsg; - String? pReturnStatus; - String? pScheduledHours; - String? pShtName; - String? pSpentHours; - String? pSwipesExemptedFlag; - dynamic pSwipeIn; - dynamic pSwipeOut; + factory GetAttendanceTracking.fromRawJson(String str) => GetAttendanceTracking.fromJson(json.decode(str)); + + String toRawJson() => json.encode(toJson()); - factory GetAttendanceTracking.fromMap(Map json) => GetAttendanceTracking( - pBreakHours: json["P_BREAK_HOURS"] == null ? null : json["P_BREAK_HOURS"], - pLateInHours: json["P_LATE_IN_HOURS"] == null ? null : json["P_LATE_IN_HOURS"], - pRemainingHours: json["P_REMAINING_HOURS"] == null ? null : json["P_REMAINING_HOURS"], - pReturnMsg: json["P_RETURN_MSG"] == null ? null : json["P_RETURN_MSG"], - pReturnStatus: json["P_RETURN_STATUS"] == null ? null : json["P_RETURN_STATUS"], - pScheduledHours: json["P_SCHEDULED_HOURS"] == null ? null : json["P_SCHEDULED_HOURS"], - pShtName: json["P_SHT_NAME"] == null ? null : json["P_SHT_NAME"], - pSpentHours: json["P_SPENT_HOURS"] == null ? null : json["P_SPENT_HOURS"], - pSwipesExemptedFlag: json["P_SWIPES_EXEMPTED_FLAG"] == null ? null : json["P_SWIPES_EXEMPTED_FLAG"], - pSwipeIn: json["P_SWIPE_IN"], - pSwipeOut: json["P_SWIPE_OUT"], - ); + factory GetAttendanceTracking.fromJson(Map json) => GetAttendanceTracking( + pSwipesExemptedFlag: json["p_SWIPES_EXEMPTED_FLAG"], + pShtName: json["p_SHT_NAME"], + pScheduledHours: json["p_SCHEDULED_HOURS"], + pBreakHours: json["p_BREAK_HOURS"], + pSpentHours: json["p_SPENT_HOURS"], + pRemainingHours: json["p_REMAINING_HOURS"], + pLateInHours: json["p_LATE_IN_HOURS"], + pSwipeIn: json["p_SWIPE_IN"], + pSwipeOut: json["p_SWIPE_OUT"], + pReturnStatus: json["p_RETURN_STATUS"], + pReturnMsg: json["p_RETURN_MSG"], + ); - Map toMap() => { - "P_BREAK_HOURS": pBreakHours == null ? null : pBreakHours, - "P_LATE_IN_HOURS": pLateInHours == null ? null : pLateInHours, - "P_REMAINING_HOURS": pRemainingHours == null ? null : pRemainingHours, - "P_RETURN_MSG": pReturnMsg == null ? null : pReturnMsg, - "P_RETURN_STATUS": pReturnStatus == null ? null : pReturnStatus, - "P_SCHEDULED_HOURS": pScheduledHours == null ? null : pScheduledHours, - "P_SHT_NAME": pShtName == null ? null : pShtName, - "P_SPENT_HOURS": pSpentHours == null ? null : pSpentHours, - "P_SWIPES_EXEMPTED_FLAG": pSwipesExemptedFlag == null ? null : pSwipesExemptedFlag, - "P_SWIPE_IN": pSwipeIn, - "P_SWIPE_OUT": pSwipeOut, - }; + Map toJson() => { + "p_SWIPES_EXEMPTED_FLAG": pSwipesExemptedFlag, + "p_SHT_NAME": pShtName, + "p_SCHEDULED_HOURS": pScheduledHours, + "p_BREAK_HOURS": pBreakHours, + "p_SPENT_HOURS": pSpentHours, + "p_REMAINING_HOURS": pRemainingHours, + "p_LATE_IN_HOURS": pLateInHours, + "p_SWIPE_IN": pSwipeIn, + "p_SWIPE_OUT": pSwipeOut, + "p_RETURN_STATUS": pReturnStatus, + "p_RETURN_MSG": pReturnMsg, + }; } diff --git a/lib/models/dashboard/get_open_missing_swipe.dart b/lib/models/dashboard/get_open_missing_swipe.dart new file mode 100644 index 0000000..ac76376 --- /dev/null +++ b/lib/models/dashboard/get_open_missing_swipe.dart @@ -0,0 +1,29 @@ +import 'dart:convert'; + +class GetOpenMissingSwipes { + int? pOpenMissingSwipes; + String? pReturnStatus; + String? pReturnMsg; + + GetOpenMissingSwipes({ + this.pOpenMissingSwipes, + this.pReturnStatus, + this.pReturnMsg, + }); + + factory GetOpenMissingSwipes.fromRawJson(String str) => GetOpenMissingSwipes.fromJson(json.decode(str)); + + String toRawJson() => json.encode(toJson()); + + factory GetOpenMissingSwipes.fromJson(Map json) => GetOpenMissingSwipes( + pOpenMissingSwipes: json["p_OPEN_MISSING_SWIPES"], + pReturnStatus: json["p_RETURN_STATUS"], + pReturnMsg: json["p_RETURN_MSG"], + ); + + Map toJson() => { + "p_OPEN_MISSING_SWIPES": pOpenMissingSwipes, + "p_RETURN_STATUS": pReturnStatus, + "p_RETURN_MSG": pReturnMsg, + }; +} diff --git a/lib/models/dashboard/get_open_notifications_list.dart b/lib/models/dashboard/get_open_notifications_list.dart index 854b62a..6760cf4 100644 --- a/lib/models/dashboard/get_open_notifications_list.dart +++ b/lib/models/dashboard/get_open_notifications_list.dart @@ -10,14 +10,14 @@ class GetOpenNotificationsList { int? openNtfNumber; factory GetOpenNotificationsList.fromMap(Map json) => GetOpenNotificationsList( - itemType: json["ITEM_TYPE"] == null ? null : json["ITEM_TYPE"], - itemTypeDisplayName: json["ITEM_TYPE_DISPLAY_NAME"] == null ? null : json["ITEM_TYPE_DISPLAY_NAME"], - openNtfNumber: json["OPEN_NTF_NUMBER"] == null ? null : json["OPEN_NTF_NUMBER"], + itemType: json["iteM_TYPE"] == null ? null : json["iteM_TYPE"], + itemTypeDisplayName: json["iteM_TYPE_DISPLAY_NAME"] == null ? null : json["iteM_TYPE_DISPLAY_NAME"], + openNtfNumber: json["opeN_NTF_NUMBER"] == null ? null : json["opeN_NTF_NUMBER"], ); Map toMap() => { - "ITEM_TYPE": itemType == null ? null : itemType, - "ITEM_TYPE_DISPLAY_NAME": itemTypeDisplayName == null ? null : itemTypeDisplayName, - "OPEN_NTF_NUMBER": openNtfNumber == null ? null : openNtfNumber, + "iteM_TYPE": itemType == null ? null : itemType, + "iteM_TYPE_DISPLAY_NAME": itemTypeDisplayName == null ? null : itemTypeDisplayName, + "opeN_NTF_NUMBER": openNtfNumber == null ? null : openNtfNumber, }; } diff --git a/lib/models/dashboard/list_menu.dart b/lib/models/dashboard/list_menu.dart index a55cd79..fe45b09 100644 --- a/lib/models/dashboard/list_menu.dart +++ b/lib/models/dashboard/list_menu.dart @@ -1,39 +1,45 @@ +import 'dart:convert'; + class ListMenu { + int? menUId; + String? menUName; + String? menUType; + dynamic suBMenuName; + dynamic resPId; + int? requesTGroupId; + String? requesTGroupName; + ListMenu({ - this.menuId, - this.menuName, - this.menuType, - this.requestGroupId, - this.requestGroupName, - this.respId, - this.subMenuName, + this.menUId, + this.menUName, + this.menUType, + this.suBMenuName, + this.resPId, + this.requesTGroupId, + this.requesTGroupName, }); - int? menuId; - String? menuName; - String? menuType; - int? requestGroupId; - String? requestGroupName; - dynamic? respId; - String? subMenuName; + factory ListMenu.fromRawJson(String str) => ListMenu.fromJson(json.decode(str)); + + String toRawJson() => json.encode(toJson()); factory ListMenu.fromJson(Map json) => ListMenu( - menuId: json["MENU_ID"] == null ? null : json["MENU_ID"], - menuName: json["MENU_NAME"] == null ? null : json["MENU_NAME"], - menuType: json["MENU_TYPE"] == null ? null : json["MENU_TYPE"], - requestGroupId: json["REQUEST_GROUP_ID"] == null ? null : json["REQUEST_GROUP_ID"], - requestGroupName: json["REQUEST_GROUP_NAME"] == null ? null : json["REQUEST_GROUP_NAME"], - respId: json["RESP_ID"], - subMenuName: json["SUB_MENU_NAME"] == null ? null : json["SUB_MENU_NAME"], - ); + menUId: json["menU_ID"], + menUName: json["menU_NAME"], + menUType: json["menU_TYPE"], + suBMenuName: json["suB_MENU_NAME"], + resPId: json["resP_ID"], + requesTGroupId: json["requesT_GROUP_ID"], + requesTGroupName: json["requesT_GROUP_NAME"], + ); Map toJson() => { - "MENU_ID": menuId == null ? null : menuId, - "MENU_NAME": menuName == null ? null : menuName, - "MENU_TYPE": menuType == null ? null : menuType, - "REQUEST_GROUP_ID": requestGroupId == null ? null : requestGroupId, - "REQUEST_GROUP_NAME": requestGroupName == null ? null : requestGroupName, - "RESP_ID": respId, - "SUB_MENU_NAME": subMenuName == null ? null : subMenuName, - }; + "menU_ID": menUId, + "menU_NAME": menUName, + "menU_TYPE": menUType, + "suB_MENU_NAME": suBMenuName, + "resP_ID": resPId, + "requesT_GROUP_ID": requesTGroupId, + "requesT_GROUP_NAME": requesTGroupName, + }; } diff --git a/lib/models/dashboard/menu_entries.dart b/lib/models/dashboard/menu_entries.dart index 7678ad8..6250cb6 100644 --- a/lib/models/dashboard/menu_entries.dart +++ b/lib/models/dashboard/menu_entries.dart @@ -1,3 +1,5 @@ +import 'dart:convert'; + class GetMenuEntriesList { GetMenuEntriesList({ this.addButton, @@ -12,6 +14,7 @@ class GetMenuEntriesList { this.prompt, this.requestType, this.updateButton, + this.attachmenTRequired }); String? addButton; @@ -26,35 +29,41 @@ class GetMenuEntriesList { String? prompt; String? requestType; String? updateButton; + dynamic attachmenTRequired; + factory GetMenuEntriesList.fromRawJson(String str) => GetMenuEntriesList.fromJson(json.decode(str)); + + String toRawJson() => json.encode(toJson()); factory GetMenuEntriesList.fromJson(Map json) => GetMenuEntriesList( - addButton: json["ADD_BUTTON"] == null ? null : json["ADD_BUTTON"], - deleteButton: json["DELETE_BUTTON"] == null ? null : json["DELETE_BUTTON"], - entrySequence: json["ENTRY_SEQUENCE"] == null ? null : json["ENTRY_SEQUENCE"], - functionName: json["FUNCTION_NAME"] == null ? null : json["FUNCTION_NAME"], - icon: json["ICON"] == null ? null : json["ICON"], - lvl: json["LVL"] == null ? null : json["LVL"], - menuEntryType: json["MENU_ENTRY_TYPE"] == null ? null : json["MENU_ENTRY_TYPE"], - menuName: json["MENU_NAME"] == null ? null : json["MENU_NAME"], - parentMenuName: json["PARENT_MENU_NAME"] == null ? null : json["PARENT_MENU_NAME"], - prompt: json["PROMPT"] == null ? null : json["PROMPT"], - requestType: json["REQUEST_TYPE"] == null ? null : json["REQUEST_TYPE"], - updateButton: json["UPDATE_BUTTON"] == null ? null :json["UPDATE_BUTTON"], + addButton: json["adDButton"] == null ? null : json["adDButton"], + deleteButton: json["deletEButton"] == null ? null : json["deletEButton"], + entrySequence: json["entrYSequence"] == null ? null : json["entrYSequence"], + functionName: json["functioNName"] == null ? null : json["functioNName"], + icon: json["icon"] == null ? null : json["icon"], + lvl: json["lvl"] == null ? null : json["lvl"], + menuEntryType: json["menU_ENTRY_TYPE"] == null ? null : json["menU_ENTRY_TYPE"], + menuName: json["menUName"] == null ? null : json["menUName"], + parentMenuName: json["parenTMenuName"] == null ? null : json["parenTMenuName"], + prompt: json["prompt"] == null ? null : json["prompt"], + requestType: json["requesTType"] == null ? null : json["requesTType"], + updateButton: json["updatEButton"] == null ? null :json["updatEButton"], + attachmenTRequired: json["attachmenT_REQUIRED"], ); Map toJson() => { - "ADD_BUTTON": addButton == null ? null :addButton, - "DELETE_BUTTON": deleteButton == null ? null : deleteButton, - "ENTRY_SEQUENCE": entrySequence == null ? null : entrySequence, - "FUNCTION_NAME": functionName == null ? null : functionName, - "ICON": icon == null ? null : icon, - "LVL": lvl == null ? null : lvl, - "MENU_ENTRY_TYPE": menuEntryType == null ? null : menuEntryType, - "MENU_NAME": menuName == null ? null : menuName, - "PARENT_MENU_NAME": parentMenuName == null ? null : parentMenuName, - "PROMPT": prompt == null ? null : prompt, - "REQUEST_TYPE": requestType == null ? null : requestType, - "UPDATE_BUTTON": updateButton == null ? null : updateButton, + "adDButton": addButton == null ? null :addButton, + "deletEButton": deleteButton == null ? null : deleteButton, + "entrYSequence": entrySequence == null ? null : entrySequence, + "functioNName": functionName == null ? null : functionName, + "icon": icon == null ? null : icon, + "lvl": lvl == null ? null : lvl, + "menU_ENTRY_TYPE": menuEntryType == null ? null : menuEntryType, + "menUName": menuName == null ? null : menuName, + "parenTMenuName": parentMenuName == null ? null : parentMenuName, + "prompt": prompt == null ? null : prompt, + "requesTType": requestType == null ? null : requestType, + "updatEButton": updateButton == null ? null : updateButton, + "attachmenT_REQUIRED": attachmenTRequired, }; } diff --git a/lib/models/generic_response_model.dart b/lib/models/generic_response_model.dart index 857ef3d..2dfac07 100644 --- a/lib/models/generic_response_model.dart +++ b/lib/models/generic_response_model.dart @@ -818,7 +818,7 @@ class GenericResponseModel { }); } - getAttendanceTrackingList = json["GetAttendanceTrackingList"] == null ? null : GetAttendanceTracking.fromMap(json["GetAttendanceTrackingList"]); + getAttendanceTrackingList = json["GetAttendanceTrackingList"] == null ? null : GetAttendanceTracking.fromRawJson(json["GetAttendanceTrackingList"]); if (json['GetBasicDetColsStructureList'] != null) { getBasicDetColsStructureList = []; json['GetBasicDetColsStructureList'].forEach((v) { @@ -1279,7 +1279,7 @@ class GenericResponseModel { listMenu = json["List_Menu"] == null ? [] : List.from(json["List_Menu"].map((x) => ListMenu.fromJson(x))); listNewEmployees = json['List_NewEmployees']; listRadScreen = json['List_RadScreen']; - logInTokenID = json['LogInTokenID']; + logInTokenID = json['logInTokenID']; if (json['MemberInformationList'] != null) { memberInformationList = []; json['MemberInformationList'].forEach((v) { diff --git a/lib/models/get_mobile_login_info_list_model.dart b/lib/models/get_mobile_login_info_list_model.dart index 06292b5..c6be04f 100644 --- a/lib/models/get_mobile_login_info_list_model.dart +++ b/lib/models/get_mobile_login_info_list_model.dart @@ -7,7 +7,7 @@ class GetMobileLoginInfoListModel { int? companyID; String? deviceType; String? deviceToken; - int? language; + String? language; int? gender; int? loginType; String? createdOn; @@ -31,36 +31,36 @@ class GetMobileLoginInfoListModel { this.businessCardPrivilege}); GetMobileLoginInfoListModel.fromJson(Map json) { - iD = json['ID']; - employeeID = json['EmployeeID']; - channelID = json['ChannelID']; - companyID = json['CompanyID']; - deviceType = json['DeviceType']; - deviceToken = json['DeviceToken']; - language = json['Language']; - gender = json['Gender']; - loginType = json['LoginType']; - createdOn = json['CreatedOn']; - editedOn = json['EditedOn']; - employeeName = json['EmployeeName']; - businessCardPrivilege = json['BusinessCardPrivilege']; + iD = json['id']; + employeeID = json['employeeID']; + channelID = json['channelID']; + companyID = json['companyID']; + deviceType = json['deviceType']; + deviceToken = json['deviceToken']; + language = json['language']; + gender = json['gender']; + loginType = json['loginType']; + createdOn = json['createdOn']; + editedOn = json['editedOn']; + employeeName = json['employeeName']; + businessCardPrivilege = json['businessCardPrivilege']; } Map toJson() { Map data = Map(); - data['ID'] = iD; - data['EmployeeID'] = employeeID; - data['ChannelID'] = channelID; - data['CompanyID'] = companyID; - data['DeviceType'] = deviceType; - data['DeviceToken'] = deviceToken; - data['Language'] = language; - data['Gender'] = gender; - data['LoginType'] = loginType; - data['CreatedOn'] = createdOn; - data['EditedOn'] = editedOn; + data['id'] = iD; + data['employeeID'] = employeeID; + data['channelID'] = channelID; + data['companyID'] = companyID; + data['deviceType'] = deviceType; + data['deviceToken'] = deviceToken; + data['language'] = language; + data['gender'] = gender; + data['loginType'] = loginType; + data['createdOn'] = createdOn; + data['editedOn'] = editedOn; data['EmployeeName'] = employeeName; - data['BusinessCardPrivilege'] = businessCardPrivilege; + data['businessCardPrivilege'] = businessCardPrivilege; return data; } diff --git a/lib/models/member_information_list_model.dart b/lib/models/member_information_list_model.dart index d975fd4..af2c602 100644 --- a/lib/models/member_information_list_model.dart +++ b/lib/models/member_information_list_model.dart @@ -3,349 +3,341 @@ import 'dart:convert'; import 'package:mohem_flutter_app/classes/consts.dart'; import 'package:shared_preferences/shared_preferences.dart'; + + + + class MemberInformationListModel { - String? aCTUALTERMINATIONDATE; - String? aSSIGNMENTENDDATE; - int? aSSIGNMENTID; - String? aSSIGNMENTNUMBER; - String? aSSIGNMENTSTARTDATE; - int? aSSIGNMENTSTATUSTYPEID; - String? aSSIGNMENTTYPE; - int? bUSINESSGROUPID; - String? bUSINESSGROUPNAME; - String? businessCardQR; - String? cURRENTEMPLOYEEFLAG; - String? eMPLOYEEDISPLAYNAME; - String? eMPLOYEEDISPLAYNAMEAr; - String? eMPLOYEEDISPLAYNAMEEn; - String? eMPLOYEEEMAILADDRESS; - String? eMPLOYEEIMAGE; - String? eMPLOYEEMOBILENUMBER; - String? eMPLOYEENAME; - String? eMPLOYEENAMEAr; - String? eMPLOYEENAMEEn; - String? eMPLOYEENUMBER; - String? eMPLOYEEWORKNUMBER; - String? eMPLOYMENTCATEGORY; - String? eMPLOYMENTCATEGORYMEANING; - String? employeeQR; - String? fREQUENCY; - String? fREQUENCYMEANING; - int? fROMROWNUM; - int? gRADEID; - String? gRADENAME; - String? hIREDATE; - int? jOBID; - String? jOBNAME; - String? jOBNAMEAr; - String? jOBNAMEEn; - int? lEDGERID; - int? lOCATIONID; - String? lOCATIONNAME; - String? mANUALTIMECARDFLAG; - String? mANUALTIMECARDMEANING; - String? mobileNumberWithZipCode; - String? nATIONALITYCODE; - String? nATIONALITYMEANING; - String? nATIONALIDENTIFIER; - dynamic? nORMALHOURS; - int? nOOFROWS; - int? oRGANIZATIONID; - String? oRGANIZATIONNAME; - String? pAYROLLCODE; - int? pAYROLLID; - String? pAYROLLNAME; - int? pERSONID; - String? pERSONTYPE; - int? pERSONTYPEID; - String? pERINFORMATIONCATEGORY; - int? pOSITIONID; - String? pOSITIONNAME; - String? pRIMARYFLAG; - String? rOWNUM; - int? sERVICEDAYS; - int? sERVICEMONTHS; - int? sERVICEYEARS; - String? sUPERVISORASSIGNMENTID; - String? sUPERVISORDISPLAYNAME; - String? sUPERVISOREMAILADDRESS; - int? sUPERVISORID; - String? sUPERVISORMOBILENUMBER; - String? sUPERVISORNAME; - String? sUPERVISORNUMBER; - String? sUPERVISORWORKNUMBER; - String? sWIPESEXEMPTEDFLAG; - String? sWIPESEXEMPTEDMEANING; - String? sYSTEMPERSONTYPE; - String? tKEMAILADDRESS; - String? tKEMPLOYEEDISPLAYNAME; - String? tKEMPLOYEENAME; - String? tKEMPLOYEENUMBER; - int? tKPERSONID; - int? tOROWNUM; - String? uNITNUMBER; - String? uSERSTATUS; + int? businesSGroupId; + int? persoNId; + int? persoNTypeId; + int? assignmenTId; + String? assignmenTStartDate; + String? assignmenTEndDate; + String? primarYFlag; + String? currenTEmployeeFlag; + int? assignmenTStatusTypeId; + dynamic normaLHours; + dynamic frequency; + dynamic frequencYMeaning; + String? employeENumber; + String? nationaLIdentifier; + String? systeMPersonType; + String? persoNType; + String? manuaLTimecardFlag; + String? manuaLTimecardMeaning; + String? swipeSExemptedFlag; + String? swipeSExemptedMeaning; + String? assignmenTNumber; + dynamic uniTNumber; + String? useRStatus; + String? employmenTCategory; + String? assignmenTType; + String? employmenTCategoryMeaning; + String? peRInformationCategory; + String? nationalitYCode; + String? nationalitYMeaning; + String? hirEDate; + String? roWNum; + int? servicEYears; + int? servicEDays; + dynamic actuaLTerminationDate; + String? employeEEmailAddress; + int? joBId; + int? positioNId; + int? organizatioNId; + int? locatioNId; + int? payrolLId; + dynamic gradEId; + String? positioNName; + String? organizatioNName; + String? locatioNName; + String? payrolLName; + String? payrolLCode; + dynamic gradEName; + String? employeEMobileNumber; + String? employeEWorkNumber; + String? employeeQr; bool? businessCardPrivilege; + String? businessCardQr; + int? supervisoRId; + dynamic supervisoRAssignmentId; + String? supervisoRNumber; + String? supervisoRName; + String? supervisoRDisplayName; + String? supervisoREmailAddress; + String? supervisoRMobileNumber; + String? supervisoRWorkNumber; + String? employeEImage; + int? tKPersonId; + String? tKEmployeeNumber; + String? tKEmployeeName; + String? tKEmployeeDisplayName; + String? tKEmailAddress; + int? nOOfRows; + int? froMRowNum; + int? tORowNum; + int? ledgeRId; + int? servicEMonths; + String? employeeNameEn; + dynamic employeENameAr; + String? jobNameEn; + dynamic joBNameAr; + String? employeeDisplayNameEn; + dynamic employeEDisplayNameAr; + String? mobileNumberWithZipCode; - MemberInformationListModel( - {this.aCTUALTERMINATIONDATE, - this.aSSIGNMENTENDDATE, - this.aSSIGNMENTID, - this.aSSIGNMENTNUMBER, - this.aSSIGNMENTSTARTDATE, - this.aSSIGNMENTSTATUSTYPEID, - this.aSSIGNMENTTYPE, - this.bUSINESSGROUPID, - this.bUSINESSGROUPNAME, - this.businessCardQR, - this.businessCardPrivilege, - this.cURRENTEMPLOYEEFLAG, - this.eMPLOYEEDISPLAYNAME, - this.eMPLOYEEDISPLAYNAMEAr, - this.eMPLOYEEDISPLAYNAMEEn, - this.eMPLOYEEEMAILADDRESS, - this.eMPLOYEEIMAGE, - this.eMPLOYEEMOBILENUMBER, - this.eMPLOYEENAME, - this.eMPLOYEENAMEAr, - this.eMPLOYEENAMEEn, - this.eMPLOYEENUMBER, - this.eMPLOYEEWORKNUMBER, - this.eMPLOYMENTCATEGORY, - this.eMPLOYMENTCATEGORYMEANING, - this.employeeQR, - this.fREQUENCY, - this.fREQUENCYMEANING, - this.fROMROWNUM, - this.gRADEID, - this.gRADENAME, - this.hIREDATE, - this.jOBID, - this.jOBNAME, - this.jOBNAMEAr, - this.jOBNAMEEn, - this.lEDGERID, - this.lOCATIONID, - this.lOCATIONNAME, - this.mANUALTIMECARDFLAG, - this.mANUALTIMECARDMEANING, - this.mobileNumberWithZipCode, - this.nATIONALITYCODE, - this.nATIONALITYMEANING, - this.nATIONALIDENTIFIER, - this.nORMALHOURS, - this.nOOFROWS, - this.oRGANIZATIONID, - this.oRGANIZATIONNAME, - this.pAYROLLCODE, - this.pAYROLLID, - this.pAYROLLNAME, - this.pERSONID, - this.pERSONTYPE, - this.pERSONTYPEID, - this.pERINFORMATIONCATEGORY, - this.pOSITIONID, - this.pOSITIONNAME, - this.pRIMARYFLAG, - this.rOWNUM, - this.sERVICEDAYS, - this.sERVICEMONTHS, - this.sERVICEYEARS, - this.sUPERVISORASSIGNMENTID, - this.sUPERVISORDISPLAYNAME, - this.sUPERVISOREMAILADDRESS, - this.sUPERVISORID, - this.sUPERVISORMOBILENUMBER, - this.sUPERVISORNAME, - this.sUPERVISORNUMBER, - this.sUPERVISORWORKNUMBER, - this.sWIPESEXEMPTEDFLAG, - this.sWIPESEXEMPTEDMEANING, - this.sYSTEMPERSONTYPE, - this.tKEMAILADDRESS, - this.tKEMPLOYEEDISPLAYNAME, - this.tKEMPLOYEENAME, - this.tKEMPLOYEENUMBER, - this.tKPERSONID, - this.tOROWNUM, - this.uNITNUMBER, - this.uSERSTATUS}); + MemberInformationListModel({ + this.businesSGroupId, + this.persoNId, + this.persoNTypeId, + this.assignmenTId, + this.assignmenTStartDate, + this.assignmenTEndDate, + this.primarYFlag, + this.currenTEmployeeFlag, + this.assignmenTStatusTypeId, + this.normaLHours, + this.frequency, + this.frequencYMeaning, + this.employeENumber, + this.nationaLIdentifier, + this.systeMPersonType, + this.persoNType, + this.manuaLTimecardFlag, + this.manuaLTimecardMeaning, + this.swipeSExemptedFlag, + this.swipeSExemptedMeaning, + this.assignmenTNumber, + this.uniTNumber, + this.useRStatus, + this.employmenTCategory, + this.assignmenTType, + this.employmenTCategoryMeaning, + this.peRInformationCategory, + this.nationalitYCode, + this.nationalitYMeaning, + this.hirEDate, + this.roWNum, + this.servicEYears, + this.servicEDays, + this.actuaLTerminationDate, + this.employeEEmailAddress, + this.joBId, + this.positioNId, + this.organizatioNId, + this.locatioNId, + this.payrolLId, + this.gradEId, + this.positioNName, + this.organizatioNName, + this.locatioNName, + this.payrolLName, + this.payrolLCode, + this.gradEName, + this.employeEMobileNumber, + this.employeEWorkNumber, + this.employeeQr, + this.businessCardPrivilege, + this.businessCardQr, + this.supervisoRId, + this.supervisoRAssignmentId, + this.supervisoRNumber, + this.supervisoRName, + this.supervisoRDisplayName, + this.supervisoREmailAddress, + this.supervisoRMobileNumber, + this.supervisoRWorkNumber, + this.employeEImage, + this.tKPersonId, + this.tKEmployeeNumber, + this.tKEmployeeName, + this.tKEmployeeDisplayName, + this.tKEmailAddress, + this.nOOfRows, + this.froMRowNum, + this.tORowNum, + this.ledgeRId, + this.servicEMonths, + this.employeeNameEn, + this.employeENameAr, + this.jobNameEn, + this.joBNameAr, + this.employeeDisplayNameEn, + this.employeEDisplayNameAr, + this.mobileNumberWithZipCode, + }); - MemberInformationListModel.fromJson(Map json) { - aCTUALTERMINATIONDATE = json['ACTUAL_TERMINATION_DATE']; - aSSIGNMENTENDDATE = json['ASSIGNMENT_END_DATE']; - aSSIGNMENTID = json['ASSIGNMENT_ID']; - aSSIGNMENTNUMBER = json['ASSIGNMENT_NUMBER']; - businessCardPrivilege = json['businessCardPrivilege']; - aSSIGNMENTSTARTDATE = json['ASSIGNMENT_START_DATE']; - aSSIGNMENTSTATUSTYPEID = json['ASSIGNMENT_STATUS_TYPE_ID']; - aSSIGNMENTTYPE = json['ASSIGNMENT_TYPE']; - bUSINESSGROUPID = json['BUSINESS_GROUP_ID']; - bUSINESSGROUPNAME = json['BUSINESS_GROUP_NAME']; - businessCardQR = json['BusinessCardQR']; - cURRENTEMPLOYEEFLAG = json['CURRENT_EMPLOYEE_FLAG']; - eMPLOYEEDISPLAYNAME = json['EMPLOYEE_DISPLAY_NAME']; - eMPLOYEEDISPLAYNAMEAr = json['EMPLOYEE_DISPLAY_NAME_Ar']; - eMPLOYEEDISPLAYNAMEEn = json['EMPLOYEE_DISPLAY_NAME_En']; - eMPLOYEEEMAILADDRESS = json['EMPLOYEE_EMAIL_ADDRESS']; - eMPLOYEEIMAGE = json['EMPLOYEE_IMAGE']; - eMPLOYEEMOBILENUMBER = json['EMPLOYEE_MOBILE_NUMBER']; - eMPLOYEENAME = json['EMPLOYEE_NAME']; - eMPLOYEENAMEAr = json['EMPLOYEE_NAME_Ar']; - eMPLOYEENAMEEn = json['EMPLOYEE_NAME_En']; - eMPLOYEENUMBER = json['EMPLOYEE_NUMBER']; - eMPLOYEEWORKNUMBER = json['EMPLOYEE_WORK_NUMBER']; - eMPLOYMENTCATEGORY = json['EMPLOYMENT_CATEGORY']; - eMPLOYMENTCATEGORYMEANING = json['EMPLOYMENT_CATEGORY_MEANING']; - employeeQR = json['EmployeeQR']; - fREQUENCY = json['FREQUENCY']; - fREQUENCYMEANING = json['FREQUENCY_MEANING']; - fROMROWNUM = json['FROM_ROW_NUM']; - gRADEID = json['GRADE_ID']; - gRADENAME = json['GRADE_NAME']; - hIREDATE = json['HIRE_DATE']; - jOBID = json['JOB_ID']; - jOBNAME = json['JOB_NAME']; - jOBNAMEAr = json['JOB_NAME_Ar']; - jOBNAMEEn = json['JOB_NAME_En']; - lEDGERID = json['LEDGER_ID']; - lOCATIONID = json['LOCATION_ID']; - lOCATIONNAME = json['LOCATION_NAME']; - mANUALTIMECARDFLAG = json['MANUAL_TIMECARD_FLAG']; - mANUALTIMECARDMEANING = json['MANUAL_TIMECARD_MEANING']; - mobileNumberWithZipCode = json['MobileNumberWithZipCode']; - nATIONALITYCODE = json['NATIONALITY_CODE']; - nATIONALITYMEANING = json['NATIONALITY_MEANING']; - nATIONALIDENTIFIER = json['NATIONAL_IDENTIFIER']; - nORMALHOURS = json['NORMAL_HOURS']; - nOOFROWS = json['NO_OF_ROWS']; - oRGANIZATIONID = json['ORGANIZATION_ID']; - oRGANIZATIONNAME = json['ORGANIZATION_NAME']; - pAYROLLCODE = json['PAYROLL_CODE']; - pAYROLLID = json['PAYROLL_ID']; - pAYROLLNAME = json['PAYROLL_NAME']; - pERSONID = json['PERSON_ID']; - pERSONTYPE = json['PERSON_TYPE']; - pERSONTYPEID = json['PERSON_TYPE_ID']; - pERINFORMATIONCATEGORY = json['PER_INFORMATION_CATEGORY']; - pOSITIONID = json['POSITION_ID']; - pOSITIONNAME = json['POSITION_NAME']; - pRIMARYFLAG = json['PRIMARY_FLAG']; - rOWNUM = json['ROW_NUM']; - sERVICEDAYS = json['SERVICE_DAYS']; - sERVICEMONTHS = json['SERVICE_MONTHS']; - sERVICEYEARS = json['SERVICE_YEARS']; - sUPERVISORASSIGNMENTID = json['SUPERVISOR_ASSIGNMENT_ID']; - sUPERVISORDISPLAYNAME = json['SUPERVISOR_DISPLAY_NAME']; - sUPERVISOREMAILADDRESS = json['SUPERVISOR_EMAIL_ADDRESS']; - sUPERVISORID = json['SUPERVISOR_ID']; - sUPERVISORMOBILENUMBER = json['SUPERVISOR_MOBILE_NUMBER']; - sUPERVISORNAME = json['SUPERVISOR_NAME']; - sUPERVISORNUMBER = json['SUPERVISOR_NUMBER']; - sUPERVISORWORKNUMBER = json['SUPERVISOR_WORK_NUMBER']; - sWIPESEXEMPTEDFLAG = json['SWIPES_EXEMPTED_FLAG']; - sWIPESEXEMPTEDMEANING = json['SWIPES_EXEMPTED_MEANING']; - sYSTEMPERSONTYPE = json['SYSTEM_PERSON_TYPE']; - tKEMAILADDRESS = json['TK_EMAIL_ADDRESS']; - tKEMPLOYEEDISPLAYNAME = json['TK_EMPLOYEE_DISPLAY_NAME']; - tKEMPLOYEENAME = json['TK_EMPLOYEE_NAME']; - tKEMPLOYEENUMBER = json['TK_EMPLOYEE_NUMBER']; - tKPERSONID = json['TK_PERSON_ID']; - tOROWNUM = json['TO_ROW_NUM']; - uNITNUMBER = json['UNIT_NUMBER']; - uSERSTATUS = json['USER_STATUS']; - } + factory MemberInformationListModel.fromRawJson(String str) => MemberInformationListModel.fromJson(json.decode(str)); + + String toRawJson() => json.encode(toJson()); + + factory MemberInformationListModel.fromJson(Map json) => MemberInformationListModel( + businesSGroupId: json["businesS_GROUP_ID"], + persoNId: json["persoN_ID"], + persoNTypeId: json["persoN_TYPE_ID"], + assignmenTId: json["assignmenT_ID"], + assignmenTStartDate: json["assignmenT_START_DATE"], + assignmenTEndDate: json["assignmenT_END_DATE"], + primarYFlag: json["primarY_FLAG"], + currenTEmployeeFlag: json["currenT_EMPLOYEE_FLAG"], + assignmenTStatusTypeId: json["assignmenT_STATUS_TYPE_ID"], + normaLHours: json["normaL_HOURS"], + frequency: json["frequency"], + frequencYMeaning: json["frequencY_MEANING"], + employeENumber: json["employeE_NUMBER"], + nationaLIdentifier: json["nationaL_IDENTIFIER"], + systeMPersonType: json["systeM_PERSON_TYPE"], + persoNType: json["persoN_TYPE"], + manuaLTimecardFlag: json["manuaL_TIMECARD_FLAG"], + manuaLTimecardMeaning: json["manuaL_TIMECARD_MEANING"], + swipeSExemptedFlag: json["swipeS_EXEMPTED_FLAG"], + swipeSExemptedMeaning: json["swipeS_EXEMPTED_MEANING"], + assignmenTNumber: json["assignmenT_NUMBER"], + uniTNumber: json["uniT_NUMBER"], + useRStatus: json["useR_STATUS"], + employmenTCategory: json["employmenT_CATEGORY"], + assignmenTType: json["assignmenT_TYPE"], + employmenTCategoryMeaning: json["employmenT_CATEGORY_MEANING"], + peRInformationCategory: json["peR_INFORMATION_CATEGORY"], + nationalitYCode: json["nationalitY_CODE"], + nationalitYMeaning: json["nationalitY_MEANING"], + hirEDate: json["hirE_DATE"], + roWNum: json["roW_NUM"], + servicEYears: json["servicE_YEARS"], + servicEDays: json["servicE_DAYS"], + actuaLTerminationDate: json["actuaL_TERMINATION_DATE"], + employeEEmailAddress: json["employeE_EMAIL_ADDRESS"], + joBId: json["joB_ID"], + positioNId: json["positioN_ID"], + organizatioNId: json["organizatioN_ID"], + locatioNId: json["locatioN_ID"], + payrolLId: json["payrolL_ID"], + gradEId: json["gradE_ID"], + positioNName: json["positioN_NAME"], + organizatioNName: json["organizatioN_NAME"], + locatioNName: json["locatioN_NAME"], + payrolLName: json["payrolL_NAME"], + payrolLCode: json["payrolL_CODE"], + gradEName: json["gradE_NAME"], + employeEMobileNumber: json["employeE_MOBILE_NUMBER"], + employeEWorkNumber: json["employeE_WORK_NUMBER"], + employeeQr: json["employeeQR"], + businessCardPrivilege: json["businessCardPrivilege"], + businessCardQr: json["businessCardQR"], + supervisoRId: json["supervisoR_ID"], + supervisoRAssignmentId: json["supervisoR_ASSIGNMENT_ID"], + supervisoRNumber: json["supervisoR_NUMBER"], + supervisoRName: json["supervisoR_NAME"], + supervisoRDisplayName: json["supervisoR_DISPLAY_NAME"], + supervisoREmailAddress: json["supervisoR_EMAIL_ADDRESS"], + supervisoRMobileNumber: json["supervisoR_MOBILE_NUMBER"], + supervisoRWorkNumber: json["supervisoR_WORK_NUMBER"], + employeEImage: json["employeE_IMAGE"], + tKPersonId: json["tK_PERSON_ID"], + tKEmployeeNumber: json["tK_EMPLOYEE_NUMBER"], + tKEmployeeName: json["tK_EMPLOYEE_NAME"], + tKEmployeeDisplayName: json["tK_EMPLOYEE_DISPLAY_NAME"], + tKEmailAddress: json["tK_EMAIL_ADDRESS"], + nOOfRows: json["nO_OF_ROWS"], + froMRowNum: json["froM_ROW_NUM"], + tORowNum: json["tO_ROW_NUM"], + ledgeRId: json["ledgeR_ID"], + servicEMonths: json["servicE_MONTHS"], + employeeNameEn: json["EMPLOYEE_NAME_EN"], + employeENameAr: json["employeE_NAME_AR"], + jobNameEn: json["JOB_NAME_EN"], + joBNameAr: json["joB_NAME_AR"], + employeeDisplayNameEn: json["EMPLOYEE_DISPLAY_NAME_EN"], + employeEDisplayNameAr: json["employeE_DISPLAY_NAME_AR"], + mobileNumberWithZipCode: json["mobileNumberWithZipCode"], + ); + + Map toJson() => { + "businesS_GROUP_ID": businesSGroupId, + "persoN_ID": persoNId, + "persoN_TYPE_ID": persoNTypeId, + "assignmenT_ID": assignmenTId, + "assignmenT_START_DATE": assignmenTStartDate, + "assignmenT_END_DATE": assignmenTEndDate, + "primarY_FLAG": primarYFlag, + "currenT_EMPLOYEE_FLAG": currenTEmployeeFlag, + "assignmenT_STATUS_TYPE_ID": assignmenTStatusTypeId, + "normaL_HOURS": normaLHours, + "frequency": frequency, + "frequencY_MEANING": frequencYMeaning, + "employeE_NUMBER": employeENumber, + "nationaL_IDENTIFIER": nationaLIdentifier, + "systeM_PERSON_TYPE": systeMPersonType, + "persoN_TYPE": persoNType, + "manuaL_TIMECARD_FLAG": manuaLTimecardFlag, + "manuaL_TIMECARD_MEANING": manuaLTimecardMeaning, + "swipeS_EXEMPTED_FLAG": swipeSExemptedFlag, + "swipeS_EXEMPTED_MEANING": swipeSExemptedMeaning, + "assignmenT_NUMBER": assignmenTNumber, + "uniT_NUMBER": uniTNumber, + "useR_STATUS": useRStatus, + "employmenT_CATEGORY": employmenTCategory, + "assignmenT_TYPE": assignmenTType, + "employmenT_CATEGORY_MEANING": employmenTCategoryMeaning, + "peR_INFORMATION_CATEGORY": peRInformationCategory, + "nationalitY_CODE": nationalitYCode, + "nationalitY_MEANING": nationalitYMeaning, + "hirE_DATE": hirEDate, + "roW_NUM": roWNum, + "servicE_YEARS": servicEYears, + "servicE_DAYS": servicEDays, + "actuaL_TERMINATION_DATE": actuaLTerminationDate, + "employeE_EMAIL_ADDRESS": employeEEmailAddress, + "joB_ID": joBId, + "positioN_ID": positioNId, + "organizatioN_ID": organizatioNId, + "locatioN_ID": locatioNId, + "payrolL_ID": payrolLId, + "gradE_ID": gradEId, + "positioN_NAME": positioNName, + "organizatioN_NAME": organizatioNName, + "locatioN_NAME": locatioNName, + "payrolL_NAME": payrolLName, + "payrolL_CODE": payrolLCode, + "gradE_NAME": gradEName, + "employeE_MOBILE_NUMBER": employeEMobileNumber, + "employeE_WORK_NUMBER": employeEWorkNumber, + "employeeQR": employeeQr, + "businessCardPrivilege": businessCardPrivilege, + "businessCardQR": businessCardQr, + "supervisoR_ID": supervisoRId, + "supervisoR_ASSIGNMENT_ID": supervisoRAssignmentId, + "supervisoR_NUMBER": supervisoRNumber, + "supervisoR_NAME": supervisoRName, + "supervisoR_DISPLAY_NAME": supervisoRDisplayName, + "supervisoR_EMAIL_ADDRESS": supervisoREmailAddress, + "supervisoR_MOBILE_NUMBER": supervisoRMobileNumber, + "supervisoR_WORK_NUMBER": supervisoRWorkNumber, + "employeE_IMAGE": employeEImage, + "tK_PERSON_ID": tKPersonId, + "tK_EMPLOYEE_NUMBER": tKEmployeeNumber, + "tK_EMPLOYEE_NAME": tKEmployeeName, + "tK_EMPLOYEE_DISPLAY_NAME": tKEmployeeDisplayName, + "tK_EMAIL_ADDRESS": tKEmailAddress, + "nO_OF_ROWS": nOOfRows, + "froM_ROW_NUM": froMRowNum, + "tO_ROW_NUM": tORowNum, + "ledgeR_ID": ledgeRId, + "servicE_MONTHS": servicEMonths, + "EMPLOYEE_NAME_EN": employeeNameEn, + "employeE_NAME_AR": employeENameAr, + "JOB_NAME_EN": jobNameEn, + "joB_NAME_AR": joBNameAr, + "EMPLOYEE_DISPLAY_NAME_EN": employeeDisplayNameEn, + "employeE_DISPLAY_NAME_AR": employeEDisplayNameAr, + "mobileNumberWithZipCode": mobileNumberWithZipCode, + }; - Map toJson() { - Map data = new Map(); - data['ACTUAL_TERMINATION_DATE'] = this.aCTUALTERMINATIONDATE; - data['ASSIGNMENT_END_DATE'] = this.aSSIGNMENTENDDATE; - data['ASSIGNMENT_ID'] = this.aSSIGNMENTID; - data['ASSIGNMENT_NUMBER'] = this.aSSIGNMENTNUMBER; - data['ASSIGNMENT_START_DATE'] = this.aSSIGNMENTSTARTDATE; - data['ASSIGNMENT_STATUS_TYPE_ID'] = this.aSSIGNMENTSTATUSTYPEID; - data['ASSIGNMENT_TYPE'] = this.aSSIGNMENTTYPE; - data['BUSINESS_GROUP_ID'] = this.bUSINESSGROUPID; - data['BUSINESS_GROUP_NAME'] = this.bUSINESSGROUPNAME; - data['BusinessCardQR'] = this.businessCardQR; - data['CURRENT_EMPLOYEE_FLAG'] = this.cURRENTEMPLOYEEFLAG; - data['EMPLOYEE_DISPLAY_NAME'] = this.eMPLOYEEDISPLAYNAME; - data['EMPLOYEE_DISPLAY_NAME_Ar'] = this.eMPLOYEEDISPLAYNAMEAr; - data['EMPLOYEE_DISPLAY_NAME_En'] = this.eMPLOYEEDISPLAYNAMEEn; - data['EMPLOYEE_EMAIL_ADDRESS'] = this.eMPLOYEEEMAILADDRESS; - data['EMPLOYEE_IMAGE'] = this.eMPLOYEEIMAGE; - data['EMPLOYEE_MOBILE_NUMBER'] = this.eMPLOYEEMOBILENUMBER; - data['EMPLOYEE_NAME'] = this.eMPLOYEENAME; - data['EMPLOYEE_NAME_Ar'] = this.eMPLOYEENAMEAr; - data['EMPLOYEE_NAME_En'] = this.eMPLOYEENAMEEn; - data['EMPLOYEE_NUMBER'] = this.eMPLOYEENUMBER; - data['businessCardPrivilege'] = this.businessCardPrivilege; - data['EMPLOYEE_WORK_NUMBER'] = this.eMPLOYEEWORKNUMBER; - data['EMPLOYMENT_CATEGORY'] = this.eMPLOYMENTCATEGORY; - data['EMPLOYMENT_CATEGORY_MEANING'] = this.eMPLOYMENTCATEGORYMEANING; - data['EmployeeQR'] = this.employeeQR; - data['FREQUENCY'] = this.fREQUENCY; - data['FREQUENCY_MEANING'] = this.fREQUENCYMEANING; - data['FROM_ROW_NUM'] = this.fROMROWNUM; - data['GRADE_ID'] = this.gRADEID; - data['GRADE_NAME'] = this.gRADENAME; - data['HIRE_DATE'] = this.hIREDATE; - data['JOB_ID'] = this.jOBID; - data['JOB_NAME'] = this.jOBNAME; - data['JOB_NAME_Ar'] = this.jOBNAMEAr; - data['JOB_NAME_En'] = this.jOBNAMEEn; - data['LEDGER_ID'] = this.lEDGERID; - data['LOCATION_ID'] = this.lOCATIONID; - data['LOCATION_NAME'] = this.lOCATIONNAME; - data['MANUAL_TIMECARD_FLAG'] = this.mANUALTIMECARDFLAG; - data['MANUAL_TIMECARD_MEANING'] = this.mANUALTIMECARDMEANING; - data['MobileNumberWithZipCode'] = this.mobileNumberWithZipCode; - data['NATIONALITY_CODE'] = this.nATIONALITYCODE; - data['NATIONALITY_MEANING'] = this.nATIONALITYMEANING; - data['NATIONAL_IDENTIFIER'] = this.nATIONALIDENTIFIER; - data['NORMAL_HOURS'] = this.nORMALHOURS; - data['NO_OF_ROWS'] = this.nOOFROWS; - data['ORGANIZATION_ID'] = this.oRGANIZATIONID; - data['ORGANIZATION_NAME'] = this.oRGANIZATIONNAME; - data['PAYROLL_CODE'] = this.pAYROLLCODE; - data['PAYROLL_ID'] = this.pAYROLLID; - data['PAYROLL_NAME'] = this.pAYROLLNAME; - data['PERSON_ID'] = this.pERSONID; - data['PERSON_TYPE'] = this.pERSONTYPE; - data['PERSON_TYPE_ID'] = this.pERSONTYPEID; - data['PER_INFORMATION_CATEGORY'] = this.pERINFORMATIONCATEGORY; - data['POSITION_ID'] = this.pOSITIONID; - data['POSITION_NAME'] = this.pOSITIONNAME; - data['PRIMARY_FLAG'] = this.pRIMARYFLAG; - data['ROW_NUM'] = this.rOWNUM; - data['SERVICE_DAYS'] = this.sERVICEDAYS; - data['SERVICE_MONTHS'] = this.sERVICEMONTHS; - data['SERVICE_YEARS'] = this.sERVICEYEARS; - data['SUPERVISOR_ASSIGNMENT_ID'] = this.sUPERVISORASSIGNMENTID; - data['SUPERVISOR_DISPLAY_NAME'] = this.sUPERVISORDISPLAYNAME; - data['SUPERVISOR_EMAIL_ADDRESS'] = this.sUPERVISOREMAILADDRESS; - data['SUPERVISOR_ID'] = this.sUPERVISORID; - data['SUPERVISOR_MOBILE_NUMBER'] = this.sUPERVISORMOBILENUMBER; - data['SUPERVISOR_NAME'] = this.sUPERVISORNAME; - data['SUPERVISOR_NUMBER'] = this.sUPERVISORNUMBER; - data['SUPERVISOR_WORK_NUMBER'] = this.sUPERVISORWORKNUMBER; - data['SWIPES_EXEMPTED_FLAG'] = this.sWIPESEXEMPTEDFLAG; - data['SWIPES_EXEMPTED_MEANING'] = this.sWIPESEXEMPTEDMEANING; - data['SYSTEM_PERSON_TYPE'] = this.sYSTEMPERSONTYPE; - data['TK_EMAIL_ADDRESS'] = this.tKEMAILADDRESS; - data['TK_EMPLOYEE_DISPLAY_NAME'] = this.tKEMPLOYEEDISPLAYNAME; - data['TK_EMPLOYEE_NAME'] = this.tKEMPLOYEENAME; - data['TK_EMPLOYEE_NUMBER'] = this.tKEMPLOYEENUMBER; - data['TK_PERSON_ID'] = this.tKPERSONID; - data['TO_ROW_NUM'] = this.tOROWNUM; - data['UNIT_NUMBER'] = this.uNITNUMBER; - data['USER_STATUS'] = this.uSERSTATUS; - return data; - } String getPositionName() { String positionName = ""; - List list = pOSITIONNAME?.split(".") ?? []; + List list = positionName?.split(".") ?? []; if (list.isNotEmpty) { if (list.length > 1) { positionName = list[0] + " " + list[1]; @@ -358,13 +350,15 @@ class MemberInformationListModel { static Future> getFromPrefs() async { SharedPreferences prefs = await SharedPreferences.getInstance(); - List encodedList = prefs.getStringList(SharedPrefsConsts.memberInformation) ?? []; - return encodedList.map((e) => MemberInformationListModel.fromJson(jsonDecode(e))).toList(); + List encodedList = prefs.getStringList( + SharedPrefsConsts.memberInformation) ?? []; + return encodedList.map((e) => + MemberInformationListModel.fromJson(jsonDecode(e))).toList(); } - static void saveToPrefs(List list) async { + static Future saveToPrefs(List list) async { SharedPreferences prefs = await SharedPreferences.getInstance(); List encodedList = list.map((e) => jsonEncode(e.toJson())).toList(); await prefs.setStringList(SharedPrefsConsts.memberInformation, encodedList); } -} + } \ No newline at end of file diff --git a/lib/models/member_login_list_model.dart b/lib/models/member_login_list_model.dart index ca581ca..2a60c8a 100644 --- a/lib/models/member_login_list_model.dart +++ b/lib/models/member_login_list_model.dart @@ -1,49 +1,56 @@ import 'dart:convert'; class MemberLoginListModel { - String? pReturnStatus; - String? pReturnMsg; - String? pPassowrdExpired; - String? pPasswordExpiredMsg; - String? pMobileNumber; - String? pEmailAddress; - String? pLegislationCode; - String? logInTokenId; - MemberLoginListModel({ - this.pReturnStatus, - this.pReturnMsg, - this.pPassowrdExpired, - this.pPasswordExpiredMsg, - this.pMobileNumber, - this.pEmailAddress, - this.pLegislationCode, - this.logInTokenId, + required this.pReturnStatus, + required this.pReturnMsg, + required this.pPassowrdExpired, + required this.pPasswordExpiredMsg, + required this.pMobileNumber, + required this.pEmailAddress, + required this.pLegislationCode, + required this.logInTokenId, }); + final String? pReturnStatus; + final String? pReturnMsg; + final String? pPassowrdExpired; + final String? pPasswordExpiredMsg; + final String? pMobileNumber; + final String? pEmailAddress; + final String? pLegislationCode; + final String? logInTokenId; + + factory MemberLoginListModel.fromRawJson(String str) => MemberLoginListModel.fromJson(json.decode(str)); String toRawJson() => json.encode(toJson()); - factory MemberLoginListModel.fromJson(Map json) => MemberLoginListModel( - pReturnStatus: json["P_RETURN_STATUS"], - pReturnMsg: json["P_RETURN_MSG"], - pPassowrdExpired: json["P_PASSOWRD_EXPIRED"], - pPasswordExpiredMsg: json["P_PASSWORD_EXPIRED_MSG"], - pMobileNumber: json["P_MOBILE_NUMBER"], - pEmailAddress: json["P_EMAIL_ADDRESS"], - pLegislationCode: json["P_LEGISLATION_CODE"], - logInTokenId: json["LogInTokenID"], - ); + + factory MemberLoginListModel.fromJson(Map json){ + + return MemberLoginListModel( + pReturnStatus: json["p_RETURN_STATUS"], + pReturnMsg: json["p_RETURN_MSG"], + pPassowrdExpired: json["p_PASSOWRD_EXPIRED"], + pPasswordExpiredMsg: json["p_PASSWORD_EXPIRED_MSG"], + pMobileNumber: json["p_MOBILE_NUMBER"], + pEmailAddress: json["p_EMAIL_ADDRESS"], + pLegislationCode: json["p_LEGISLATION_CODE"], + logInTokenId: json["logInTokenID"], + ); + + } Map toJson() => { - "P_RETURN_STATUS": pReturnStatus, - "P_RETURN_MSG": pReturnMsg, - "P_PASSOWRD_EXPIRED": pPassowrdExpired, - "P_PASSWORD_EXPIRED_MSG": pPasswordExpiredMsg, - "P_MOBILE_NUMBER": pMobileNumber, - "P_EMAIL_ADDRESS": pEmailAddress, - "P_LEGISLATION_CODE": pLegislationCode, - "LogInTokenID": logInTokenId, + "p_RETURN_STATUS": pReturnStatus, + "p_RETURN_MSG": pReturnMsg, + "p_PASSOWRD_EXPIRED": pPassowrdExpired, + "p_PASSWORD_EXPIRED_MSG": pPasswordExpiredMsg, + "p_MOBILE_NUMBER": pMobileNumber, + "p_EMAIL_ADDRESS": pEmailAddress, + "p_LEGISLATION_CODE": pLegislationCode, + "logInTokenID": logInTokenId, }; + } diff --git a/lib/models/post_params_model.dart b/lib/models/post_params_model.dart index f15054c..158e772 100644 --- a/lib/models/post_params_model.dart +++ b/lib/models/post_params_model.dart @@ -15,7 +15,7 @@ class PostParamsModel { String? payrollCodeStr; int? pSessionId; String? userName; - + String? language; PostParamsModel({ this.versionID, this.channel, @@ -31,6 +31,7 @@ class PostParamsModel { this.pSelectedEmployeeNumber, this.payrollCodeStr, this.pLegislationCode, + this.language }); PostParamsModel.fromJson(Map json) { @@ -46,33 +47,34 @@ class PostParamsModel { Map toJson() { Map data = new Map(); - data['VersionID'] = this.versionID; - data['Channel'] = this.channel; - data['LanguageID'] = this.languageID; + data['versionID'] = this.versionID; + data['channel'] = this.channel; + data['languageID'] = this.languageID; data['MobileType'] = this.mobileType; - data['LogInTokenID'] = this.logInTokenID; - data['PayrollCodeStr'] = this.payrollCodeStr; - data['LegislationCodeStr'] = this.pLegislationCode; - data['TokenID'] = this.tokenID; + data['logInTokenID'] = this.logInTokenID ??""; + data['payrollCodeStr'] = this.payrollCodeStr ?? "CS"; + data['legislationCodeStr'] = this.pLegislationCode ?? "CS"; + data['tokenID'] = this.tokenID ?? ""; return data; } Map toJsonAfterLogin() { Map data = new Map(); - data['VersionID'] = this.versionID; - data['Channel'] = this.channel; - data['LanguageID'] = this.languageID; - data['MobileType'] = this.mobileType; - data['LogInTokenID'] = this.logInTokenID; - data['TokenID'] = this.tokenID; - data['MobileNumber'] = this.mobileNumber; - data['UserName'] = this.userName; - data['P_EMAIL_ADDRESS'] = this.pEmailAddress; - data['P_SESSION_ID'] = this.pSessionId; - data['PayrollCodeStr'] = this.payrollCodeStr; - data['LegislationCodeStr'] = this.pLegislationCode; - data['P_SELECTED_EMPLOYEE_NUMBER'] = this.pSelectedEmployeeNumber; - data['P_USER_NAME'] = this.pUserName; + data['versionID'] = this.versionID; + data['channel'] = this.channel; + data['languageID'] = this.languageID; + data['mobileType'] = this.mobileType; + data['logInTokenID'] = this.logInTokenID; + data['tokenID'] = this.tokenID; + data['mobileNumber'] = this.mobileNumber; + data['userName'] = this.userName; + data['p_EMAIL_ADDRESS'] = this.pEmailAddress; + data['p_SESSION_ID'] = this.pSessionId; + data['payrollCodeStr'] = this.payrollCodeStr; + data['legislationCodeStr'] = this.pLegislationCode; + data['p_SELECTED_EMPLOYEE_NUMBER'] = this.pSelectedEmployeeNumber; + data['p_USER_NAME'] = this.pUserName; + data['p_LANGUAGE'] = this.language; return data; } diff --git a/lib/provider/dashboard_provider_model.dart b/lib/provider/dashboard_provider_model.dart index e3f6511..88474d1 100644 --- a/lib/provider/dashboard_provider_model.dart +++ b/lib/provider/dashboard_provider_model.dart @@ -11,6 +11,7 @@ import 'package:mohem_flutter_app/main.dart'; import 'package:mohem_flutter_app/models/dashboard/drawer_menu_item_model.dart'; import 'package:mohem_flutter_app/models/dashboard/get_accrual_balances_list_model.dart'; import 'package:mohem_flutter_app/models/dashboard/get_attendance_tracking_list_model.dart'; +import 'package:mohem_flutter_app/models/dashboard/get_open_missing_swipe.dart'; import 'package:mohem_flutter_app/models/dashboard/get_open_notifications_list.dart'; import 'package:mohem_flutter_app/models/dashboard/itg_forms_model.dart'; import 'package:mohem_flutter_app/models/dashboard/list_menu.dart'; @@ -143,7 +144,7 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin { workListCounter = genericResponseModel?.pOPENNTFNUMBER ?? 0; - itgFormsModel = await DashboardApiClient().getItgFormsPendingTask(); + //itgFormsModel = await DashboardApiClient().getItgFormsPendingTask(); workListCounter = workListCounter + (itgFormsModel?.totalCount ?? 0); GenericResponseModel? cocGenericResponseModel = await DashboardApiClient().getCOCNotifications(); cocCount = cocGenericResponseModel?.mohemmITGPendingTaskResponseItem; @@ -176,9 +177,9 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin { //Missing Siwpe API's & Methods Future fetchMissingSwipe(context) async { try { - GenericResponseModel? genericResponseModel = await DashboardApiClient().getOpenMissingSwipes(); + GetOpenMissingSwipes? genericResponseModel = await DashboardApiClient().getOpenMissingSwipes(); isMissingSwipeLoading = false; - missingSwipeCounter = genericResponseModel!.getOpenMissingSwipesList!.pOpenMissingSwipes ?? 0; + missingSwipeCounter = genericResponseModel!.pOpenMissingSwipes ?? 0; notifyListeners(); } catch (ex) { isMissingSwipeLoading = false; @@ -211,11 +212,11 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin { void fetchListMenu() async { try { List menuList = await DashboardApiClient().getListMenu(); - List findMyRequest = menuList.where((element) => element.menuType == "E").toList(); + List findMyRequest = menuList.where((element) => element.menUType == "E").toList(); if (findMyRequest.isNotEmpty) { drawerMenuItemList.insert(3, DrawerMenuItem("assets/images/drawer/my_requests.svg", LocaleKeys.myRequest.tr(), AppRoutes.myRequests)); } - List findMyTeam = menuList.where((element) => element.menuType == "M").toList(); + List findMyTeam = menuList.where((element) => element.menUType == "M").toList(); if (findMyTeam.isNotEmpty) { AppState().setempStatusIsManager = true; drawerMenuItemList.insert(2, DrawerMenuItem("assets/images/drawer/my_team.svg", LocaleKeys.myTeamMembers.tr(), AppRoutes.myTeam)); @@ -229,9 +230,9 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin { //Menu Entries API's & Methods void fetchMenuEntries() async { try { - GenericResponseModel? genericResponseModel = await DashboardApiClient().getGetMenuEntries(); - getMenuEntriesList = genericResponseModel!.getMenuEntriesList; - homeMenus = parseMenus(getMenuEntriesList ?? []); + List? getMenuEntriesList = await DashboardApiClient().getGetMenuEntries(); + getMenuEntriesList = getMenuEntriesList; //genericResponseModel!.getMenuEntriesList; + homeMenus = parseMenus(getMenuEntriesList!); if (homeMenus!.isNotEmpty) { homeMenus!.first.menuEntiesList.insert(0, GetMenuEntriesList(requestType: "MONTHLY_ATTENDANCE", prompt: LocaleKeys.monthlyAttendance.tr())); homeMenus!.first.menuEntiesList.add(GetMenuEntriesList(requestType: "VACATION_RULE", prompt: LocaleKeys.vacationRule.tr())); diff --git a/lib/ui/dialogs/id/business_card_dialog.dart b/lib/ui/dialogs/id/business_card_dialog.dart index ed9f260..1e2914c 100644 --- a/lib/ui/dialogs/id/business_card_dialog.dart +++ b/lib/ui/dialogs/id/business_card_dialog.dart @@ -41,7 +41,7 @@ class BusinessCardDialog extends StatelessWidget { ), ), Image.memory( - Utils.getPostBytes(AppState().memberInformationList!.businessCardQR ?? ""), + Utils.getPostBytes(AppState().memberInformationList!.businessCardQr ?? ""), width: 129, height: 129, ), @@ -51,7 +51,7 @@ class BusinessCardDialog extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ - (AppState().memberInformationList!.eMPLOYEENAME ?? "").toText23(isBold: true).paddingOnly(top: 15), + (AppState().memberInformationList!.employeeNameEn ?? "").toText23(isBold: true).paddingOnly(top: 15), (AppState().memberInformationList!.getPositionName() ?? "").toText17( color: MyColors.grey57Color, ), @@ -61,7 +61,7 @@ class BusinessCardDialog extends StatelessWidget { children: [ const Icon(Icons.email, size: 17.5, color: MyColors.grey3AColor).paddingOnly(right: 11.5), ("${LocaleKeys.email.tr()}: ").toText18(color: MyColors.grey57Color), - (AppState().memberInformationList!.eMPLOYEEEMAILADDRESS ?? "").toText18(), + (AppState().memberInformationList!.employeEEmailAddress ?? "").toText18(), ], ), Row( diff --git a/lib/ui/dialogs/id/employee_digital_id_dialog.dart b/lib/ui/dialogs/id/employee_digital_id_dialog.dart index 63a5e29..6c94e6d 100644 --- a/lib/ui/dialogs/id/employee_digital_id_dialog.dart +++ b/lib/ui/dialogs/id/employee_digital_id_dialog.dart @@ -36,20 +36,20 @@ class EmployeeDigitialIdDialog extends StatelessWidget { boxShadow: [BoxShadow(color: Colors.white60, blurRadius: 10, spreadRadius: 10)], ), clipBehavior: Clip.antiAlias, - child: (AppState().memberInformationList!.eMPLOYEEIMAGE == null || AppState().memberInformationList!.eMPLOYEEIMAGE!.isEmpty) + child: (AppState().memberInformationList!.employeEImage == null || AppState().memberInformationList!.employeEImage!.isEmpty) ? Container( color: Colors.grey[300], child: SvgPicture.asset("assets/images/user.svg"), ) : Image.memory( Utils.dataFromBase64String( - AppState().memberInformationList!.eMPLOYEEIMAGE ?? "", + AppState().memberInformationList!.employeEImage ?? "", ), fit: BoxFit.cover, ), ), 16.width, - (AppState().memberInformationList!.eMPLOYEENUMBER ?? "").toText20(), + (AppState().memberInformationList!.employeENumber ?? "").toText20(), ], ), Container( @@ -59,14 +59,14 @@ class EmployeeDigitialIdDialog extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ 12.height, - (AppState().memberInformationList!.eMPLOYEEDISPLAYNAME ?? "").toText16(), + (AppState().memberInformationList!.employeeDisplayNameEn ?? "").toText16(), 4.height, - (showJobName(AppState().memberInformationList!.pOSITIONNAME ?? "")).toText12(isBold: false), + (showJobName(AppState().memberInformationList!.positioNName ?? "")).toText12(isBold: false), ], ), ), Image.memory( - Utils.getPostBytes(AppState().memberInformationList!.employeeQR ?? ""), + Utils.getPostBytes(AppState().memberInformationList!.employeeQr ?? ""), width: 160, height: 160, ), diff --git a/lib/ui/landing/dashboard_screen.dart b/lib/ui/landing/dashboard_screen.dart index 4448ad1..8c75d56 100644 --- a/lib/ui/landing/dashboard_screen.dart +++ b/lib/ui/landing/dashboard_screen.dart @@ -245,7 +245,7 @@ class _DashboardScreenState extends State with WidgetsBindingOb children: [ Image.memory( Utils.dataFromBase64String( - AppState().memberInformationList!.eMPLOYEEIMAGE ?? "", + AppState().memberInformationList!.employeEImage ?? "", ), errorBuilder: (BuildContext context, Object error, StackTrace? stackTrace) { return SvgPicture.asset( @@ -297,7 +297,7 @@ class _DashboardScreenState extends State with WidgetsBindingOb crossAxisAlignment: CrossAxisAlignment.start, children: [ LocaleKeys.welcomeBack.tr().toText14(color: MyColors.grey77Color), - (AppState().memberInformationList!.eMPLOYEENAME ?? "").toText24(isBold: true), + (AppState().memberInformationList!.employeeNameEn ?? "").toText24(isBold: true), 16.height, Row( children: [ diff --git a/lib/ui/landing/itg/change_itg_ad_password_screen.dart b/lib/ui/landing/itg/change_itg_ad_password_screen.dart index cc84f96..66404e5 100644 --- a/lib/ui/landing/itg/change_itg_ad_password_screen.dart +++ b/lib/ui/landing/itg/change_itg_ad_password_screen.dart @@ -38,7 +38,7 @@ class _ChangeItgAdPasswordScreenState extends State { void setNewPassword() async { Utils.showLoading(context); try { - GenericResponseModel response = await LoginApiClient().changePasswordFromActiveDirectorySession(password.text, AppState().memberInformationList!.eMPLOYEEEMAILADDRESS!); + GenericResponseModel response = await LoginApiClient().changePasswordFromActiveDirectorySession(password.text, AppState().memberInformationList!.employeEEmailAddress!); Utils.hideLoading(context); if ((response.messageStatus ?? 0) == 1) { Utils.showToast(LocaleKeys.passwordChangedSuccessfully.tr()); diff --git a/lib/ui/landing/widget/app_drawer.dart b/lib/ui/landing/widget/app_drawer.dart index 4721470..d5f7cac 100644 --- a/lib/ui/landing/widget/app_drawer.dart +++ b/lib/ui/landing/widget/app_drawer.dart @@ -56,7 +56,7 @@ class _AppDrawerState extends State { ).paddingOnly(left: 4, right: 14), Row( children: [ - AppState().memberInformationList!.eMPLOYEEIMAGE == null + AppState().memberInformationList!.employeEImage == null ? SvgPicture.asset( "assets/images/user.svg", height: 52, @@ -64,14 +64,14 @@ class _AppDrawerState extends State { ) : CircleAvatar( radius: 52 / 2, - backgroundImage: MemoryImage(Utils.dataFromBase64String(AppState().memberInformationList!.eMPLOYEEIMAGE!)), + backgroundImage: MemoryImage(Utils.dataFromBase64String(AppState().memberInformationList!.employeEImage!)), backgroundColor: Colors.black, ), 12.width, Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - AppState().memberInformationList!.eMPLOYEENAME!.toText18(isBold: true), + AppState().memberInformationList!.employeeNameEn!.toText18(isBold: true), AppState().memberInformationList!.getPositionName().toText14(weight: FontWeight.w500), ], ).expanded @@ -165,6 +165,7 @@ class _AppDrawerState extends State { void postLanguageChange(BuildContext context) { var obj = AppState().postParamsObject; obj?.languageID = EasyLocalization.of(context)?.locale.languageCode == "ar" ? 1 : 2; + obj?.language = EasyLocalization.of(context)?.locale.languageCode == "ar" ? "ar" : "us"; AppState().setPostParamsModel(obj!); Navigator.pop(context); widget.onLanguageChange(); diff --git a/lib/ui/login/login_screen.dart b/lib/ui/login/login_screen.dart index 087d74c..c86590a 100644 --- a/lib/ui/login/login_screen.dart +++ b/lib/ui/login/login_screen.dart @@ -183,7 +183,7 @@ class _LoginScreenState extends State { // print("firebaseToken:$firebaseToken"); this.username.text = username; this.password.text = password; - _autoLogin = true; + // _autoLogin = true; } } diff --git a/lib/ui/login/verify_last_login_screen.dart b/lib/ui/login/verify_last_login_screen.dart index 8c673e4..42fe23e 100644 --- a/lib/ui/login/verify_last_login_screen.dart +++ b/lib/ui/login/verify_last_login_screen.dart @@ -20,6 +20,7 @@ import 'package:mohem_flutter_app/models/basic_member_information_model.dart'; import 'package:mohem_flutter_app/models/check_activation_code_model.dart'; import 'package:mohem_flutter_app/models/generic_response_model.dart'; import 'package:mohem_flutter_app/models/get_mobile_login_info_list_model.dart'; +import 'package:mohem_flutter_app/models/privilege_list_model.dart'; import 'package:mohem_flutter_app/ui/dialogs/id/business_card_dialog.dart'; import 'package:mohem_flutter_app/ui/dialogs/id/employee_digital_id_dialog.dart'; import 'package:mohem_flutter_app/widgets/button/default_button.dart'; @@ -119,7 +120,7 @@ class _VerifyLastLoginScreenState extends State { crossAxisAlignment: CrossAxisAlignment.center, children: [ LocaleKeys.lastLoginDetails.tr().toText16(), - DateUtil.formatDateToDate(DateUtil.convertStringToDate(mobileLoginInfoListModel!.editedOn!), false).toText12(), + DateUtil.formatDateToDate(DateTime.parse(mobileLoginInfoListModel!.editedOn!), false).toText12(), ], ), Row( @@ -129,7 +130,7 @@ class _VerifyLastLoginScreenState extends State { LocaleKeys.verificationType.tr().toText10(color: MyColors.grey57Color), getVerificationType(mobileLoginInfoListModel!.loginType!).toText12(), Expanded(child: SizedBox()), - DateUtil.formatDateToTime(DateUtil.convertStringToDate(mobileLoginInfoListModel!.editedOn!)).toText12(), + DateUtil.formatDateToTimeLang(DateTime.parse(mobileLoginInfoListModel!.editedOn!), false).toText12(), ], ) ], @@ -375,18 +376,18 @@ class _VerifyLastLoginScreenState extends State { await LoginApiClient().insertMobileLoginInfoNEW( AppState().memberLoginList?.pEmailAddress ?? "", genericResponseModel?.pSessionId ?? 0, - genericResponseModel?.memberInformationList![0].eMPLOYEENAME ?? "", + genericResponseModel?.memberInformationList![0].employeeNameEn ?? "", _flag, AppState().memberLoginList?.pMobileNumber ?? "", AppState().getUserName!, AppState().getIsHuawei ? AppState().getHuaweiPushToken : mobileLoginInfoListModel!.deviceToken!, Platform.isAndroid ? "android" : "ios"); AppState().setMemberInformationListModel = genericResponseModel!.memberInformationList?.first; - AppState().setPrivilegeListModel = genericResponseModel.privilegeList ?? []; - if (genericResponseModel.errorMessage != null) { - Utils.showToast(genericResponseModel.errorMessage ?? ""); - // Navigator.pop(context); - } + AppState().setPrivilegeListModel = (genericResponseModel.privilegeList ?? []).cast(); + // if (genericResponseModel.errorMessage != null) { + // Utils.showToast(genericResponseModel.errorMessage ?? ""); + // // Navigator.pop(context); + // } Utils.hideLoading(context); Navigator.pop(context); Navigator.pushNamedAndRemoveUntil(context, AppRoutes.dashboard, (Route route) => false); diff --git a/lib/ui/login/verify_login_screen.dart b/lib/ui/login/verify_login_screen.dart index 48815bb..c796cc4 100644 --- a/lib/ui/login/verify_login_screen.dart +++ b/lib/ui/login/verify_login_screen.dart @@ -629,19 +629,19 @@ class _VerifyLoginScreenState extends State { await LoginApiClient().insertMobileLoginInfoNEW( AppState().memberLoginList?.pEmailAddress ?? "", genericResponseModel?.pSessionId ?? 0, - genericResponseModel?.memberInformationList![0].eMPLOYEENAME ?? "", + genericResponseModel?.memberInformationList![0].employeeNameEn ?? "", _flag, AppState().memberLoginList?.pMobileNumber ?? "", AppState().getUserName!, AppState().getIsHuawei ? AppState().getHuaweiPushToken : firebaseToken!, Platform.isAndroid ? "android" : "ios"); - if (genericResponseModel?.errorMessage != null) { - Utils.showToast(genericResponseModel?.errorMessage ?? ""); - } else { - AppState().setPrivilegeListModel = genericResponseModel!.privilegeList ?? []; + // if (genericResponseModel?.errorMessage != null) { + // Utils.showToast(genericResponseModel?.errorMessage ?? ""); + // } else { + AppState().setPrivilegeListModel = (genericResponseModel!.privilegeList ?? []).cast(); AppState().setMemberInformationListModel = genericResponseModel.memberInformationList?.first; MemberInformationListModel.saveToPrefs(genericResponseModel.memberInformationList ?? []); - PrivilegeListModel.saveToPrefs(genericResponseModel.privilegeList ?? []); + PrivilegeListModel.saveToPrefs(genericResponseModel.privilegeList!.cast()); AppState().setMohemmWifiSSID = genericResponseModel.mohemmWifiSsid; AppState().setMohemmWifiPassword = genericResponseModel.mohemmWifiPassword; AppState().setMohemmWifiPassword = genericResponseModel.mohemmWifiPassword; @@ -649,7 +649,7 @@ class _VerifyLoginScreenState extends State { Utils.saveStringFromPrefs(SharedPrefsConsts.password, AppState().password!); Utils.saveStringFromPrefs(SharedPrefsConsts.mohemmWifiSSID, genericResponseModel.mohemmWifiSsid!); Utils.saveStringFromPrefs(SharedPrefsConsts.mohemmWifiPassword, genericResponseModel.mohemmWifiPassword!); - } + // } Utils.hideLoading(context); Navigator.pop(context); Navigator.pushNamedAndRemoveUntil(context, AppRoutes.dashboard, (Route route) => false); diff --git a/lib/ui/marathon/marathon_provider.dart b/lib/ui/marathon/marathon_provider.dart index ce8476b..46fd61e 100644 --- a/lib/ui/marathon/marathon_provider.dart +++ b/lib/ui/marathon/marathon_provider.dart @@ -330,7 +330,7 @@ class MarathonProvider extends ChangeNotifier { selectedWinners = await MarathonApiClient().getSelectedWinner(marathonId: marathonDetailModel.id!); if (selectedWinners != null) { selectedWinners!.removeWhere((WinnerModel element) { - if (element.employeeId == AppState().memberInformationList!.eMPLOYEENUMBER) { + if (element.employeeId == AppState().memberInformationList!.employeENumber) { iAmWinner = true; return true; } else { diff --git a/lib/ui/marathon/marathon_screen.dart b/lib/ui/marathon/marathon_screen.dart index a39b998..9a07e8d 100644 --- a/lib/ui/marathon/marathon_screen.dart +++ b/lib/ui/marathon/marathon_screen.dart @@ -81,14 +81,14 @@ class MarathonScreen extends StatelessWidget { displayLocalizedContent( isPhoneLangArabic: AppState().isArabic(context), selectedLanguage: provider.demoMarathonDetailModel.selectedLanguage!, - arabicContent: AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEAr ?? "", - englishContent: AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEEn ?? "", + arabicContent: AppState().memberInformationList!.employeENameAr ?? "", + englishContent: AppState().memberInformationList!.employeeDisplayNameEn ?? "", ).toText22( color: MyColors.grey3AColor, isCentered: true, ), 8.height, - AppState().memberInformationList!.eMPLOYEENUMBER!.toText22(color: MyColors.grey57Color), + AppState().memberInformationList!.employeENumber!.toText22(color: MyColors.grey57Color), ], ), 60.height, @@ -173,14 +173,14 @@ class MarathonScreen extends StatelessWidget { displayLocalizedContent( isPhoneLangArabic: AppState().isArabic(context), selectedLanguage: provider.marathonDetailModel.selectedLanguage ?? 0, - arabicContent: AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEAr ?? "", - englishContent: AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEEn ?? "", + arabicContent: AppState().memberInformationList!.employeEDisplayNameAr ?? "", + englishContent: AppState().memberInformationList!.employeeDisplayNameEn ?? "", ).toText24( color: MyColors.grey3AColor, isCentered: true, ), 8.height, - AppState().memberInformationList!.eMPLOYEENUMBER!.toText22(color: MyColors.grey57Color), + AppState().memberInformationList!.employeENumber!.toText22(color: MyColors.grey57Color), ], ) : const SizedBox(), @@ -276,10 +276,10 @@ class MarathonScreen extends StatelessWidget { displayLocalizedContent( isPhoneLangArabic: AppState().isArabic(context), selectedLanguage: (!AppState().getIsDemoMarathon ? provider.marathonDetailModel.selectedLanguage : provider.demoMarathonDetailModel.selectedLanguage) ?? 0, - arabicContent: AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEAr ?? "", - englishContent: AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEEn ?? "", + arabicContent: AppState().memberInformationList!.employeEDisplayNameAr ?? "", + englishContent: AppState().memberInformationList!.employeeDisplayNameEn ?? "", ).toText17(isBold: true, color: MyColors.white), - AppState().memberInformationList!.eMPLOYEENUMBER!.toText17(isBold: true, color: MyColors.white), + AppState().memberInformationList!.employeENumber!.toText17(isBold: true, color: MyColors.white), ], ), ).paddingOnly(left: 20, right: 20, top: 12, bottom: 10); diff --git a/lib/ui/profile/personal_info.dart b/lib/ui/profile/personal_info.dart index 84e45ff..c3dd9a2 100644 --- a/lib/ui/profile/personal_info.dart +++ b/lib/ui/profile/personal_info.dart @@ -29,19 +29,19 @@ class PersonalInfo extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.start, children: [ LocaleKeys.category.tr().toText13(color: MyColors.lightGrayColor), - (memberInformationList.eMPLOYMENTCATEGORYMEANING ?? "").toText16(), + (memberInformationList.employmenTCategoryMeaning ?? "").toText16(), 12.height, LocaleKeys.address.tr().toText13(color: MyColors.lightGrayColor), - (memberInformationList.lOCATIONNAME ?? "").toText16(), + (memberInformationList.locatioNName ?? "").toText16(), 12.height, LocaleKeys.phoneNumber.tr().toText13(color: MyColors.lightGrayColor), - (memberInformationList.eMPLOYEEMOBILENUMBER ?? "").toText16(), + (memberInformationList.employeEMobileNumber ?? "").toText16(), 12.height, LocaleKeys.businessGroup.tr().toText13(color: MyColors.lightGrayColor), - (memberInformationList.bUSINESSGROUPNAME ?? "").toText16(), + (memberInformationList.jobNameEn ?? "").toText16(), 12.height, LocaleKeys.Payroll.tr().toText13(color: MyColors.lightGrayColor), - (memberInformationList.pAYROLLNAME ?? "").toText16(), + (memberInformationList.payrolLName ?? "").toText16(), ], ).objectContainerView(center: false).paddingAll(21), ], diff --git a/lib/ui/profile/profile_screen.dart b/lib/ui/profile/profile_screen.dart index 6060cbf..b381e4f 100644 --- a/lib/ui/profile/profile_screen.dart +++ b/lib/ui/profile/profile_screen.dart @@ -46,14 +46,14 @@ class _ProfileScreenState extends State { backgroundColor: const Color(0xffefefef), body: Stack( children: [ - memberInformationList!.eMPLOYEEIMAGE != null + memberInformationList!.employeEImage != null ? Container( height: 300, margin: const EdgeInsets.only(top: 50), decoration: BoxDecoration( image: DecorationImage( image: MemoryImage( - Utils.dataFromBase64String(memberInformationList.eMPLOYEEIMAGE!), + Utils.dataFromBase64String(memberInformationList.employeEImage!), ), fit: BoxFit.cover), ), @@ -157,7 +157,7 @@ class _ProfileScreenState extends State { Utils.hideLoading(context); if (empImageUpdteResp['P_RETURN_STATUS'] == 'S') { setState(() { - memberInformationList.eMPLOYEEIMAGE = image; + memberInformationList.employeEImage = image; }); } } diff --git a/lib/ui/profile/widgets/profile_info.dart b/lib/ui/profile/widgets/profile_info.dart index 73635d8..b3e4541 100644 --- a/lib/ui/profile/widgets/profile_info.dart +++ b/lib/ui/profile/widgets/profile_info.dart @@ -29,17 +29,17 @@ class ProfileInFo extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ 16.height, - memberInfo.eMPLOYEENAME!.toText22(), - ("${memberInfo.eMPLOYEENUMBER!} | ${memberInfo.getPositionName()}").toText13(color: MyColors.grey80Color), - memberInfo.eMPLOYEEEMAILADDRESS!.toText13(), + memberInfo.employeeDisplayNameEn!.toText22(), + ("${memberInfo.employeENumber!} | ${memberInfo.getPositionName()}").toText13(color: MyColors.grey80Color), + memberInfo.employeEEmailAddress!.toText13(), 12.height, const Divider(height: 8, thickness: 8, color: MyColors.lightGreyEFColor), 12.height, LocaleKeys.completingYear.tr().toText11(), Row(children: [ - appreciationTime(LocaleKeys.year.tr(), memberInfo.sERVICEYEARS.toString()), - appreciationTime(LocaleKeys.month.tr(), memberInfo.sERVICEMONTHS.toString()), - appreciationTime(LocaleKeys.day.tr(), memberInfo.sERVICEDAYS.toString()), + appreciationTime(LocaleKeys.year.tr(), memberInfo.servicEYears.toString()), + appreciationTime(LocaleKeys.month.tr(), memberInfo.servicEMonths.toString()), + appreciationTime(LocaleKeys.day.tr(), memberInfo.servicEDays.toString()), ]).paddingOnly(bottom: 12, top: 12), const Divider(height: 8, thickness: 8, color: MyColors.lightGreyEFColor), // Column( diff --git a/lib/ui/profile/widgets/profile_panel.dart b/lib/ui/profile/widgets/profile_panel.dart index 3440cc9..43732cc 100644 --- a/lib/ui/profile/widgets/profile_panel.dart +++ b/lib/ui/profile/widgets/profile_panel.dart @@ -42,7 +42,7 @@ class ProfilePanel extends StatelessWidget { ); } - Widget profileImage() => memberInformationList.eMPLOYEEIMAGE == null + Widget profileImage() => memberInformationList.employeEImage == null ? SvgPicture.asset( "assets/images/user.svg", height: 68, @@ -50,7 +50,7 @@ class ProfilePanel extends StatelessWidget { ) : ClipOval( child: Image.memory( - Utils.dataFromBase64String(memberInformationList.eMPLOYEEIMAGE!), + Utils.dataFromBase64String(memberInformationList.employeEImage!), width: 68, height: 68, fit: BoxFit.fill, diff --git a/lib/ui/screens/items_for_sale/fragments/my_posted_ads_fragment.dart b/lib/ui/screens/items_for_sale/fragments/my_posted_ads_fragment.dart index ffce243..9a4d08e 100644 --- a/lib/ui/screens/items_for_sale/fragments/my_posted_ads_fragment.dart +++ b/lib/ui/screens/items_for_sale/fragments/my_posted_ads_fragment.dart @@ -175,8 +175,8 @@ class _MyPostedAdsFragmentState extends State { void updateItemForSale(EmployeePostedAds employeePostedAds) async { Utils.showLoading(context); - String? empNum = AppState().memberInformationList?.eMPLOYEENUMBER; - String? empMobNum = AppState().memberInformationList?.eMPLOYEEMOBILENUMBER; + String? empNum = AppState().memberInformationList?.employeENumber; + String? empMobNum = AppState().memberInformationList?.employeEMobileNumber; String? loginTokenID = AppState().postParamsObject?.logInTokenID; String? tokenID = AppState().postParamsObject?.tokenID; diff --git a/lib/ui/work_list/itg_detail_screen.dart b/lib/ui/work_list/itg_detail_screen.dart index aaef95f..1c81f19 100644 --- a/lib/ui/work_list/itg_detail_screen.dart +++ b/lib/ui/work_list/itg_detail_screen.dart @@ -71,7 +71,7 @@ class _ItgDetailScreenState extends State { void getItgData() async { try { Utils.showLoading(context); - itgRequest = await WorkListApiClient().getITGFormDetails(requestDetails!.requestType!, requestDetails!.iD, requestDetails!.itemID, AppState().memberInformationList?.eMPLOYEENUMBER ?? ""); + itgRequest = await WorkListApiClient().getITGFormDetails(requestDetails!.requestType!, requestDetails!.iD, requestDetails!.itemID, AppState().memberInformationList?.employeENumber ?? ""); allowedActionList = itgRequest?.allowedActions ?? []; if (allowedActionList.isNotEmpty) { isCloseAvailable = allowedActionList.any((element) => element.action == "CLOSE"); @@ -419,10 +419,10 @@ class _ItgDetailScreenState extends State { performAction("Answer"); break; case "ReportGenerated": - performDataCorrectionORReportGeneratedAction(requestDetails!.requestType!, requestDetails!.iD!, requestDetails!.itemID!, AppState().memberInformationList?.eMPLOYEENUMBER ?? ""); + performDataCorrectionORReportGeneratedAction(requestDetails!.requestType!, requestDetails!.iD!, requestDetails!.itemID!, AppState().memberInformationList?.employeENumber ?? ""); break; case "DataCorrected": - performDataCorrectionORReportGeneratedAction(requestDetails!.requestType!, requestDetails!.iD!, requestDetails!.itemID!, AppState().memberInformationList?.eMPLOYEENUMBER ?? ""); + performDataCorrectionORReportGeneratedAction(requestDetails!.requestType!, requestDetails!.iD!, requestDetails!.itemID!, AppState().memberInformationList?.employeENumber ?? ""); break; } setState(() { @@ -498,13 +498,13 @@ class _ItgDetailScreenState extends State { actionMode: actionMode, onTap: (note) { if (actionMode == "APPROVED") { - performApproveAction(requestDetails!.requestType!, requestDetails!.iD, requestDetails!.itemID, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", note); + performApproveAction(requestDetails!.requestType!, requestDetails!.iD, requestDetails!.itemID, AppState().memberInformationList?.employeENumber ?? "", note); } else if (actionMode == "Answer") { - performAnswerAction(requestDetails!.requestType!, requestDetails!.iD, requestDetails!.itemID, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", note); + performAnswerAction(requestDetails!.requestType!, requestDetails!.iD, requestDetails!.itemID, AppState().memberInformationList?.employeENumber ?? "", note); } else if (actionMode == "Generate") { - performGenerateQrAction(requestDetails!.requestType!, requestDetails!.iD, requestDetails!.itemID, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", note); + performGenerateQrAction(requestDetails!.requestType!, requestDetails!.iD, requestDetails!.itemID, AppState().memberInformationList?.employeENumber ?? "", note); } else { - performRejectAction(requestDetails!.requestType!, requestDetails!.iD, requestDetails!.itemID, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", note); + performRejectAction(requestDetails!.requestType!, requestDetails!.iD, requestDetails!.itemID, AppState().memberInformationList?.employeENumber ?? "", note); } }, ), @@ -515,7 +515,7 @@ class _ItgDetailScreenState extends State { try { Utils.showLoading(context); ITGRequest? itgRequest = - await WorkListApiClient().requestActionITGRequest(requestType, taskId, itemId, employeeNumber, "", comments, AppState().memberInformationList?.eMPLOYEEEMAILADDRESS ?? ""); + await WorkListApiClient().requestActionITGRequest(requestType, taskId, itemId, employeeNumber, "", comments, AppState().memberInformationList?.employeEEmailAddress ?? ""); Utils.hideLoading(context); Utils.showToast(LocaleKeys.yourChangeHasBeenSavedSuccessfully.tr()); // Navigator.pop(context, "delegate_reload"); @@ -647,7 +647,7 @@ class _ItgDetailScreenState extends State { isAttachmentLoaded = false; itgFormAttachmentsList.clear(); List _itgFormAttachmentsList = - (await WorkListApiClient().getITGFormAttachments(requestDetails!.requestType!, requestDetails!.iD, requestDetails!.itemID, AppState().memberInformationList?.eMPLOYEENUMBER ?? ""))!; + (await WorkListApiClient().getITGFormAttachments(requestDetails!.requestType!, requestDetails!.iD, requestDetails!.itemID, AppState().memberInformationList?.employeENumber ?? ""))!; if (!isAttachmentLoaded) { itgFormAttachmentsList = _itgFormAttachmentsList; } diff --git a/lib/ui/work_list/itg_fragments/approval_level_fragment.dart b/lib/ui/work_list/itg_fragments/approval_level_fragment.dart index 09e44d4..fec2b2f 100644 --- a/lib/ui/work_list/itg_fragments/approval_level_fragment.dart +++ b/lib/ui/work_list/itg_fragments/approval_level_fragment.dart @@ -111,7 +111,7 @@ class ApprovalLevelfragment extends StatelessWidget { }).expanded, Container(width: 1, height: 30, color: MyColors.lightGreyEFColor), LocaleKeys.delegate.tr().toText12(color: MyColors.gradiantEndColor).center.paddingOnly(top: 6, bottom: 6).onPress(() { - if (history.employeeID == AppState().memberInformationList?.eMPLOYEENUMBER) { + if (history.employeeID == AppState().memberInformationList?.employeENumber) { showMyBottomSheet(context, callBackFunc: voidCallback, child: DelegateSheet( diff --git a/lib/ui/work_list/sheets/selected_item_sheet.dart b/lib/ui/work_list/sheets/selected_item_sheet.dart index 2efe88b..ba2df58 100644 --- a/lib/ui/work_list/sheets/selected_item_sheet.dart +++ b/lib/ui/work_list/sheets/selected_item_sheet.dart @@ -176,9 +176,9 @@ class SelectedItemSheet extends StatelessWidget { if (replacementList != null) empID = replacementList!.userName; try { memberInformationListModel = await WorkListApiClient().getUserInformation(-999, empID!); - if (actionHistoryList != null) empID = actionHistoryList!.eMPLOYEEIMAGE = memberInformationListModel!.eMPLOYEEIMAGE ?? AppState().getBase64ImageEmp; - if (favoriteReplacements != null) empID = favoriteReplacements!.employeeImage = memberInformationListModel!.eMPLOYEEIMAGE ?? AppState().getBase64ImageEmp; - if (replacementList != null) empID = replacementList!.employeeImage = memberInformationListModel!.eMPLOYEEIMAGE ?? AppState().getBase64ImageEmp; + if (actionHistoryList != null) empID = actionHistoryList!.eMPLOYEEIMAGE = memberInformationListModel!.employeEImage ?? AppState().getBase64ImageEmp; + if (favoriteReplacements != null) empID = favoriteReplacements!.employeeImage = memberInformationListModel!.employeEImage ?? AppState().getBase64ImageEmp; + if (replacementList != null) empID = replacementList!.employeeImage = memberInformationListModel!.employeEImage ?? AppState().getBase64ImageEmp; (context as Element).markNeedsBuild(); } catch (ex) { Utils.handleException(ex, context, null); @@ -211,13 +211,13 @@ class SelectedItemSheet extends StatelessWidget { try { var requestDetails = AppState().requestAllList![AppState().itgWorkListIndex!]; if (apiMode == "Delegate") { - await WorkListApiClient().delegateITGRequest(requestDetails.requestType!, requestDetails.iD, requestDetails.itemID, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", + await WorkListApiClient().delegateITGRequest(requestDetails.requestType!, requestDetails.iD, requestDetails.itemID, AppState().memberInformationList?.employeENumber ?? "", isITGRequest ? favoriteReplacements!.userName! : actionHistoryList!.uSERNAME!, comment); } else if (apiMode == "RequestInformation") { - await WorkListApiClient().informationITGRequest(requestDetails.requestType!, requestDetails.iD, requestDetails.itemID, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", + await WorkListApiClient().informationITGRequest(requestDetails.requestType!, requestDetails.iD, requestDetails.itemID, AppState().memberInformationList?.employeENumber ?? "", isITGRequest ? favoriteReplacements!.userName! : actionHistoryList!.uSERNAME!, comment); } else if (apiMode == "Answer") { - await WorkListApiClient().answerITGRequest(requestDetails.requestType!, requestDetails.iD, requestDetails.itemID, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", + await WorkListApiClient().answerITGRequest(requestDetails.requestType!, requestDetails.iD, requestDetails.itemID, AppState().memberInformationList?.employeENumber ?? "", isITGRequest ? favoriteReplacements!.userName! : actionHistoryList!.uSERNAME!, comment); } Utils.hideLoading(context); diff --git a/lib/ui/work_list/sheets/selected_itg_item_sheet.dart b/lib/ui/work_list/sheets/selected_itg_item_sheet.dart index db10717..71dfe23 100644 --- a/lib/ui/work_list/sheets/selected_itg_item_sheet.dart +++ b/lib/ui/work_list/sheets/selected_itg_item_sheet.dart @@ -122,13 +122,13 @@ class SelectedItgItemSheet extends StatelessWidget { var requestDetails = AppState().requestAllList![AppState().itgWorkListIndex!]; if (apiMode == "Delegate") { await WorkListApiClient() - .delegateITGRequest(requestDetails.requestType!, requestDetails.iD, requestDetails.itemID, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", wfHistory.employeeID!, comment); + .delegateITGRequest(requestDetails.requestType!, requestDetails.iD, requestDetails.itemID, AppState().memberInformationList?.employeENumber ?? "", wfHistory.employeeID!, comment); } else if (apiMode == "RequestInformation") { await WorkListApiClient() - .informationITGRequest(requestDetails.requestType!, requestDetails.iD, requestDetails.itemID, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", wfHistory.employeeID!, comment); + .informationITGRequest(requestDetails.requestType!, requestDetails.iD, requestDetails.itemID, AppState().memberInformationList?.employeENumber ?? "", wfHistory.employeeID!, comment); } else if (apiMode == "Answer") { await WorkListApiClient() - .answerITGRequest(requestDetails.requestType!, requestDetails.iD, requestDetails.itemID, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", wfHistory.employeeID!, comment); + .answerITGRequest(requestDetails.requestType!, requestDetails.iD, requestDetails.itemID, AppState().memberInformationList?.employeENumber ?? "", wfHistory.employeeID!, comment); } Utils.hideLoading(context); Navigator.pop(context, "delegate_reload"); diff --git a/lib/ui/work_list/worklist_fragments/actions_fragment.dart b/lib/ui/work_list/worklist_fragments/actions_fragment.dart index 29d5328..6b12232 100644 --- a/lib/ui/work_list/worklist_fragments/actions_fragment.dart +++ b/lib/ui/work_list/worklist_fragments/actions_fragment.dart @@ -124,7 +124,7 @@ class ActionsFragment extends StatelessWidget { }).expanded, Container(width: 1, height: 30, color: MyColors.lightGreyEFColor), LocaleKeys.delegate.tr().toText12(color: MyColors.gradiantEndColor).center.paddingOnly(top: 6, bottom: 6).onPress(() { - if (actionHistory.uSERNAME == AppState().memberInformationList?.eMPLOYEENUMBER) { + if (actionHistory.uSERNAME == AppState().memberInformationList?.employeENumber) { showMyBottomSheet(context, callBackFunc: voidCallback, child: DelegateSheet( diff --git a/lib/ui/work_list/worklist_fragments/detail_fragment.dart b/lib/ui/work_list/worklist_fragments/detail_fragment.dart index 03e2272..6442a1a 100644 --- a/lib/ui/work_list/worklist_fragments/detail_fragment.dart +++ b/lib/ui/work_list/worklist_fragments/detail_fragment.dart @@ -52,21 +52,21 @@ class _DetailFragmentState extends State { mainAxisSize: MainAxisSize.min, children: [ ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.employeeNumber.tr(), widget.memberInformationListModel!.eMPLOYEENUMBER ?? ""), + ItemDetailViewCol(LocaleKeys.employeeNumber.tr(), widget.memberInformationListModel!.employeENumber ?? ""), ItemDetailViewCol( - LocaleKeys.employeeName.tr(), (AppState().isArabic(context) ? widget.memberInformationListModel!.eMPLOYEENAMEAr : widget.memberInformationListModel!.eMPLOYEENAMEEn) ?? ""), + LocaleKeys.employeeName.tr(), (AppState().isArabic(context) ? widget.memberInformationListModel!.employeENameAr : widget.memberInformationListModel!.employeeNameEn) ?? ""), ), ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.jobTitle.tr(), makePositionName(widget.memberInformationListModel!.pOSITIONNAME ?? "")), - ItemDetailViewCol(LocaleKeys.grade.tr(), widget.memberInformationListModel!.gRADENAME ?? ""), + ItemDetailViewCol(LocaleKeys.jobTitle.tr(), makePositionName(widget.memberInformationListModel!.positioNName ?? "")), + ItemDetailViewCol(LocaleKeys.grade.tr(), widget.memberInformationListModel!.gradEName ?? ""), ), ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.jobCategory.tr(), makePositionName(widget.memberInformationListModel!.pOSITIONNAME ?? "")), - ItemDetailViewCol(LocaleKeys.category.tr(), widget.memberInformationListModel!.eMPLOYMENTCATEGORYMEANING ?? ""), + ItemDetailViewCol(LocaleKeys.jobCategory.tr(), makePositionName(widget.memberInformationListModel!.positioNName ?? "")), + ItemDetailViewCol(LocaleKeys.category.tr(), widget.memberInformationListModel!.employmenTCategoryMeaning ?? ""), ), ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.employeeEmailAddress.tr(), widget.memberInformationListModel!.eMPLOYEEEMAILADDRESS ?? ""), - ItemDetailViewCol(LocaleKeys.payrollBranch.tr(), widget.memberInformationListModel!.pAYROLLNAME ?? ""), + ItemDetailViewCol(LocaleKeys.employeeEmailAddress.tr(), widget.memberInformationListModel!.employeEEmailAddress ?? ""), + ItemDetailViewCol(LocaleKeys.payrollBranch.tr(), widget.memberInformationListModel!.payrolLName ?? ""), isItLast: true, ), ],