From 4ebba3900c9bbe728d874f380414019b96992194 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Wed, 3 Aug 2022 11:58:40 +0300 Subject: [PATCH 1/2] dashboard improvements, monthly attendance & vacation rule added. --- assets/langs/ar-SA.json | 1 + assets/langs/en-US.json | 1 + lib/config/routes.dart | 7 +++- lib/generated/codegen_loader.g.dart | 2 + lib/generated/locale_keys.g.dart | 1 + lib/provider/dashboard_provider_model.dart | 18 ++++----- ...ce.dart => monthly_attendance_screen.dart} | 10 ++--- lib/ui/attendance/vacation_rule_screen.dart | 36 +++++++++++++++++ lib/ui/landing/widget/services_widget.dart | 11 ++++- .../my_attendance/my_attendance_screen.dart | 40 ++++++------------- 10 files changed, 80 insertions(+), 47 deletions(-) rename lib/ui/attendance/{monthly_attendance.dart => monthly_attendance_screen.dart} (99%) create mode 100644 lib/ui/attendance/vacation_rule_screen.dart diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index d3ac0ba..816708e 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -30,6 +30,7 @@ "services": "خدمات", "viewAllServices": "عرض جميع الخدمات", "monthlyAttendance": "الحضور الشهري", + "vacationRule": "حكم اجازة", "workFromHome": "العمل من المنزل", "ticketRequest": "طلب تذكرة", "viewAllOffers": "مشاهدة جميع العروض", diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index 838d20f..84f0c0d 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -30,6 +30,7 @@ "services": "Services", "viewAllServices": "View All Services", "monthlyAttendance": "Monthly Attendance", + "vacationRule": "Vacation Rule", "workFromHome": "Work From Home", "ticketRequest": "Ticket Request", "viewAllOffers": "View All Offers", diff --git a/lib/config/routes.dart b/lib/config/routes.dart index c18219d..4d9c390 100644 --- a/lib/config/routes.dart +++ b/lib/config/routes.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; -import 'package:mohem_flutter_app/ui/attendance/monthly_attendance.dart'; +import 'package:mohem_flutter_app/ui/attendance/monthly_attendance_screen.dart'; +import 'package:mohem_flutter_app/ui/attendance/vacation_rule_screen.dart'; import 'package:mohem_flutter_app/ui/bottom_sheets/attendence_details_bottom_sheet.dart'; import 'package:mohem_flutter_app/ui/landing/dashboard_screen.dart'; import 'package:mohem_flutter_app/ui/landing/today_attendance_screen.dart'; @@ -70,6 +71,7 @@ class AppRoutes { //Attendance static const String attendance = "/attendance"; static const String monthlyAttendance = "/monthlyAttendance"; + static const String vacationRule = "/vacationRule"; //Bottom Sheet static const String attendanceDetailsBottomSheet = "/attendanceDetailsBottomSheet"; @@ -124,7 +126,8 @@ class AppRoutes { // addWorkFromHome: (context) => AddWorkFromHomeScreen(), profile: (context) => ProfileScreen(), //Attendance - monthlyAttendance: (context) => MonthlyAttendance(), + monthlyAttendance: (context) => MonthlyAttendanceScreen(), + vacationRule: (context) => VacationRuleScreen(), //Bottom Sheet attendanceDetailsBottomSheet: (context) => AttendenceDetailsBottomSheet(), diff --git a/lib/generated/codegen_loader.g.dart b/lib/generated/codegen_loader.g.dart index 5b433e7..3667ad5 100644 --- a/lib/generated/codegen_loader.g.dart +++ b/lib/generated/codegen_loader.g.dart @@ -46,6 +46,7 @@ class CodegenLoader extends AssetLoader{ "services": "خدمات", "viewAllServices": "عرض جميع الخدمات", "monthlyAttendance": "الحضور الشهري", + "vacationRule": "حكم اجازة", "workFromHome": "العمل من المنزل", "ticketRequest": "طلب تذكرة", "viewAllOffers": "مشاهدة جميع العروض", @@ -385,6 +386,7 @@ static const Map en_US = { "services": "Services", "viewAllServices": "View All Services", "monthlyAttendance": "Monthly Attendance", + "vacationRule": "Vacation Rule", "workFromHome": "Work From Home", "ticketRequest": "Ticket Request", "viewAllOffers": "View All Offers", diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index 6ff58d6..ca40afb 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -31,6 +31,7 @@ abstract class LocaleKeys { static const services = 'services'; static const viewAllServices = 'viewAllServices'; static const monthlyAttendance = 'monthlyAttendance'; + static const vacationRule = 'vacationRule'; static const workFromHome = 'workFromHome'; static const ticketRequest = 'ticketRequest'; static const viewAllOffers = 'viewAllOffers'; diff --git a/lib/provider/dashboard_provider_model.dart b/lib/provider/dashboard_provider_model.dart index a78fd67..511fc03 100644 --- a/lib/provider/dashboard_provider_model.dart +++ b/lib/provider/dashboard_provider_model.dart @@ -1,9 +1,11 @@ import 'dart:convert'; +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:mohem_flutter_app/api/dashboard_api_client.dart'; import 'package:mohem_flutter_app/classes/utils.dart'; +import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; import 'package:mohem_flutter_app/main.dart'; import 'package:mohem_flutter_app/models/dashboard/get_attendance_tracking_list_model.dart'; import 'package:mohem_flutter_app/models/dashboard/get_open_notifications_list.dart'; @@ -159,7 +161,11 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin { try { GenericResponseModel? genericResponseModel = await DashboardApiClient().getGetMenuEntries(); getMenuEntriesList = genericResponseModel!.getMenuEntriesList; - homeMenus = parseMenues(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())); + } isServicesMenusLoading = false; notifyListeners(); } catch (ex) { @@ -169,21 +175,13 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin { } } - List parseMenues(List getMenuEntriesList) { + List parseMenus(List getMenuEntriesList) { List menus = []; for (int i = 0; i < getMenuEntriesList.length; i++) { if (getMenuEntriesList[i].parentMenuName!.isEmpty) { menus.add(Menus(getMenuEntriesList[i], getMenuEntriesList.where((element) => getMenuEntriesList[i].menuName == element.parentMenuName).toList())); } } - - // Verify Menus by printing in log - // for(int i=0;i { +class _MonthlyAttendanceScreenState extends State { bool isPresent = false; bool isAbsent = false; bool isMissing = false; diff --git a/lib/ui/attendance/vacation_rule_screen.dart b/lib/ui/attendance/vacation_rule_screen.dart new file mode 100644 index 0000000..e1f8745 --- /dev/null +++ b/lib/ui/attendance/vacation_rule_screen.dart @@ -0,0 +1,36 @@ +import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter/material.dart'; +import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; +import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; + +class VacationRuleScreen extends StatefulWidget { + VacationRuleScreen({Key? key}) : super(key: key); + + @override + _VacationRuleScreenState createState() { + return _VacationRuleScreenState(); + } +} + +class _VacationRuleScreenState extends State { + @override + void initState() { + super.initState(); + } + + @override + void dispose() { + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.white, + appBar: AppBarWidget( + context, + title: LocaleKeys.vacationRule.tr(), + ), + ); + } +} diff --git a/lib/ui/landing/widget/services_widget.dart b/lib/ui/landing/widget/services_widget.dart index 9500ac4..e99205b 100644 --- a/lib/ui/landing/widget/services_widget.dart +++ b/lib/ui/landing/widget/services_widget.dart @@ -18,9 +18,9 @@ class ServicesWidget extends StatelessWidget { List namesT = [LocaleKeys.monthlyAttendance.tr(), LocaleKeys.workFromHome.tr(), LocaleKeys.ticketRequest.tr(), LocaleKeys.monthlyAttendance.tr()]; List iconT = [ "assets/images/monthly_attendance.svg", - "assets/images/dynamic_screens.svg", + "assets/images/monthly_attendance.svg", + "assets/images/ticket_request.svg", "assets/images/ticket_request.svg", - "assets/images/dynamic_screens.svg", "assets/images/dynamic_screens.svg", "assets/images/dynamic_screens.svg", "assets/images/dynamic_screens.svg", @@ -109,6 +109,13 @@ class ServicesWidget extends StatelessWidget { void handleOnPress(context, GetMenuEntriesList menuEntry) { var pro = Provider.of(context, listen: false); + if (menuEntry.requestType == "MONTHLY_ATTENDANCE") { + Navigator.pushNamed(context, AppRoutes.monthlyAttendance); + return; + } else if (menuEntry.requestType == "VACATION_RULE") { + Navigator.pushNamed(context, AppRoutes.vacationRule); + return; + } List menuList = pro.getMenuEntriesList?.where((element) => element.parentMenuName == menuEntry.menuName && element.menuEntryType == "FUNCTION").toList() ?? []; menuEntry.icon = ""; print(menuEntry.toJson()); diff --git a/lib/ui/my_attendance/my_attendance_screen.dart b/lib/ui/my_attendance/my_attendance_screen.dart index cfa8eee..207e2c7 100644 --- a/lib/ui/my_attendance/my_attendance_screen.dart +++ b/lib/ui/my_attendance/my_attendance_screen.dart @@ -27,34 +27,18 @@ class MyAttendanceScreen extends StatelessWidget { title: LocaleKeys.myAttendance.tr(), ), body: SizedBox( - width: double.infinity, - height: double.infinity, - child: list.isEmpty - ? Utils.getNoDataWidget(context) - : Column( - children: [ - // commenting this because missing wipe coming as duplicate in the screen - itemView( - "assets/images/pdf.svg", - LocaleKeys.myAttendance.tr(), - ).onPress(() { - Navigator.pushNamed(context, AppRoutes.monthlyAttendance, arguments: DynamicListViewParams(LocaleKeys.missingSwipes.tr(), "HMG_OTL_MISSING_SWIPE_EIT_SS")); - }).paddingOnly(left: 21, right: 21), - 12.height, - ListView.separated( - padding: const EdgeInsets.all(21), - itemBuilder: (cxt, index) => itemView( - "assets/images/pdf.svg", - //LocaleKeys.missingSwipes.tr(), - list[index].prompt!, - ).onPress(() { - Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(list[index].prompt!, list[index].functionName!)); - }), - separatorBuilder: (cxt, index) => 12.height, - itemCount: list.length) - .expanded - ], - )), + width: double.infinity, + height: double.infinity, + child: list.isEmpty + ? Utils.getNoDataWidget(context) + : ListView.separated( + padding: const EdgeInsets.all(21), + itemBuilder: (cxt, index) => itemView("assets/images/pdf.svg", list[index].prompt!).onPress(() { + Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(list[index].prompt!, list[index].functionName!)); + }), + separatorBuilder: (cxt, index) => 12.height, + itemCount: list.length), + ), ); } From 0d812cf266a3b594044ac65067b33c790e93d32b Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Thu, 4 Aug 2022 11:09:12 +0300 Subject: [PATCH 2/2] Vacation rule added. --- assets/langs/ar-SA.json | 37 +++--- assets/langs/en-US.json | 35 ++--- ...art => monthly_attendance_api_client.dart} | 0 lib/api/vacation_rule_api_client.dart | 78 +++++++++++ lib/config/routes.dart | 6 +- lib/generated/locale_keys.g.dart | 3 + lib/models/generic_response_model.dart | 118 ++++++++++++----- ...et_item_type_notifications_list_model.dart | 28 ++++ ...notification_reassign_mode_list_model.dart | 22 ++++ .../get_vacation_rules_list_model.dart | 92 +++++++++++++ .../respond_attributes_list_model.dart | 28 ++++ .../vr_item_types_list_model.dart | 18 +++ .../vacation_rule/wf_look_up_list_model.dart | 21 +++ .../attendance/add_vacation_rule_screen.dart | 124 ++++++++++++++++++ .../attendance/monthly_attendance_screen.dart | 5 +- lib/ui/attendance/vacation_rule_screen.dart | 110 ++++++++++++++++ .../dynamic_listview_screen.dart | 4 +- .../worklist_fragments/actions_fragment.dart | 7 - 18 files changed, 655 insertions(+), 81 deletions(-) rename lib/api/{monthlyAttendance_api_client.dart => monthly_attendance_api_client.dart} (100%) create mode 100644 lib/api/vacation_rule_api_client.dart create mode 100644 lib/models/vacation_rule/get_item_type_notifications_list_model.dart create mode 100644 lib/models/vacation_rule/get_notification_reassign_mode_list_model.dart create mode 100644 lib/models/vacation_rule/get_vacation_rules_list_model.dart create mode 100644 lib/models/vacation_rule/respond_attributes_list_model.dart create mode 100644 lib/models/vacation_rule/vr_item_types_list_model.dart create mode 100644 lib/models/vacation_rule/wf_look_up_list_model.dart create mode 100644 lib/ui/attendance/add_vacation_rule_screen.dart diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index 816708e..663dc52 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -31,6 +31,8 @@ "viewAllServices": "عرض جميع الخدمات", "monthlyAttendance": "الحضور الشهري", "vacationRule": "حكم اجازة", + "startDateT": "تاريخ البدء", + "endDateT": "تاريخ الانتهاء", "workFromHome": "العمل من المنزل", "ticketRequest": "طلب تذكرة", "viewAllOffers": "مشاهدة جميع العروض", @@ -232,6 +234,7 @@ "myAttendance": "حضوري", "workOnBreak": "التعويض عن العمل اثناءالاستراحه", "next": "التالي", + "apply": "يتقدم", "mobile": "التليفون المحمول", "completingYear": "نحن نقدر لك لاستكمال خدمة", "year": "سنة", @@ -273,39 +276,39 @@ "addNewFamilyMember": "اضافة عضو جديد", "addRow": "اضافة صف جديد", "pleaseSelect": "الرجاء اختيار", - "delete" : "حذف", - "edit" : "تعديل", - "add" : "اضافه", + "delete": "حذف", + "edit": "تعديل", + "add": "اضافه", "myProfile": "معلوماتي", "mowadhafhi": "موظفي", "searchAnnouncements": "بحث الاعلانات", "announcements": "اعلانات", "swipeRequest": "طلب تسجيل حضور", - "serviceType":"نوع الخدمه", - "departmentName":"اسم القسم", + "serviceType": "نوع الخدمه", + "departmentName": "اسم القسم", "selectDepartment": "اختر القسم", - "relatedSection":"قسم ذو صله", + "relatedSection": "قسم ذو صله", "selectSection": "اختيار القسم", "relatedTopic": "عنوان ذو صله", "selectTopic": "اختر العنوان", - "supportingDocument":"ارفاق مستند", + "supportingDocument": "ارفاق مستند", "mowadhafhiRequest": "طلب موظفي", - "ticketReference":"مرجع التذكره", + "ticketReference": "مرجع التذكره", "section": "القسم", "topic": "العنوان", - "actionBy":"الرد بواسطة", - "pending" : "معلق", + "actionBy": "الرد بواسطة", + "pending": "معلق", "pendingTransactions": "المعاملات المعلقه", - "selectRequestType":"الرجاء اختيار نوع الطلب", - "dateFrom":"من تاريخ", - "dateTo":"الى تاريخ", - "requestName":"اسم الطلب", - "createdFor":"انشاء لأجل", + "selectRequestType": "الرجاء اختيار نوع الطلب", + "dateFrom": "من تاريخ", + "dateTo": "الى تاريخ", + "requestName": "اسم الطلب", + "createdFor": "انشاء لأجل", "requestCreatedSuccessfully": "تم انشاء الطلب بنجاح", "search": "بحث", "wantToReject": "هل انت متأكد تريد الرفض", - "requestType":"نوع الطلب", - "employeeDigitalID":"هويةالموظف الرقمية", + "requestType": "نوع الطلب", + "employeeDigitalID": "هويةالموظف الرقمية", "businessCard": "بطاقة العمل", "profile": { "reset_password": { diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index 84f0c0d..e8b180b 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -31,6 +31,8 @@ "viewAllServices": "View All Services", "monthlyAttendance": "Monthly Attendance", "vacationRule": "Vacation Rule", + "startDateT": "Start Date", + "endDateT": "End Date", "workFromHome": "Work From Home", "ticketRequest": "Ticket Request", "viewAllOffers": "View All Offers", @@ -232,6 +234,7 @@ "myAttendance": "My Attendance", "workOnBreak": "Work On Break", "next": "Next", + "apply": "Apply", "mobile": "Mobile", "year": "Year", "month": "Month", @@ -274,38 +277,38 @@ "addNewFamilyMember": "Add New Family Member", "addRow": "Add new row", "pleaseSelect": "Please Select *", - "delete" : "delete", - "add" : "Add", - "edit" : "Edit", + "delete": "delete", + "add": "Add", + "edit": "Edit", "myProfile": "My Profile", "mowadhafhi": "Mowadhafhi", "searchAnnouncements": "Search Announcements", "announcements": "Announcements", "swipeRequest": "Swipe Request", - "serviceType":"Service Type", - "departmentName":"Department Name", + "serviceType": "Service Type", + "departmentName": "Department Name", "selectDepartment": "Select Department", - "relatedSection":"Related Section", + "relatedSection": "Related Section", "selectSection": "Select Section", "relatedTopic": "Related Topic", "selectTopic": "Select Topic", - "supportingDocument":"Supporting Document", + "supportingDocument": "Supporting Document", "mowadhafhiRequest": "Mowadhafhi Request", - "ticketReference":"Ticket Reference", + "ticketReference": "Ticket Reference", "section": "Section", "topic": "Topic", - "actionBy":"Action By", + "actionBy": "Action By", "pendingTransactions": "Pending Transactions", - "selectRequestType":"Please select request type", - "dateFrom":"Date From", - "dateTo":"Date To", - "requestName":"Request Name", - "createdFor":"Created For", - "requestType":"Request Type", + "selectRequestType": "Please select request type", + "dateFrom": "Date From", + "dateTo": "Date To", + "requestName": "Request Name", + "createdFor": "Created For", + "requestType": "Request Type", "requestCreatedSuccessfully": "Request created successfully", "search": "Search", "wantToReject": "Are you sure want to reject?", - "employeeDigitalID":"Employee Digital ID", + "employeeDigitalID": "Employee Digital ID", "businessCard": "Business Card", "profile": { "reset_password": { diff --git a/lib/api/monthlyAttendance_api_client.dart b/lib/api/monthly_attendance_api_client.dart similarity index 100% rename from lib/api/monthlyAttendance_api_client.dart rename to lib/api/monthly_attendance_api_client.dart diff --git a/lib/api/vacation_rule_api_client.dart b/lib/api/vacation_rule_api_client.dart new file mode 100644 index 0000000..d144174 --- /dev/null +++ b/lib/api/vacation_rule_api_client.dart @@ -0,0 +1,78 @@ +import 'package:mohem_flutter_app/api/api_client.dart'; +import 'package:mohem_flutter_app/app_state/app_state.dart'; +import 'package:mohem_flutter_app/classes/consts.dart'; +import 'package:mohem_flutter_app/models/generic_response_model.dart'; +import 'package:mohem_flutter_app/models/vacation_rule/get_item_type_notifications_list_model.dart'; +import 'package:mohem_flutter_app/models/vacation_rule/get_notification_reassign_mode_list_model.dart'; +import 'package:mohem_flutter_app/models/vacation_rule/get_vacation_rules_list_model.dart'; +import 'package:mohem_flutter_app/models/vacation_rule/respond_attributes_list_model.dart'; +import 'package:mohem_flutter_app/models/vacation_rule/vr_item_types_list_model.dart'; +import 'package:mohem_flutter_app/models/vacation_rule/wf_look_up_list_model.dart'; + +class VacationRuleApiClient { + static final VacationRuleApiClient _instance = VacationRuleApiClient._internal(); + + VacationRuleApiClient._internal(); + + factory VacationRuleApiClient() => _instance; + + Future> getVacationRules() async { + String url = "${ApiConsts.erpRest}GET_VACATION_RULES"; + Map postParams = {"P_PAGE_LIMIT": 50, "P_PAGE_NUM": 1}; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + GenericResponseModel? responseData = GenericResponseModel.fromJson(json); + return responseData.getVacationRulesList ?? []; + }, url, postParams); + } + + Future> getVrItemTypes() async { + String url = "${ApiConsts.erpRest}GET_VR_ITEM_TYPES"; + Map postParams = {}; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + GenericResponseModel? responseData = GenericResponseModel.fromJson(json); + return responseData.vrItemTypesList ?? []; + }, url, postParams); + } + + Future> getItemTypeNotifications(String pItemType) async { + String url = "${ApiConsts.erpRest}GET_ITEM_TYPE_NOTIFICATIONS"; + Map postParams = {"P_ITEM_TYPE": pItemType}; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + GenericResponseModel? responseData = GenericResponseModel.fromJson(json); + return responseData.getItemTypeNotificationsList ?? []; + }, url, postParams); + } + + Future> getNotificationReassignMode() async { + String url = "${ApiConsts.erpRest}GET_NOTIFICATION_REASSIGN_MODE"; + Map postParams = {}; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + GenericResponseModel? responseData = GenericResponseModel.fromJson(json); + return responseData.getNotificationReassignModeList ?? []; + }, url, postParams); + } + + Future> getRespondAttributes(String pItemType, String pNotificationName) async { + String url = "${ApiConsts.erpRest}GET_RESPOND_ATTRIBUTES"; + Map postParams = {"P_ITEM_TYPE": pItemType, "P_NOTIFICATION_NAME": pNotificationName}; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + GenericResponseModel? responseData = GenericResponseModel.fromJson(json); + return responseData.respondAttributesList ?? []; + }, url, postParams); + } + + Future> getWfLookup(String pLookupType) async { + String url = "${ApiConsts.erpRest}GET_WF_LOOKUP"; + Map postParams = {"P_LOOKUP_TYPE": pLookupType}; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + GenericResponseModel? responseData = GenericResponseModel.fromJson(json); + return responseData.wFLookUpList ?? []; + }, url, postParams); + } +} diff --git a/lib/config/routes.dart b/lib/config/routes.dart index 4d9c390..235de7b 100644 --- a/lib/config/routes.dart +++ b/lib/config/routes.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:mohem_flutter_app/ui/attendance/add_vacation_rule_screen.dart'; import 'package:mohem_flutter_app/ui/attendance/monthly_attendance_screen.dart'; import 'package:mohem_flutter_app/ui/attendance/vacation_rule_screen.dart'; import 'package:mohem_flutter_app/ui/bottom_sheets/attendence_details_bottom_sheet.dart'; @@ -14,6 +15,7 @@ import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_input import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart'; import 'package:mohem_flutter_app/ui/my_attendance/my_attendance_screen.dart'; import 'package:mohem_flutter_app/ui/payslip/monthly_pay_slip_screen.dart'; +import 'package:mohem_flutter_app/ui/profile/add_update_family_member.dart'; import 'package:mohem_flutter_app/ui/profile/basic_details.dart'; import 'package:mohem_flutter_app/ui/profile/contact_details.dart'; import 'package:mohem_flutter_app/ui/profile/delete_family_member.dart'; @@ -22,7 +24,7 @@ import 'package:mohem_flutter_app/ui/profile/family_members.dart'; import 'package:mohem_flutter_app/ui/profile/personal_info.dart'; import 'package:mohem_flutter_app/ui/screens/announcements/announcement_details.dart'; import 'package:mohem_flutter_app/ui/screens/announcements/announcements.dart'; -import 'package:mohem_flutter_app/ui/profile/add_update_family_member.dart'; + // import 'package:mohem_flutter_app/ui/my_attendance/work_from_home_screen.dart'; import 'package:mohem_flutter_app/ui/screens/eit/add_eit.dart'; import 'package:mohem_flutter_app/ui/screens/mowadhafhi/mowadhafhi_home.dart'; @@ -72,6 +74,7 @@ class AppRoutes { static const String attendance = "/attendance"; static const String monthlyAttendance = "/monthlyAttendance"; static const String vacationRule = "/vacationRule"; + static const String addVacationRule = "/addVacationRule"; //Bottom Sheet static const String attendanceDetailsBottomSheet = "/attendanceDetailsBottomSheet"; @@ -128,6 +131,7 @@ class AppRoutes { //Attendance monthlyAttendance: (context) => MonthlyAttendanceScreen(), vacationRule: (context) => VacationRuleScreen(), + addVacationRule: (context) => AddVacationRuleScreen(), //Bottom Sheet attendanceDetailsBottomSheet: (context) => AttendenceDetailsBottomSheet(), diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index ca40afb..f1b355f 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -32,6 +32,8 @@ abstract class LocaleKeys { static const viewAllServices = 'viewAllServices'; static const monthlyAttendance = 'monthlyAttendance'; static const vacationRule = 'vacationRule'; + static const startDateT = 'startDateT'; + static const endDateT = 'endDateT'; static const workFromHome = 'workFromHome'; static const ticketRequest = 'ticketRequest'; static const viewAllOffers = 'viewAllOffers'; @@ -233,6 +235,7 @@ abstract class LocaleKeys { static const myAttendance = 'myAttendance'; static const workOnBreak = 'workOnBreak'; static const next = 'next'; + static const apply = 'apply'; static const mobile = 'mobile'; static const completingYear = 'completingYear'; static const year = 'year'; diff --git a/lib/models/generic_response_model.dart b/lib/models/generic_response_model.dart index 3b04f06..5d93f16 100644 --- a/lib/models/generic_response_model.dart +++ b/lib/models/generic_response_model.dart @@ -56,11 +56,17 @@ import 'package:mohem_flutter_app/models/profile/basic_details_cols_structions.d import 'package:mohem_flutter_app/models/profile/basic_details_dff_structure.dart'; import 'package:mohem_flutter_app/models/profile/get_contact_clos_structure_list.dart'; import 'package:mohem_flutter_app/models/profile/get_contact_details_list.dart'; -import 'package:mohem_flutter_app/models/profile/submit_phone_transactions.dart'; import 'package:mohem_flutter_app/models/profile/phone_number_types_modek.dart'; +import 'package:mohem_flutter_app/models/profile/submit_contact_transaction_list_model.dart'; import 'package:mohem_flutter_app/models/start_eit_approval_process_model.dart'; import 'package:mohem_flutter_app/models/submit_eit_transaction_list_model.dart'; import 'package:mohem_flutter_app/models/subordinates_on_leaves_model.dart'; +import 'package:mohem_flutter_app/models/vacation_rule/get_item_type_notifications_list_model.dart'; +import 'package:mohem_flutter_app/models/vacation_rule/get_notification_reassign_mode_list_model.dart'; +import 'package:mohem_flutter_app/models/vacation_rule/get_vacation_rules_list_model.dart'; +import 'package:mohem_flutter_app/models/vacation_rule/respond_attributes_list_model.dart'; +import 'package:mohem_flutter_app/models/vacation_rule/vr_item_types_list_model.dart'; +import 'package:mohem_flutter_app/models/vacation_rule/wf_look_up_list_model.dart'; import 'package:mohem_flutter_app/models/validate_eit_transaction_list_model.dart'; import 'package:mohem_flutter_app/models/worklist/get_favorite_replacements_model.dart'; import 'package:mohem_flutter_app/models/worklist/hr/eit_otification_body_model.dart'; @@ -69,7 +75,6 @@ import 'package:mohem_flutter_app/models/worklist/hr/get_contact_notification_bo import 'package:mohem_flutter_app/models/worklist/hr/get_phones_notification_body_list_model.dart'; import 'package:mohem_flutter_app/models/worklist/replacement_list_model.dart'; import 'package:mohem_flutter_app/models/worklist_response_model.dart'; -import 'package:mohem_flutter_app/models/profile/submit_contact_transaction_list_model.dart'; class GenericResponseModel { String? date; @@ -163,14 +168,14 @@ class GenericResponseModel { List? getHrCollectionNotificationBodyList; List? getHrTransactionList; GetItemCreationNtfBodyList? getItemCreationNtfBodyList; - List? getItemTypeNotificationsList; + List? getItemTypeNotificationsList; List? getItemTypesList; List? getLookupValuesList; List? getMenuEntriesList; List? getMoItemHistoryList; List? getMoNotificationBodyList; List? getNotificationButtonsList; - List? getNotificationReassignModeList; + List? getNotificationReassignModeList; List? getObjectValuesList; GetOpenMissingSwipesList? getOpenMissingSwipesList; List? getOpenNotificationsList; @@ -217,7 +222,7 @@ class GenericResponseModel { List? getPendingTransactionsFunctions; List? getPendingTransactionsDetails; List? getUserItemTypesList; - List? getVacationRulesList; + List? getVacationRulesList; List? getVaccinationOnHandList; List? getVaccinationsList; List? getValueSetValuesList; @@ -282,7 +287,7 @@ class GenericResponseModel { String? processTransactions; String? registerUserNameList; List? replacementList; - String? respondAttributesList; + List? respondAttributesList; String? respondRolesList; String? resubmitAbsenceTransactionList; String? resubmitEITTransactionList; @@ -325,8 +330,8 @@ class GenericResponseModel { String? validateAbsenceTransactionList; ValidateEITTransactionList? validateEITTransactionList; String? validatePhonesTransactionList; - String? vrItemTypesList; - String? wFLookUpList; + List? vrItemTypesList; + List? wFLookUpList; String? eLearningGETEMPLOYEEPROFILEList; String? eLearningLOGINList; String? eLearningValidateLoginList; @@ -733,8 +738,7 @@ class GenericResponseModel { if (json['GetContactColsStructureList'] != null) { getContactColsStructureList = []; json['GetContactColsStructureList'].forEach((v) { - getContactColsStructureList! - .add(new GetContactColsStructureList.fromJson(v)); + getContactColsStructureList!.add(new GetContactColsStructureList.fromJson(v)); }); } getContactNotificationBodyList = json["GetContactNotificationBodyList"] == null ? null : GetContactNotificationBodyList.fromJson(json["GetContactNotificationBodyList"]); @@ -806,7 +810,13 @@ class GenericResponseModel { getItemCreationNtfBodyList = json['GetItemCreationNtfBodyList'] != null ? new GetItemCreationNtfBodyList.fromJson(json['GetItemCreationNtfBodyList']) : null; - getItemTypeNotificationsList = json['GetItemTypeNotificationsList']; + if (json['GetItemTypeNotificationsList'] != null) { + getItemTypeNotificationsList = []; + json['GetItemTypeNotificationsList'].forEach((v) { + getItemTypeNotificationsList!.add(new GetItemTypeNotificationsList.fromJson(v)); + }); + } + getItemTypesList = json['GetItemTypesList']; getLookupValuesList = json['GetLookupValuesList']; getMenuEntriesList = json["GetMenuEntriesList"] == null ? null : List.from(json["GetMenuEntriesList"].map((x) => GetMenuEntriesList.fromJson(x))); @@ -827,14 +837,21 @@ class GenericResponseModel { if (json['GetNotificationButtonsList'] != null) { getNotificationButtonsList = []; json['GetNotificationButtonsList'].forEach((v) { - getNotificationButtonsList!.add(new GetNotificationButtonsList.fromJson(v)); + getNotificationButtonsList!.add(GetNotificationButtonsList.fromJson(v)); + }); + } + + if (json['GetNotificationReassignModeList'] != null) { + getNotificationReassignModeList = []; + json['GetNotificationReassignModeList'].forEach((v) { + getNotificationReassignModeList!.add(GetNotificationReassignModeList.fromJson(v)); }); } if (json['GetObjectValuesList'] != null) { getObjectValuesList = []; json['GetObjectValuesList'].forEach((v) { - getObjectValuesList!.add(new GetPhoneNumberTypesModel.fromJson(v)); + getObjectValuesList!.add(GetPhoneNumberTypesModel.fromJson(v)); }); } @@ -1001,7 +1018,12 @@ class GenericResponseModel { } getUserItemTypesList = json['GetUserItemTypesList']; - getVacationRulesList = json['GetVacationRulesList']; + if (json['GetVacationRulesList'] != null) { + getVacationRulesList = []; + json['GetVacationRulesList'].forEach((v) { + getVacationRulesList!.add(GetVacationRulesList.fromJson(v)); + }); + } getVaccinationOnHandList = json['GetVaccinationOnHandList']; getVaccinationsList = json['GetVaccinationsList']; @@ -1110,7 +1132,13 @@ class GenericResponseModel { processTransactions = json['ProcessTransactions']; registerUserNameList = json['RegisterUserNameList']; replacementList = json["ReplacementList"] == null ? null : List.from(json["ReplacementList"].map((x) => ReplacementList.fromJson(x))); - respondAttributesList = json['RespondAttributesList']; + + if (json['RespondAttributesList'] != null) { + respondAttributesList = []; + json['RespondAttributesList'].forEach((v) { + respondAttributesList!.add(new RespondAttributesList.fromJson(v)); + }); + } respondRolesList = json['RespondRolesList']; resubmitAbsenceTransactionList = json['ResubmitAbsenceTransactionList']; resubmitEITTransactionList = json['ResubmitEITTransactionList']; @@ -1132,10 +1160,7 @@ class GenericResponseModel { submitBasicDetTransactionList = json['SubmitBasicDetTransactionList']; submitCEITransactionList = json['SubmitCEITransactionList']; submitCcpTransactionList = json['SubmitCcpTransactionList']; - submitContactTransactionList = json['SubmitContactTransactionList'] != null - ? new SubmitContactTransactionList.fromJson( - json['SubmitContactTransactionList']) - : null; + submitContactTransactionList = json['SubmitContactTransactionList'] != null ? new SubmitContactTransactionList.fromJson(json['SubmitContactTransactionList']) : null; submitEITTransactionList = json['SubmitEITTransactionList'] != null ? new SubmitEITTransactionList.fromJson(json['SubmitEITTransactionList']) : null; submitHrTransactionList = json['SubmitHrTransactionList']; @@ -1168,8 +1193,18 @@ class GenericResponseModel { validateEITTransactionList = json['ValidateEITTransactionList'] != null ? new ValidateEITTransactionList.fromJson(json['ValidateEITTransactionList']) : null; validatePhonesTransactionList = json['ValidatePhonesTransactionList']; - vrItemTypesList = json['VrItemTypesList']; - wFLookUpList = json['WFLookUpList']; + if (json['VrItemTypesList'] != null) { + vrItemTypesList = []; + json['VrItemTypesList'].forEach((v) { + vrItemTypesList!.add(VrItemTypesList.fromJson(v)); + }); + } + if (json['WFLookUpList'] != null) { + wFLookUpList = []; + json['WFLookUpList'].forEach((v) { + wFLookUpList!.add(new WFLookUpList.fromJson(v)); + }); + } eLearningGETEMPLOYEEPROFILEList = json['eLearning_GET_EMPLOYEE_PROFILEList']; eLearningLOGINList = json['eLearning_LOGINList']; eLearningValidateLoginList = json['eLearning_ValidateLoginList']; @@ -1279,16 +1314,13 @@ class GenericResponseModel { data['GetCcpTransactionsList_New'] = this.getCcpTransactionsListNew; data['GetConcurrentProgramsList'] = this.getConcurrentProgramsList; if (this.getContactDetailsList != null) { - data['GetContactDetailsList'] = - this.getContactDetailsList!.map((v) => v.toJson()).toList(); + data['GetContactDetailsList'] = this.getContactDetailsList!.map((v) => v.toJson()).toList(); } if (this.getContactColsStructureList != null) { - data['GetContactColsStructureList'] = - this.getContactColsStructureList!.map((v) => v.toJson()).toList(); + data['GetContactColsStructureList'] = this.getContactColsStructureList!.map((v) => v.toJson()).toList(); } if (this.getContactDffStructureList != null) { - data['GetContactDffStructureList'] = - this.getContactDffStructureList!.map((v) => v.toJson()).toList(); + data['GetContactDffStructureList'] = this.getContactDffStructureList!.map((v) => v.toJson()).toList(); } data['GetContactNotificationBodyList'] = this.getContactNotificationBodyList; data['GetCountriesList'] = this.getCountriesList; @@ -1334,7 +1366,10 @@ class GenericResponseModel { data['GetItemCreationNtfBodyList'] = this.getItemCreationNtfBodyList!.toJson(); } - data['GetItemTypeNotificationsList'] = this.getItemTypeNotificationsList; + if (this.getItemTypeNotificationsList != null) { + data['GetItemTypeNotificationsList'] = this.getItemTypeNotificationsList!.map((v) => v.toJson()).toList(); + } + data['GetItemTypesList'] = this.getItemTypesList; data['GetLookupValuesList'] = this.getLookupValuesList; data['GetMenuEntriesList'] = this.getMenuEntriesList; @@ -1350,7 +1385,10 @@ class GenericResponseModel { data['GetNotificationButtonsList'] = this.getNotificationButtonsList!.map((v) => v.toJson()).toList(); } - data['GetNotificationReassignModeList'] = this.getNotificationReassignModeList; + if (getNotificationReassignModeList != null) { + data['GetNotificationReassignModeList'] = getNotificationReassignModeList!.map((v) => v.toJson()).toList(); + } + data['GetObjectValuesList'] = this.getObjectValuesList; data['GetOpenMissingSwipesList'] = this.getOpenMissingSwipesList; data['GetOpenNotificationsList'] = this.getOpenNotificationsList; @@ -1416,7 +1454,9 @@ class GenericResponseModel { data['GetTimeCardSummaryList'] = this.getTimeCardSummaryList!.map((v) => v.toJson()).toList(); } data['GetUserItemTypesList'] = this.getUserItemTypesList; - data['GetVacationRulesList'] = this.getVacationRulesList; + if (this.getVacationRulesList != null) { + data['GetVacationRulesList'] = this.getVacationRulesList!.map((v) => v.toJson()).toList(); + } data['GetVaccinationOnHandList'] = this.getVaccinationOnHandList; data['GetVaccinationsList'] = this.getVaccinationsList; if (getValueSetValuesList != null) { @@ -1501,7 +1541,10 @@ class GenericResponseModel { data['ProcessTransactions'] = this.processTransactions; data['RegisterUserNameList'] = this.registerUserNameList; data['ReplacementList'] = this.replacementList; - data['RespondAttributesList'] = this.respondAttributesList; + + if (respondAttributesList != null) { + data['RespondAttributesList'] = respondAttributesList!.map((v) => v.toJson()).toList(); + } data['RespondRolesList'] = this.respondRolesList; data['ResubmitAbsenceTransactionList'] = this.resubmitAbsenceTransactionList; data['ResubmitEITTransactionList'] = this.resubmitEITTransactionList; @@ -1555,13 +1598,16 @@ class GenericResponseModel { data['VHR_IsVerificationCodeValid'] = this.vHRIsVerificationCodeValid; data['ValidateAbsenceTransactionList'] = this.validateAbsenceTransactionList; - if (this.validateEITTransactionList != null) { - data['ValidateEITTransactionList'] = this.validateEITTransactionList!.toJson(); + if (validateEITTransactionList != null) { + data['ValidateEITTransactionList'] = validateEITTransactionList!.toJson(); } - data['ValidatePhonesTransactionList'] = this.validatePhonesTransactionList; - data['VrItemTypesList'] = this.vrItemTypesList; - data['WFLookUpList'] = this.wFLookUpList; + if (vrItemTypesList != null) { + data['VrItemTypesList'] = vrItemTypesList!.map((v) => v.toJson()).toList(); + } + if (wFLookUpList != null) { + data['WFLookUpList'] = wFLookUpList!.map((v) => v.toJson()).toList(); + } data['eLearning_GET_EMPLOYEE_PROFILEList'] = this.eLearningGETEMPLOYEEPROFILEList; data['eLearning_LOGINList'] = this.eLearningLOGINList; data['eLearning_ValidateLoginList'] = this.eLearningValidateLoginList; diff --git a/lib/models/vacation_rule/get_item_type_notifications_list_model.dart b/lib/models/vacation_rule/get_item_type_notifications_list_model.dart new file mode 100644 index 0000000..4d80a0e --- /dev/null +++ b/lib/models/vacation_rule/get_item_type_notifications_list_model.dart @@ -0,0 +1,28 @@ +class GetItemTypeNotificationsList { + String? fYIFLAG; + String? nOTIFICATIONDISPLAYNAME; + String? nOTIFICATIONNAME; + String? nOTIFICATIONSUBJECT; + + GetItemTypeNotificationsList( + {this.fYIFLAG, + this.nOTIFICATIONDISPLAYNAME, + this.nOTIFICATIONNAME, + this.nOTIFICATIONSUBJECT}); + + GetItemTypeNotificationsList.fromJson(Map json) { + fYIFLAG = json['FYI_FLAG']; + nOTIFICATIONDISPLAYNAME = json['NOTIFICATION_DISPLAY_NAME']; + nOTIFICATIONNAME = json['NOTIFICATION_NAME']; + nOTIFICATIONSUBJECT = json['NOTIFICATION_SUBJECT']; + } + + Map toJson() { + final Map data = new Map(); + data['FYI_FLAG'] = this.fYIFLAG; + data['NOTIFICATION_DISPLAY_NAME'] = this.nOTIFICATIONDISPLAYNAME; + data['NOTIFICATION_NAME'] = this.nOTIFICATIONNAME; + data['NOTIFICATION_SUBJECT'] = this.nOTIFICATIONSUBJECT; + return data; + } +} \ No newline at end of file diff --git a/lib/models/vacation_rule/get_notification_reassign_mode_list_model.dart b/lib/models/vacation_rule/get_notification_reassign_mode_list_model.dart new file mode 100644 index 0000000..e3495d0 --- /dev/null +++ b/lib/models/vacation_rule/get_notification_reassign_mode_list_model.dart @@ -0,0 +1,22 @@ +class GetNotificationReassignModeList { + String? rADIOBUTTONACTION; + String? rADIOBUTTONLABEL; + int? rADIOBUTTONSEQ; + + GetNotificationReassignModeList( + {this.rADIOBUTTONACTION, this.rADIOBUTTONLABEL, this.rADIOBUTTONSEQ}); + + GetNotificationReassignModeList.fromJson(Map json) { + rADIOBUTTONACTION = json['RADIO_BUTTON_ACTION']; + rADIOBUTTONLABEL = json['RADIO_BUTTON_LABEL']; + rADIOBUTTONSEQ = json['RADIO_BUTTON_SEQ']; + } + + Map toJson() { + final Map data = new Map(); + data['RADIO_BUTTON_ACTION'] = this.rADIOBUTTONACTION; + data['RADIO_BUTTON_LABEL'] = this.rADIOBUTTONLABEL; + data['RADIO_BUTTON_SEQ'] = this.rADIOBUTTONSEQ; + return data; + } +} \ No newline at end of file diff --git a/lib/models/vacation_rule/get_vacation_rules_list_model.dart b/lib/models/vacation_rule/get_vacation_rules_list_model.dart new file mode 100644 index 0000000..5abd32a --- /dev/null +++ b/lib/models/vacation_rule/get_vacation_rules_list_model.dart @@ -0,0 +1,92 @@ +class GetVacationRulesList { + String? aCTION; + String? aCTIONDISPLAY; + String? bEGINDATE; + String? eNDDATE; + int? fROMROWNUM; + String? fYIFLAG; + String? iTEMTYPE; + String? iTEMTYPEDISPLAYNAME; + String? mESSAGE; + String? nOTIFICATIONDISPLAYNAME; + String? nOTIFICATIONNAME; + String? nOTIFICATIONSUBJECT; + int? nOOFROWS; + String? rEPLACEMENTUSERNAME; + int? rOWNUM; + int? rULEID; + String? rULENAME; + String? rULESTATUS; + String? rULETIPMESSAGE; + int? tOROWNUM; + + GetVacationRulesList( + {this.aCTION, + this.aCTIONDISPLAY, + this.bEGINDATE, + this.eNDDATE, + this.fROMROWNUM, + this.fYIFLAG, + this.iTEMTYPE, + this.iTEMTYPEDISPLAYNAME, + this.mESSAGE, + this.nOTIFICATIONDISPLAYNAME, + this.nOTIFICATIONNAME, + this.nOTIFICATIONSUBJECT, + this.nOOFROWS, + this.rEPLACEMENTUSERNAME, + this.rOWNUM, + this.rULEID, + this.rULENAME, + this.rULESTATUS, + this.rULETIPMESSAGE, + this.tOROWNUM}); + + GetVacationRulesList.fromJson(Map json) { + aCTION = json['ACTION']; + aCTIONDISPLAY = json['ACTION_DISPLAY']; + bEGINDATE = json['BEGIN_DATE']; + eNDDATE = json['END_DATE']; + fROMROWNUM = json['FROM_ROW_NUM']; + fYIFLAG = json['FYI_FLAG']; + iTEMTYPE = json['ITEM_TYPE']; + iTEMTYPEDISPLAYNAME = json['ITEM_TYPE_DISPLAY_NAME']; + mESSAGE = json['MESSAGE']; + nOTIFICATIONDISPLAYNAME = json['NOTIFICATION_DISPLAY_NAME']; + nOTIFICATIONNAME = json['NOTIFICATION_NAME']; + nOTIFICATIONSUBJECT = json['NOTIFICATION_SUBJECT']; + nOOFROWS = json['NO_OF_ROWS']; + rEPLACEMENTUSERNAME = json['REPLACEMENT_USER_NAME']; + rOWNUM = json['ROW_NUM']; + rULEID = json['RULE_ID']; + rULENAME = json['RULE_NAME']; + rULESTATUS = json['RULE_STATUS']; + rULETIPMESSAGE = json['RULE_TIP_MESSAGE']; + tOROWNUM = json['TO_ROW_NUM']; + } + + Map toJson() { + final Map data = new Map(); + data['ACTION'] = this.aCTION; + data['ACTION_DISPLAY'] = this.aCTIONDISPLAY; + data['BEGIN_DATE'] = this.bEGINDATE; + data['END_DATE'] = this.eNDDATE; + data['FROM_ROW_NUM'] = this.fROMROWNUM; + data['FYI_FLAG'] = this.fYIFLAG; + data['ITEM_TYPE'] = this.iTEMTYPE; + data['ITEM_TYPE_DISPLAY_NAME'] = this.iTEMTYPEDISPLAYNAME; + data['MESSAGE'] = this.mESSAGE; + data['NOTIFICATION_DISPLAY_NAME'] = this.nOTIFICATIONDISPLAYNAME; + data['NOTIFICATION_NAME'] = this.nOTIFICATIONNAME; + data['NOTIFICATION_SUBJECT'] = this.nOTIFICATIONSUBJECT; + data['NO_OF_ROWS'] = this.nOOFROWS; + data['REPLACEMENT_USER_NAME'] = this.rEPLACEMENTUSERNAME; + data['ROW_NUM'] = this.rOWNUM; + data['RULE_ID'] = this.rULEID; + data['RULE_NAME'] = this.rULENAME; + data['RULE_STATUS'] = this.rULESTATUS; + data['RULE_TIP_MESSAGE'] = this.rULETIPMESSAGE; + data['TO_ROW_NUM'] = this.tOROWNUM; + return data; + } +} \ No newline at end of file diff --git a/lib/models/vacation_rule/respond_attributes_list_model.dart b/lib/models/vacation_rule/respond_attributes_list_model.dart new file mode 100644 index 0000000..ca7b2db --- /dev/null +++ b/lib/models/vacation_rule/respond_attributes_list_model.dart @@ -0,0 +1,28 @@ +class RespondAttributesList { + String? aTTRIBUTEDISPLAYNAME; + String? aTTRIBUTEFORMAT; + String? aTTRIBUTENAME; + String? aTTRIBUTETYPE; + + RespondAttributesList( + {this.aTTRIBUTEDISPLAYNAME, + this.aTTRIBUTEFORMAT, + this.aTTRIBUTENAME, + this.aTTRIBUTETYPE}); + + RespondAttributesList.fromJson(Map json) { + aTTRIBUTEDISPLAYNAME = json['ATTRIBUTE_DISPLAY_NAME']; + aTTRIBUTEFORMAT = json['ATTRIBUTE_FORMAT']; + aTTRIBUTENAME = json['ATTRIBUTE_NAME']; + aTTRIBUTETYPE = json['ATTRIBUTE_TYPE']; + } + + Map toJson() { + final Map data = new Map(); + data['ATTRIBUTE_DISPLAY_NAME'] = this.aTTRIBUTEDISPLAYNAME; + data['ATTRIBUTE_FORMAT'] = this.aTTRIBUTEFORMAT; + data['ATTRIBUTE_NAME'] = this.aTTRIBUTENAME; + data['ATTRIBUTE_TYPE'] = this.aTTRIBUTETYPE; + return data; + } +} \ No newline at end of file diff --git a/lib/models/vacation_rule/vr_item_types_list_model.dart b/lib/models/vacation_rule/vr_item_types_list_model.dart new file mode 100644 index 0000000..d31ffa6 --- /dev/null +++ b/lib/models/vacation_rule/vr_item_types_list_model.dart @@ -0,0 +1,18 @@ +class VrItemTypesList { + String? iTEMTYPE; + String? iTEMTYPEDISPLAYNAME; + + VrItemTypesList({this.iTEMTYPE, this.iTEMTYPEDISPLAYNAME}); + + VrItemTypesList.fromJson(Map json) { + iTEMTYPE = json['ITEM_TYPE']; + iTEMTYPEDISPLAYNAME = json['ITEM_TYPE_DISPLAY_NAME']; + } + + Map toJson() { + final Map data = new Map(); + data['ITEM_TYPE'] = this.iTEMTYPE; + data['ITEM_TYPE_DISPLAY_NAME'] = this.iTEMTYPEDISPLAYNAME; + return data; + } +} \ No newline at end of file diff --git a/lib/models/vacation_rule/wf_look_up_list_model.dart b/lib/models/vacation_rule/wf_look_up_list_model.dart new file mode 100644 index 0000000..25fb2ee --- /dev/null +++ b/lib/models/vacation_rule/wf_look_up_list_model.dart @@ -0,0 +1,21 @@ +class WFLookUpList { + String? lOOKUPCODE; + String? lOOKUPDESCRIPTION; + String? lOOKUPMEANING; + + WFLookUpList({this.lOOKUPCODE, this.lOOKUPDESCRIPTION, this.lOOKUPMEANING}); + + WFLookUpList.fromJson(Map json) { + lOOKUPCODE = json['LOOKUP_CODE']; + lOOKUPDESCRIPTION = json['LOOKUP_DESCRIPTION']; + lOOKUPMEANING = json['LOOKUP_MEANING']; + } + + Map toJson() { + final Map data = new Map(); + data['LOOKUP_CODE'] = this.lOOKUPCODE; + data['LOOKUP_DESCRIPTION'] = this.lOOKUPDESCRIPTION; + data['LOOKUP_MEANING'] = this.lOOKUPMEANING; + return data; + } +} \ No newline at end of file diff --git a/lib/ui/attendance/add_vacation_rule_screen.dart b/lib/ui/attendance/add_vacation_rule_screen.dart new file mode 100644 index 0000000..b3c3780 --- /dev/null +++ b/lib/ui/attendance/add_vacation_rule_screen.dart @@ -0,0 +1,124 @@ +import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter/material.dart'; +import 'package:mohem_flutter_app/api/vacation_rule_api_client.dart'; +import 'package:mohem_flutter_app/classes/utils.dart'; +import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; +import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; +import 'package:mohem_flutter_app/models/vacation_rule/get_item_type_notifications_list_model.dart'; +import 'package:mohem_flutter_app/models/vacation_rule/get_notification_reassign_mode_list_model.dart'; +import 'package:mohem_flutter_app/models/vacation_rule/respond_attributes_list_model.dart'; +import 'package:mohem_flutter_app/models/vacation_rule/vr_item_types_list_model.dart'; +import 'package:mohem_flutter_app/models/vacation_rule/wf_look_up_list_model.dart'; +import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; +import 'package:mohem_flutter_app/widgets/button/default_button.dart'; + +class AddVacationRuleScreen extends StatefulWidget { + AddVacationRuleScreen({Key? key}) : super(key: key); + + @override + _AddVacationRuleScreenState createState() { + return _AddVacationRuleScreenState(); + } +} + +class _AddVacationRuleScreenState extends State { + List? vrItemTypesList; + List? itemTypeNotificationsList; + + List? notificationReassignModeList; + List? respondAttributesList; + List? wfLookupList; + + int currentStage = 0; + + @override + void initState() { + super.initState(); + getVacationRulesList(); + } + + void getVacationRulesList() async { + try { + Utils.showLoading(context); + vrItemTypesList = await VacationRuleApiClient().getVrItemTypes(); + Utils.hideLoading(context); + currentStage = 1; + setState(() {}); + } catch (ex) { + Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } + } + + void getItemTypeNotificationsList() async { + try { + Utils.showLoading(context); + //itemTypeNotificationsList = await VacationRuleApiClient().getItemTypeNotifications(); + Utils.hideLoading(context); + currentStage = 2; + setState(() {}); + } catch (ex) { + Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } + } + + void callCombineApis() async { + try { + Utils.showLoading(context); + List results = await Future.wait([ + // VacationRuleApiClient().getNotificationReassignMode(), + // VacationRuleApiClient().getRespondAttributes("", ""), + // VacationRuleApiClient().getWfLookup(P_LOOKUP_TYPE), + ]); + notificationReassignModeList = results[0]; + respondAttributesList = results[1]; + wfLookupList = results[2]; + Utils.hideLoading(context); + currentStage = 3; + setState(() {}); + } catch (ex) { + Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } + } + + @override + void dispose() { + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.white, + appBar: AppBarWidget( + context, + title: LocaleKeys.vacationRule.tr(), + ), + body: vrItemTypesList == null + ? const SizedBox() + : (vrItemTypesList!.isEmpty + ? Utils.getNoDataWidget(context) + : Column( + children: [ + ListView( + padding: const EdgeInsets.all(21), + physics: const BouncingScrollPhysics(), + children: [], + ).expanded, + DefaultButton( + currentStage == 3 ? LocaleKeys.apply.tr() : LocaleKeys.next.tr(), + () { + if (currentStage == 1) { + getItemTypeNotificationsList(); + } else if (currentStage == 2) { + callCombineApis(); + } + }, + ).insideContainer, + ], + )), + ); + } +} diff --git a/lib/ui/attendance/monthly_attendance_screen.dart b/lib/ui/attendance/monthly_attendance_screen.dart index c81a5be..1b1b7a2 100644 --- a/lib/ui/attendance/monthly_attendance_screen.dart +++ b/lib/ui/attendance/monthly_attendance_screen.dart @@ -4,7 +4,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/painting.dart'; import 'package:intl/intl.dart'; -import 'package:mohem_flutter_app/api/monthlyAttendance_api_client.dart'; +import 'package:mohem_flutter_app/api/monthly_attendance_api_client.dart'; import 'package:mohem_flutter_app/classes/colors.dart'; import 'package:mohem_flutter_app/classes/utils.dart'; import 'package:mohem_flutter_app/extensions/int_extensions.dart'; @@ -135,7 +135,7 @@ class _MonthlyAttendanceScreenState extends State { ], ).paddingOnly(left: 21, right: 21), 18.height, - AspectRatio(aspectRatio: 333 / 270, child: calendarWidget()).paddingOnly(left: 18, right: 25), + AspectRatio(aspectRatio: 333 / 270, child: calendarWidget()).paddingOnly(left: 21, right: 21), Row( mainAxisAlignment: MainAxisAlignment.start, children: [ @@ -285,6 +285,7 @@ class _MonthlyAttendanceScreenState extends State { view: CalendarView.month, showDatePickerButton: false, controller: _calendarController, + backgroundColor: Colors.white, headerHeight: 0, viewNavigationMode: ViewNavigationMode.none, todayHighlightColor: MyColors.grey3AColor, diff --git a/lib/ui/attendance/vacation_rule_screen.dart b/lib/ui/attendance/vacation_rule_screen.dart index e1f8745..a2aa5df 100644 --- a/lib/ui/attendance/vacation_rule_screen.dart +++ b/lib/ui/attendance/vacation_rule_screen.dart @@ -1,7 +1,16 @@ import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; +import 'package:mohem_flutter_app/api/vacation_rule_api_client.dart'; +import 'package:mohem_flutter_app/classes/colors.dart'; +import 'package:mohem_flutter_app/classes/utils.dart'; +import 'package:mohem_flutter_app/config/routes.dart'; +import 'package:mohem_flutter_app/extensions/int_extensions.dart'; +import 'package:mohem_flutter_app/extensions/string_extensions.dart'; +import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; +import 'package:mohem_flutter_app/models/vacation_rule/get_vacation_rules_list_model.dart'; import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; +import 'package:mohem_flutter_app/widgets/item_detail_view_widget.dart'; class VacationRuleScreen extends StatefulWidget { VacationRuleScreen({Key? key}) : super(key: key); @@ -13,9 +22,24 @@ class VacationRuleScreen extends StatefulWidget { } class _VacationRuleScreenState extends State { + List? vacationRuleList; + @override void initState() { super.initState(); + getVacationRulesList(); + } + + void getVacationRulesList() async { + try { + Utils.showLoading(context); + vacationRuleList = await VacationRuleApiClient().getVacationRules(); + Utils.hideLoading(context); + setState(() {}); + } catch (ex) { + Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } } @override @@ -31,6 +55,92 @@ class _VacationRuleScreenState extends State { context, title: LocaleKeys.vacationRule.tr(), ), + body: vacationRuleList == null + ? const SizedBox() + : (vacationRuleList!.isEmpty + ? Utils.getNoDataWidget(context) + : ListView.separated( + physics: const BouncingScrollPhysics(), + padding: const EdgeInsets.all(21), + itemBuilder: (cxt, int parentIndex) => Container( + width: double.infinity, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(10), + boxShadow: [ + BoxShadow( + color: const Color(0xff000000).withOpacity(.05), + blurRadius: 26, + offset: const Offset(0, -3), + ), + ], + ), + clipBehavior: Clip.antiAlias, + child: Stack( + clipBehavior: Clip.antiAlias, + children: [ + Positioned( + left: -20, + top: -10, + child: Transform.rotate( + angle: 15, + child: Container( + width: 50, + height: 30, + color: getStatusColor(vacationRuleList![parentIndex].rULESTATUS!), + ), + ), + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + ("${vacationRuleList![parentIndex].rULENAME!} | ${vacationRuleList![parentIndex].iTEMTYPEDISPLAYNAME!}").toText16(), + 4.height, + ItemDetailView(LocaleKeys.startDateT.tr(), getParsedTime(vacationRuleList![parentIndex].bEGINDATE!)), + ItemDetailView(LocaleKeys.endDateT.tr(), getParsedTime(vacationRuleList![parentIndex].eNDDATE!)), + 4.height, + vacationRuleList![parentIndex].rULESTATUS!.toText12(color: getStatusColor(vacationRuleList![parentIndex].rULESTATUS!)), + ], + ).paddingOnly(top: 16, left: 16, right: 16, bottom: 16), + ], + ), + ), + separatorBuilder: (cxt, index) => 12.height, + itemCount: vacationRuleList!.length)), + floatingActionButton: Container( + height: 54, + width: 54, + decoration: const BoxDecoration( + shape: BoxShape.circle, + gradient: LinearGradient(transform: GradientRotation(.83), begin: Alignment.topRight, end: Alignment.bottomLeft, colors: [ + MyColors.gradiantEndColor, + MyColors.gradiantStartColor, + ]), + ), + child: const Icon(Icons.add, color: Colors.white, size: 30), + ).onPress(() { + Navigator.pushNamed(context, AppRoutes.addVacationRule); + }), ); } + + Color getStatusColor(String code) { + if (code == "SUBMIT") { + return const Color(0xff2E303A); + } else if (code == "Inactive") { + return const Color(0xffD02127); + } else if (code == "active") { + return const Color(0xff1FA269); + } else if (code == "REQUEST_INFO") { + return const Color(0xff2E303A); + } else { + return const Color(0xff2E303A); + } + } + + String getParsedTime(String time) { + DateTime date = DateFormat("mm/dd/yyyy").parse(time); + return DateFormat("d MMM yyyy").format(date); + } } diff --git a/lib/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart b/lib/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart index 54aee5c..8dd78f7 100644 --- a/lib/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart +++ b/lib/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart @@ -91,8 +91,8 @@ class _DynamicListViewScreenState extends State { separatorBuilder: (cxt, index) => 12.height, itemCount: getEITTransactionList!.length)), floatingActionButton: Container( - height: 50, - width: 50, + height: 54, + width: 54, decoration: const BoxDecoration( shape: BoxShape.circle, gradient: LinearGradient(transform: GradientRotation(.83), begin: Alignment.topRight, end: Alignment.bottomLeft, colors: [ diff --git a/lib/ui/work_list/worklist_fragments/actions_fragment.dart b/lib/ui/work_list/worklist_fragments/actions_fragment.dart index 056ca1f..db40be1 100644 --- a/lib/ui/work_list/worklist_fragments/actions_fragment.dart +++ b/lib/ui/work_list/worklist_fragments/actions_fragment.dart @@ -8,7 +8,6 @@ import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; import 'package:mohem_flutter_app/models/get_action_history_list_model.dart'; import 'package:mohem_flutter_app/ui/work_list/sheets/delegate_sheet.dart'; -import 'package:mohem_flutter_app/ui/work_list/sheets/request_more_info_sheet.dart'; import 'package:mohem_flutter_app/widgets/bottom_sheet.dart'; import 'package:mohem_flutter_app/widgets/circular_avatar.dart'; @@ -126,9 +125,3 @@ class ActionsFragment extends StatelessWidget { } } } - -List actionsList = [ - Colors.black, - Colors.red, - Colors.green, -];