@zeniai/client-epic-state 5.1.0-betaSS3 → 5.1.1-beta0ND
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/common/aiCfo/aiCfoSuggestedQuestionsPageContext.d.ts +1 -1
- package/lib/commonStateTypes/amount.d.ts +1 -0
- package/lib/commonStateTypes/amount.js +9 -1
- package/lib/commonStateTypes/animations.d.ts +1 -1
- package/lib/commonStateTypes/animations.js +1 -0
- package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
- package/lib/commonStateTypes/viewAndReport/viewAndReport.js +2 -0
- package/lib/commonStateTypes/workingDayHelper.d.ts +9 -0
- package/lib/commonStateTypes/workingDayHelper.js +28 -1
- package/lib/entity/account/accountSelector.d.ts +9 -0
- package/lib/entity/account/accountSelector.js +14 -1
- package/lib/entity/account/accountState.d.ts +1 -1
- package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
- package/lib/entity/aiCfo/aiCfoPayload.d.ts +64 -5
- package/lib/entity/aiCfo/aiCfoReducer.d.ts +23 -2
- package/lib/entity/aiCfo/aiCfoReducer.js +252 -10
- package/lib/entity/aiCfo/aiCfoSelector.d.ts +4 -1
- package/lib/entity/aiCfo/aiCfoSelector.js +19 -1
- package/lib/entity/aiCfo/aiCfoState.d.ts +98 -4
- package/lib/entity/aiCfo/aiCfoState.js +20 -1
- package/lib/entity/approvalRule/approvalRuleConflict.d.ts +56 -0
- package/lib/entity/approvalRule/approvalRuleConflict.js +77 -0
- package/lib/entity/approvalRule/approvalRulePayload.d.ts +34 -5
- package/lib/entity/approvalRule/approvalRulePayload.js +145 -10
- package/lib/entity/approvalRule/approvalRuleSelector.d.ts +25 -1
- package/lib/entity/approvalRule/approvalRuleSelector.js +40 -0
- package/lib/entity/approvalRule/approvalRuleState.d.ts +59 -7
- package/lib/entity/cardPolicy/cardPolicyPayload.d.ts +277 -0
- package/lib/entity/cardPolicy/cardPolicyPayload.js +143 -0
- package/lib/entity/cardPolicy/cardPolicyReducer.d.ts +19 -0
- package/lib/entity/cardPolicy/cardPolicyReducer.js +175 -0
- package/lib/entity/cardPolicy/cardPolicySelector.d.ts +32 -0
- package/lib/entity/cardPolicy/cardPolicySelector.js +99 -0
- package/lib/entity/cardPolicy/cardPolicyState.d.ts +205 -0
- package/lib/entity/cardPolicy/cardPolicyState.js +14 -0
- package/lib/entity/cardPolicy/extractPolicyDocumentEpic.d.ts +18 -0
- package/lib/entity/cardPolicy/extractPolicyDocumentEpic.js +68 -0
- package/lib/entity/cardPolicy/fetchCardPolicyVendorOptionsEpic.d.ts +26 -0
- package/lib/entity/cardPolicy/fetchCardPolicyVendorOptionsEpic.js +47 -0
- package/lib/entity/cardPolicy/policyDocumentExtractionToRecommendationBridgeEpic.d.ts +25 -0
- package/lib/entity/cardPolicy/policyDocumentExtractionToRecommendationBridgeEpic.js +39 -0
- package/lib/entity/cardPolicy/policyRecommendationFromUploadEpic.d.ts +24 -0
- package/lib/entity/cardPolicy/policyRecommendationFromUploadEpic.js +105 -0
- 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 +4 -0
- package/lib/entity/company/companyStateTypes.d.ts +4 -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 +19 -0
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +2 -0
- package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +1 -1
- package/lib/entity/monthEndCloseChecks/monthEndCloseChecksState.d.ts +1 -1
- package/lib/entity/paymentAccount/paymentAccountSelector.d.ts +1 -0
- package/lib/entity/paymentAccount/paymentAccountSelector.js +9 -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/sectionProjectView/sectionProjectView.d.ts +1 -1
- package/lib/entity/sectionProjectView/sectionProjectViewReducer.d.ts +2 -2
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +7 -0
- package/lib/entity/task/taskPayload.d.ts +3 -1
- package/lib/entity/task/taskPayload.js +2 -0
- package/lib/entity/task/taskState.d.ts +2 -0
- package/lib/entity/tenant/clearAllEpic.d.ts +9 -2
- package/lib/entity/tenant/clearAllEpic.js +14 -0
- package/lib/entity/tenant/epic/deleteConnectionEpic.d.ts +1 -1
- package/lib/entity/tenant/epic/initEmailConnectOAuthEpic.d.ts +21 -0
- package/lib/entity/tenant/epic/initEmailConnectOAuthEpic.js +54 -0
- package/lib/entity/tenant/epic/saveAPIKeyConnectionEpic.d.ts +1 -1
- package/lib/entity/tenant/epic/saveConnectorCredentialsEpic.d.ts +3 -3
- package/lib/entity/tenant/epic/saveOAuthConnectionEpic.d.ts +1 -1
- package/lib/entity/tenant/tenantPayload.d.ts +22 -0
- package/lib/entity/tenant/tenantReducer.d.ts +52 -30
- package/lib/entity/tenant/tenantReducer.js +195 -11
- package/lib/entity/tenant/tenantState.d.ts +25 -1
- package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +4 -0
- package/lib/entity/transaction/payloadTypes/transactionPayload.js +17 -7
- package/lib/entity/transaction/stateTypes/transaction.d.ts +3 -0
- package/lib/entity/transaction/stateTypes/transactionLine.d.ts +2 -1
- package/lib/entity/transaction/stateTypes/transactionLine.js +2 -1
- package/lib/epic.d.ts +36 -2
- package/lib/epic.js +37 -2
- package/lib/esm/commonStateTypes/amount.js +7 -0
- package/lib/esm/commonStateTypes/animations.js +1 -0
- package/lib/esm/commonStateTypes/viewAndReport/viewAndReport.js +2 -0
- package/lib/esm/commonStateTypes/workingDayHelper.js +26 -0
- package/lib/esm/entity/account/accountSelector.js +11 -0
- package/lib/esm/entity/aiCfo/aiCfoReducer.js +252 -10
- package/lib/esm/entity/aiCfo/aiCfoSelector.js +17 -1
- package/lib/esm/entity/aiCfo/aiCfoState.js +17 -0
- package/lib/esm/entity/approvalRule/approvalRuleConflict.js +74 -0
- package/lib/esm/entity/approvalRule/approvalRulePayload.js +145 -10
- package/lib/esm/entity/approvalRule/approvalRuleSelector.js +35 -0
- package/lib/esm/entity/cardPolicy/cardPolicyPayload.js +130 -0
- package/lib/esm/entity/cardPolicy/cardPolicyReducer.js +171 -0
- package/lib/esm/entity/cardPolicy/cardPolicySelector.js +75 -0
- package/lib/esm/entity/cardPolicy/cardPolicyState.js +9 -0
- package/lib/esm/entity/cardPolicy/extractPolicyDocumentEpic.js +64 -0
- package/lib/esm/entity/cardPolicy/fetchCardPolicyVendorOptionsEpic.js +43 -0
- package/lib/esm/entity/cardPolicy/policyDocumentExtractionToRecommendationBridgeEpic.js +35 -0
- package/lib/esm/entity/cardPolicy/policyRecommendationFromUploadEpic.js +101 -0
- package/lib/esm/entity/company/companyPayload.js +4 -0
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +19 -0
- package/lib/esm/entity/paymentAccount/paymentAccountSelector.js +8 -0
- package/lib/esm/entity/snackbar/snackbarTypes.js +7 -0
- package/lib/esm/entity/task/taskPayload.js +2 -0
- package/lib/esm/entity/tenant/clearAllEpic.js +14 -0
- package/lib/esm/entity/tenant/epic/initEmailConnectOAuthEpic.js +50 -0
- package/lib/esm/entity/tenant/tenantReducer.js +192 -9
- package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +17 -7
- package/lib/esm/entity/transaction/stateTypes/transactionLine.js +1 -0
- package/lib/esm/epic.js +37 -2
- package/lib/esm/index.js +77 -34
- package/lib/esm/reducer.js +21 -0
- package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +6 -3
- package/lib/esm/view/aiCfoView/epics/createSessionAndSubmitEpic.js +5 -2
- package/lib/esm/view/aiCfoView/epics/createSessionEpic.js +2 -1
- package/lib/esm/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +12 -2
- package/lib/esm/view/companyTaskManagerView/companyTaskManagerViewReducer.js +39 -11
- package/lib/esm/view/companyTaskManagerView/companyTaskManagerViewSelector.js +14 -4
- package/lib/esm/view/companyTaskManagerView/epics/fetchCockpitContextEpic.js +38 -0
- package/lib/esm/view/companyTaskManagerView/epics/fetchCompanyTaskManagerViewEpic.js +37 -28
- package/lib/esm/view/companyTaskManagerView/epics/updateCompanyTaskManagerViewFiltersEpic.js +16 -0
- package/lib/esm/view/companyView/companyViewReducer.js +46 -1
- package/lib/esm/view/companyView/epic/companyPassport/dismissCapitalizationOnboardingEpic.js +25 -0
- package/lib/esm/view/companyView/epic/companyPassport/updateCapitalizationAccountThresholdEpic.js +98 -0
- package/lib/esm/view/companyView/epic/fetchAllCockpitViewsEpic.js +2 -2
- package/lib/esm/view/companyView/types/companyPassport/companyPassportViewState.js +4 -0
- package/lib/esm/view/createTransferEntry/createTransferEntryReducer.js +82 -0
- package/lib/esm/view/createTransferEntry/createTransferEntrySelector.js +64 -0
- package/lib/esm/view/createTransferEntry/createTransferEntryState.js +17 -0
- package/lib/esm/view/createTransferEntry/epics/createTransferEntryEpic.js +136 -0
- package/lib/esm/view/createTransferEntry/epics/fetchTransferAccountsEpic.js +36 -0
- package/lib/esm/view/dashboard/dashboardReducer.js +11 -1
- package/lib/esm/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +3 -3
- package/lib/esm/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +3 -4
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +13 -9
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/backgroundRefetchReviewTabEpic.js +3 -16
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +9 -16
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.js +2 -2
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/markTransactionAsNotMiscategorizedEpic.js +2 -13
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/saveTransactionCategorizationEpic.js +2 -6
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/triggerReviewTabRefetchEpic.js +2 -2
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/updateTransactionCategorizationEpic.js +2 -6
- package/lib/esm/view/expenseAutomationView/expenseAutomationViewReducer.js +3 -20
- package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +21 -49
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +14 -7
- package/lib/esm/view/expenseAutomationView/transactionFilterHelpers.js +106 -18
- package/lib/esm/view/fileView/epic/deleteFileEpic.js +2 -2
- package/lib/esm/view/fileView/epic/deleteFileListEpic.js +2 -2
- package/lib/esm/view/fileView/epic/updateFileNameEpic.js +2 -2
- package/lib/esm/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.js +40 -0
- package/lib/esm/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiActivationViewedEpic.js +29 -0
- package/lib/esm/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiFinanceTeamEpic.js +40 -0
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewReducer.js +218 -50
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewSelector.js +12 -2
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewState.js +12 -0
- package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesSelector.js +22 -2
- package/lib/esm/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +14 -0
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewReducer.js +109 -12
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/deleteBillPayApprovalRuleEpic.js +10 -2
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPaySetupApproverViewEpic.js +8 -4
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/initializeBillPaySetupApproverViewUpdateDataEpic.js +11 -7
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/reorderBillPayApprovalRulesEpic.js +54 -0
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/saveBillPaySetupApproverViewUpdatesEpic.js +13 -4
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js +140 -16
- package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +60 -4
- package/lib/esm/view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic.js +8 -2
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowPayload.js +29 -0
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowReducer.js +78 -0
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowSelector.js +47 -0
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowState.js +47 -0
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/epics/fetchCashManagementSettingsEpic.js +32 -0
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/epics/saveAutoSweepSettingsEpic.js +32 -0
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewPayload.js +54 -0
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewReducer.js +92 -0
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector.js +224 -0
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewState.js +10 -0
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementBannerEpic.js +23 -0
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementOverviewPageEpic.js +36 -0
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementRecommendationEpic.js +27 -0
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchRecentTransferEpic.js +28 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailReducer.js +52 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailSelector.js +22 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailState.js +1 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/fetchCardPolicyDetailEpic.js +36 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/updateCardPolicyEpic.js +39 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/archiveCardPolicyEpic.js +34 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer.js +71 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListSelector.js +21 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListState.js +1 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/fetchCardPolicyListEpic.js +38 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyAiCardPolicyFormDraftUpdate.js +289 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToAiCardPolicyDraft.js +109 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToDraftEpic.js +44 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToManualCardPolicyDraft.js +111 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyUploadPlanToAiCardPolicyDraft.js +25 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/buildAiCardPolicyFormDraftSeed.js +363 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/buildManualCardPolicyFormDraftSeed.js +36 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyChipIds.js +19 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyFormDraftTypes.js +6 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyRequestParts.js +119 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyReducer.js +154 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicySelector.js +22 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyState.js +1 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyTemplateEpic.js +49 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/deriveAiPolicyReviewRowsFromInputs.js +140 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/fetchCardPolicyMccCategoriesEpic.js +20 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/seedAiCardPolicyFormDraftEpic.js +100 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toBulkCardPolicyTemplateRequestsFromDraft.js +96 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toCardPolicyTemplateRequestFromDraft.js +59 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toManualCardPolicyTemplateRequestFromDraft.js +24 -0
- package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +25 -0
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/aiCardCreationFormDraftTypes.js +1 -0
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/applyAiCardCreationFormDraftUpdate.js +34 -0
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/buildAiCardCreationFormDraftSeed.js +57 -0
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/deriveAiCardRowsFromTeams.js +35 -0
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardEpic.js +2 -2
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.js +42 -4
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.js +35 -0
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/seedAiCardCreationFormDraftEpic.js +62 -0
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/toIssueChargeCardLocalDataFromDraft.js +44 -0
- package/lib/esm/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.js +58 -0
- package/lib/esm/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.js +77 -0
- package/lib/esm/view/spendManagement/commonSetup/kycKybAutofillActions.js +14 -0
- package/lib/esm/view/spendManagement/commonSetup/kycKybParseMapper.js +207 -0
- package/lib/esm/view/spendManagement/commonSetup/setupViewReducer.js +106 -52
- package/lib/esm/view/spendManagement/commonSetup/setupViewSelector.js +6 -1
- package/lib/esm/view/spendManagement/commonSetup/types/kycKybAutofill.js +41 -0
- package/lib/esm/view/spendManagement/reimbursement/editRemiView/epics/fetchEditRemiDetailPageEpic.js +5 -1
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/deleteRemiApprovalRuleEpic.js +10 -2
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/fetchRemiSetupApproverViewEpic.js +8 -2
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/initializeRemiSetupApproverViewUpdateDataEpic.js +11 -7
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/reorderRemiApprovalRulesEpic.js +61 -0
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/saveRemiSetupApproverViewUpdatesEpic.js +13 -4
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewReducer.js +80 -11
- package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.js +18 -0
- package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.js +18 -0
- package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.js +1 -1
- package/lib/esm/view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer.js +45 -1
- package/lib/esm/view/transactionDetail/journalEntryLinesViewModel.js +149 -0
- package/lib/esm/view/transactionDetail/transactionDetailSelector.js +6 -1
- package/lib/index.d.ts +94 -40
- package/lib/index.js +281 -37
- package/lib/reducer.d.ts +21 -0
- package/lib/reducer.js +21 -0
- package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +11 -2
- package/lib/view/aiCfoView/aiCfoViewReducer.js +6 -3
- package/lib/view/aiCfoView/epics/createSessionAndSubmitEpic.js +5 -2
- package/lib/view/aiCfoView/epics/createSessionEpic.js +2 -1
- package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.d.ts +8 -1
- package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +12 -2
- package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
- package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
- package/lib/view/cardBalance/cardBalanceSelector.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/companyTaskManagerView/companyTaskManagerViewPayload.d.ts +19 -11
- package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.d.ts +11 -5
- package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.js +40 -12
- package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.d.ts +2 -0
- package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.js +13 -3
- package/lib/view/companyTaskManagerView/companyTaskManagerViewState.d.ts +11 -3
- package/lib/view/companyTaskManagerView/epics/fetchCockpitContextEpic.d.ts +10 -0
- package/lib/view/companyTaskManagerView/epics/fetchCockpitContextEpic.js +42 -0
- package/lib/view/companyTaskManagerView/epics/fetchCompanyTaskManagerViewEpic.d.ts +1 -3
- package/lib/view/companyTaskManagerView/epics/fetchCompanyTaskManagerViewEpic.js +37 -28
- package/lib/view/companyTaskManagerView/epics/updateCompanyTaskManagerViewFiltersEpic.d.ts +6 -0
- package/lib/view/companyTaskManagerView/epics/updateCompanyTaskManagerViewFiltersEpic.js +20 -0
- package/lib/view/companyView/companyViewReducer.d.ts +12 -1
- package/lib/view/companyView/companyViewReducer.js +48 -3
- package/lib/view/companyView/epic/companyPassport/dismissCapitalizationOnboardingEpic.d.ts +9 -0
- package/lib/view/companyView/epic/companyPassport/dismissCapitalizationOnboardingEpic.js +29 -0
- package/lib/view/companyView/epic/companyPassport/updateCapitalizationAccountThresholdEpic.d.ts +10 -0
- package/lib/view/companyView/epic/companyPassport/updateCapitalizationAccountThresholdEpic.js +102 -0
- package/lib/view/companyView/epic/fetchAllCockpitViewsEpic.js +2 -2
- package/lib/view/companyView/types/cockpitTypes.d.ts +3 -2
- package/lib/view/companyView/types/companyPassport/companyPassportViewState.d.ts +1 -0
- package/lib/view/companyView/types/companyPassport/companyPassportViewState.js +4 -0
- package/lib/view/createTransferEntry/createTransferEntryReducer.d.ts +32 -0
- package/lib/view/createTransferEntry/createTransferEntryReducer.js +86 -0
- package/lib/view/createTransferEntry/createTransferEntrySelector.d.ts +39 -0
- package/lib/view/createTransferEntry/createTransferEntrySelector.js +69 -0
- package/lib/view/createTransferEntry/createTransferEntryState.d.ts +30 -0
- package/lib/view/createTransferEntry/createTransferEntryState.js +20 -0
- package/lib/view/createTransferEntry/epics/createTransferEntryEpic.d.ts +11 -0
- package/lib/view/createTransferEntry/epics/createTransferEntryEpic.js +140 -0
- package/lib/view/createTransferEntry/epics/fetchTransferAccountsEpic.d.ts +14 -0
- package/lib/view/createTransferEntry/epics/fetchTransferAccountsEpic.js +40 -0
- package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
- package/lib/view/dashboard/dashboardReducer.js +11 -1
- package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +3 -3
- package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +3 -4
- package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.d.ts +6 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +14 -10
- package/lib/view/expenseAutomationView/epics/transactionCategorization/backgroundRefetchReviewTabEpic.js +3 -16
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +9 -16
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.js +2 -2
- package/lib/view/expenseAutomationView/epics/transactionCategorization/markTransactionAsNotMiscategorizedEpic.js +2 -13
- package/lib/view/expenseAutomationView/epics/transactionCategorization/saveTransactionCategorizationEpic.js +2 -6
- package/lib/view/expenseAutomationView/epics/transactionCategorization/triggerReviewTabRefetchEpic.js +2 -2
- package/lib/view/expenseAutomationView/epics/transactionCategorization/updateTransactionCategorizationEpic.js +2 -6
- package/lib/view/expenseAutomationView/expenseAutomationViewReducer.d.ts +2 -6
- package/lib/view/expenseAutomationView/expenseAutomationViewReducer.js +3 -20
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/payload/transactionCategorizationPayload.d.ts +20 -9
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +11 -18
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +22 -50
- package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +8 -6
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.d.ts +2 -1
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +16 -8
- package/lib/view/expenseAutomationView/transactionFilterHelpers.js +106 -18
- package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +1 -1
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +2 -3
- package/lib/view/fileView/epic/deleteFileEpic.js +1 -1
- package/lib/view/fileView/epic/deleteFileListEpic.js +1 -1
- package/lib/view/fileView/epic/updateFileNameEpic.js +1 -1
- package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
- package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
- package/lib/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.d.ts +7 -0
- package/lib/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.js +44 -0
- package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiActivationViewedEpic.d.ts +8 -0
- package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiActivationViewedEpic.js +33 -0
- package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiFinanceTeamEpic.d.ts +9 -0
- package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiFinanceTeamEpic.js +44 -0
- package/lib/view/onboardingView/customerView/onboardingCustomerViewPayload.d.ts +3 -0
- package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.d.ts +41 -4
- package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.js +220 -51
- package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.d.ts +5 -1
- package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.js +15 -2
- package/lib/view/onboardingView/customerView/onboardingCustomerViewState.d.ts +40 -0
- package/lib/view/onboardingView/customerView/onboardingCustomerViewState.js +13 -1
- package/lib/view/people/peopleTypes.d.ts +1 -1
- package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
- package/lib/view/reportsResync/reportsResyncReducer.d.ts +2 -2
- package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
- package/lib/view/spendManagement/autotransferRules/autoTransferRulesSelector.d.ts +8 -1
- package/lib/view/spendManagement/autotransferRules/autoTransferRulesSelector.js +21 -1
- package/lib/view/spendManagement/autotransferRules/autoTransferRulesState.d.ts +22 -0
- package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.d.ts +7 -0
- package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +14 -0
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewReducer.d.ts +14 -3
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewReducer.js +110 -13
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewState.d.ts +16 -0
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/deleteBillPayApprovalRuleEpic.js +10 -2
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPaySetupApproverViewEpic.js +8 -4
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/initializeBillPaySetupApproverViewUpdateDataEpic.js +10 -6
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/reorderBillPayApprovalRulesEpic.d.ts +23 -0
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/reorderBillPayApprovalRulesEpic.js +58 -0
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/saveBillPaySetupApproverViewUpdatesEpic.js +12 -3
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.d.ts +59 -1
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js +142 -17
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonState.d.ts +31 -5
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +8 -1
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +60 -4
- package/lib/view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic.js +8 -2
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowPayload.d.ts +47 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowPayload.js +34 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowReducer.d.ts +23 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowReducer.js +82 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowSelector.d.ts +40 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowSelector.js +51 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowState.d.ts +37 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowState.js +53 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/fetchCashManagementSettingsEpic.d.ts +14 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/fetchCashManagementSettingsEpic.js +36 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/saveAutoSweepSettingsEpic.d.ts +7 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/saveAutoSweepSettingsEpic.js +36 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewPayload.d.ts +56 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewPayload.js +60 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewReducer.d.ts +22 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewReducer.js +96 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector.d.ts +59 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector.js +229 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewState.d.ts +122 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewState.js +13 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementBannerEpic.d.ts +7 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementBannerEpic.js +27 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementOverviewPageEpic.d.ts +9 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementOverviewPageEpic.js +40 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementRecommendationEpic.d.ts +7 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementRecommendationEpic.js +31 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchRecentTransferEpic.d.ts +15 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchRecentTransferEpic.js +32 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailReducer.d.ts +14 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailReducer.js +56 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailSelector.d.ts +15 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailSelector.js +28 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailState.d.ts +8 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailState.js +2 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/fetchCardPolicyDetailEpic.d.ts +8 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/fetchCardPolicyDetailEpic.js +40 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/updateCardPolicyEpic.d.ts +8 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/updateCardPolicyEpic.js +43 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/archiveCardPolicyEpic.d.ts +8 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/archiveCardPolicyEpic.js +38 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer.d.ts +15 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer.js +75 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListSelector.d.ts +15 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListSelector.js +27 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListState.d.ts +7 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListState.js +2 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/fetchCardPolicyListEpic.d.ts +8 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/fetchCardPolicyListEpic.js +42 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyAiCardPolicyFormDraftUpdate.d.ts +8 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyAiCardPolicyFormDraftUpdate.js +294 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToAiCardPolicyDraft.d.ts +8 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToAiCardPolicyDraft.js +113 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToDraftEpic.d.ts +9 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToDraftEpic.js +48 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToManualCardPolicyDraft.d.ts +8 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToManualCardPolicyDraft.js +115 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyUploadPlanToAiCardPolicyDraft.d.ts +13 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyUploadPlanToAiCardPolicyDraft.js +29 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/buildAiCardPolicyFormDraftSeed.d.ts +14 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/buildAiCardPolicyFormDraftSeed.js +369 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/buildManualCardPolicyFormDraftSeed.d.ts +6 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/buildManualCardPolicyFormDraftSeed.js +40 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyChipIds.d.ts +7 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyChipIds.js +26 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyFormDraftTypes.d.ts +116 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyFormDraftTypes.js +10 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyRequestParts.d.ts +33 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyRequestParts.js +126 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyReducer.d.ts +52 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyReducer.js +158 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicySelector.d.ts +11 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicySelector.js +31 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyState.d.ts +12 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyState.js +2 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyTemplateEpic.d.ts +9 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyTemplateEpic.js +53 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/deriveAiPolicyReviewRowsFromInputs.d.ts +10 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/deriveAiPolicyReviewRowsFromInputs.js +144 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/fetchCardPolicyMccCategoriesEpic.d.ts +7 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/fetchCardPolicyMccCategoriesEpic.js +24 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/seedAiCardPolicyFormDraftEpic.d.ts +11 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/seedAiCardPolicyFormDraftEpic.js +104 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toBulkCardPolicyTemplateRequestsFromDraft.d.ts +22 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toBulkCardPolicyTemplateRequestsFromDraft.js +100 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toCardPolicyTemplateRequestFromDraft.d.ts +8 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toCardPolicyTemplateRequestFromDraft.js +63 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toManualCardPolicyTemplateRequestFromDraft.d.ts +3 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toManualCardPolicyTemplateRequestFromDraft.js +28 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.d.ts +14 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +27 -1
- package/lib/view/spendManagement/chargeCards/issueChargeCard/aiCardCreationFormDraftTypes.d.ts +34 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/aiCardCreationFormDraftTypes.js +2 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/applyAiCardCreationFormDraftUpdate.d.ts +7 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/applyAiCardCreationFormDraftUpdate.js +38 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/buildAiCardCreationFormDraftSeed.d.ts +12 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/buildAiCardCreationFormDraftSeed.js +61 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/deriveAiCardRowsFromTeams.d.ts +9 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/deriveAiCardRowsFromTeams.js +39 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardEpic.d.ts +2 -2
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardEpic.js +1 -1
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.d.ts +12 -2
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.js +43 -5
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.d.ts +7 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.js +42 -1
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardState.d.ts +5 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/seedAiCardCreationFormDraftEpic.d.ts +11 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/seedAiCardCreationFormDraftEpic.js +66 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/toIssueChargeCardLocalDataFromDraft.d.ts +3 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/toIssueChargeCardLocalDataFromDraft.js +48 -0
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.d.ts +28 -0
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.js +62 -0
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.d.ts +9 -0
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.js +81 -0
- package/lib/view/spendManagement/commonSetup/kycKybAutofillActions.d.ts +24 -0
- package/lib/view/spendManagement/commonSetup/kycKybAutofillActions.js +17 -0
- package/lib/view/spendManagement/commonSetup/kycKybParseMapper.d.ts +29 -0
- package/lib/view/spendManagement/commonSetup/kycKybParseMapper.js +215 -0
- package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +28 -2
- package/lib/view/spendManagement/commonSetup/setupViewReducer.js +107 -53
- package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +7 -2
- package/lib/view/spendManagement/commonSetup/setupViewSelector.js +6 -1
- package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +19 -0
- package/lib/view/spendManagement/commonSetup/types/kycKybAutofill.d.ts +154 -0
- package/lib/view/spendManagement/commonSetup/types/kycKybAutofill.js +46 -0
- package/lib/view/spendManagement/reimbursement/editRemiView/epics/fetchEditRemiDetailPageEpic.js +5 -1
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/deleteRemiApprovalRuleEpic.js +10 -2
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/fetchRemiSetupApproverViewEpic.js +8 -2
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/initializeRemiSetupApproverViewUpdateDataEpic.js +10 -6
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/reorderRemiApprovalRulesEpic.d.ts +14 -0
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/reorderRemiApprovalRulesEpic.js +65 -0
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/saveRemiSetupApproverViewUpdatesEpic.js +12 -3
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewReducer.d.ts +14 -3
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewReducer.js +81 -12
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewState.d.ts +12 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.d.ts +8 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.js +22 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.d.ts +8 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.js +22 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.js +1 -1
- package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer.d.ts +1 -1
- package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer.js +46 -2
- package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewState.d.ts +2 -0
- package/lib/view/taskManager/taskListView/taskList.d.ts +3 -3
- package/lib/view/taskManager/taskListView/taskListReducer.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/journalEntryLinesViewModel.d.ts +102 -0
- package/lib/view/transactionDetail/journalEntryLinesViewModel.js +160 -0
- package/lib/view/transactionDetail/transactionDetailPayload.d.ts +1 -1
- package/lib/view/transactionDetail/transactionDetailSelector.d.ts +6 -1
- package/lib/view/transactionDetail/transactionDetailSelector.js +6 -1
- package/lib/zeniAPI.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { from } from 'rxjs';
|
|
2
2
|
import { filter, mergeMap } from 'rxjs/operators';
|
|
3
|
-
import { getApprovalRuleById } from '../../../../../entity/approvalRule/approvalRuleSelector';
|
|
3
|
+
import { getAmountCriteria, getApprovalRuleById, getDepartmentCriteria, getVendorCriteria, } from '../../../../../entity/approvalRule/approvalRuleSelector';
|
|
4
4
|
import { clearBillPaySetupApproverViewUpdateData, initializeBillPaySetupApproverViewUpdateData, saveBillPaySetupApproverViewUpdateData, } from '../billPaySetupApproverViewReducer';
|
|
5
5
|
export const initializeBillPaySetupApproverViewUpdateDataEpic = (actions$, state$) => actions$.pipe(filter(initializeBillPaySetupApproverViewUpdateData.match), mergeMap((action) => {
|
|
6
6
|
const { approvalRuleId } = action.payload;
|
|
@@ -8,16 +8,20 @@ export const initializeBillPaySetupApproverViewUpdateDataEpic = (actions$, state
|
|
|
8
8
|
if (approvalRuleId != null) {
|
|
9
9
|
const approvalRule = getApprovalRuleById(state$.value.approvalRuleState, approvalRuleId);
|
|
10
10
|
if (approvalRule != null) {
|
|
11
|
-
const criteria = approvalRule.criteria[0];
|
|
12
|
-
const range = criteria?.range;
|
|
13
11
|
const billPaySetupApproverViewUpdateData = {
|
|
14
12
|
approvalRuleId,
|
|
15
13
|
steps: approvalRule.steps,
|
|
16
14
|
criteria: {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
amount: getAmountCriteria(approvalRule.criteria),
|
|
16
|
+
vendor: getVendorCriteria(approvalRule.criteria),
|
|
17
|
+
department: getDepartmentCriteria(approvalRule.criteria),
|
|
20
18
|
},
|
|
19
|
+
// Approval Rules 3.0 — seed rule-level fields so the form can
|
|
20
|
+
// round-trip them on edit. Each may be undefined on legacy rules.
|
|
21
|
+
name: approvalRule.name,
|
|
22
|
+
description: approvalRule.description,
|
|
23
|
+
separationOfDuties: approvalRule.separationOfDuties,
|
|
24
|
+
isFallback: approvalRule.isFallback,
|
|
21
25
|
};
|
|
22
26
|
fetchActions.push(clearBillPaySetupApproverViewUpdateData(), saveBillPaySetupApproverViewUpdateData(billPaySetupApproverViewUpdateData));
|
|
23
27
|
}
|
|
@@ -25,7 +29,7 @@ export const initializeBillPaySetupApproverViewUpdateDataEpic = (actions$, state
|
|
|
25
29
|
else {
|
|
26
30
|
const billPaySetupApproverViewCreateData = {
|
|
27
31
|
steps: [],
|
|
28
|
-
criteria:
|
|
32
|
+
criteria: {},
|
|
29
33
|
};
|
|
30
34
|
fetchActions.push(clearBillPaySetupApproverViewUpdateData(), saveBillPaySetupApproverViewUpdateData(billPaySetupApproverViewCreateData));
|
|
31
35
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { from } from 'rxjs';
|
|
2
|
+
import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
|
|
3
|
+
import { updateApprovalRules } from '../../../../../entity/approvalRule/approvalRuleReducer';
|
|
4
|
+
import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
|
|
5
|
+
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../../responsePayload';
|
|
6
|
+
import { fetchBillPaySetupApproverView, reorderBillPayApprovalRules, reorderBillPayApprovalRulesFailure, reorderBillPayApprovalRulesSuccess, } from '../billPaySetupApproverViewReducer';
|
|
7
|
+
export const reorderBillPayApprovalRulesEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(reorderBillPayApprovalRules.match), switchMap((action) => {
|
|
8
|
+
const { approvalRuleIds, useV3 } = action.payload;
|
|
9
|
+
// Approval Rules 3.0 — flag-gated endpoint selection. Mirrors
|
|
10
|
+
// the pattern used by delete + fetch epics: the v3 dev host
|
|
11
|
+
// until the production base URL ships the v2 reorder route.
|
|
12
|
+
const endpoint = `${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/bill-pay/approval-rules-v2/reorder`;
|
|
13
|
+
return zeniAPI
|
|
14
|
+
.putAndGetJSON(endpoint, {
|
|
15
|
+
rule_ids: approvalRuleIds,
|
|
16
|
+
})
|
|
17
|
+
.pipe(mergeMap((response) => {
|
|
18
|
+
if (isSuccessResponse(response) && response.data != null) {
|
|
19
|
+
const serverOrderedIds = response.data.approval_rules.map((approvalRule) => approvalRule.approval_rule_id);
|
|
20
|
+
const actions = [
|
|
21
|
+
updateApprovalRules(response.data.approval_rules),
|
|
22
|
+
reorderBillPayApprovalRulesSuccess(serverOrderedIds),
|
|
23
|
+
openSnackbar({
|
|
24
|
+
messageSection: `bill_pay_approval_reorder`,
|
|
25
|
+
messageText: 'success',
|
|
26
|
+
type: 'success',
|
|
27
|
+
}),
|
|
28
|
+
];
|
|
29
|
+
return from(actions);
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
const recovery = [
|
|
33
|
+
reorderBillPayApprovalRulesFailure(response.status),
|
|
34
|
+
openSnackbar({
|
|
35
|
+
messageSection: `bill_pay_approval_reorder`,
|
|
36
|
+
messageText: 'failed',
|
|
37
|
+
type: 'error',
|
|
38
|
+
}),
|
|
39
|
+
// Refetch to revert the optimistic order to server truth.
|
|
40
|
+
fetchBillPaySetupApproverView(true, true, useV3),
|
|
41
|
+
];
|
|
42
|
+
return from(recovery);
|
|
43
|
+
}
|
|
44
|
+
}), catchError((error) => from([
|
|
45
|
+
reorderBillPayApprovalRulesFailure(createZeniAPIStatus('Unexpected Error', 'Reorder Bill Pay Approval Rules errored out' +
|
|
46
|
+
JSON.stringify(error))),
|
|
47
|
+
openSnackbar({
|
|
48
|
+
messageSection: `bill_pay_approval_reorder`,
|
|
49
|
+
messageText: 'failed',
|
|
50
|
+
type: 'error',
|
|
51
|
+
}),
|
|
52
|
+
fetchBillPaySetupApproverView(true, true, useV3),
|
|
53
|
+
])));
|
|
54
|
+
}));
|
|
@@ -5,15 +5,24 @@ import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
|
|
|
5
5
|
import { updateAllUsers } from '../../../../../entity/user/userReducer';
|
|
6
6
|
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../../responsePayload';
|
|
7
7
|
import { saveBillPaySetupApproverViewUpdates, saveBillPaySetupApproverViewUpdatesFailure, saveBillPaySetupApproverViewUpdatesSuccess, } from '../billPaySetupApproverViewReducer';
|
|
8
|
-
import { toApprovalChangableInfoPayload } from '../types/commonPayload';
|
|
9
|
-
export const saveBillPaySetupApproverViewUpdatesEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(saveBillPaySetupApproverViewUpdates.match), switchMap(() => {
|
|
8
|
+
import { toApprovalChangableInfoPayload, toApprovalChangableInfoPayloadV1, } from '../types/commonPayload';
|
|
9
|
+
export const saveBillPaySetupApproverViewUpdatesEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(saveBillPaySetupApproverViewUpdates.match), switchMap((action) => {
|
|
10
10
|
const { billPaySetupApproverViewState } = state$.value;
|
|
11
11
|
const billPaySetupApproverViewUpdateData = billPaySetupApproverViewState.billPaySetupApproverViewUpdateData;
|
|
12
12
|
if (billPaySetupApproverViewUpdateData != null &&
|
|
13
13
|
billPaySetupApproverViewUpdateData.data != null) {
|
|
14
|
-
|
|
14
|
+
// Approval Rules 3.0 — gate URL + write-side payload mapper on
|
|
15
|
+
// the `approval_rule_v3_config` dynamic config. `useV3` arrives
|
|
16
|
+
// on the action payload from the screen connector.
|
|
17
|
+
const { useV3 } = action.payload;
|
|
18
|
+
const payload = useV3
|
|
19
|
+
? toApprovalChangableInfoPayload(billPaySetupApproverViewUpdateData.data)
|
|
20
|
+
: toApprovalChangableInfoPayloadV1(billPaySetupApproverViewUpdateData.data);
|
|
21
|
+
const endpoint = useV3
|
|
22
|
+
? `${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/bill-pay/approval-rules-v2`
|
|
23
|
+
: `${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/bill-pay/approval-rules`;
|
|
15
24
|
return zeniAPI
|
|
16
|
-
.postAndGetJSON(
|
|
25
|
+
.postAndGetJSON(endpoint, payload)
|
|
17
26
|
.pipe(mergeMap((response) => {
|
|
18
27
|
if (isSuccessResponse(response) && response.data != null) {
|
|
19
28
|
const approvalRuleIds = response.data.approval_rules.map((approvalRule) => approvalRule.approval_rule_id);
|
package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js
CHANGED
|
@@ -1,20 +1,48 @@
|
|
|
1
1
|
export const toApprovalChangableInfoPayload = (approverViewUpdateData) => {
|
|
2
|
-
|
|
2
|
+
// Form-side criteria is a structured object with optional slots for
|
|
3
|
+
// amount / vendor / department; flatten it into the wire format's
|
|
4
|
+
// `conditions[]` array.
|
|
5
|
+
let criteriaPayload;
|
|
3
6
|
if (approverViewUpdateData.criteria != null) {
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
7
|
+
const { amount, vendor, department } = approverViewUpdateData.criteria;
|
|
8
|
+
const conditions = [];
|
|
9
|
+
if (amount?.min != null) {
|
|
10
|
+
conditions.push({
|
|
11
|
+
field: 'amount',
|
|
12
|
+
type: 'gte',
|
|
13
|
+
value: amount.min.amount,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
if (amount?.max != null) {
|
|
17
|
+
conditions.push({
|
|
18
|
+
field: 'amount',
|
|
19
|
+
type: 'lte',
|
|
20
|
+
value: amount.max.amount,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
if (vendor != null && vendor.vendorIds.length > 0) {
|
|
24
|
+
conditions.push({
|
|
25
|
+
field: 'vendor_id',
|
|
26
|
+
type: vendor.operator === 'is_not' ? 'not_in' : 'in',
|
|
27
|
+
value: vendor.vendorIds,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
if (department != null && department.departmentIds.length > 0) {
|
|
31
|
+
conditions.push({
|
|
32
|
+
field: 'department_id',
|
|
33
|
+
type: department.operator === 'is_not' ? 'not_in' : 'in',
|
|
34
|
+
value: department.departmentIds,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
if (conditions.length > 0) {
|
|
38
|
+
const currency = amount?.min ?? amount?.max ?? null;
|
|
39
|
+
criteriaPayload = {
|
|
40
|
+
conditions,
|
|
41
|
+
criteria_operator: 'and',
|
|
42
|
+
currency_code: currency?.currencyCode ?? 'USD',
|
|
43
|
+
currency_symbol: currency?.currencySymbol ?? '$',
|
|
44
|
+
};
|
|
45
|
+
}
|
|
18
46
|
}
|
|
19
47
|
const steps = approverViewUpdateData.steps.map((step) => {
|
|
20
48
|
return {
|
|
@@ -35,10 +63,106 @@ export const toApprovalChangableInfoPayload = (approverViewUpdateData) => {
|
|
|
35
63
|
});
|
|
36
64
|
const isUpdate = approverViewUpdateData.approvalRuleId != null;
|
|
37
65
|
const payload = {
|
|
38
|
-
criteria: criteriaPayload,
|
|
39
66
|
steps,
|
|
40
67
|
is_applicable_on_pending_approval_entity: approverViewUpdateData.isApplicableOnPendingApprovalEntity ?? true,
|
|
41
68
|
};
|
|
69
|
+
if (criteriaPayload != null) {
|
|
70
|
+
payload.criteria = criteriaPayload;
|
|
71
|
+
}
|
|
72
|
+
// Approval Rules 3.0 — surface rule-level fields when the form set them.
|
|
73
|
+
// Send only what the user actually entered: an undefined value means
|
|
74
|
+
// "no opinion" and stays off the wire.
|
|
75
|
+
if (approverViewUpdateData.name != null) {
|
|
76
|
+
payload.name = approverViewUpdateData.name;
|
|
77
|
+
}
|
|
78
|
+
if (approverViewUpdateData.description != null) {
|
|
79
|
+
payload.description = approverViewUpdateData.description;
|
|
80
|
+
}
|
|
81
|
+
if (approverViewUpdateData.separationOfDuties != null) {
|
|
82
|
+
payload.is_separation_of_duty_enabled =
|
|
83
|
+
approverViewUpdateData.separationOfDuties;
|
|
84
|
+
}
|
|
85
|
+
if (approverViewUpdateData.isFallback != null) {
|
|
86
|
+
payload.is_fallback = approverViewUpdateData.isFallback;
|
|
87
|
+
}
|
|
88
|
+
if (isUpdate) {
|
|
89
|
+
payload.approval_rule_id = approverViewUpdateData.approvalRuleId;
|
|
90
|
+
}
|
|
91
|
+
return payload;
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* V1 wire mapper — used when 'approval_rule_v3_config' resolves to OFF
|
|
95
|
+
* for the current tenant. Emits the legacy snake_case array shape that
|
|
96
|
+
* '/approval-rules' historically consumed (see the V1 fixture in
|
|
97
|
+
* 'entity/entityApprovalStatus/__mocks__/json/entityApprovalStatusPayload.json'):
|
|
98
|
+
* criteria: [{type: 'range', range_entity: 'currency', min, max,
|
|
99
|
+
* currency_code, currency_symbol}]
|
|
100
|
+
*
|
|
101
|
+
* Open-ended semantics are preserved on the wire: an absent 'min' or
|
|
102
|
+
* 'max' is sent as 'null' rather than synthesised to '0' or
|
|
103
|
+
* 'MAX_SAFE_INTEGER', so a 'greater_than' / 'less_than' rule stays
|
|
104
|
+
* one-sided after rollback rather than collapsing into a closed range.
|
|
105
|
+
*
|
|
106
|
+
* The V1 backend does not understand vendor / department criteria or
|
|
107
|
+
* the rule-level 3.0 fields, so those are dropped on the wire.
|
|
108
|
+
*/
|
|
109
|
+
export const toApprovalChangableInfoPayloadV1 = (approverViewUpdateData) => {
|
|
110
|
+
const amount = approverViewUpdateData.criteria?.amount;
|
|
111
|
+
const minAmount = amount?.min;
|
|
112
|
+
const maxAmount = amount?.max;
|
|
113
|
+
const currencyCode = minAmount?.currencyCode ?? maxAmount?.currencyCode ?? 'USD';
|
|
114
|
+
const currencySymbol = minAmount?.currencySymbol ?? maxAmount?.currencySymbol ?? '$';
|
|
115
|
+
const steps = approverViewUpdateData.steps.map((step) => {
|
|
116
|
+
return {
|
|
117
|
+
action: step.action,
|
|
118
|
+
operator: step.operator,
|
|
119
|
+
actors: step.actors
|
|
120
|
+
.filter((actor) => actor.subType !== 'admin')
|
|
121
|
+
.map((actor) => {
|
|
122
|
+
return {
|
|
123
|
+
type: actor.type,
|
|
124
|
+
id: actor.userId ?? null,
|
|
125
|
+
sub_type: actor.subType ?? null,
|
|
126
|
+
id_type: actor.idType ?? null,
|
|
127
|
+
is_implicit_actor: actor.isImplicitActor ?? false,
|
|
128
|
+
};
|
|
129
|
+
}),
|
|
130
|
+
};
|
|
131
|
+
});
|
|
132
|
+
const isUpdate = approverViewUpdateData.approvalRuleId != null;
|
|
133
|
+
const minValue = minAmount?.amount ?? null;
|
|
134
|
+
const maxValue = maxAmount?.amount ?? null;
|
|
135
|
+
// Approval Rules 3.0 — guard against the both-null case. The form
|
|
136
|
+
// is expected to always set at least one bound, but if drift ever
|
|
137
|
+
// hands us a rule with no min and no max we'd otherwise emit
|
|
138
|
+
// '[{type: range, min: null, max: null, ...}]' — a payload that
|
|
139
|
+
// (a) the read-side 'legacyAmountRangeToCriteria' decodes back to
|
|
140
|
+
// '[]' (asymmetric round-trip), and (b) the V1 backend will
|
|
141
|
+
// reject anyway. Emit 'criteria: []' instead so the save fails
|
|
142
|
+
// cleanly on the server side and we leave a breadcrumb in the
|
|
143
|
+
// console for diagnosis rather than persisting mis-shaped data.
|
|
144
|
+
const criteria = [];
|
|
145
|
+
if (minValue == null && maxValue == null) {
|
|
146
|
+
console.warn('[approvalRules][V1] toApprovalChangableInfoPayloadV1: rule has ' +
|
|
147
|
+
'no amount bounds; emitting empty criteria array. The V1 backend ' +
|
|
148
|
+
'will reject this save — caller should ensure at least one bound ' +
|
|
149
|
+
'is set on the form.');
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
criteria.push({
|
|
153
|
+
type: 'range',
|
|
154
|
+
range_entity: 'currency',
|
|
155
|
+
min: minValue,
|
|
156
|
+
max: maxValue,
|
|
157
|
+
currency_code: currencyCode,
|
|
158
|
+
currency_symbol: currencySymbol,
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
const payload = {
|
|
162
|
+
steps,
|
|
163
|
+
is_applicable_on_pending_approval_entity: approverViewUpdateData.isApplicableOnPendingApprovalEntity ?? true,
|
|
164
|
+
criteria,
|
|
165
|
+
};
|
|
42
166
|
if (isUpdate) {
|
|
43
167
|
payload.approval_rule_id = approverViewUpdateData.approvalRuleId;
|
|
44
168
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import recordGet from 'lodash/get';
|
|
2
2
|
import has from 'lodash/has';
|
|
3
3
|
import { reduceFetchState } from '../../../../commonStateTypes/reduceFetchState';
|
|
4
|
+
import { getAmountCriteria, getDepartmentCriteria, getVendorCriteria, } from '../../../../entity/approvalRule/approvalRuleSelector';
|
|
4
5
|
import { getBankAccountByBankAccountId, getBankAccountsByBankAccountIds, } from '../../../../entity/bankAccount/bankAccountSelector';
|
|
5
6
|
import { getContactById, getContactsByIds, } from '../../../../entity/billPay/contact/contactSelector';
|
|
6
7
|
import { getCompanyByCompanyId } from '../../../../entity/company/companySelector';
|
|
@@ -356,6 +357,14 @@ export const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, i
|
|
|
356
357
|
isDeleted,
|
|
357
358
|
showAutofill,
|
|
358
359
|
addBillAutoFields,
|
|
360
|
+
// Bill-level accounting class. Approval Rules 3.0 'department'
|
|
361
|
+
// criteria match against this. Lives on BillTransaction; not on
|
|
362
|
+
// any sub-section. Empty-string is normalised to 'undefined'
|
|
363
|
+
// so downstream readers treat "no class" uniformly regardless
|
|
364
|
+
// of whether the wire used '' or omitted the field.
|
|
365
|
+
classId: transaction?.classId != null && transaction.classId !== ''
|
|
366
|
+
? transaction.classId
|
|
367
|
+
: undefined,
|
|
359
368
|
billStage,
|
|
360
369
|
deleteStatus,
|
|
361
370
|
billActivities,
|
|
@@ -678,12 +687,59 @@ export const getDefaultWithdrawFromAccount = (state, depositAccounts, companyId,
|
|
|
678
687
|
}
|
|
679
688
|
return undefined;
|
|
680
689
|
};
|
|
681
|
-
export const checkIfCreatorIsApprover = (billAmount, approvalRules, signedInUser) => {
|
|
690
|
+
export const checkIfCreatorIsApprover = (billAmount, approvalRules, signedInUser, billVendorId, billDepartmentId) => {
|
|
682
691
|
let isCreatorAlsoApprover = false;
|
|
692
|
+
// Approval Rules 3.0 — a rule applies to a bill only when all of
|
|
693
|
+
// its present criteria are satisfied. Criteria not declared on
|
|
694
|
+
// the rule are treated as "no narrowing on this axis".
|
|
695
|
+
//
|
|
696
|
+
// Strict-match semantics for vendor / department: if the rule
|
|
697
|
+
// narrows by an axis but the bill has no value on that axis, the
|
|
698
|
+
// rule does NOT apply (an absent bill-side value can't satisfy
|
|
699
|
+
// either 'is' or 'is_not'). Amount is always present on a rule
|
|
700
|
+
// (the form enforces this), but bounds may be one-sided.
|
|
683
701
|
const approvalRule = approvalRules.find((rule) => {
|
|
684
|
-
const
|
|
685
|
-
|
|
686
|
-
(
|
|
702
|
+
const vendorCriteria = getVendorCriteria(rule.criteria);
|
|
703
|
+
if (vendorCriteria != null) {
|
|
704
|
+
if (billVendorId == null) {
|
|
705
|
+
return false;
|
|
706
|
+
}
|
|
707
|
+
const includesVendor = vendorCriteria.vendorIds.includes(billVendorId);
|
|
708
|
+
if (vendorCriteria.operator === 'is' && !includesVendor) {
|
|
709
|
+
return false;
|
|
710
|
+
}
|
|
711
|
+
if (vendorCriteria.operator === 'is_not' && includesVendor) {
|
|
712
|
+
return false;
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
const departmentCriteria = getDepartmentCriteria(rule.criteria);
|
|
716
|
+
if (departmentCriteria != null) {
|
|
717
|
+
if (billDepartmentId == null) {
|
|
718
|
+
return false;
|
|
719
|
+
}
|
|
720
|
+
const includesDepartment = departmentCriteria.departmentIds.includes(billDepartmentId);
|
|
721
|
+
if (departmentCriteria.operator === 'is' && !includesDepartment) {
|
|
722
|
+
return false;
|
|
723
|
+
}
|
|
724
|
+
if (departmentCriteria.operator === 'is_not' && includesDepartment) {
|
|
725
|
+
return false;
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
const amountCriteria = getAmountCriteria(rule.criteria);
|
|
729
|
+
if (amountCriteria == null) {
|
|
730
|
+
// The form guarantees an amount criterion on every rule, so
|
|
731
|
+
// this branch is defensive against backend drift. Keep
|
|
732
|
+
// pre-3.0 behaviour: a rule that doesn't declare amount
|
|
733
|
+
// doesn't participate here.
|
|
734
|
+
return false;
|
|
735
|
+
}
|
|
736
|
+
// Bounds use the wire's inclusive 'gte' / 'lte' semantics, and
|
|
737
|
+
// either side may be absent for a one-sided 'greater_than' /
|
|
738
|
+
// 'less_than' rule.
|
|
739
|
+
const { min, max } = amountCriteria;
|
|
740
|
+
const matchesMin = min == null || billAmount >= min.amount;
|
|
741
|
+
const matchesMax = max == null || billAmount <= max.amount;
|
|
742
|
+
return matchesMin && matchesMax;
|
|
687
743
|
});
|
|
688
744
|
if (approvalRule != null) {
|
|
689
745
|
const requireApprovalSteps = approvalRule.steps.filter((step) => step.action === 'require_approval');
|
package/lib/esm/view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic.js
CHANGED
|
@@ -38,7 +38,10 @@ export const fetchEditBillDetailPageEpic = (actions$, state$) => actions$.pipe(f
|
|
|
38
38
|
else {
|
|
39
39
|
billDetailActions.push(updateShowAutofill(true));
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
// Side-fetch from the edit-bill page bootstrap. The triggering
|
|
42
|
+
// action doesn't carry the V3 flag, so we explicitly target v1
|
|
43
|
+
// here; tenants on v3 re-fetch through their own screen connector.
|
|
44
|
+
billDetailActions.push(fetchBillPaySetupApproverView(true, true, false));
|
|
42
45
|
}
|
|
43
46
|
else {
|
|
44
47
|
if (state.ownerListState.fetchState !== 'In-Progress' &&
|
|
@@ -81,7 +84,10 @@ export const fetchEditBillDetailPageEpic = (actions$, state$) => actions$.pipe(f
|
|
|
81
84
|
// While opening New Bill Refresh Approval Rules and Payment Accounts
|
|
82
85
|
if (approvalViewFetchState !== 'In-Progress' &&
|
|
83
86
|
approvalViewFetchState !== 'Completed') {
|
|
84
|
-
|
|
87
|
+
// Side-fetch from the edit-bill page bootstrap. The triggering
|
|
88
|
+
// action doesn't carry the V3 flag, so we explicitly target v1
|
|
89
|
+
// here; tenants on v3 re-fetch through their own screen connector.
|
|
90
|
+
billDetailActions.push(fetchBillPaySetupApproverView(true, true, false));
|
|
85
91
|
}
|
|
86
92
|
}
|
|
87
93
|
return concat(from(billDetailActions));
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { toAmount } from '../../../../commonStateTypes/amount';
|
|
2
|
+
import { date } from '../../../../zeniDayJS';
|
|
3
|
+
import { toAutoSweepFrequency, } from './autoSweepFlowState';
|
|
4
|
+
export const toSaveAutoSweepSettingsBody = (state) => ({
|
|
5
|
+
frequency: state.frequency,
|
|
6
|
+
memo: state.memo,
|
|
7
|
+
minimum_buffer_usd: state.bufferAmount.amount,
|
|
8
|
+
});
|
|
9
|
+
/**
|
|
10
|
+
* Map a `GET /cash-management/settings` payload into the slice's writable
|
|
11
|
+
* fields. Defensive on the frequency (string-from-the-wire → union via
|
|
12
|
+
* `toAutoSweepFrequency`, falling back to `'weekly'` if the server returns
|
|
13
|
+
* something we don't model yet). Only the source account *id* is stored
|
|
14
|
+
* here — the full deposit-account payload is published to the entity bucket
|
|
15
|
+
* by the fetch epic.
|
|
16
|
+
*/
|
|
17
|
+
export const toAutoSweepFlowStatePatch = (payload) => {
|
|
18
|
+
const currencyCode = payload.source_bank_account.balances?.currency_code;
|
|
19
|
+
const currencySymbol = payload.source_bank_account.balances?.currency_symbol;
|
|
20
|
+
return {
|
|
21
|
+
bufferAmount: toAmount(payload.minimum_buffer_usd, currencyCode ?? 'USD', currencySymbol ?? '$'),
|
|
22
|
+
frequency: toAutoSweepFrequency(payload.frequency) ?? 'weekly',
|
|
23
|
+
nextTransferDate: payload.next_transfer_date != null && payload.next_transfer_date !== ''
|
|
24
|
+
? date(payload.next_transfer_date)
|
|
25
|
+
: undefined,
|
|
26
|
+
primaryFundingAccountId: payload.source_bank_account.deposit_account_id ?? undefined,
|
|
27
|
+
settingsId: payload.cash_management_settings_id ?? undefined,
|
|
28
|
+
};
|
|
29
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { createSlice } from '@reduxjs/toolkit';
|
|
2
|
+
import { toAutoSweepFlowStatePatch, } from './autoSweepFlowPayload';
|
|
3
|
+
import { initialAutoSweepFlowState, } from './autoSweepFlowState';
|
|
4
|
+
export const initialState = initialAutoSweepFlowState;
|
|
5
|
+
const autoSweepFlow = createSlice({
|
|
6
|
+
name: 'autoSweepFlow',
|
|
7
|
+
initialState,
|
|
8
|
+
reducers: {
|
|
9
|
+
/**
|
|
10
|
+
* Kicks off `GET /cash-management/settings`. Flips the top-level
|
|
11
|
+
* fetchState to `In-Progress`; the fetch epic picks this up.
|
|
12
|
+
*/
|
|
13
|
+
fetchCashManagementSettings(draft) {
|
|
14
|
+
draft.fetchState = 'In-Progress';
|
|
15
|
+
draft.error = undefined;
|
|
16
|
+
},
|
|
17
|
+
/**
|
|
18
|
+
* Hydrates the form fields with the server-side settings (and stashes
|
|
19
|
+
* the settings id for subsequent saves). Marks the GET as `Completed`.
|
|
20
|
+
*/
|
|
21
|
+
updateCashManagementSettings(draft, action) {
|
|
22
|
+
const patch = toAutoSweepFlowStatePatch(action.payload.data);
|
|
23
|
+
draft.bufferAmount = patch.bufferAmount;
|
|
24
|
+
draft.frequency = patch.frequency;
|
|
25
|
+
draft.nextTransferDate = patch.nextTransferDate;
|
|
26
|
+
draft.primaryFundingAccountId = patch.primaryFundingAccountId;
|
|
27
|
+
draft.settingsId = patch.settingsId;
|
|
28
|
+
draft.fetchState = 'Completed';
|
|
29
|
+
draft.error = undefined;
|
|
30
|
+
},
|
|
31
|
+
updateCashManagementSettingsFetchStatus(draft, action) {
|
|
32
|
+
draft.fetchState = action.payload.fetchState;
|
|
33
|
+
draft.error = action.payload.error;
|
|
34
|
+
},
|
|
35
|
+
/**
|
|
36
|
+
* Live-update the buffer (risk band) as the user toggles the risk picker
|
|
37
|
+
* on the setup page, without staging frequency/memo. The selector derives
|
|
38
|
+
* the risk-adjusted sweep amount off `bufferAmount`, so dispatching this on
|
|
39
|
+
* every risk change keeps the setup and review screens in sync.
|
|
40
|
+
*/
|
|
41
|
+
updateAutoSweepRisk(draft, action) {
|
|
42
|
+
draft.bufferAmount = action.payload.bufferAmount;
|
|
43
|
+
},
|
|
44
|
+
/**
|
|
45
|
+
* Stage the in-flight form values without submitting them — fired from
|
|
46
|
+
* the setup→review transition so other selectors (and devtools) can see
|
|
47
|
+
* what the user is about to confirm. Leaves `saveStatus` untouched; the
|
|
48
|
+
* actual PUT only kicks off when the user clicks "Confirm Sweep" via
|
|
49
|
+
* `saveAutoSweepSettings`.
|
|
50
|
+
*/
|
|
51
|
+
updateAutoSweepDraft(draft, action) {
|
|
52
|
+
draft.bufferAmount = action.payload.bufferAmount;
|
|
53
|
+
draft.frequency = action.payload.frequency;
|
|
54
|
+
draft.memo = action.payload.memo;
|
|
55
|
+
},
|
|
56
|
+
/**
|
|
57
|
+
* Trigger the PUT for the auto-sweep settings already staged via
|
|
58
|
+
* `updateAutoSweepDraft`. Carries no payload — flips `saveStatus` to
|
|
59
|
+
* `In-Progress` and the save epic reads `bufferAmount` / `frequency` /
|
|
60
|
+
* `memo` straight from the slice. Callers must ensure those fields
|
|
61
|
+
* reflect the user's latest input before dispatching.
|
|
62
|
+
*/
|
|
63
|
+
saveAutoSweepSettings(draft) {
|
|
64
|
+
draft.saveStatus = { fetchState: 'In-Progress', error: undefined };
|
|
65
|
+
},
|
|
66
|
+
updateAutoSweepSettingsFetchStatus(draft, action) {
|
|
67
|
+
draft.saveStatus = {
|
|
68
|
+
fetchState: action.payload.fetchState,
|
|
69
|
+
error: action.payload.error,
|
|
70
|
+
};
|
|
71
|
+
},
|
|
72
|
+
clearAutoSweepFlow() {
|
|
73
|
+
return initialAutoSweepFlowState;
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
export const { fetchCashManagementSettings, updateCashManagementSettings, updateCashManagementSettingsFetchStatus, updateAutoSweepRisk, updateAutoSweepDraft, saveAutoSweepSettings, updateAutoSweepSettingsFetchStatus, clearAutoSweepFlow, } = autoSweepFlow.actions;
|
|
78
|
+
export default autoSweepFlow.reducer;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { getDepositAccountByDepositAccountId } from '../../../../entity/depositAccount/depositAccountSelector';
|
|
2
|
+
import { mapDepositAccToFundingAccount, } from '../../commonSetup/setupViewSelector';
|
|
3
|
+
import { getTreasuryDetail } from '../../treasury/treasuryList/treasuryDetailSelector';
|
|
4
|
+
import { getCashManagementOverviewBanner } from '../cashManagementOverview/cashManagementOverviewSelector';
|
|
5
|
+
import { RISK_BUFFER_AMOUNT, bufferAmountToRisk, } from './autoSweepFlowState';
|
|
6
|
+
/**
|
|
7
|
+
* Risk band the agent's recommended sweep amount is computed against. The
|
|
8
|
+
* `sweepAmount` returned by the banner assumes this buffer, so the selector
|
|
9
|
+
* adjusts the displayed sweep by the delta between the user's selected band
|
|
10
|
+
* and this default.
|
|
11
|
+
*/
|
|
12
|
+
const DEFAULT_RISK_LEVEL = 'moderate';
|
|
13
|
+
export const getAutoSweepFlow = (state) => {
|
|
14
|
+
const { bufferAmount, frequency, memo, saveStatus, settingsId, primaryFundingAccountId, fetchState, error, } = state.autoSweepFlowState;
|
|
15
|
+
const depositAccount = primaryFundingAccountId != null
|
|
16
|
+
? getDepositAccountByDepositAccountId(state.depositAccountState, primaryFundingAccountId)
|
|
17
|
+
: undefined;
|
|
18
|
+
const risk = bufferAmountToRisk(bufferAmount.amount);
|
|
19
|
+
// The banner's recommended sweep assumes the default buffer band; shift it
|
|
20
|
+
// by the delta between the user's selected band and that default so a
|
|
21
|
+
// tighter buffer sweeps more and a looser buffer sweeps less.
|
|
22
|
+
const baseSweepAmount = getCashManagementOverviewBanner(state).amount;
|
|
23
|
+
const sweepAmount = {
|
|
24
|
+
...baseSweepAmount,
|
|
25
|
+
amount: baseSweepAmount.amount +
|
|
26
|
+
RISK_BUFFER_AMOUNT[risk] -
|
|
27
|
+
RISK_BUFFER_AMOUNT[DEFAULT_RISK_LEVEL],
|
|
28
|
+
};
|
|
29
|
+
return {
|
|
30
|
+
fetchState,
|
|
31
|
+
error,
|
|
32
|
+
formData: {
|
|
33
|
+
bufferAmount,
|
|
34
|
+
frequency,
|
|
35
|
+
memo,
|
|
36
|
+
risk,
|
|
37
|
+
},
|
|
38
|
+
primaryFundingAccount: depositAccount != null
|
|
39
|
+
? mapDepositAccToFundingAccount(depositAccount)
|
|
40
|
+
: undefined,
|
|
41
|
+
saveStatus,
|
|
42
|
+
settingsId,
|
|
43
|
+
sweepAmount,
|
|
44
|
+
treasurySummary: getTreasuryDetail(state).accountSummary,
|
|
45
|
+
version: 0,
|
|
46
|
+
};
|
|
47
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { toAmount } from '../../../../commonStateTypes/amount';
|
|
2
|
+
import { stringToUnion } from '../../../../commonStateTypes/stringToUnion';
|
|
3
|
+
/**
|
|
4
|
+
* Cadence at which the auto-sweep transfer fires. Lowercase to match the
|
|
5
|
+
* cash-management settings API contract (and the `SweepFrequency` literal
|
|
6
|
+
* already used by `<AutoSweepSetupPage>` in web-components).
|
|
7
|
+
*/
|
|
8
|
+
export const ALL_AUTO_SWEEP_FREQUENCIES = [
|
|
9
|
+
'daily',
|
|
10
|
+
'weekly',
|
|
11
|
+
'biweekly',
|
|
12
|
+
'monthly',
|
|
13
|
+
];
|
|
14
|
+
export const toAutoSweepFrequency = (v) => stringToUnion(v ?? '', ALL_AUTO_SWEEP_FREQUENCIES);
|
|
15
|
+
/**
|
|
16
|
+
* Risk presets the auto-sweep setup form exposes. Each level maps to a
|
|
17
|
+
* canonical minimum-buffer amount (USD). Selecting a level in the UI is
|
|
18
|
+
* shorthand for choosing that buffer.
|
|
19
|
+
*/
|
|
20
|
+
export const ALL_AUTO_SWEEP_RISK_LEVELS = ['low', 'moderate', 'high'];
|
|
21
|
+
export const toAutoSweepRiskLevel = (v) => stringToUnion(v ?? '', ALL_AUTO_SWEEP_RISK_LEVELS);
|
|
22
|
+
export const RISK_BUFFER_AMOUNT = {
|
|
23
|
+
low: 15000,
|
|
24
|
+
moderate: 10000,
|
|
25
|
+
high: 5000,
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Maps a buffer amount back onto the closest preset risk level. Falls back
|
|
29
|
+
* to `'moderate'` when the amount doesn't match a known preset (e.g. the
|
|
30
|
+
* server returned a custom value). The dropdown in `<AutoSweepSetupPage>`
|
|
31
|
+
* uses this so it can pre-select the user's existing band on edit.
|
|
32
|
+
*/
|
|
33
|
+
export const bufferAmountToRisk = (amount) => {
|
|
34
|
+
const match = Object.entries(RISK_BUFFER_AMOUNT).find(([, presetAmount]) => presetAmount === amount);
|
|
35
|
+
return match != null ? match[0] : 'moderate';
|
|
36
|
+
};
|
|
37
|
+
export const initialAutoSweepFlowState = {
|
|
38
|
+
bufferAmount: toAmount(10000, 'USD', '$'),
|
|
39
|
+
frequency: 'weekly',
|
|
40
|
+
memo: '',
|
|
41
|
+
saveStatus: { fetchState: 'Not-Started', error: undefined },
|
|
42
|
+
nextTransferDate: undefined,
|
|
43
|
+
primaryFundingAccountId: undefined,
|
|
44
|
+
settingsId: undefined,
|
|
45
|
+
fetchState: 'Not-Started',
|
|
46
|
+
error: undefined,
|
|
47
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { of } from 'rxjs';
|
|
2
|
+
import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
|
|
3
|
+
import { updateDepositAccounts } from '../../../../../entity/depositAccount/depositAccountReducer';
|
|
4
|
+
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../../responsePayload';
|
|
5
|
+
import { fetchCashManagementSettings, updateCashManagementSettings, updateCashManagementSettingsFetchStatus, } from '../autoSweepFlowReducer';
|
|
6
|
+
/**
|
|
7
|
+
* Hits `GET /cash-management/settings` and hydrates the auto-sweep slice
|
|
8
|
+
* with the server's existing settings (frequency, minimum buffer, settings
|
|
9
|
+
* id). Called from the cash management overview page-fetch epic alongside
|
|
10
|
+
* the other top-level fetches.
|
|
11
|
+
*/
|
|
12
|
+
export const fetchCashManagementSettingsEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(fetchCashManagementSettings.match), switchMap(() => {
|
|
13
|
+
const endpoint = `${zeniAPI.apiEndPoints.cashManagementAgentBaseUrl}/1.0/cash-management/settings`;
|
|
14
|
+
return zeniAPI.getJSON(endpoint).pipe(mergeMap((response) => {
|
|
15
|
+
if (isSuccessResponse(response) && response.data != null) {
|
|
16
|
+
return of(
|
|
17
|
+
// Publish the source deposit account into the shared entity
|
|
18
|
+
// bucket so the selector can hydrate the full `FundingAccount`
|
|
19
|
+
// from `getDepositAccountByDepositAccountId` rather than the
|
|
20
|
+
// auto-sweep slice holding a duplicate copy.
|
|
21
|
+
updateDepositAccounts([response.data.source_bank_account]), updateCashManagementSettings({ data: response.data }));
|
|
22
|
+
}
|
|
23
|
+
return of(updateCashManagementSettingsFetchStatus({
|
|
24
|
+
fetchState: 'Error',
|
|
25
|
+
error: response.status,
|
|
26
|
+
}));
|
|
27
|
+
}), catchError((error) => of(updateCashManagementSettingsFetchStatus({
|
|
28
|
+
fetchState: 'Error',
|
|
29
|
+
error: createZeniAPIStatus('Unexpected Error', 'Fetch cash management settings REST API call errored out: ' +
|
|
30
|
+
(error?.message ?? String(error))),
|
|
31
|
+
}))));
|
|
32
|
+
}));
|