bug fixes and added contact approval process api

master_merge
Sultan khan 4 hours ago
parent 5852320906
commit 83df2f3626

@ -843,7 +843,7 @@
"travelEssentials": "أساسيات السفر", "travelEssentials": "أساسيات السفر",
"fromEverydayCareToYourNextAdventure": "من العناية اليومية إلى مغامرتك القادمة.", "fromEverydayCareToYourNextAdventure": "من العناية اليومية إلى مغامرتك القادمة.",
"homeAndKitchen": "المنزل والمطبخ", "homeAndKitchen": "المنزل والمطبخ",
"curatedPicksForYourHomeAndKitchen": "اختيارات مميزة لمنزلك ومطبخك.", "curatedPicksForYourHomeAndKitchen": "اختيارات مميزة لأنشطتك.",
"discover": "اكتشف", "discover": "اكتشف",
"saved": "المحفوظات", "saved": "المحفوظات",
"myFamily": "عائلتي", "myFamily": "عائلتي",
@ -886,5 +886,6 @@
"initializingChatPleaseWait": "يرجى الانتظار، جاري تهيئة المحادثة...", "initializingChatPleaseWait": "يرجى الانتظار، جاري تهيئة المحادثة...",
"am": "ص", "am": "ص",
"pm": "م", "pm": "م",
"carServices": "خدمات السيارات" "carServices": "خدمات السيارات",
"activities": "أنشطة"
} }

@ -845,7 +845,7 @@
"carServices": "Car Services", "carServices": "Car Services",
"fromEverydayCareToYourNextAdventure": "From everyday care to your next adventure.", "fromEverydayCareToYourNextAdventure": "From everyday care to your next adventure.",
"homeAndKitchen": "Home & Kitchen", "homeAndKitchen": "Home & Kitchen",
"curatedPicksForYourHomeAndKitchen": "Curated picks for your home and kitchen.", "curatedPicksForYourHomeAndKitchen": "Curated picks for your activities.",
"discover": "Discover", "discover": "Discover",
"saved": "Saved", "saved": "Saved",
"myFamily": "My Family", "myFamily": "My Family",
@ -890,6 +890,7 @@
"typeAMessage": "Type a message..", "typeAMessage": "Type a message..",
"initializingChatPleaseWait": "Please wait, initializing chat...", "initializingChatPleaseWait": "Please wait, initializing chat...",
"am": "AM", "am": "AM",
"pm": "PM" "pm": "PM",
"activities": "Activities"
} }

@ -482,6 +482,38 @@ class ProfileApiClient {
); );
} }
Future<dynamic> startContactApprovalProcess(
String action,
String comments,
String itemKey,
int transactionId, {
dynamic relationId,
}) async {
String url = "${ApiConsts.erpRest}START_CONTACT_APPROVAL_PROCESS";
Map<String, dynamic> postParams = {
"P_SELECTED_RESP_ID": -999,
"P_MENU_TYPE": "E",
"P_FUNCTION_NAME": "HR_PERINFO_SS",
"P_ACTION_MODE": action,
"P_ACTION": action,
"P_COMMENTS": comments,
"P_ITEM_KEY": itemKey,
"P_TRANSACTION_ID": transactionId,
};
if (relationId != null) {
postParams["P_CONTACT_RELATIONSHIP_ID"] = relationId;
}
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject(
(json) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
return responseData.startContactApprovalProcessList ?? responseData;
},
url,
postParams,
);
}
Future<List<GetPerformanceAppraisalList>> getPerformanceAppraisal() async { Future<List<GetPerformanceAppraisalList>> getPerformanceAppraisal() async {
String url = "${ApiConsts.erpRest}GET_Performance_Appraisal"; String url = "${ApiConsts.erpRest}GET_Performance_Appraisal";
Map<String, dynamic> postParams = {}; Map<String, dynamic> postParams = {};

@ -9,6 +9,7 @@ import 'package:flutter_svg/flutter_svg.dart';
import 'package:google_api_availability/google_api_availability.dart'; import 'package:google_api_availability/google_api_availability.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart'; import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/colors.dart'; import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/classes/consts.dart';
import 'package:mohem_flutter_app/config/routes.dart'; import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/exceptions/api_exception.dart'; import 'package:mohem_flutter_app/exceptions/api_exception.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart'; import 'package:mohem_flutter_app/extensions/int_extensions.dart';
@ -125,27 +126,31 @@ class Utils {
lower.contains("grant request") || lower.contains("grant request") ||
lower.contains("grant was found") || lower.contains("grant was found") ||
lower.contains("grant_request") || lower.contains("grant_request") ||
lower.contains("authorized to access") ||
lower.contains("not authorized") ||
lower.contains("e4:") || lower.contains("e4:") ||
lower.contains("e4 -") || lower.contains("e4 -") ||
lower.contains("e4 :")) { lower.contains("e4 :")) {
return true; return true;
} }
if ((lower.contains("authorized to access") || lower.contains("not authorized")) &&
(lower.contains("mazaya") || lower.contains("program"))) {
return true;
}
if (str.contains("طلب منح") || if (str.contains("طلب منح") ||
str.contains("منح نشط") || str.contains("منح نشط") ||
str.contains("لا يوجد طلب منح") || str.contains("لا يوجد طلب منح") ||
str.contains("تم إلغاء وصول مزايا") || str.contains("تم إلغاء وصول مزايا") ||
str.contains("إلغاء مزايا") || str.contains("إلغاء مزايا")) {
str.contains("غير مصرح لك بالوصول") || return true;
str.contains("غير مصرح")) { }
if ((str.contains("غير مصرح لك بالوصول") || str.contains("غير مصرح")) &&
(str.contains("مزايا") || str.contains("برنامج"))) {
return true; return true;
} }
return false; return false;
} }
static void handleException(dynamic exception, cxt, Function(String)? onErrorMessage) { static void handleException(dynamic exception, cxt, Function(String)? onErrorMessage) {
if (isMazayaAccessRevoked(exception)) { if (ApiConsts.ISDependetLogin && isMazayaAccessRevoked(exception)) {
String depName = AppState().dependentName ?? ""; String depName = AppState().dependentName ?? "";
if (depName.isEmpty) { if (depName.isEmpty) {
depName = AppState().walaplusDepInfoModel?.pDependentName ?? ""; depName = AppState().walaplusDepInfoModel?.pDependentName ?? "";

@ -859,7 +859,7 @@ class CodegenLoader extends AssetLoader{
"travelEssentials": "أساسيات السفر", "travelEssentials": "أساسيات السفر",
"fromEverydayCareToYourNextAdventure": "من العناية اليومية إلى مغامرتك القادمة.", "fromEverydayCareToYourNextAdventure": "من العناية اليومية إلى مغامرتك القادمة.",
"homeAndKitchen": "المنزل والمطبخ", "homeAndKitchen": "المنزل والمطبخ",
"curatedPicksForYourHomeAndKitchen": "اختيارات مميزة لمنزلك ومطبخك.", "curatedPicksForYourHomeAndKitchen": "اختيارات مميزة لأنشطتك.",
"discover": "اكتشف", "discover": "اكتشف",
"saved": "المحفوظات", "saved": "المحفوظات",
"myFamily": "عائلتي", "myFamily": "عائلتي",
@ -898,7 +898,8 @@ class CodegenLoader extends AssetLoader{
"initializingChatPleaseWait": "يرجى الانتظار، جاري تهيئة المحادثة...", "initializingChatPleaseWait": "يرجى الانتظار، جاري تهيئة المحادثة...",
"am": "ص", "am": "ص",
"pm": "م", "pm": "م",
"carServices": "خدمات السيارات" "carServices": "خدمات السيارات",
"activities": "أنشطة"
}; };
static const Map<String,dynamic> _en_US = { static const Map<String,dynamic> _en_US = {
"mohemm": "Mohemm", "mohemm": "Mohemm",
@ -1743,7 +1744,7 @@ static const Map<String,dynamic> _en_US = {
"carServices": "Car Services", "carServices": "Car Services",
"fromEverydayCareToYourNextAdventure": "From everyday care to your next adventure.", "fromEverydayCareToYourNextAdventure": "From everyday care to your next adventure.",
"homeAndKitchen": "Home & Kitchen", "homeAndKitchen": "Home & Kitchen",
"curatedPicksForYourHomeAndKitchen": "Curated picks for your home and kitchen.", "curatedPicksForYourHomeAndKitchen": "Curated picks for your activities.",
"discover": "Discover", "discover": "Discover",
"saved": "Saved", "saved": "Saved",
"myFamily": "My Family", "myFamily": "My Family",
@ -1784,7 +1785,8 @@ static const Map<String,dynamic> _en_US = {
"typeAMessage": "Type a message..", "typeAMessage": "Type a message..",
"initializingChatPleaseWait": "Please wait, initializing chat...", "initializingChatPleaseWait": "Please wait, initializing chat...",
"am": "AM", "am": "AM",
"pm": "PM" "pm": "PM",
"activities": "Activities"
}; };
static const Map<String, Map<String,dynamic>> mapLocales = {"ar_SA": _ar_SA, "en_US": _en_US}; static const Map<String, Map<String,dynamic>> mapLocales = {"ar_SA": _ar_SA, "en_US": _en_US};
} }

@ -871,5 +871,6 @@ abstract class LocaleKeys {
static const am = 'am'; static const am = 'am';
static const pm = 'pm'; static const pm = 'pm';
static const carServices = 'carServices'; static const carServices = 'carServices';
static const activities = 'activities';
} }

@ -356,7 +356,7 @@ class GenericResponseModel {
StartAddressApprovalProcess? startAddressApprovalProcessList; StartAddressApprovalProcess? startAddressApprovalProcessList;
StartAddressApprovalProcess? startBasicDetApprProcessList; StartAddressApprovalProcess? startBasicDetApprProcessList;
String? startCeiApprovalProcess; String? startCeiApprovalProcess;
String? startContactApprovalProcessList; dynamic startContactApprovalProcessList;
StartEitApprovalProcess? startEitApprovalProcess; StartEitApprovalProcess? startEitApprovalProcess;
String? startHrApprovalProcessList; String? startHrApprovalProcessList;
StartPhoneApprovalProcess? startPhonesApprovalProcessList; StartPhoneApprovalProcess? startPhonesApprovalProcessList;

@ -67,8 +67,8 @@ class _MazayaDiscoverScreenState extends State<MazayaDiscoverScreen> {
// Fixed-category sections - to point a section at a different category, change only the id // Fixed-category sections - to point a section at a different category, change only the id
// passed here. Everything else (fetch, title, UI) reads off the _MazayaCategorySection object. // passed here. Everything else (fetch, title, UI) reads off the _MazayaCategorySection object.
final _MazayaCategorySection _travelSection = _MazayaCategorySection('p03'); final _MazayaCategorySection _travelSection = _MazayaCategorySection('p03');
final _MazayaCategorySection _homeKitchenSection = _MazayaCategorySection( final _MazayaCategorySection _activitiesSection = _MazayaCategorySection(
'Bw', 'jk0',
); );
@override @override
@ -99,7 +99,7 @@ class _MazayaDiscoverScreenState extends State<MazayaDiscoverScreen> {
if (mounted) { if (mounted) {
_fetchLatestOnMazaya(); _fetchLatestOnMazaya();
_fetchCategorySection(_travelSection); _fetchCategorySection(_travelSection);
_fetchCategorySection(_homeKitchenSection); _fetchCategorySection(_activitiesSection);
} }
} }
@ -305,7 +305,7 @@ class _MazayaDiscoverScreenState extends State<MazayaDiscoverScreen> {
setState(() => selectedCity = AppState().selectedMazayaCity); setState(() => selectedCity = AppState().selectedMazayaCity);
_fetchLatestOnMazaya(); _fetchLatestOnMazaya();
_fetchCategorySection(_travelSection); _fetchCategorySection(_travelSection);
_fetchCategorySection(_homeKitchenSection); _fetchCategorySection(_activitiesSection);
} }
} }
@ -325,7 +325,7 @@ class _MazayaDiscoverScreenState extends State<MazayaDiscoverScreen> {
setState(() => selectedCity = AppState().selectedMazayaCity); setState(() => selectedCity = AppState().selectedMazayaCity);
_fetchLatestOnMazaya(); _fetchLatestOnMazaya();
_fetchCategorySection(_travelSection); _fetchCategorySection(_travelSection);
_fetchCategorySection(_homeKitchenSection); _fetchCategorySection(_activitiesSection);
} }
} }
@ -349,7 +349,7 @@ class _MazayaDiscoverScreenState extends State<MazayaDiscoverScreen> {
setState(() => selectedCity = AppState().selectedMazayaCity); setState(() => selectedCity = AppState().selectedMazayaCity);
_fetchLatestOnMazaya(); _fetchLatestOnMazaya();
_fetchCategorySection(_travelSection); _fetchCategorySection(_travelSection);
_fetchCategorySection(_homeKitchenSection); _fetchCategorySection(_activitiesSection);
} }
} }
@ -358,7 +358,7 @@ class _MazayaDiscoverScreenState extends State<MazayaDiscoverScreen> {
_fetchCategories(), _fetchCategories(),
_fetchLatestOnMazaya(), _fetchLatestOnMazaya(),
_fetchCategorySection(_travelSection), _fetchCategorySection(_travelSection),
_fetchCategorySection(_homeKitchenSection), _fetchCategorySection(_activitiesSection),
_fetchExclusiveOffers(), _fetchExclusiveOffers(),
]); ]);
} }
@ -550,17 +550,17 @@ class _MazayaDiscoverScreenState extends State<MazayaDiscoverScreen> {
), ),
_buildBrandSection( _buildBrandSection(
title: _sectionTitle( title: _sectionTitle(
_homeKitchenSection, _activitiesSection,
LocaleKeys.homeAndKitchen.tr(), LocaleKeys.homeAndKitchen.tr(),
), ),
subtitle: LocaleKeys.curatedPicksForYourHomeAndKitchen.tr(), subtitle: LocaleKeys.curatedPicksForYourHomeAndKitchen.tr(),
isLoading: _homeKitchenSection.isLoading, isLoading: _activitiesSection.isLoading,
retailers: _homeKitchenSection.retailers, retailers: _activitiesSection.retailers,
backgroundColor: Colors.white, backgroundColor: Colors.white,
onSeeAll: onSeeAll:
() => _openRetailersGrid( () => _openRetailersGrid(
category: _categoryForSection( category: _categoryForSection(
_homeKitchenSection, _activitiesSection,
LocaleKeys.homeAndKitchen.tr(), LocaleKeys.homeAndKitchen.tr(),
), ),
), ),
@ -650,7 +650,7 @@ class _MazayaDiscoverScreenState extends State<MazayaDiscoverScreen> {
setState(() => selectedCity = newCity); setState(() => selectedCity = newCity);
_fetchLatestOnMazaya(); _fetchLatestOnMazaya();
_fetchCategorySection(_travelSection); _fetchCategorySection(_travelSection);
_fetchCategorySection(_homeKitchenSection); _fetchCategorySection(_activitiesSection);
}, },
), ),
child: Row( child: Row(

@ -114,11 +114,11 @@ class _RequestSubmitScreenState extends State<RequestSubmitScreen> {
params!.transactionId, params!.transactionId,
); );
} else if (params!.approvalFlag == 'family_member') { } else if (params!.approvalFlag == 'family_member') {
await ProfileApiClient().getApproves( await ProfileApiClient().startContactApprovalProcess(
"SUBMIT", "SUBMIT",
comments.text, comments.text,
params!.transactionId!.toInt(), params!.pItemId,
params!.pItemId.toString(), params!.transactionId,
); );
} else if (params!.approvalFlag == 'basicDetails') { } else if (params!.approvalFlag == 'basicDetails') {
await ProfileApiClient().startBasicDetailsApprovalProcess( await ProfileApiClient().startBasicDetailsApprovalProcess(

@ -1803,33 +1803,19 @@ class _AddDependentVerifyScreenState extends State<AddDependentVerifyScreen> {
SubmitContactTransactionList? submitResult = await ProfileApiClient().submitContactTransactionAddAndUpdate("ADD", null, valuesFinal); SubmitContactTransactionList? submitResult = await ProfileApiClient().submitContactTransactionAddAndUpdate("ADD", null, valuesFinal);
Utils.hideLoading(context);
if (submitResult != null && submitResult.pTRANSACTIONID != null) { if (submitResult != null && submitResult.pTRANSACTIONID != null) {
await Navigator.pushNamed( await ProfileApiClient().startContactApprovalProcess(
context, "SUBMIT",
AppRoutes.requestSubmitScreen, "",
arguments: RequestSubmitScreenParams( submitResult.pITEMKEY ?? '',
LocaleKeys.profile_familyDetails.tr(), submitResult.pTRANSACTIONID!,
submitResult.pTRANSACTIONID!,
submitResult.pITEMKEY ?? '',
'family_member',
),
); );
if (!AppState().cancelRequestTrancsection) {
Navigator.pop(context);
return;
}
Utils.showLoading(context);
await LeaveBalanceApiClient().cancelHrTransaction(submitResult.pTRANSACTIONID!);
Utils.hideLoading(context);
Navigator.pop(context);
} else {
Utils.showToast(LocaleKeys.dependentAddedSuccessfully.tr(), isSuccess: true);
Navigator.pop(context);
} }
if (!mounted) return;
Utils.hideLoading(context);
Utils.showToast(LocaleKeys.yourRequestHasBeenSubmittedForApprovals.tr(), isSuccess: true, longDuration: true);
Navigator.pop(context);
} catch (ex) { } catch (ex) {
Utils.hideLoading(context); Utils.hideLoading(context);
Utils.handleException(ex, context, null); Utils.handleException(ex, context, null);

@ -213,17 +213,17 @@ class SelectedItemSheet extends StatelessWidget {
if (apiMode == "Delegate") { 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 ?? "",
//commented the previous one because we need the replacement in both cases //commented the previous one because we need the replacement in both cases
favoriteReplacements !=null ? favoriteReplacements!.userName! : actionHistoryList!.uSERNAME!, comment); favoriteReplacements !=null ? favoriteReplacements!.userName! :actionHistoryList !=null? actionHistoryList!.uSERNAME!: userId!, comment);
// isITGRequest ? favoriteReplacements!.userName! : actionHistoryList!.uSERNAME!, comment); // isITGRequest ? favoriteReplacements!.userName! : actionHistoryList!.uSERNAME!, comment);
} else if (apiMode == "RequestInformation") { } 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 ?? "",
//commented the previous one because we need the replacement in both cases //commented the previous one because we need the replacement in both cases
// isITGRequest ? favoriteReplacements!.userName! : actionHistoryList!.uSERNAME!, comment); // isITGRequest ? favoriteReplacements!.userName! : actionHistoryList!.uSERNAME!, comment);
favoriteReplacements !=null ? favoriteReplacements!.userName! : actionHistoryList!.uSERNAME!, comment); favoriteReplacements !=null ? favoriteReplacements!.userName! :actionHistoryList !=null? actionHistoryList!.uSERNAME!: userId!, comment);
} else if (apiMode == "Answer") { } 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 ?? "",
//commented the previous one because we need the replacement in both cases //commented the previous one because we need the replacement in both cases
favoriteReplacements !=null ? favoriteReplacements!.userName! : actionHistoryList!.uSERNAME!, comment); favoriteReplacements !=null ? favoriteReplacements!.userName! :actionHistoryList !=null? actionHistoryList!.uSERNAME!: userId!, comment);
//favoriteReplacements!.userName! : actionHistoryList!.uSERNAME!, comment); //favoriteReplacements!.userName! : actionHistoryList!.uSERNAME!, comment);
} }
Utils.hideLoading(context); Utils.hideLoading(context);

Loading…
Cancel
Save