Dashboard API's 1.0
							parent
							
								
									ab25a98a9e
								
							
						
					
					
						commit
						baa7182655
					
				| @ -0,0 +1,69 @@ | ||||
| import 'dart:async'; | ||||
| 
 | ||||
| import 'package:mohem_flutter_app/app_state/app_state.dart'; | ||||
| import 'package:mohem_flutter_app/classes/consts.dart'; | ||||
| import 'package:mohem_flutter_app/models/basic_member_information_model.dart'; | ||||
| import 'package:mohem_flutter_app/models/check_mobile_app_version_model.dart'; | ||||
| import 'package:mohem_flutter_app/models/dashboard/itg_forms_model.dart'; | ||||
| import 'package:mohem_flutter_app/models/generic_response_model.dart'; | ||||
| import 'package:mohem_flutter_app/models/member_login_list_model.dart'; | ||||
| 
 | ||||
| import 'api_client.dart'; | ||||
| 
 | ||||
| class DashbaordApiClient { | ||||
|   static final DashbaordApiClient _instance = DashbaordApiClient._internal(); | ||||
| 
 | ||||
|   DashbaordApiClient._internal(); | ||||
| 
 | ||||
|   factory DashbaordApiClient() => _instance; | ||||
| 
 | ||||
|   Future<GenericResponseModel?> getAttendanceTracking() async { | ||||
|     String url = "${ApiConsts.erpRest}GET_Attendance_Tracking"; | ||||
|     Map<String, dynamic> postParams = {}; | ||||
|     postParams.addAll(AppState().postParamsJson); | ||||
|     return await ApiClient().postJsonForObject((json) { | ||||
|       GenericResponseModel responseData = GenericResponseModel.fromJson(json); | ||||
|       return responseData; | ||||
|     }, url, postParams); | ||||
|   } | ||||
| 
 | ||||
|   Future<GenericResponseModel?> getOpenNotifications() async { | ||||
|     String url = "${ApiConsts.erpRest}GET_OPEN_NOTIFICATIONS"; | ||||
|     Map<String, dynamic> postParams = {}; | ||||
|     postParams.addAll(AppState().postParamsJson); | ||||
|     return await ApiClient().postJsonForObject((json) { | ||||
|       GenericResponseModel responseData = GenericResponseModel.fromJson(json); | ||||
|       return responseData; | ||||
|     }, url, postParams); | ||||
|   } | ||||
| 
 | ||||
|   Future<ItgFormsModel?> getItgFormsPendingTask() async { | ||||
|     String url = "${ApiConsts.cocRest}ITGFormsPendingTasks"; | ||||
|     Map<String, dynamic> postParams = {}; | ||||
|     postParams.addAll(AppState().postParamsJson); | ||||
|     return await ApiClient().postJsonForObject((json) { | ||||
|       ItgFormsModel responseData = ItgFormsModel.fromJson(json); | ||||
|       return responseData; | ||||
|     }, url, postParams); | ||||
|   } | ||||
| 
 | ||||
|   Future<GenericResponseModel?> getAccrualBalances() async { | ||||
|     String url = "${ApiConsts.erpRest}GET_ACCRUAL_BALANCES"; | ||||
|     Map<String, dynamic> postParams = {"P_EFFECTIVE_DATE": "1/30/2022"}; | ||||
|     postParams.addAll(AppState().postParamsJson); | ||||
|     return await ApiClient().postJsonForObject((json) { | ||||
|       GenericResponseModel responseData = GenericResponseModel.fromJson(json); | ||||
|       return responseData; | ||||
|     }, url, postParams); | ||||
|   } | ||||
| 
 | ||||
|   Future<GenericResponseModel?> getOpenMissingSwipes() async { | ||||
|     String url = "${ApiConsts.erpRest}GET_OPEN_MISSING_SWIPES"; | ||||
|     Map<String, dynamic> postParams = {}; | ||||
|     postParams.addAll(AppState().postParamsJson); | ||||
|     return await ApiClient().postJsonForObject((json) { | ||||
|       GenericResponseModel responseData = GenericResponseModel.fromJson(json); | ||||
|       return responseData; | ||||
|     }, url, postParams); | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,39 @@ | ||||
| class GetAccrualBalancesList { | ||||
|   GetAccrualBalancesList({ | ||||
|     this.accrualNetEntitlement, | ||||
|     this.accrualUsedEntitlement, | ||||
|     this.accrualYearlyEntitlement, | ||||
|     this.accuralPlanName, | ||||
|     this.endDate, | ||||
|     this.lastAccrualDate, | ||||
|     this.startDate, | ||||
|   }); | ||||
| 
 | ||||
|   double? accrualNetEntitlement; | ||||
|   int? accrualUsedEntitlement; | ||||
|   dynamic accrualYearlyEntitlement; | ||||
|   String? accuralPlanName; | ||||
|   String? endDate; | ||||
|   String? lastAccrualDate; | ||||
|   String? startDate; | ||||
| 
 | ||||
|   factory GetAccrualBalancesList.fromJson(Map<String, dynamic> json) => GetAccrualBalancesList( | ||||
|     accrualNetEntitlement: json["ACCRUAL_NET_ENTITLEMENT"] == null ? null : json["ACCRUAL_NET_ENTITLEMENT"].toDouble(), | ||||
|     accrualUsedEntitlement: json["ACCRUAL_USED_ENTITLEMENT"] == null ? null : json["ACCRUAL_USED_ENTITLEMENT"], | ||||
|     accrualYearlyEntitlement: json["ACCRUAL_YEARLY_ENTITLEMENT"], | ||||
|     accuralPlanName: json["ACCURAL_PLAN_NAME"] == null ? null : json["ACCURAL_PLAN_NAME"], | ||||
|     endDate: json["END_DATE"] == null ? null : json["END_DATE"], | ||||
|     lastAccrualDate: json["LAST_ACCRUAL_DATE"] == null ? null : json["LAST_ACCRUAL_DATE"], | ||||
|     startDate: json["START_DATE"] == null ? null : json["START_DATE"], | ||||
|   ); | ||||
| 
 | ||||
|   Map<String, dynamic> toJson() => { | ||||
|     "ACCRUAL_NET_ENTITLEMENT": accrualNetEntitlement == null ? null : accrualNetEntitlement, | ||||
|     "ACCRUAL_USED_ENTITLEMENT": accrualUsedEntitlement == null ? null : accrualUsedEntitlement, | ||||
|     "ACCRUAL_YEARLY_ENTITLEMENT": accrualYearlyEntitlement, | ||||
|     "ACCURAL_PLAN_NAME": accuralPlanName == null ? null : accuralPlanName, | ||||
|     "END_DATE": endDate == null ? null : endDate, | ||||
|     "LAST_ACCRUAL_DATE": lastAccrualDate == null ? null : lastAccrualDate, | ||||
|     "START_DATE": startDate == null ? null : startDate, | ||||
|   }; | ||||
| } | ||||
| @ -0,0 +1,55 @@ | ||||
| class GetAttendanceTrackingList { | ||||
|   GetAttendanceTrackingList({ | ||||
|     this.pBreakHours, | ||||
|     this.pLateInHours, | ||||
|     this.pRemainingHours, | ||||
|     this.pReturnMsg, | ||||
|     this.pReturnStatus, | ||||
|     this.pScheduledHours, | ||||
|     this.pShtName, | ||||
|     this.pSpentHours, | ||||
|     this.pSwipesExemptedFlag, | ||||
|     this.pSwipeIn, | ||||
|     this.pSwipeOut, | ||||
|   }); | ||||
| 
 | ||||
|   String? pBreakHours; | ||||
|   String? pLateInHours; | ||||
|   String? pRemainingHours; | ||||
|   String? pReturnMsg; | ||||
|   String? pReturnStatus; | ||||
|   String? pScheduledHours; | ||||
|   String? pShtName; | ||||
|   String? pSpentHours; | ||||
|   String? pSwipesExemptedFlag; | ||||
|   dynamic pSwipeIn; | ||||
|   dynamic pSwipeOut; | ||||
| 
 | ||||
|   factory GetAttendanceTrackingList.fromMap(Map<String, dynamic> json) => GetAttendanceTrackingList( | ||||
|         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"], | ||||
|       ); | ||||
| 
 | ||||
|   Map<String, dynamic> 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, | ||||
|       }; | ||||
| } | ||||
| @ -0,0 +1,24 @@ | ||||
| 
 | ||||
| class GetOpenMissingSwipesList { | ||||
|   GetOpenMissingSwipesList({ | ||||
|     this.pOpenMissingSwipes, | ||||
|     this.pReturnMsg, | ||||
|     this.pReturnStatus, | ||||
|   }); | ||||
| 
 | ||||
|   int? pOpenMissingSwipes; | ||||
|   String? pReturnMsg; | ||||
|   String? pReturnStatus; | ||||
| 
 | ||||
|   factory GetOpenMissingSwipesList.fromJson(Map<String, dynamic> json) => GetOpenMissingSwipesList( | ||||
|     pOpenMissingSwipes: json["P_OPEN_MISSING_SWIPES"] == null ? null : json["P_OPEN_MISSING_SWIPES"], | ||||
|     pReturnMsg: json["P_RETURN_MSG"] == null ? null : json["P_RETURN_MSG"], | ||||
|     pReturnStatus: json["P_RETURN_STATUS"] == null ? null : json["P_RETURN_STATUS"], | ||||
|   ); | ||||
| 
 | ||||
|   Map<String, dynamic> toJson() => { | ||||
|     "P_OPEN_MISSING_SWIPES": pOpenMissingSwipes == null ? null : pOpenMissingSwipes, | ||||
|     "P_RETURN_MSG": pReturnMsg == null ? null : pReturnMsg, | ||||
|     "P_RETURN_STATUS": pReturnStatus == null ? null : pReturnStatus, | ||||
|   }; | ||||
| } | ||||
| @ -0,0 +1,23 @@ | ||||
| class GetOpenNotificationsList { | ||||
|   GetOpenNotificationsList({ | ||||
|     this.itemType, | ||||
|     this.itemTypeDisplayName, | ||||
|     this.openNtfNumber, | ||||
|   }); | ||||
| 
 | ||||
|   String? itemType; | ||||
|   String? itemTypeDisplayName; | ||||
|   int? openNtfNumber; | ||||
| 
 | ||||
|   factory GetOpenNotificationsList.fromMap(Map<String, dynamic> 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"], | ||||
|       ); | ||||
| 
 | ||||
|   Map<String, dynamic> toMap() => { | ||||
|         "ITEM_TYPE": itemType == null ? null : itemType, | ||||
|         "ITEM_TYPE_DISPLAY_NAME": itemTypeDisplayName == null ? null : itemTypeDisplayName, | ||||
|         "OPEN_NTF_NUMBER": openNtfNumber == null ? null : openNtfNumber, | ||||
|       }; | ||||
| } | ||||
| @ -0,0 +1,189 @@ | ||||
| // To parse this JSON data, do | ||||
| // | ||||
| //     final itgFormsModel = itgFormsModelFromMap(jsonString); | ||||
| 
 | ||||
| import 'dart:convert'; | ||||
| 
 | ||||
| ItgFormsModel itgFormsModelFromMap(String str) => ItgFormsModel.fromJson(json.decode(str)); | ||||
| 
 | ||||
| String itgFormsModelToMap(ItgFormsModel data) => json.encode(data.toMap()); | ||||
| 
 | ||||
| class ItgFormsModel { | ||||
|   ItgFormsModel({ | ||||
|     this.date, | ||||
|     this.languageId, | ||||
|     this.serviceName, | ||||
|     this.time, | ||||
|     this.androidLink, | ||||
|     this.authenticationTokenId, | ||||
|     this.data, | ||||
|     this.dataw, | ||||
|     this.dietType, | ||||
|     this.dietTypeId, | ||||
|     this.errorCode, | ||||
|     this.errorEndUserMessage, | ||||
|     this.errorEndUserMessageN, | ||||
|     this.errorMessage, | ||||
|     this.errorType, | ||||
|     this.foodCategory, | ||||
|     this.iosLink, | ||||
|     this.isAuthenticated, | ||||
|     this.mealOrderStatus, | ||||
|     this.mealType, | ||||
|     this.messageStatus, | ||||
|     this.numberOfResultRecords, | ||||
|     this.patientBlodType, | ||||
|     this.successMsg, | ||||
|     this.successMsgN, | ||||
|     this.vidaUpdatedResponse, | ||||
|     this.itgRequest, | ||||
|     this.itgFormAttachmentsList, | ||||
|     this.message, | ||||
|     this.mohemmItgDepartmentSectionsList, | ||||
|     this.mohemmItgProjectDepartmentsList, | ||||
|     this.mohemmItgResponseItem, | ||||
|     this.mohemmItgSectionTopicsList, | ||||
|     this.mohemmItgTicketDetailsList, | ||||
|     this.mohemmItgTicketTransactionsList, | ||||
|     this.mohemmItgTicketsByEmployeeList, | ||||
|     this.mohemmItgProjectsList, | ||||
|     this.mohemmItgTicketTypesList, | ||||
|     this.referenceNumber, | ||||
|     this.requestType, | ||||
|     this.totalCount, | ||||
|     this.statuseCode, | ||||
|   }); | ||||
| 
 | ||||
|   dynamic date; | ||||
|   int? languageId; | ||||
|   int? serviceName; | ||||
|   dynamic time; | ||||
|   dynamic androidLink; | ||||
|   dynamic authenticationTokenId; | ||||
|   dynamic data; | ||||
|   bool? dataw; | ||||
|   int? dietType; | ||||
|   int? dietTypeId; | ||||
|   dynamic errorCode; | ||||
|   dynamic errorEndUserMessage; | ||||
|   dynamic errorEndUserMessageN; | ||||
|   dynamic errorMessage; | ||||
|   int? errorType; | ||||
|   int? foodCategory; | ||||
|   dynamic iosLink; | ||||
|   bool? isAuthenticated; | ||||
|   int? mealOrderStatus; | ||||
|   int? mealType; | ||||
|   int? messageStatus; | ||||
|   int? numberOfResultRecords; | ||||
|   dynamic patientBlodType; | ||||
|   String? successMsg; | ||||
|   dynamic successMsgN; | ||||
|   dynamic vidaUpdatedResponse; | ||||
|   dynamic itgRequest; | ||||
|   dynamic itgFormAttachmentsList; | ||||
|   String? message; | ||||
|   dynamic mohemmItgDepartmentSectionsList; | ||||
|   dynamic mohemmItgProjectDepartmentsList; | ||||
|   dynamic mohemmItgResponseItem; | ||||
|   dynamic mohemmItgSectionTopicsList; | ||||
|   dynamic mohemmItgTicketDetailsList; | ||||
|   dynamic mohemmItgTicketTransactionsList; | ||||
|   dynamic mohemmItgTicketsByEmployeeList; | ||||
|   dynamic mohemmItgProjectsList; | ||||
|   dynamic mohemmItgTicketTypesList; | ||||
|   DateTime? referenceNumber; | ||||
|   dynamic requestType; | ||||
|   int? totalCount; | ||||
|   int? statuseCode; | ||||
| 
 | ||||
|   factory ItgFormsModel.fromJson(Map<String, dynamic> json) => ItgFormsModel( | ||||
|     date: json["Date"], | ||||
|     languageId: json["LanguageID"] == null ? null : json["LanguageID"], | ||||
|     serviceName: json["ServiceName"] == null ? null : json["ServiceName"], | ||||
|     time: json["Time"], | ||||
|     androidLink: json["AndroidLink"], | ||||
|     authenticationTokenId: json["AuthenticationTokenID"], | ||||
|     data: json["Data"], | ||||
|     dataw: json["Dataw"] == null ? null : json["Dataw"], | ||||
|     dietType: json["DietType"] == null ? null : json["DietType"], | ||||
|     dietTypeId: json["DietTypeID"] == null ? null : json["DietTypeID"], | ||||
|     errorCode: json["ErrorCode"], | ||||
|     errorEndUserMessage: json["ErrorEndUserMessage"], | ||||
|     errorEndUserMessageN: json["ErrorEndUserMessageN"], | ||||
|     errorMessage: json["ErrorMessage"], | ||||
|     errorType: json["ErrorType"] == null ? null : json["ErrorType"], | ||||
|     foodCategory: json["FoodCategory"] == null ? null : json["FoodCategory"], | ||||
|     iosLink: json["IOSLink"], | ||||
|     isAuthenticated: json["IsAuthenticated"] == null ? null : json["IsAuthenticated"], | ||||
|     mealOrderStatus: json["MealOrderStatus"] == null ? null : json["MealOrderStatus"], | ||||
|     mealType: json["MealType"] == null ? null : json["MealType"], | ||||
|     messageStatus: json["MessageStatus"] == null ? null : json["MessageStatus"], | ||||
|     numberOfResultRecords: json["NumberOfResultRecords"] == null ? null : json["NumberOfResultRecords"], | ||||
|     patientBlodType: json["PatientBlodType"], | ||||
|     successMsg: json["SuccessMsg"] == null ? null : json["SuccessMsg"], | ||||
|     successMsgN: json["SuccessMsgN"], | ||||
|     vidaUpdatedResponse: json["VidaUpdatedResponse"], | ||||
|     itgRequest: json["ITGRequest"], | ||||
|     itgFormAttachmentsList: json["Itg_FormAttachmentsList"], | ||||
|     message: json["Message"] == null ? null : json["Message"], | ||||
|     mohemmItgDepartmentSectionsList: json["Mohemm_ITG_DepartmentSectionsList"], | ||||
|     mohemmItgProjectDepartmentsList: json["Mohemm_ITG_ProjectDepartmentsList"], | ||||
|     mohemmItgResponseItem: json["Mohemm_ITG_ResponseItem"], | ||||
|     mohemmItgSectionTopicsList: json["Mohemm_ITG_SectionTopicsList"], | ||||
|     mohemmItgTicketDetailsList: json["Mohemm_ITG_TicketDetailsList"], | ||||
|     mohemmItgTicketTransactionsList: json["Mohemm_ITG_TicketTransactionsList"], | ||||
|     mohemmItgTicketsByEmployeeList: json["Mohemm_ITG_TicketsByEmployeeList"], | ||||
|     mohemmItgProjectsList: json["Mohemm_Itg_ProjectsList"], | ||||
|     mohemmItgTicketTypesList: json["Mohemm_Itg_TicketTypesList"], | ||||
|     referenceNumber: json["ReferenceNumber"] == null ? null : DateTime.parse(json["ReferenceNumber"]), | ||||
|     requestType: json["RequestType"], | ||||
|     totalCount: json["TotalCount"] == null ? null : json["TotalCount"], | ||||
|     statuseCode: json["statuseCode"] == null ? null : json["statuseCode"], | ||||
|   ); | ||||
| 
 | ||||
|   Map<String, dynamic> toMap() => { | ||||
|     "Date": date, | ||||
|     "LanguageID": languageId == null ? null : languageId, | ||||
|     "ServiceName": serviceName == null ? null : serviceName, | ||||
|     "Time": time, | ||||
|     "AndroidLink": androidLink, | ||||
|     "AuthenticationTokenID": authenticationTokenId, | ||||
|     "Data": data, | ||||
|     "Dataw": dataw == null ? null : dataw, | ||||
|     "DietType": dietType == null ? null : dietType, | ||||
|     "DietTypeID": dietTypeId == null ? null : dietTypeId, | ||||
|     "ErrorCode": errorCode, | ||||
|     "ErrorEndUserMessage": errorEndUserMessage, | ||||
|     "ErrorEndUserMessageN": errorEndUserMessageN, | ||||
|     "ErrorMessage": errorMessage, | ||||
|     "ErrorType": errorType == null ? null : errorType, | ||||
|     "FoodCategory": foodCategory == null ? null : foodCategory, | ||||
|     "IOSLink": iosLink, | ||||
|     "IsAuthenticated": isAuthenticated == null ? null : isAuthenticated, | ||||
|     "MealOrderStatus": mealOrderStatus == null ? null : mealOrderStatus, | ||||
|     "MealType": mealType == null ? null : mealType, | ||||
|     "MessageStatus": messageStatus == null ? null : messageStatus, | ||||
|     "NumberOfResultRecords": numberOfResultRecords == null ? null : numberOfResultRecords, | ||||
|     "PatientBlodType": patientBlodType, | ||||
|     "SuccessMsg": successMsg == null ? null : successMsg, | ||||
|     "SuccessMsgN": successMsgN, | ||||
|     "VidaUpdatedResponse": vidaUpdatedResponse, | ||||
|     "ITGRequest": itgRequest, | ||||
|     "Itg_FormAttachmentsList": itgFormAttachmentsList, | ||||
|     "Message": message == null ? null : message, | ||||
|     "Mohemm_ITG_DepartmentSectionsList": mohemmItgDepartmentSectionsList, | ||||
|     "Mohemm_ITG_ProjectDepartmentsList": mohemmItgProjectDepartmentsList, | ||||
|     "Mohemm_ITG_ResponseItem": mohemmItgResponseItem, | ||||
|     "Mohemm_ITG_SectionTopicsList": mohemmItgSectionTopicsList, | ||||
|     "Mohemm_ITG_TicketDetailsList": mohemmItgTicketDetailsList, | ||||
|     "Mohemm_ITG_TicketTransactionsList": mohemmItgTicketTransactionsList, | ||||
|     "Mohemm_ITG_TicketsByEmployeeList": mohemmItgTicketsByEmployeeList, | ||||
|     "Mohemm_Itg_ProjectsList": mohemmItgProjectsList, | ||||
|     "Mohemm_Itg_TicketTypesList": mohemmItgTicketTypesList, | ||||
|     "ReferenceNumber": referenceNumber == null ? null : referenceNumber!.toIso8601String(), | ||||
|     "RequestType": requestType, | ||||
|     "TotalCount": totalCount == null ? null : totalCount, | ||||
|     "statuseCode": statuseCode == null ? null : statuseCode, | ||||
|   }; | ||||
| } | ||||
					Loading…
					
					
				
		Reference in New Issue