@zeniai/client-epic-state 4.13.15 → 4.13.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonPayloadTypes/commonPayload.d.ts +7 -0
- package/lib/commonStateTypes/common.d.ts +2 -0
- package/lib/commonStateTypes/common.js +5 -1
- package/lib/commonStateTypes/fiscalYearHelpers/formatZeniDateFY.d.ts +1 -0
- package/lib/commonStateTypes/fiscalYearHelpers/formatZeniDateFY.js +2 -1
- package/lib/commonStateTypes/timePeriod.d.ts +16 -0
- package/lib/commonStateTypes/timePeriod.js +31 -1
- package/lib/commonStateTypes/viewAndReport/reportIDHelper.d.ts +1 -0
- package/lib/commonStateTypes/viewAndReport/reportIDHelper.js +3 -1
- package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
- package/lib/commonStateTypes/viewAndReport/viewAndReport.js +2 -0
- package/lib/entity/account/accountState.d.ts +1 -1
- package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
- package/lib/entity/chargeCard/chargeCard.d.ts +16 -2
- package/lib/entity/chargeCard/chargeCard.js +18 -1
- package/lib/entity/chargeCard/chargeCardPayload.d.ts +14 -5
- package/lib/entity/chargeCard/chargeCardPayload.js +24 -7
- package/lib/entity/class/classReducer.d.ts +4 -4
- package/lib/entity/class/classState.d.ts +1 -1
- package/lib/entity/company/companyPayload.d.ts +4 -0
- package/lib/entity/company/companyPayload.js +6 -3
- package/lib/entity/company/companyReducer.d.ts +4 -1
- package/lib/entity/company/companyReducer.js +6 -2
- package/lib/entity/company/companyStateTypes.d.ts +5 -1
- package/lib/entity/file/fileState.d.ts +3 -3
- package/lib/entity/file/fileState.js +2 -0
- package/lib/entity/forecast/forecastState.d.ts +1 -1
- package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +1 -0
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +7 -1
- package/lib/entity/jeSchedules/jeSchedulesReducer.d.ts +2 -2
- package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +3 -1
- package/lib/entity/jeSchedules/jeSchedulesSelector.js +2 -1
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +3 -1
- package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +2 -0
- package/lib/entity/jeSchedules/jeSchedulesTypes.js +12 -1
- package/lib/entity/monthEndCloseChecks/monthEndCloseChecksPayload.d.ts +32 -0
- package/lib/entity/monthEndCloseChecks/monthEndCloseChecksPayload.js +60 -0
- package/lib/entity/monthEndCloseChecks/monthEndCloseChecksReducer.d.ts +12 -0
- package/lib/entity/monthEndCloseChecks/monthEndCloseChecksReducer.js +25 -0
- package/lib/entity/monthEndCloseChecks/monthEndCloseChecksSelector.d.ts +7 -0
- package/lib/entity/monthEndCloseChecks/monthEndCloseChecksSelector.js +36 -0
- package/lib/entity/monthEndCloseChecks/monthEndCloseChecksState.d.ts +38 -0
- package/lib/entity/monthEndCloseChecks/monthEndCloseChecksState.js +10 -0
- package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +3 -0
- package/lib/entity/tenant/clearAllEpic.d.ts +12 -2
- package/lib/entity/tenant/clearAllEpic.js +20 -0
- package/lib/entity/tenant/epic/fetchActiveTenantEpic.d.ts +2 -1
- package/lib/entity/tenant/epic/fetchActiveTenantEpic.js +9 -1
- package/lib/entity/tenant/epic/fetchAllTenantsEpic.d.ts +7 -1
- package/lib/entity/tenant/epic/fetchAllTenantsEpic.js +34 -2
- package/lib/entity/tenant/tenantPayload.d.ts +1 -0
- package/lib/entity/tenant/tenantReducer.js +3 -0
- package/lib/entity/tenant/tenantState.d.ts +1 -0
- package/lib/entity/toastNotification/epic/pushToastNotificationEpic.d.ts +1 -1
- package/lib/entity/transaction/payloadTypes/attachmentPayload.d.ts +1 -1
- package/lib/entity/transaction/payloadTypes/attachmentPayload.js +3 -3
- package/lib/entity/transaction/stateTypes/transactionType.d.ts +2 -2
- package/lib/entity/transaction/transactionSelector.d.ts +1 -0
- package/lib/entity/transaction/transactionSelector.js +7 -1
- package/lib/entity/user/userPayload.d.ts +1 -0
- package/lib/entity/user/userReducer.js +9 -8
- package/lib/entity/user/userState.d.ts +1 -0
- package/lib/entity/vendor/__mocks__/vendorStateMocks.d.ts +1 -0
- package/lib/entity/vendor/__mocks__/vendorStateMocks.js +35 -1
- package/lib/entity/vendor/vendorPayload.js +3 -2
- package/lib/entity/vendor/vendorState.d.ts +3 -3
- package/lib/entity/vendor/vendorType.d.ts +0 -2
- package/lib/entity/vendor/vendorType.js +1 -4
- package/lib/entity/vendorExpense/vendorExpenseSelector.d.ts +2 -2
- package/lib/entity/vendorExpense/vendorExpenseSelector.js +1 -0
- package/lib/epic.d.ts +18 -2
- package/lib/epic.js +18 -2
- package/lib/index.d.ts +65 -21
- package/lib/index.js +102 -28
- package/lib/reducer.d.ts +31 -1
- package/lib/reducer.js +31 -1
- package/lib/view/addressView/__mocks__/json/createCompanyAddressSuccess.json +7 -1
- package/lib/view/addressView/__mocks__/json/createCompanyUserAddressSuccess.json +7 -1
- package/lib/view/addressView/addressViewState.d.ts +1 -1
- package/lib/view/addressView/toAddressViewLocalData.d.ts +2 -0
- package/lib/view/addressView/toAddressViewLocalData.js +9 -3
- package/lib/view/auditReportView/auditReportViewState.d.ts +2 -2
- package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
- package/lib/view/cardBalance/cardBalanceSelector.d.ts +1 -1
- package/lib/view/cardPayment/epic/addCardPaymentSourceEpic.d.ts +1 -1
- package/lib/view/cardPayment/epic/confirmCardSetupIntentEpic.d.ts +1 -1
- package/lib/view/cardPayment/epic/createCardSetupIntentEpic.d.ts +1 -1
- package/lib/view/cardPayment/epic/fetchPaymentSourcesEpic.d.ts +1 -1
- package/lib/view/cashBalance/cashBalanceSelector.d.ts +1 -1
- package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
- package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
- package/lib/view/commonVendorView/vendorView/vendorViewSelector.d.ts +1 -1
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewReducer.d.ts +2 -2
- package/lib/view/companyMonthEndReportView/companyMonthEndReportViewReducer.d.ts +10 -5
- package/lib/view/companyMonthEndReportView/companyMonthEndReportViewReducer.js +10 -7
- package/lib/view/companyMonthEndReportView/epics/fetchCompanyMonthEndReportTemplatesEpic.js +4 -4
- package/lib/view/companyMonthEndReportView/epics/fetchCompanyMonthEndReportViewEpic.js +4 -4
- package/lib/view/companyMonthEndReportView/epics/improveUsingZeniGPTEpic.js +5 -3
- package/lib/view/companyMonthEndReportView/epics/saveCompanyMonthEndReportEpic.js +3 -3
- package/lib/view/companyMonthEndReportView/epics/sendCompanyMonthEndReportEpic.js +3 -3
- package/lib/view/companyView/epic/companyPassport/updateCompanyPassportLocalStoreDataEpic.js +1 -6
- package/lib/view/companyView/selectorHelpers/getCompanyView.js +4 -0
- package/lib/view/companyView/types/cockpitTypes.d.ts +2 -2
- package/lib/view/companyView/types/companyPassport/companyUsersLocalData.d.ts +2 -0
- package/lib/view/companyView/types/companyPassport/companyUsersLocalData.js +7 -1
- package/lib/view/companyView/types/companyView.d.ts +1 -0
- package/lib/view/countryList/countryListReducer.d.ts +17 -0
- package/lib/view/countryList/countryListReducer.js +58 -0
- package/lib/view/countryList/countryListSelector.d.ts +7 -0
- package/lib/view/countryList/countryListSelector.js +13 -0
- package/lib/view/countryList/countryListState.d.ts +12 -0
- package/lib/view/countryList/countryListState.js +2 -0
- package/lib/view/countryList/epics/fetchCountryListEpic.d.ts +6 -0
- package/lib/view/countryList/epics/fetchCountryListEpic.js +19 -0
- package/lib/view/countryList/epics/fetchNationalityCountryListEpic.d.ts +7 -0
- package/lib/view/countryList/epics/fetchNationalityCountryListEpic.js +38 -0
- package/lib/view/countryList/payloads/countryListPayload.d.ts +6 -0
- package/lib/view/countryList/payloads/countryListPayload.js +10 -0
- package/lib/view/countryList/payloads/nationalityCountryListPayload.d.ts +11 -0
- package/lib/view/countryList/payloads/nationalityCountryListPayload.js +2 -0
- package/lib/view/dashboard/dashboardEpic.d.ts +2 -1
- package/lib/view/dashboard/dashboardEpic.js +22 -2
- package/lib/view/dashboard/dashboardReducer.d.ts +3 -2
- package/lib/view/dashboard/dashboardReducer.js +2 -1
- package/lib/view/dashboard/dashboardSelector.d.ts +2 -0
- package/lib/view/dashboard/dashboardSelector.js +10 -2
- package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.d.ts +10 -0
- package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +72 -0
- package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.d.ts +11 -0
- package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +53 -0
- package/lib/view/expenseAutomationView/epics/fluxAnalysis/fetchFluxAnalysisViewEpic.d.ts +11 -0
- package/lib/view/expenseAutomationView/epics/fluxAnalysis/fetchFluxAnalysisViewEpic.js +66 -0
- package/lib/view/expenseAutomationView/epics/fluxAnalysis/reviewFluxAnalysisEpic.d.ts +7 -0
- package/lib/view/expenseAutomationView/epics/fluxAnalysis/reviewFluxAnalysisEpic.js +39 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.d.ts +7 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +22 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.d.ts +8 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +59 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/ignoreRecommendedJeScheduleEpic.d.ts +8 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/ignoreRecommendedJeScheduleEpic.js +78 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/initializeJeScheduleLocalDataEpic.d.ts +6 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/initializeJeScheduleLocalDataEpic.js +28 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/retryJeSchedulesEpic.d.ts +9 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/retryJeSchedulesEpic.js +78 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMissingReceiptsEpic.d.ts +8 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMissingReceiptsEpic.js +58 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/uploadMissingReceiptSuccessEpic.d.ts +10 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/uploadMissingReceiptSuccessEpic.js +12 -0
- package/lib/view/expenseAutomationView/expenseAutomationViewPayload.d.ts +3 -0
- package/lib/view/expenseAutomationView/expenseAutomationViewPayload.js +2 -0
- package/lib/view/expenseAutomationView/expenseAutomationViewReducer.d.ts +17 -0
- package/lib/view/expenseAutomationView/expenseAutomationViewReducer.js +66 -0
- package/lib/view/expenseAutomationView/expenseAutomationViewSelector.d.ts +3 -0
- package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +97 -0
- package/lib/view/expenseAutomationView/expenseAutomationViewState.d.ts +11 -0
- package/lib/view/expenseAutomationView/expenseAutomationViewState.js +14 -0
- package/lib/view/expenseAutomationView/helpers/helpers.d.ts +7 -0
- package/lib/view/expenseAutomationView/helpers/helpers.js +67 -0
- package/lib/view/expenseAutomationView/payload/fluxAnalysisPayload.d.ts +76 -0
- package/lib/view/expenseAutomationView/payload/fluxAnalysisPayload.js +9 -0
- package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +36 -0
- package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.js +58 -0
- package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.d.ts +16 -0
- package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.js +2 -0
- package/lib/view/expenseAutomationView/reducers/fluxAnalysisViewReducer.d.ts +34 -0
- package/lib/view/expenseAutomationView/reducers/fluxAnalysisViewReducer.js +205 -0
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +53 -0
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +245 -0
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +31 -0
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +130 -0
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +5 -0
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +45 -0
- package/lib/view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes.d.ts +34 -0
- package/lib/view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes.js +44 -0
- package/lib/view/expenseAutomationView/selectorTypes/fluxAnalysisViewSelectorTypes.d.ts +32 -0
- package/lib/view/expenseAutomationView/selectorTypes/fluxAnalysisViewSelectorTypes.js +2 -0
- package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +28 -0
- package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.js +2 -0
- package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +11 -0
- package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.js +2 -0
- package/lib/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.d.ts +3 -0
- package/lib/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +55 -0
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.d.ts +7 -0
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +95 -0
- package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.d.ts +3 -0
- package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +61 -0
- package/lib/view/expenseAutomationView/types/fluxAnalysisViewState.d.ts +53 -0
- package/lib/view/expenseAutomationView/types/fluxAnalysisViewState.js +5 -0
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +31 -0
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +2 -0
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +20 -0
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.js +13 -0
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +28 -0
- package/lib/view/expenseAutomationView/types/transactionsViewState.js +15 -0
- package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
- package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
- package/lib/view/monthEndCloseChecksView/epics/fetchMonthEndCloseChecksEpic.d.ts +8 -0
- package/lib/view/monthEndCloseChecksView/epics/fetchMonthEndCloseChecksEpic.js +58 -0
- package/lib/view/monthEndCloseChecksView/monthEndCloseChecksViewPayload.d.ts +3 -0
- package/lib/view/monthEndCloseChecksView/monthEndCloseChecksViewPayload.js +2 -0
- package/lib/view/monthEndCloseChecksView/monthEndCloseChecksViewReducer.d.ts +16 -0
- package/lib/view/monthEndCloseChecksView/monthEndCloseChecksViewReducer.js +36 -0
- package/lib/view/monthEndCloseChecksView/monthEndCloseChecksViewSelector.d.ts +10 -0
- package/lib/view/monthEndCloseChecksView/monthEndCloseChecksViewSelector.js +27 -0
- package/lib/view/monthEndCloseChecksView/monthEndCloseChecksViewState.d.ts +5 -0
- package/lib/view/monthEndCloseChecksView/monthEndCloseChecksViewState.js +2 -0
- package/lib/view/onboardingView/customerView/epic/customerDetails/fetchOnboardingCustomerViewEpic.d.ts +8 -1
- package/lib/view/onboardingView/customerView/epic/customerDetails/fetchOnboardingCustomerViewEpic.js +3 -1
- package/lib/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewEpic.js +5 -4
- package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.d.ts +2 -0
- package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.js +6 -3
- package/lib/view/people/changeZeniPersonRolesEpic.d.ts +1 -1
- package/lib/view/people/deletePersonEpic.d.ts +1 -1
- package/lib/view/people/invitePeopleEpic.d.ts +1 -1
- package/lib/view/people/inviteZeniPeopleEpic.d.ts +1 -1
- package/lib/view/people/resendInviteEpic.d.ts +1 -1
- package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
- package/lib/view/reviewCompanyView/reviewCompanyViewState.d.ts +1 -1
- package/lib/view/scheduleView/scheduleAccruedDetailView/LinkBillExpenseView/linkBillExpense.d.ts +1 -1
- package/lib/view/scheduleView/scheduleDetailView/epics/fetchScheduleDetailsEpic.js +3 -2
- package/lib/view/scheduleView/scheduleDetailView/epics/fetchScheduleDetailsPageEpic.js +1 -1
- package/lib/view/scheduleView/scheduleDetailView/epics/saveScheduleDetailsEpic.js +2 -2
- package/lib/view/scheduleView/scheduleDetailView/scheduleDetailLocalDataHelper.js +19 -5
- package/lib/view/scheduleView/scheduleDetailView/scheduleDetailPayload.d.ts +8 -3
- package/lib/view/scheduleView/scheduleDetailView/scheduleDetailPayload.js +39 -57
- package/lib/view/scheduleView/scheduleDetailView/scheduleDetailReducer.d.ts +13 -8
- package/lib/view/scheduleView/scheduleDetailView/scheduleDetailReducer.js +19 -12
- package/lib/view/scheduleView/scheduleDetailView/scheduleDetailSelector.d.ts +1 -0
- package/lib/view/scheduleView/scheduleDetailView/scheduleDetailSelector.js +4 -3
- package/lib/view/scheduleView/scheduleDetailView/scheduleDetailState.d.ts +2 -0
- package/lib/view/scheduleView/scheduleListView/scheduleListSelector.js +1 -1
- package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
- package/lib/view/settingsView/epic/saveNotificationSettingsEpic.d.ts +1 -1
- package/lib/view/settingsView/epic/updateMyProfileEpic.js +6 -4
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigState.d.ts +1 -4
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +2 -0
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +3 -0
- package/lib/view/spendManagement/billPay/editBillView/epics/parseInvoiceToBillEpic.js +2 -2
- package/lib/view/spendManagement/billPay/internationalWire/internationalWireSelector.d.ts +2 -1
- package/lib/view/spendManagement/billPay/internationalWireVerification/epics/fetchIntlVerificationFormEpic.d.ts +7 -0
- package/lib/view/spendManagement/billPay/internationalWireVerification/epics/fetchIntlVerificationFormEpic.js +36 -0
- package/lib/view/spendManagement/billPay/internationalWireVerification/epics/initializeIntlVerificationFormEpic.d.ts +6 -0
- package/lib/view/spendManagement/billPay/internationalWireVerification/epics/initializeIntlVerificationFormEpic.js +42 -0
- package/lib/view/spendManagement/billPay/internationalWireVerification/epics/submitIntlVerificationEpic.d.ts +9 -0
- package/lib/view/spendManagement/billPay/internationalWireVerification/epics/submitIntlVerificationEpic.js +67 -0
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationPayload.d.ts +26 -0
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationPayload.js +22 -0
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationReducer.d.ts +22 -0
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationReducer.js +89 -0
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationSelector.d.ts +15 -0
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationSelector.js +30 -0
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationState.d.ts +20 -0
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationState.js +2 -0
- package/lib/view/spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingReducer.d.ts +3 -1
- package/lib/view/spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingReducer.js +6 -2
- package/lib/view/spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingSelector.d.ts +2 -3
- package/lib/view/spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingSelector.js +3 -3
- package/lib/view/spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingState.d.ts +1 -3
- package/lib/view/spendManagement/chargeCards/cardUserOnboarding/epics/initializeCardUserOnboardingLocalDataEpic.d.ts +1 -2
- package/lib/view/spendManagement/chargeCards/cardUserOnboarding/epics/initializeCardUserOnboardingLocalDataEpic.js +1 -21
- package/lib/view/spendManagement/chargeCards/cardUserOnboarding/epics/saveCardOnboardingUserDetailsEpic.js +1 -3
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.d.ts +1 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.js +4 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.d.ts +8 -1
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +25 -2
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.d.ts +1 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.js +8 -4
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.js +2 -1
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/updatePhysicalChargeCardAttemptEpic.d.ts +11 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/updatePhysicalChargeCardAttemptEpic.js +42 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -14
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +2 -13
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.d.ts +3 -6
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +2 -17
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.d.ts +8 -2
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +55 -15
- package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchIssueCardPageEpic.d.ts +9 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchIssueCardPageEpic.js +44 -0
- package/lib/view/spendManagement/chargeCards/{chargeCardList → issueChargeCard}/issueChargeCardEpic.d.ts +3 -2
- package/lib/view/spendManagement/chargeCards/{chargeCardList → issueChargeCard}/issueChargeCardEpic.js +35 -18
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.d.ts +15 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.js +65 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.d.ts +22 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.js +77 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardState.d.ts +28 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardState.js +23 -0
- package/lib/view/spendManagement/commonSetup/epic/setup/updateBusinessVerificationDetailsEpic.d.ts +1 -1
- package/lib/view/spendManagement/commonSetup/epic/setup/updateBusinessVerificationDetailsEpic.js +31 -6
- package/lib/view/spendManagement/commonSetup/epic/setup/updateSetupViewLocalStoreDataEpic.d.ts +2 -2
- package/lib/view/spendManagement/commonSetup/epic/setup/updateSetupViewLocalStoreDataEpic.js +5 -2
- package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +4 -1
- package/lib/view/spendManagement/commonSetup/setupViewSelector.js +6 -2
- package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +1 -0
- package/lib/view/spendManagement/commonSetup/types/businessVerification.d.ts +4 -0
- package/lib/view/spendManagement/reimbursement/editRemiView/epics/parseReceiptsToRemiEpic.js +2 -2
- package/lib/view/subscriptionView/types/subscriptionTypes.d.ts +1 -1
- package/lib/view/tagView/epics/createTagEpic.d.ts +1 -1
- package/lib/view/tagView/epics/deleteTagEpic.d.ts +1 -1
- package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
- package/lib/view/topEx/topExSelector.d.ts +1 -1
- package/lib/view/transactionDetail/epics/uploadMissingReceiptSuccessEpic.js +2 -2
- package/lib/view/transactionDetail/transactionDetailState.d.ts +2 -2
- package/lib/view/userListView/fetchUserListByTypeEpic.js +4 -1
- package/lib/view/vendorFiling1099/__mock__/vendorFiling1099ListMock.js +1 -1
- package/lib/view/vendorFiling1099/__mock__/vendorFiling1099ListSelectorMock.js +1 -1
- package/lib/view/vendorReviewView/common/state/commonTypes.d.ts +1 -1
- package/lib/view/vendorReviewView/vendorFirstReviewView/epics/saveVendorFirstReviewViewEpic.js +34 -3
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewReducer.d.ts +1 -1
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewReducer.js +2 -2
- package/lib/view/zeniAccStatementList/zeniAccStatementList.d.ts +2 -5
- package/package.json +2 -2
- package/lib/commonPayloadTypes/v2/getSumOfBalancesGroupedByPeriod.d.ts +0 -0
- package/lib/commonPayloadTypes/v2/getSumOfBalancesGroupedByPeriod.js +0 -1
- package/lib/commonStateTypes/selectorTypes/pickAndMergeForecastSectionWithAcOnly.d.ts +0 -0
- package/lib/commonStateTypes/selectorTypes/pickAndMergeForecastSectionWithAcOnly.js +0 -1
package/lib/view/spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingSelector.js
CHANGED
|
@@ -5,8 +5,8 @@ const toolkit_1 = require("@reduxjs/toolkit");
|
|
|
5
5
|
const twoFactorAuthenticationSelector_1 = require("../../../twoFactorAuthentication/twoFactorAuthenticationSelector");
|
|
6
6
|
const reduceFetchState_1 = require("../../../../commonStateTypes/reduceFetchState");
|
|
7
7
|
const userSelector_1 = require("../../../../entity/user/userSelector");
|
|
8
|
-
exports.getCardUserOnboardingView = (0, toolkit_1.createSelector)((state) => state, (state) => state.
|
|
9
|
-
var _a
|
|
8
|
+
exports.getCardUserOnboardingView = (0, toolkit_1.createSelector)((state) => state, (state) => state.cardUserOnboardingState, (state) => state.settingsViewState, (state) => state.tenantState, (state) => state.userState, (state, cardUserOnboardingState, settingsViewState, tenantState, userState) => {
|
|
9
|
+
var _a;
|
|
10
10
|
const twoFAView = (0, twoFactorAuthenticationSelector_1.getTwoFactorAuthenticationView)(state);
|
|
11
11
|
const updateStatus = (0, reduceFetchState_1.reduceAllFetchState)([
|
|
12
12
|
settingsViewState.profile.updateStatus,
|
|
@@ -22,7 +22,6 @@ exports.getCardUserOnboardingView = (0, toolkit_1.createSelector)((state) => sta
|
|
|
22
22
|
const isDOBPresent = (user === null || user === void 0 ? void 0 : user.birthday) != null;
|
|
23
23
|
return {
|
|
24
24
|
cardUserOnboardingLocalData: cardUserOnboardingState.cardUserOnboardingLocalData,
|
|
25
|
-
addressData: (_b = addressViewState.newAddressState) === null || _b === void 0 ? void 0 : _b['user_address'],
|
|
26
25
|
onboardingProgressStatus: updateStatus,
|
|
27
26
|
updateStatus: settingsViewState.profile.updateStatus,
|
|
28
27
|
sendOtpStatus: cardUserOnboardingState.sendOtpStatus,
|
|
@@ -30,5 +29,6 @@ exports.getCardUserOnboardingView = (0, toolkit_1.createSelector)((state) => sta
|
|
|
30
29
|
twoFAView,
|
|
31
30
|
isDOBPresent,
|
|
32
31
|
firstViewAfterActivation: cardUserOnboardingState.firstViewAfterActivation,
|
|
32
|
+
currentDisplayedCardId: cardUserOnboardingState.currentDisplayedCardId,
|
|
33
33
|
};
|
|
34
34
|
});
|
package/lib/view/spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingState.d.ts
CHANGED
|
@@ -2,9 +2,6 @@ import { FetchStateAndError, ID } from '../../../../commonStateTypes/common';
|
|
|
2
2
|
import { ZeniDate } from '../../../../zeniDayJS';
|
|
3
3
|
export interface CardUserOnboardingLocalData {
|
|
4
4
|
userId: ID;
|
|
5
|
-
firstName: string;
|
|
6
|
-
lastName: string;
|
|
7
|
-
email: string;
|
|
8
5
|
phone?: string;
|
|
9
6
|
isPhoneVerified?: boolean;
|
|
10
7
|
otpChallenge?: string;
|
|
@@ -17,4 +14,5 @@ export interface CardUserOnboardingState {
|
|
|
17
14
|
verifyOtpStatus: FetchStateAndError;
|
|
18
15
|
activationWaitStatus: FetchStateAndError;
|
|
19
16
|
firstViewAfterActivation: boolean;
|
|
17
|
+
currentDisplayedCardId?: ID;
|
|
20
18
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { RootState } from '../../../../../reducer';
|
|
4
|
-
import { newAddressInLocalStore, resetNewAddressDataInLocalStore } from '../../../../addressView/addressViewReducer';
|
|
5
4
|
import { initializeCardUserOnboardingLocalData, updateCardUserOnboardingLocalData } from '../cardUserOnboardingReducer';
|
|
6
|
-
export declare type ActionType = ReturnType<typeof initializeCardUserOnboardingLocalData> | ReturnType<typeof updateCardUserOnboardingLocalData
|
|
5
|
+
export declare type ActionType = ReturnType<typeof initializeCardUserOnboardingLocalData> | ReturnType<typeof updateCardUserOnboardingLocalData>;
|
|
7
6
|
export declare const initializeCardUserOnboardingLocalDataEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
|
|
@@ -3,33 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.initializeCardUserOnboardingLocalDataEpic = void 0;
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const addressSelector_1 = require("../../../../../entity/address/addressSelector");
|
|
7
|
-
const addressViewReducer_1 = require("../../../../addressView/addressViewReducer");
|
|
8
6
|
const cardUserOnboardingReducer_1 = require("../cardUserOnboardingReducer");
|
|
9
7
|
const userRoleSelector_1 = require("../../../../../entity/userRole/userRoleSelector");
|
|
10
8
|
const userSelector_1 = require("../../../../../entity/user/userSelector");
|
|
11
|
-
const chargeCardSelector_1 = require("../../../../../entity/chargeCard/chargeCardSelector");
|
|
12
9
|
const initializeCardUserOnboardingLocalDataEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(cardUserOnboardingReducer_1.initializeCardUserOnboardingLocalData.match), (0, operators_1.mergeMap)((action) => {
|
|
13
10
|
const { userId } = action.payload;
|
|
14
|
-
const actions = [
|
|
15
|
-
(0, addressViewReducer_1.resetNewAddressDataInLocalStore)('user_address'),
|
|
16
|
-
];
|
|
17
11
|
const userState = state$.value.userState;
|
|
18
12
|
const userRoleState = state$.value.userRoleState;
|
|
19
13
|
const user = (0, userSelector_1.getUserByUserId)(userState, userId);
|
|
20
14
|
const userRole = (0, userRoleSelector_1.getUserRoleByUserId)(userRoleState, userId);
|
|
21
|
-
const
|
|
22
|
-
const userAddress = (userRole === null || userRole === void 0 ? void 0 : userRole.addressId) != null
|
|
23
|
-
? (0, addressSelector_1.getAddressByAddressId)(state$.value.addressState, userRole.addressId)
|
|
24
|
-
: userCards.length > 0
|
|
25
|
-
? (0, addressSelector_1.getAddressByAddressId)(state$.value.addressState, userCards[0].billingAddressId)
|
|
26
|
-
: undefined;
|
|
27
|
-
if (userAddress != null) {
|
|
28
|
-
actions.push((0, addressViewReducer_1.newAddressInLocalStore)({
|
|
29
|
-
addressType: 'user_address',
|
|
30
|
-
addressToCreate: userAddress,
|
|
31
|
-
}));
|
|
32
|
-
}
|
|
15
|
+
const actions = [];
|
|
33
16
|
if (user != null && userRole != null) {
|
|
34
17
|
const dateOfBirth = user.birthday;
|
|
35
18
|
const phoneNumber = user.phone;
|
|
@@ -37,9 +20,6 @@ const initializeCardUserOnboardingLocalDataEpic = (actions$, state$) => actions$
|
|
|
37
20
|
const syncToken = user === null || user === void 0 ? void 0 : user.syncToken;
|
|
38
21
|
const cardUserOnboardingLocalData = {
|
|
39
22
|
userId,
|
|
40
|
-
firstName: user.firstName,
|
|
41
|
-
lastName: user.lastName,
|
|
42
|
-
email: user.email,
|
|
43
23
|
dateOfBirth,
|
|
44
24
|
phone: phoneNumber,
|
|
45
25
|
isPhoneVerified,
|
|
@@ -6,11 +6,9 @@ const operators_1 = require("rxjs/operators");
|
|
|
6
6
|
const cardUserOnboardingReducer_1 = require("../cardUserOnboardingReducer");
|
|
7
7
|
const settingsViewReducer_1 = require("../../../../settingsView/settingsViewReducer");
|
|
8
8
|
const saveCardOnboardingUserDetailsEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(cardUserOnboardingReducer_1.saveCardOnboardingUserDetails.match), (0, operators_1.mergeMap)(() => {
|
|
9
|
-
var _a;
|
|
10
9
|
const localData = state$.value.cardUserOnboardingState.cardUserOnboardingLocalData;
|
|
11
|
-
const address = (_a = state$.value.addressViewState.newAddressState) === null || _a === void 0 ? void 0 : _a.user_address.addressToCreate;
|
|
12
10
|
return (0, rxjs_1.from)([
|
|
13
|
-
(0, settingsViewReducer_1.updateMyProfile)('CardUserOnboarding', localData === null || localData === void 0 ? void 0 : localData.phone, localData === null || localData === void 0 ? void 0 : localData.otpChallenge, localData === null || localData === void 0 ? void 0 : localData.dateOfBirth
|
|
11
|
+
(0, settingsViewReducer_1.updateMyProfile)('CardUserOnboarding', localData === null || localData === void 0 ? void 0 : localData.phone, localData === null || localData === void 0 ? void 0 : localData.otpChallenge, localData === null || localData === void 0 ? void 0 : localData.dateOfBirth),
|
|
14
12
|
]);
|
|
15
13
|
}));
|
|
16
14
|
exports.saveCardOnboardingUserDetailsEpic = saveCardOnboardingUserDetailsEpic;
|
|
@@ -9,6 +9,7 @@ interface ChargeCardDetail extends FetchedState {
|
|
|
9
9
|
id: ID;
|
|
10
10
|
transactionList: ChargeCardDetailTransactionList;
|
|
11
11
|
updateStatus: FetchStateAndError;
|
|
12
|
+
updatePhysicalChargeCardAttemptFetchState: FetchStateAndError;
|
|
12
13
|
}
|
|
13
14
|
export declare const toChargeCardTransactionSortKeyType: (v: string) => "type" | "amount" | "merchant" | "paymentDate" | "receipts";
|
|
14
15
|
export declare type ChargeCardTransactionSortKey = ReturnType<typeof toChargeCardTransactionSortKeyType>;
|
|
@@ -42,7 +42,14 @@ export declare const fetchChargeCardDetailPage: import("@reduxjs/toolkit").Actio
|
|
|
42
42
|
cardId: ID;
|
|
43
43
|
transactionId: ID;
|
|
44
44
|
status: ZeniAPIStatus;
|
|
45
|
-
}, string>,
|
|
45
|
+
}, string>, updatePhysicalChargeCardAttemptSuccessOrFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
46
|
+
chargeCardId: ID;
|
|
47
|
+
fetchState: FetchState;
|
|
48
|
+
error?: ZeniAPIStatus<Record<string, unknown>> | undefined;
|
|
49
|
+
}, string>, updatePhysicalChargeCardAttempt: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[chargeCardId: string, statusCode: "failed" | "success"], {
|
|
50
|
+
chargeCardId: string;
|
|
51
|
+
statusCode: "failed" | "success";
|
|
52
|
+
}, string, never, never>, updateChargeCardTransactionReceiptsShowTickFetchStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
46
53
|
transactionId: ID;
|
|
47
54
|
chargeCardId: ID;
|
|
48
55
|
shouldShowTick: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.clearChargeCardDetail = exports.updateChargeCardDetailUpdateStatus = exports.updateChargeCardDetail = exports.updateChargeCardTransactionListFailure = exports.updateChargeCardTransactionAttachmentsInCardDetail = exports.updateChargeCardTransactionReceiptsShowTickFetchStatus = exports.updateChargeCardTransactionAttachmentsFailure = exports.updateChargeCardTransactionIsViewReceiptClicked = exports.fetchChargeCardTransactionAttachments = exports.updateChargeCardTransactionUploadReceiptsFetchStatus = exports.updateChargeCardTransactionList = exports.updateChargeCardDetailUIState = exports.fetchChargeCardTransactionList = exports.updateChargeCardDetailFetchState = exports.fetchChargeCardDetail = exports.fetchChargeCardDetailPage = exports.initialState = void 0;
|
|
4
|
+
exports.clearChargeCardDetail = exports.updateChargeCardDetailUpdateStatus = exports.updateChargeCardDetail = exports.updateChargeCardTransactionListFailure = exports.updateChargeCardTransactionAttachmentsInCardDetail = exports.updateChargeCardTransactionReceiptsShowTickFetchStatus = exports.updatePhysicalChargeCardAttempt = exports.updatePhysicalChargeCardAttemptSuccessOrFailure = exports.updateChargeCardTransactionAttachmentsFailure = exports.updateChargeCardTransactionIsViewReceiptClicked = exports.fetchChargeCardTransactionAttachments = exports.updateChargeCardTransactionUploadReceiptsFetchStatus = exports.updateChargeCardTransactionList = exports.updateChargeCardDetailUIState = exports.fetchChargeCardTransactionList = exports.updateChargeCardDetailFetchState = exports.fetchChargeCardDetail = exports.fetchChargeCardDetailPage = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const sortOrderPayload_1 = require("../../../../commonPayloadTypes/sortOrderPayload");
|
|
7
7
|
const attachmentPayload_1 = require("../../../../entity/transaction/payloadTypes/attachmentPayload");
|
|
@@ -94,6 +94,29 @@ const chargeCardDetail = (0, toolkit_1.createSlice)({
|
|
|
94
94
|
const existingCardDetail = draft.detailById[chargeCardId];
|
|
95
95
|
draft.detailById[chargeCardId] = Object.assign(Object.assign({}, existingCardDetail), { transactionList: Object.assign(Object.assign({}, existingCardDetail.transactionList), { fetchState: 'Error', error }) });
|
|
96
96
|
},
|
|
97
|
+
updatePhysicalChargeCardAttempt: {
|
|
98
|
+
reducer(draft, action) {
|
|
99
|
+
const { chargeCardId } = action.payload;
|
|
100
|
+
const existingCardDetail = draft.detailById[chargeCardId];
|
|
101
|
+
draft.detailById[chargeCardId] = Object.assign(Object.assign({}, existingCardDetail), { updatePhysicalChargeCardAttemptFetchState: {
|
|
102
|
+
fetchState: 'In-Progress',
|
|
103
|
+
error: undefined,
|
|
104
|
+
} });
|
|
105
|
+
},
|
|
106
|
+
prepare(chargeCardId, statusCode) {
|
|
107
|
+
return {
|
|
108
|
+
payload: { chargeCardId, statusCode },
|
|
109
|
+
};
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
updatePhysicalChargeCardAttemptSuccessOrFailure(draft, action) {
|
|
113
|
+
const { chargeCardId, fetchState, error } = action.payload;
|
|
114
|
+
const existingCardDetail = draft.detailById[chargeCardId];
|
|
115
|
+
draft.detailById[chargeCardId] = Object.assign(Object.assign({}, existingCardDetail), { updatePhysicalChargeCardAttemptFetchState: {
|
|
116
|
+
fetchState,
|
|
117
|
+
error,
|
|
118
|
+
} });
|
|
119
|
+
},
|
|
97
120
|
updateChargeCardDetail: {
|
|
98
121
|
reducer(draft, action) {
|
|
99
122
|
const { chargeCardId } = action.payload;
|
|
@@ -181,5 +204,5 @@ const chargeCardDetail = (0, toolkit_1.createSlice)({
|
|
|
181
204
|
},
|
|
182
205
|
},
|
|
183
206
|
});
|
|
184
|
-
_a = chargeCardDetail.actions, exports.fetchChargeCardDetailPage = _a.fetchChargeCardDetailPage, exports.fetchChargeCardDetail = _a.fetchChargeCardDetail, exports.updateChargeCardDetailFetchState = _a.updateChargeCardDetailFetchState, exports.fetchChargeCardTransactionList = _a.fetchChargeCardTransactionList, exports.updateChargeCardDetailUIState = _a.updateChargeCardDetailUIState, exports.updateChargeCardTransactionList = _a.updateChargeCardTransactionList, exports.updateChargeCardTransactionUploadReceiptsFetchStatus = _a.updateChargeCardTransactionUploadReceiptsFetchStatus, exports.fetchChargeCardTransactionAttachments = _a.fetchChargeCardTransactionAttachments, exports.updateChargeCardTransactionIsViewReceiptClicked = _a.updateChargeCardTransactionIsViewReceiptClicked, exports.updateChargeCardTransactionAttachmentsFailure = _a.updateChargeCardTransactionAttachmentsFailure, exports.updateChargeCardTransactionReceiptsShowTickFetchStatus = _a.updateChargeCardTransactionReceiptsShowTickFetchStatus, exports.updateChargeCardTransactionAttachmentsInCardDetail = _a.updateChargeCardTransactionAttachmentsInCardDetail, exports.updateChargeCardTransactionListFailure = _a.updateChargeCardTransactionListFailure, exports.updateChargeCardDetail = _a.updateChargeCardDetail, exports.updateChargeCardDetailUpdateStatus = _a.updateChargeCardDetailUpdateStatus, exports.clearChargeCardDetail = _a.clearChargeCardDetail;
|
|
207
|
+
_a = chargeCardDetail.actions, exports.fetchChargeCardDetailPage = _a.fetchChargeCardDetailPage, exports.fetchChargeCardDetail = _a.fetchChargeCardDetail, exports.updateChargeCardDetailFetchState = _a.updateChargeCardDetailFetchState, exports.fetchChargeCardTransactionList = _a.fetchChargeCardTransactionList, exports.updateChargeCardDetailUIState = _a.updateChargeCardDetailUIState, exports.updateChargeCardTransactionList = _a.updateChargeCardTransactionList, exports.updateChargeCardTransactionUploadReceiptsFetchStatus = _a.updateChargeCardTransactionUploadReceiptsFetchStatus, exports.fetchChargeCardTransactionAttachments = _a.fetchChargeCardTransactionAttachments, exports.updateChargeCardTransactionIsViewReceiptClicked = _a.updateChargeCardTransactionIsViewReceiptClicked, exports.updateChargeCardTransactionAttachmentsFailure = _a.updateChargeCardTransactionAttachmentsFailure, exports.updatePhysicalChargeCardAttemptSuccessOrFailure = _a.updatePhysicalChargeCardAttemptSuccessOrFailure, exports.updatePhysicalChargeCardAttempt = _a.updatePhysicalChargeCardAttempt, exports.updateChargeCardTransactionReceiptsShowTickFetchStatus = _a.updateChargeCardTransactionReceiptsShowTickFetchStatus, exports.updateChargeCardTransactionAttachmentsInCardDetail = _a.updateChargeCardTransactionAttachmentsInCardDetail, exports.updateChargeCardTransactionListFailure = _a.updateChargeCardTransactionListFailure, exports.updateChargeCardDetail = _a.updateChargeCardDetail, exports.updateChargeCardDetailUpdateStatus = _a.updateChargeCardDetailUpdateStatus, exports.clearChargeCardDetail = _a.clearChargeCardDetail;
|
|
185
208
|
exports.default = chargeCardDetail.reducer;
|
|
@@ -18,6 +18,7 @@ export interface ChargeCardDetailSelectorView extends SelectorView {
|
|
|
18
18
|
twoFAView: TwoFactorAuthenticationView;
|
|
19
19
|
loggedInUserPhone: string;
|
|
20
20
|
updateFetchState: FetchStateAndError;
|
|
21
|
+
updatePhysicalChargeCardAttemptFetchState: FetchStateAndError;
|
|
21
22
|
chargeCard?: ChargeCardWithUser;
|
|
22
23
|
}
|
|
23
24
|
export declare const getChargeCardDetailView: (state: RootState, chargeCardId: ID) => ChargeCardDetailSelectorView;
|
|
@@ -15,7 +15,7 @@ const userRoleSelector_1 = require("../../../../entity/userRole/userRoleSelector
|
|
|
15
15
|
const chargeCardDetail_1 = require("./chargeCardDetail");
|
|
16
16
|
const twoFactorAuthenticationSelector_1 = require("../../../twoFactorAuthentication/twoFactorAuthenticationSelector");
|
|
17
17
|
const getChargeCardDetailView = (state, chargeCardId) => {
|
|
18
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
18
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
19
19
|
const { tenantState, addressState, chargeCardDetailState, chargeCardState, classState, userState, userRoleState, chargeCardConfigState, chargeCardTransactionState, } = state;
|
|
20
20
|
const twoFactorAuthenticationView = (0, twoFactorAuthenticationSelector_1.getTwoFactorAuthenticationView)(state);
|
|
21
21
|
const loggedInUserId = (_b = (_a = tenantState.loggedInUser) === null || _a === void 0 ? void 0 : _a.userId) !== null && _b !== void 0 ? _b : '';
|
|
@@ -79,13 +79,17 @@ const getChargeCardDetailView = (state, chargeCardId) => {
|
|
|
79
79
|
fetchState: 'Not-Started',
|
|
80
80
|
error: undefined,
|
|
81
81
|
},
|
|
82
|
+
updatePhysicalChargeCardAttemptFetchState: (_g = chargeCardDetail === null || chargeCardDetail === void 0 ? void 0 : chargeCardDetail.updatePhysicalChargeCardAttemptFetchState) !== null && _g !== void 0 ? _g : {
|
|
83
|
+
fetchState: 'Not-Started',
|
|
84
|
+
error: undefined,
|
|
85
|
+
},
|
|
82
86
|
chargeCard: chargeCardWithUser,
|
|
83
87
|
error: reducedFetchState.error,
|
|
84
88
|
chargeCardConfig: chargeCardConfigState,
|
|
85
89
|
transactions,
|
|
86
|
-
uploadReceiptsFetchStateByTransactionId: (
|
|
87
|
-
uploadReceiptsShowTickByTransactionId: (
|
|
88
|
-
isViewReceiptClickedImmediatelyAfterUploadTransactionId: (
|
|
90
|
+
uploadReceiptsFetchStateByTransactionId: (_h = chargeCardDetail === null || chargeCardDetail === void 0 ? void 0 : chargeCardDetail.transactionList.uploadReceiptsFetchStateByTransactionId) !== null && _h !== void 0 ? _h : {},
|
|
91
|
+
uploadReceiptsShowTickByTransactionId: (_j = chargeCardDetail === null || chargeCardDetail === void 0 ? void 0 : chargeCardDetail.transactionList.uploadReceiptsShowTickByTransactionId) !== null && _j !== void 0 ? _j : {},
|
|
92
|
+
isViewReceiptClickedImmediatelyAfterUploadTransactionId: (_k = chargeCardDetail === null || chargeCardDetail === void 0 ? void 0 : chargeCardDetail.transactionList.isViewReceiptClickedImmediatelyAfterUploadTransactionId) !== null && _k !== void 0 ? _k : {},
|
|
89
93
|
uiState,
|
|
90
94
|
transactionListFetchState,
|
|
91
95
|
twoFAView: twoFactorAuthenticationView,
|
|
@@ -26,7 +26,8 @@ const fetchChargeCardDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((
|
|
|
26
26
|
fetchState: 'In-Progress',
|
|
27
27
|
}));
|
|
28
28
|
const getChargeCardDetail$ = zeniAPI
|
|
29
|
-
.getJSON(`${zeniAPI.apiEndPoints.cardMicroServiceBaseUrl}/1.0/cards/${chargeCardId}
|
|
29
|
+
.getJSON(`${zeniAPI.apiEndPoints.cardMicroServiceBaseUrl}/1.0/cards/${chargeCardId}?query={
|
|
30
|
+
"is_include_card_activation_events":true}`)
|
|
30
31
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
31
32
|
if ((0, responsePayload_1.isSuccessStatus)(response) && response.data != null) {
|
|
32
33
|
return (0, rxjs_1.of)((0, chargeCardReducer_1.updateChargeCard)(response.data.card), (0, userReducer_1.updateAllUsers)({ users: response.data.users }), (0, userRoleReducer_1.updateUserRoles)(response.data.user_roles), (0, addressReducer_1.updateAddresses)(response.data.addresses), (0, chargeCardDetailReducer_1.updateChargeCardDetailFetchState)({
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RootState } from '../../../../reducer';
|
|
4
|
+
import { ZeniAPI } from '../../../../zeniAPI';
|
|
5
|
+
import { updatePhysicalChargeCardAttemptSuccessOrFailure, updatePhysicalChargeCardAttempt } from './chargeCardDetailReducer';
|
|
6
|
+
import { updateAllUsers } from '../../../../entity/user/userReducer';
|
|
7
|
+
import { updateUserRoles } from '../../../../entity/userRole/userRoleReducer';
|
|
8
|
+
import { updateChargeCard } from '../../../../entity/chargeCard/chargeCardReducer';
|
|
9
|
+
import { updateAddress, updateAddresses } from '../../../../entity/address/addressReducer';
|
|
10
|
+
export declare type ActionType = ReturnType<typeof updatePhysicalChargeCardAttempt> | ReturnType<typeof updatePhysicalChargeCardAttemptSuccessOrFailure> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateUserRoles> | ReturnType<typeof updateAddress> | ReturnType<typeof updateAddresses> | ReturnType<typeof updateChargeCard>;
|
|
11
|
+
export declare const updatePhysicalChargeCardAttemptEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
package/lib/view/spendManagement/chargeCards/chargeCardDetail/updatePhysicalChargeCardAttemptEpic.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updatePhysicalChargeCardAttemptEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const responsePayload_1 = require("../../../../responsePayload");
|
|
7
|
+
const chargeCardDetailReducer_1 = require("./chargeCardDetailReducer");
|
|
8
|
+
const userReducer_1 = require("../../../../entity/user/userReducer");
|
|
9
|
+
const userRoleReducer_1 = require("../../../../entity/userRole/userRoleReducer");
|
|
10
|
+
const chargeCardReducer_1 = require("../../../../entity/chargeCard/chargeCardReducer");
|
|
11
|
+
const updatePhysicalChargeCardAttemptEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(chargeCardDetailReducer_1.updatePhysicalChargeCardAttempt.match), (0, operators_1.switchMap)((action) => {
|
|
12
|
+
const { chargeCardId, statusCode } = action.payload;
|
|
13
|
+
const payload = {
|
|
14
|
+
status_code: statusCode,
|
|
15
|
+
is_card_activation_attempted: true,
|
|
16
|
+
};
|
|
17
|
+
return zeniAPI
|
|
18
|
+
.putAndGetJSON(`${zeniAPI.apiEndPoints.cardMicroServiceBaseUrl}/1.0/cards/${chargeCardId}`, payload)
|
|
19
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
20
|
+
if ((0, responsePayload_1.isSuccessStatus)(response) && response.data != null) {
|
|
21
|
+
return (0, rxjs_1.of)((0, chargeCardReducer_1.updateChargeCard)(response.data.card), (0, userReducer_1.updateAllUsers)({ users: response.data.users }), (0, userRoleReducer_1.updateUserRoles)(response.data.user_roles), (0, chargeCardDetailReducer_1.updatePhysicalChargeCardAttemptSuccessOrFailure)({
|
|
22
|
+
chargeCardId,
|
|
23
|
+
fetchState: 'Completed',
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
return (0, rxjs_1.of)((0, chargeCardDetailReducer_1.updatePhysicalChargeCardAttemptSuccessOrFailure)({
|
|
28
|
+
chargeCardId,
|
|
29
|
+
fetchState: 'Error',
|
|
30
|
+
error: response.status,
|
|
31
|
+
}));
|
|
32
|
+
}
|
|
33
|
+
}), (0, operators_1.catchError)((error) => {
|
|
34
|
+
return (0, rxjs_1.of)((0, chargeCardDetailReducer_1.updatePhysicalChargeCardAttemptSuccessOrFailure)({
|
|
35
|
+
chargeCardId,
|
|
36
|
+
fetchState: 'Error',
|
|
37
|
+
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Update physical card attempt API call errored out' +
|
|
38
|
+
JSON.stringify(error)),
|
|
39
|
+
}));
|
|
40
|
+
}));
|
|
41
|
+
}));
|
|
42
|
+
exports.updatePhysicalChargeCardAttemptEpic = updatePhysicalChargeCardAttemptEpic;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { Amount } from '../../../../commonStateTypes/amount';
|
|
2
2
|
import { FetchedState, FetchStateAndError, ID } from '../../../../commonStateTypes/common';
|
|
3
|
-
import { CreditLimitFrequencyCodeType } from '../../../../entity/chargeCard/chargeCard';
|
|
4
3
|
import { SpendManagementUIState } from '../../billPay/billList/billListState';
|
|
5
4
|
export interface ChargeCardListState extends FetchedState {
|
|
6
5
|
cardIds: ID[];
|
|
7
6
|
uiState: ChargeCardListUIState;
|
|
8
7
|
creditAccount: CreditAccount;
|
|
9
|
-
issueChargeCard: IssueChargeCard;
|
|
10
8
|
searchText: string;
|
|
11
9
|
unAssignedCredits?: Amount;
|
|
12
10
|
resendCardInvite: ResendRevokeCardInvite;
|
|
@@ -19,16 +17,6 @@ export interface ResendRevokeCardInvite {
|
|
|
19
17
|
export interface ChargeCardListUIState extends SpendManagementUIState {
|
|
20
18
|
sortKey: ChargeCardViewSortKey;
|
|
21
19
|
}
|
|
22
|
-
export interface IssueChargeCard {
|
|
23
|
-
localData: ChargeCardLocalData;
|
|
24
|
-
saveStatus: FetchStateAndError;
|
|
25
|
-
}
|
|
26
|
-
export interface ChargeCardLocalData {
|
|
27
|
-
userIds: ID[];
|
|
28
|
-
cardName: string;
|
|
29
|
-
amount?: Amount;
|
|
30
|
-
frequency: CreditLimitFrequencyCodeType;
|
|
31
|
-
}
|
|
32
20
|
export interface CreditAccount extends FetchStateAndError {
|
|
33
21
|
id: ID;
|
|
34
22
|
status: CreditAccountStatusType;
|
|
@@ -39,9 +27,8 @@ export interface CreditAccount extends FetchStateAndError {
|
|
|
39
27
|
cashback?: Amount;
|
|
40
28
|
}
|
|
41
29
|
export declare const initialCreditAcc: CreditAccount;
|
|
42
|
-
export declare const initialIssueChargeCard: IssueChargeCard;
|
|
43
30
|
export declare const initialResendRevokeCardInvite: ResendRevokeCardInvite;
|
|
44
|
-
export declare const toChargeCardSortKeyType: (v: string) => "owner" | "
|
|
31
|
+
export declare const toChargeCardSortKeyType: (v: string) => "status" | "owner" | "limit" | "department" | "cardName" | "utilisation";
|
|
45
32
|
export declare type ChargeCardViewSortKey = ReturnType<typeof toChargeCardSortKeyType>;
|
|
46
33
|
export declare const ALL_CASHBACK_SORT_KEYS: readonly ["month", "cashback"];
|
|
47
34
|
export declare const toCashbackSortKeyType: (v: string) => "month" | "cashback";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toCreditAccountStatusType = exports.toCashbackSortKeyType = exports.ALL_CASHBACK_SORT_KEYS = exports.toChargeCardSortKeyType = exports.initialResendRevokeCardInvite = exports.
|
|
3
|
+
exports.toCreditAccountStatusType = exports.toCashbackSortKeyType = exports.ALL_CASHBACK_SORT_KEYS = exports.toChargeCardSortKeyType = exports.initialResendRevokeCardInvite = exports.initialCreditAcc = void 0;
|
|
4
4
|
const stringToUnion_1 = require("../../../../commonStateTypes/stringToUnion");
|
|
5
5
|
exports.initialCreditAcc = {
|
|
6
6
|
fetchState: 'Not-Started',
|
|
@@ -33,18 +33,6 @@ exports.initialCreditAcc = {
|
|
|
33
33
|
currencySymbol: '$',
|
|
34
34
|
},
|
|
35
35
|
};
|
|
36
|
-
exports.initialIssueChargeCard = {
|
|
37
|
-
localData: {
|
|
38
|
-
userIds: [],
|
|
39
|
-
cardName: '',
|
|
40
|
-
amount: undefined,
|
|
41
|
-
frequency: 'monthly',
|
|
42
|
-
},
|
|
43
|
-
saveStatus: {
|
|
44
|
-
fetchState: 'Not-Started',
|
|
45
|
-
error: undefined,
|
|
46
|
-
},
|
|
47
|
-
};
|
|
48
36
|
exports.initialResendRevokeCardInvite = {
|
|
49
37
|
cardId: undefined,
|
|
50
38
|
saveStatus: {
|
|
@@ -56,6 +44,7 @@ const ALL_CHARGE_CARD_SORT_KEYS = [
|
|
|
56
44
|
'owner',
|
|
57
45
|
'cardName',
|
|
58
46
|
'department',
|
|
47
|
+
'status',
|
|
59
48
|
'utilisation',
|
|
60
49
|
'limit',
|
|
61
50
|
];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ZeniAPIStatus } from '../../../../responsePayload';
|
|
2
2
|
import { ChargeCardListPayload, CreditAccountPayload } from './chargeCardListPayload';
|
|
3
|
-
import { ChargeCardListState, ChargeCardListUIState
|
|
4
|
-
import {
|
|
3
|
+
import { ChargeCardListState, ChargeCardListUIState } from './chargeCardList';
|
|
4
|
+
import { ID } from '../../../../commonStateTypes/common';
|
|
5
5
|
export declare const initialState: ChargeCardListState;
|
|
6
6
|
export declare const fetchChargeCardListPage: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[doFetchCreditAccountsAndCashback: boolean, cacheOverride?: any], {
|
|
7
7
|
doFetchCreditAccountsAndCashback: boolean;
|
|
@@ -9,10 +9,7 @@ export declare const fetchChargeCardListPage: import("@reduxjs/toolkit").ActionC
|
|
|
9
9
|
}, string, never, never>, fetchCreditAccount: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, updateCreditAccount: import("@reduxjs/toolkit").ActionCreatorWithPayload<CreditAccountPayload[], string>, updateCreditAccountFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, string>, fetchChargeCardList: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, updateChargeCardList: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
10
10
|
chargeCardListPayload: ChargeCardListPayload;
|
|
11
11
|
keepExistingListItems?: boolean | undefined;
|
|
12
|
-
}, string>, updateChargeCardListFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, string>,
|
|
13
|
-
fetchState: FetchState;
|
|
14
|
-
error?: ZeniAPIStatus<Record<string, unknown>> | undefined;
|
|
15
|
-
}, string>, resetIssueChargeCardForm: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, updateSearchText: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, updateChargeCardListUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
12
|
+
}, string>, updateChargeCardListFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, string>, updateSearchText: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, updateChargeCardListUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
16
13
|
uiState: Partial<ChargeCardListUIState>;
|
|
17
14
|
}, string>, clearChargeCardList: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resendCardInvite: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cardId: string], {
|
|
18
15
|
cardId: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.revokeCardInviteFailure = exports.revokeCardInviteSuccess = exports.revokeCardInvite = exports.resendCardInviteFailure = exports.resendCardInviteSuccess = exports.resendCardInvite = exports.clearChargeCardList = exports.updateChargeCardListUIState = exports.updateSearchText = exports.
|
|
4
|
+
exports.revokeCardInviteFailure = exports.revokeCardInviteSuccess = exports.revokeCardInvite = exports.resendCardInviteFailure = exports.resendCardInviteSuccess = exports.resendCardInvite = exports.clearChargeCardList = exports.updateChargeCardListUIState = exports.updateSearchText = exports.updateChargeCardListFailure = exports.updateChargeCardList = exports.fetchChargeCardList = exports.updateCreditAccountFailure = exports.updateCreditAccount = exports.fetchCreditAccount = exports.fetchChargeCardListPage = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const chargeCardList_1 = require("./chargeCardList");
|
|
7
7
|
const amount_1 = require("../../../../commonStateTypes/amount");
|
|
@@ -15,7 +15,6 @@ exports.initialState = {
|
|
|
15
15
|
hasValidState() {
|
|
16
16
|
return this.fetchState == 'Completed';
|
|
17
17
|
},
|
|
18
|
-
issueChargeCard: chargeCardList_1.initialIssueChargeCard,
|
|
19
18
|
uiState: {
|
|
20
19
|
sortKey: 'owner',
|
|
21
20
|
sortOrder: 'ascending',
|
|
@@ -71,20 +70,6 @@ const chargeCardList = (0, toolkit_1.createSlice)({
|
|
|
71
70
|
draft.fetchState = 'Error';
|
|
72
71
|
draft.error = action.payload;
|
|
73
72
|
},
|
|
74
|
-
issueChargeCard(draft) {
|
|
75
|
-
draft.issueChargeCard.saveStatus.fetchState = 'In-Progress';
|
|
76
|
-
draft.issueChargeCard.saveStatus.error = undefined;
|
|
77
|
-
},
|
|
78
|
-
updateChargeCardLocalStore(draft, action) {
|
|
79
|
-
draft.issueChargeCard.localData = action.payload;
|
|
80
|
-
},
|
|
81
|
-
resetIssueChargeCardForm(draft) {
|
|
82
|
-
draft.issueChargeCard = Object.assign({}, exports.initialState.issueChargeCard);
|
|
83
|
-
},
|
|
84
|
-
issueChargeCardSuccessOrFailure(draft, action) {
|
|
85
|
-
draft.issueChargeCard.saveStatus.fetchState = action.payload.fetchState;
|
|
86
|
-
draft.issueChargeCard.saveStatus.error = action.payload.error;
|
|
87
|
-
},
|
|
88
73
|
updateSearchText(draft, action) {
|
|
89
74
|
draft.searchText = action.payload;
|
|
90
75
|
},
|
|
@@ -143,7 +128,7 @@ const chargeCardList = (0, toolkit_1.createSlice)({
|
|
|
143
128
|
},
|
|
144
129
|
},
|
|
145
130
|
});
|
|
146
|
-
_a = chargeCardList.actions, exports.fetchChargeCardListPage = _a.fetchChargeCardListPage, exports.fetchCreditAccount = _a.fetchCreditAccount, exports.updateCreditAccount = _a.updateCreditAccount, exports.updateCreditAccountFailure = _a.updateCreditAccountFailure, exports.fetchChargeCardList = _a.fetchChargeCardList, exports.updateChargeCardList = _a.updateChargeCardList, exports.updateChargeCardListFailure = _a.updateChargeCardListFailure, exports.
|
|
131
|
+
_a = chargeCardList.actions, exports.fetchChargeCardListPage = _a.fetchChargeCardListPage, exports.fetchCreditAccount = _a.fetchCreditAccount, exports.updateCreditAccount = _a.updateCreditAccount, exports.updateCreditAccountFailure = _a.updateCreditAccountFailure, exports.fetchChargeCardList = _a.fetchChargeCardList, exports.updateChargeCardList = _a.updateChargeCardList, exports.updateChargeCardListFailure = _a.updateChargeCardListFailure, exports.updateSearchText = _a.updateSearchText, exports.updateChargeCardListUIState = _a.updateChargeCardListUIState, exports.clearChargeCardList = _a.clearChargeCardList, exports.resendCardInvite = _a.resendCardInvite, exports.resendCardInviteSuccess = _a.resendCardInviteSuccess, exports.resendCardInviteFailure = _a.resendCardInviteFailure, exports.revokeCardInvite = _a.revokeCardInvite, exports.revokeCardInviteSuccess = _a.revokeCardInviteSuccess, exports.revokeCardInviteFailure = _a.revokeCardInviteFailure;
|
|
147
132
|
exports.default = chargeCardList.reducer;
|
|
148
133
|
// helper
|
|
149
134
|
const toCreditAccount = (payload) => ({
|
|
@@ -7,7 +7,7 @@ import { Class, ClassBase } from '../../../../entity/class/classState';
|
|
|
7
7
|
import { User } from '../../../../entity/user/userState';
|
|
8
8
|
import { UserRole } from '../../../../entity/userRole/userRoleState';
|
|
9
9
|
import { RootState } from '../../../../reducer';
|
|
10
|
-
import { ChargeCardListUIState, CreditAccount,
|
|
10
|
+
import { ChargeCardListUIState, CreditAccount, ResendRevokeCardInvite } from './chargeCardList';
|
|
11
11
|
import { Person } from '../../../people/peopleSelectorTypes';
|
|
12
12
|
import { ChargeCardConfigState } from '../chargeCardConfig/chargeCardConfigState';
|
|
13
13
|
export interface ChargeCardWithUser extends ChargeCard {
|
|
@@ -18,12 +18,14 @@ export interface ChargeCardWithUser extends ChargeCard {
|
|
|
18
18
|
department?: ClassBase;
|
|
19
19
|
mailingAddress?: Address;
|
|
20
20
|
}
|
|
21
|
+
export interface ChargeCardWithUserAndShippingAddress extends ChargeCardWithUser {
|
|
22
|
+
shippingAddress?: Address;
|
|
23
|
+
}
|
|
21
24
|
export interface ChargeCardListSelectorView extends SelectorView {
|
|
22
25
|
totalCashback: Amount;
|
|
23
26
|
cards: ChargeCardWithUser[];
|
|
24
27
|
creditAccount: CreditAccount;
|
|
25
28
|
chargeCardConfig: ChargeCardConfigState;
|
|
26
|
-
issueChargeCard: IssueChargeCard;
|
|
27
29
|
userList: Person[];
|
|
28
30
|
allAccountingClasses: Class[];
|
|
29
31
|
issueCardPageFetchState: FetchStateAndError;
|
|
@@ -33,6 +35,10 @@ export interface ChargeCardListSelectorView extends SelectorView {
|
|
|
33
35
|
revokeCardInvite: ResendRevokeCardInvite;
|
|
34
36
|
unAssignedCredits?: Amount;
|
|
35
37
|
}
|
|
38
|
+
export interface ChargeCardListWithShippingAddressSelectorView extends SelectorView {
|
|
39
|
+
cards: ChargeCardWithUserAndShippingAddress[];
|
|
40
|
+
}
|
|
36
41
|
export declare const getChargeCardListView: (state: RootState, includeCreditAccountAndCashbackInfo: boolean) => ChargeCardListSelectorView;
|
|
42
|
+
export declare const getMyChargeCardListWithShippingAddress: (state: RootState) => ChargeCardListWithShippingAddressSelectorView;
|
|
37
43
|
export declare const anyCardOnHold: (cards: ChargeCardWithUser[]) => boolean;
|
|
38
44
|
export declare const getCreditAccount: (state: RootState) => CreditAccount;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getCreditAccount = exports.anyCardOnHold = exports.getChargeCardListView = void 0;
|
|
6
|
+
exports.getCreditAccount = exports.anyCardOnHold = exports.getMyChargeCardListWithShippingAddress = exports.getChargeCardListView = void 0;
|
|
7
7
|
const orderBy_1 = __importDefault(require("lodash/orderBy"));
|
|
8
8
|
const reduceFetchState_1 = require("../../../../commonStateTypes/reduceFetchState");
|
|
9
9
|
const sortOrderPayload_1 = require("../../../../commonPayloadTypes/sortOrderPayload");
|
|
@@ -79,6 +79,8 @@ const getChargeCardListView = (state, includeCreditAccountAndCashbackInfo) => {
|
|
|
79
79
|
return card.cardName.toLowerCase();
|
|
80
80
|
case 'department':
|
|
81
81
|
return (_d = (_c = card.department) === null || _c === void 0 ? void 0 : _c.className.toLowerCase()) !== null && _d !== void 0 ? _d : '';
|
|
82
|
+
case 'status':
|
|
83
|
+
return card.status.code;
|
|
82
84
|
case 'utilisation':
|
|
83
85
|
return card.limit.amount - card.available.amount;
|
|
84
86
|
case 'limit':
|
|
@@ -86,19 +88,7 @@ const getChargeCardListView = (state, includeCreditAccountAndCashbackInfo) => {
|
|
|
86
88
|
return card.limit.amount;
|
|
87
89
|
}
|
|
88
90
|
};
|
|
89
|
-
|
|
90
|
-
let inviteNotAcceptedCards = [];
|
|
91
|
-
chargeCardsWithUserFiltered.forEach((card) => {
|
|
92
|
-
if (card.status.code !== 'request_on_hold') {
|
|
93
|
-
inviteAcceptedCards.push(card);
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
inviteNotAcceptedCards.push(card);
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
inviteAcceptedCards = (0, orderBy_1.default)(inviteAcceptedCards, (person) => getCardsBySortKey(person, sortKey), sortOrder);
|
|
100
|
-
inviteNotAcceptedCards = (0, orderBy_1.default)(inviteNotAcceptedCards, (person) => getCardsBySortKey(person, sortKey), sortOrder);
|
|
101
|
-
const cardsInOrder = [...inviteAcceptedCards, ...inviteNotAcceptedCards];
|
|
91
|
+
const cardsInOrder = (0, orderBy_1.default)(chargeCardsWithUserFiltered, (person) => getCardsBySortKey(person, sortKey), sortOrder);
|
|
102
92
|
const userListSelectorView = (0, userListViewSelector_1.getUserList)(userState, userRoleState, userListViewState, 'cardHolderCandidate');
|
|
103
93
|
const userList = userListSelectorView.users;
|
|
104
94
|
const fetchState = includeCreditAccountAndCashbackInfo === true
|
|
@@ -127,7 +117,6 @@ const getChargeCardListView = (state, includeCreditAccountAndCashbackInfo) => {
|
|
|
127
117
|
unAssignedCredits: chargeCardListState.unAssignedCredits,
|
|
128
118
|
creditAccount: chargeCardListState.creditAccount,
|
|
129
119
|
chargeCardConfig: chargeCardConfigState,
|
|
130
|
-
issueChargeCard: chargeCardListState.issueChargeCard,
|
|
131
120
|
userList,
|
|
132
121
|
allAccountingClasses,
|
|
133
122
|
issueCardPageFetchState,
|
|
@@ -139,6 +128,57 @@ const getChargeCardListView = (state, includeCreditAccountAndCashbackInfo) => {
|
|
|
139
128
|
};
|
|
140
129
|
};
|
|
141
130
|
exports.getChargeCardListView = getChargeCardListView;
|
|
131
|
+
const getMyChargeCardListWithShippingAddress = (state) => {
|
|
132
|
+
var _a, _b;
|
|
133
|
+
const { tenantState, addressState, chargeCardListState, chargeCardState, classState, userState, userRoleState, chargeCardConfigState, } = state;
|
|
134
|
+
const userId = (_b = (_a = tenantState.loggedInUser) === null || _a === void 0 ? void 0 : _a.userId) !== null && _b !== void 0 ? _b : '';
|
|
135
|
+
const cards = (0, chargeCardSelector_1.getChargeCardsByIds)(chargeCardState, chargeCardListState.cardIds);
|
|
136
|
+
const chargeCardsWithUserAndShippingAddress = [];
|
|
137
|
+
cards
|
|
138
|
+
.filter((chargeCard) => chargeCard.cardHolderUserId === userId)
|
|
139
|
+
.forEach((chargeCard) => {
|
|
140
|
+
const cardHolderUser = (0, userSelector_1.getUserByUserId)(userState, chargeCard.cardHolderUserId);
|
|
141
|
+
const cardCreatedByUser = (0, userSelector_1.getUserByUserId)(userState, chargeCard.cardCreaterUserId);
|
|
142
|
+
const cardHolderUserRole = (0, userRoleSelector_1.getUserRoleByUserId)(userRoleState, chargeCard.cardHolderUserId);
|
|
143
|
+
const department = cardHolderUserRole != null
|
|
144
|
+
? (0, classSelector_1.getClassById)(classState, {
|
|
145
|
+
classId: cardHolderUserRole.accountingClassIDs[0],
|
|
146
|
+
reportId: 'class_list',
|
|
147
|
+
})
|
|
148
|
+
: undefined;
|
|
149
|
+
const mailingAddress = chargeCard.mailingAddressId != null
|
|
150
|
+
? (0, addressSelector_1.getAddressByAddressId)(addressState, chargeCard.mailingAddressId)
|
|
151
|
+
: undefined;
|
|
152
|
+
const billingAddress = (0, addressSelector_1.getAddressByAddressId)(addressState, chargeCard.billingAddressId);
|
|
153
|
+
const shippingAddress = chargeCard.shippingAddressId != null
|
|
154
|
+
? (0, addressSelector_1.getAddressByAddressId)(addressState, chargeCard.shippingAddressId)
|
|
155
|
+
: undefined;
|
|
156
|
+
if (cardCreatedByUser == null ||
|
|
157
|
+
cardHolderUser == null ||
|
|
158
|
+
cardHolderUserRole == null ||
|
|
159
|
+
billingAddress == null) {
|
|
160
|
+
console.error(`Cannot find details for card ${chargeCard.cardName} id ${chargeCard.id} - Created by ${cardCreatedByUser === null || cardCreatedByUser === void 0 ? void 0 : cardCreatedByUser.firstName}, for ${cardHolderUser === null || cardHolderUser === void 0 ? void 0 : cardHolderUser.firstName} with role ${cardHolderUserRole} and billing address in ${billingAddress === null || billingAddress === void 0 ? void 0 : billingAddress.country}.`);
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
chargeCardsWithUserAndShippingAddress.push(Object.assign(Object.assign({}, chargeCard), { cardHolderUser,
|
|
164
|
+
cardCreatedByUser, cardHolderRoles: cardHolderUserRole, billingAddress,
|
|
165
|
+
department,
|
|
166
|
+
mailingAddress,
|
|
167
|
+
shippingAddress }));
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
const fetchState = (0, reduceFetchState_1.reduceFetchState)([
|
|
171
|
+
chargeCardListState,
|
|
172
|
+
chargeCardConfigState,
|
|
173
|
+
]).fetchState;
|
|
174
|
+
return {
|
|
175
|
+
fetchState,
|
|
176
|
+
error: chargeCardListState.error,
|
|
177
|
+
cards: chargeCardsWithUserAndShippingAddress,
|
|
178
|
+
version: '1.0',
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
exports.getMyChargeCardListWithShippingAddress = getMyChargeCardListWithShippingAddress;
|
|
142
182
|
const anyCardOnHold = (cards) => {
|
|
143
183
|
return cards.reduce((prevValue, currentValue) => {
|
|
144
184
|
return (prevValue === true && currentValue.status.code === 'request_on_hold');
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RootState } from '../../../../reducer';
|
|
4
|
+
import { fetchUserListByType } from '../../../userListView/userListViewReducer';
|
|
5
|
+
import { fetchChargeCardConfig } from '../chargeCardConfig/chargeCardConfigReducer';
|
|
6
|
+
import { fetchIssueCardPage } from './issueChargeCardReducer';
|
|
7
|
+
import { fetchCreditAccount } from '../chargeCardList/chargeCardListReducer';
|
|
8
|
+
export declare type ActionType = ReturnType<typeof fetchIssueCardPage> | ReturnType<typeof fetchChargeCardConfig> | ReturnType<typeof fetchUserListByType> | ReturnType<typeof fetchCreditAccount>;
|
|
9
|
+
export declare const fetchIssueCardPageEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
|