@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,23 +1,51 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toApprovalChangableInfoPayload = void 0;
|
|
3
|
+
exports.toApprovalChangableInfoPayloadV1 = exports.toApprovalChangableInfoPayload = void 0;
|
|
4
4
|
const toApprovalChangableInfoPayload = (approverViewUpdateData) => {
|
|
5
|
-
|
|
5
|
+
// Form-side criteria is a structured object with optional slots for
|
|
6
|
+
// amount / vendor / department; flatten it into the wire format's
|
|
7
|
+
// `conditions[]` array.
|
|
8
|
+
let criteriaPayload;
|
|
6
9
|
if (approverViewUpdateData.criteria != null) {
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
10
|
+
const { amount, vendor, department } = approverViewUpdateData.criteria;
|
|
11
|
+
const conditions = [];
|
|
12
|
+
if (amount?.min != null) {
|
|
13
|
+
conditions.push({
|
|
14
|
+
field: 'amount',
|
|
15
|
+
type: 'gte',
|
|
16
|
+
value: amount.min.amount,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
if (amount?.max != null) {
|
|
20
|
+
conditions.push({
|
|
21
|
+
field: 'amount',
|
|
22
|
+
type: 'lte',
|
|
23
|
+
value: amount.max.amount,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
if (vendor != null && vendor.vendorIds.length > 0) {
|
|
27
|
+
conditions.push({
|
|
28
|
+
field: 'vendor_id',
|
|
29
|
+
type: vendor.operator === 'is_not' ? 'not_in' : 'in',
|
|
30
|
+
value: vendor.vendorIds,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
if (department != null && department.departmentIds.length > 0) {
|
|
34
|
+
conditions.push({
|
|
35
|
+
field: 'department_id',
|
|
36
|
+
type: department.operator === 'is_not' ? 'not_in' : 'in',
|
|
37
|
+
value: department.departmentIds,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
if (conditions.length > 0) {
|
|
41
|
+
const currency = amount?.min ?? amount?.max ?? null;
|
|
42
|
+
criteriaPayload = {
|
|
43
|
+
conditions,
|
|
44
|
+
criteria_operator: 'and',
|
|
45
|
+
currency_code: currency?.currencyCode ?? 'USD',
|
|
46
|
+
currency_symbol: currency?.currencySymbol ?? '$',
|
|
47
|
+
};
|
|
48
|
+
}
|
|
21
49
|
}
|
|
22
50
|
const steps = approverViewUpdateData.steps.map((step) => {
|
|
23
51
|
return {
|
|
@@ -38,13 +66,110 @@ const toApprovalChangableInfoPayload = (approverViewUpdateData) => {
|
|
|
38
66
|
});
|
|
39
67
|
const isUpdate = approverViewUpdateData.approvalRuleId != null;
|
|
40
68
|
const payload = {
|
|
41
|
-
criteria: criteriaPayload,
|
|
42
69
|
steps,
|
|
43
70
|
is_applicable_on_pending_approval_entity: approverViewUpdateData.isApplicableOnPendingApprovalEntity ?? true,
|
|
44
71
|
};
|
|
72
|
+
if (criteriaPayload != null) {
|
|
73
|
+
payload.criteria = criteriaPayload;
|
|
74
|
+
}
|
|
75
|
+
// Approval Rules 3.0 — surface rule-level fields when the form set them.
|
|
76
|
+
// Send only what the user actually entered: an undefined value means
|
|
77
|
+
// "no opinion" and stays off the wire.
|
|
78
|
+
if (approverViewUpdateData.name != null) {
|
|
79
|
+
payload.name = approverViewUpdateData.name;
|
|
80
|
+
}
|
|
81
|
+
if (approverViewUpdateData.description != null) {
|
|
82
|
+
payload.description = approverViewUpdateData.description;
|
|
83
|
+
}
|
|
84
|
+
if (approverViewUpdateData.separationOfDuties != null) {
|
|
85
|
+
payload.is_separation_of_duty_enabled =
|
|
86
|
+
approverViewUpdateData.separationOfDuties;
|
|
87
|
+
}
|
|
88
|
+
if (approverViewUpdateData.isFallback != null) {
|
|
89
|
+
payload.is_fallback = approverViewUpdateData.isFallback;
|
|
90
|
+
}
|
|
45
91
|
if (isUpdate) {
|
|
46
92
|
payload.approval_rule_id = approverViewUpdateData.approvalRuleId;
|
|
47
93
|
}
|
|
48
94
|
return payload;
|
|
49
95
|
};
|
|
50
96
|
exports.toApprovalChangableInfoPayload = toApprovalChangableInfoPayload;
|
|
97
|
+
/**
|
|
98
|
+
* V1 wire mapper — used when 'approval_rule_v3_config' resolves to OFF
|
|
99
|
+
* for the current tenant. Emits the legacy snake_case array shape that
|
|
100
|
+
* '/approval-rules' historically consumed (see the V1 fixture in
|
|
101
|
+
* 'entity/entityApprovalStatus/__mocks__/json/entityApprovalStatusPayload.json'):
|
|
102
|
+
* criteria: [{type: 'range', range_entity: 'currency', min, max,
|
|
103
|
+
* currency_code, currency_symbol}]
|
|
104
|
+
*
|
|
105
|
+
* Open-ended semantics are preserved on the wire: an absent 'min' or
|
|
106
|
+
* 'max' is sent as 'null' rather than synthesised to '0' or
|
|
107
|
+
* 'MAX_SAFE_INTEGER', so a 'greater_than' / 'less_than' rule stays
|
|
108
|
+
* one-sided after rollback rather than collapsing into a closed range.
|
|
109
|
+
*
|
|
110
|
+
* The V1 backend does not understand vendor / department criteria or
|
|
111
|
+
* the rule-level 3.0 fields, so those are dropped on the wire.
|
|
112
|
+
*/
|
|
113
|
+
const toApprovalChangableInfoPayloadV1 = (approverViewUpdateData) => {
|
|
114
|
+
const amount = approverViewUpdateData.criteria?.amount;
|
|
115
|
+
const minAmount = amount?.min;
|
|
116
|
+
const maxAmount = amount?.max;
|
|
117
|
+
const currencyCode = minAmount?.currencyCode ?? maxAmount?.currencyCode ?? 'USD';
|
|
118
|
+
const currencySymbol = minAmount?.currencySymbol ?? maxAmount?.currencySymbol ?? '$';
|
|
119
|
+
const steps = approverViewUpdateData.steps.map((step) => {
|
|
120
|
+
return {
|
|
121
|
+
action: step.action,
|
|
122
|
+
operator: step.operator,
|
|
123
|
+
actors: step.actors
|
|
124
|
+
.filter((actor) => actor.subType !== 'admin')
|
|
125
|
+
.map((actor) => {
|
|
126
|
+
return {
|
|
127
|
+
type: actor.type,
|
|
128
|
+
id: actor.userId ?? null,
|
|
129
|
+
sub_type: actor.subType ?? null,
|
|
130
|
+
id_type: actor.idType ?? null,
|
|
131
|
+
is_implicit_actor: actor.isImplicitActor ?? false,
|
|
132
|
+
};
|
|
133
|
+
}),
|
|
134
|
+
};
|
|
135
|
+
});
|
|
136
|
+
const isUpdate = approverViewUpdateData.approvalRuleId != null;
|
|
137
|
+
const minValue = minAmount?.amount ?? null;
|
|
138
|
+
const maxValue = maxAmount?.amount ?? null;
|
|
139
|
+
// Approval Rules 3.0 — guard against the both-null case. The form
|
|
140
|
+
// is expected to always set at least one bound, but if drift ever
|
|
141
|
+
// hands us a rule with no min and no max we'd otherwise emit
|
|
142
|
+
// '[{type: range, min: null, max: null, ...}]' — a payload that
|
|
143
|
+
// (a) the read-side 'legacyAmountRangeToCriteria' decodes back to
|
|
144
|
+
// '[]' (asymmetric round-trip), and (b) the V1 backend will
|
|
145
|
+
// reject anyway. Emit 'criteria: []' instead so the save fails
|
|
146
|
+
// cleanly on the server side and we leave a breadcrumb in the
|
|
147
|
+
// console for diagnosis rather than persisting mis-shaped data.
|
|
148
|
+
const criteria = [];
|
|
149
|
+
if (minValue == null && maxValue == null) {
|
|
150
|
+
console.warn('[approvalRules][V1] toApprovalChangableInfoPayloadV1: rule has ' +
|
|
151
|
+
'no amount bounds; emitting empty criteria array. The V1 backend ' +
|
|
152
|
+
'will reject this save — caller should ensure at least one bound ' +
|
|
153
|
+
'is set on the form.');
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
criteria.push({
|
|
157
|
+
type: 'range',
|
|
158
|
+
range_entity: 'currency',
|
|
159
|
+
min: minValue,
|
|
160
|
+
max: maxValue,
|
|
161
|
+
currency_code: currencyCode,
|
|
162
|
+
currency_symbol: currencySymbol,
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
const payload = {
|
|
166
|
+
steps,
|
|
167
|
+
is_applicable_on_pending_approval_entity: approverViewUpdateData.isApplicableOnPendingApprovalEntity ?? true,
|
|
168
|
+
criteria,
|
|
169
|
+
};
|
|
170
|
+
if (isUpdate) {
|
|
171
|
+
payload.approval_rule_id = approverViewUpdateData.approvalRuleId;
|
|
172
|
+
}
|
|
173
|
+
return payload;
|
|
174
|
+
};
|
|
175
|
+
exports.toApprovalChangableInfoPayloadV1 = toApprovalChangableInfoPayloadV1;
|
|
@@ -1,19 +1,45 @@
|
|
|
1
1
|
import { FetchStateAndError, ID } from '../../../../../commonStateTypes/common';
|
|
2
|
-
import {
|
|
2
|
+
import { AmountCriteria, DepartmentCriteria, Step, VendorCriteria } from '../../../../../entity/approvalRule/approvalRuleState';
|
|
3
3
|
export type ApprovalUpdateActionType = 'approval_create' | 'approval_update';
|
|
4
4
|
export interface ApproverViewUpdateData {
|
|
5
5
|
type: ApprovalUpdateActionType;
|
|
6
6
|
updateStatus: FetchStateAndError;
|
|
7
7
|
data?: ApprovalRuleUpdateData | ApprovalRuleCreateData;
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Form-side criteria shape used by the rule create/edit form.
|
|
11
|
+
*
|
|
12
|
+
* Each condition kind gets its own optional slot, mirroring how the UI
|
|
13
|
+
* edits them as distinct rows. At most one of each kind is present; this
|
|
14
|
+
* matches the design constraint that each condition type can be added once.
|
|
15
|
+
*/
|
|
16
|
+
export interface ApprovalRuleFormCriteria {
|
|
17
|
+
amount?: AmountCriteria;
|
|
18
|
+
department?: DepartmentCriteria;
|
|
19
|
+
vendor?: VendorCriteria;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Rule-level fields shared by both create and update flows.
|
|
23
|
+
*
|
|
24
|
+
* These come from the 3.0 design: the form now owns a name, an optional
|
|
25
|
+
* description, an optional Separation-of-Duties toggle, and a flag that
|
|
26
|
+
* marks the rule as the org-wide fallback rule. They live alongside
|
|
27
|
+
* criteria/steps but are not part of either.
|
|
28
|
+
*/
|
|
29
|
+
export interface ApprovalRuleFormBase {
|
|
30
|
+
description?: string;
|
|
31
|
+
isFallback?: boolean;
|
|
32
|
+
name?: string;
|
|
33
|
+
separationOfDuties?: boolean;
|
|
34
|
+
}
|
|
35
|
+
export interface ApprovalRuleUpdateData extends ApprovalRuleFormBase {
|
|
10
36
|
approvalRuleId: ID;
|
|
11
|
-
criteria:
|
|
37
|
+
criteria: ApprovalRuleFormCriteria;
|
|
12
38
|
steps: Step[];
|
|
13
39
|
isApplicableOnPendingApprovalEntity?: boolean;
|
|
14
40
|
}
|
|
15
|
-
export interface ApprovalRuleCreateData {
|
|
16
|
-
criteria:
|
|
41
|
+
export interface ApprovalRuleCreateData extends ApprovalRuleFormBase {
|
|
42
|
+
criteria: ApprovalRuleFormCriteria;
|
|
17
43
|
steps: Step[];
|
|
18
44
|
isApplicableOnPendingApprovalEntity?: boolean;
|
|
19
45
|
}
|
|
@@ -100,6 +100,13 @@ export interface EditBillDetailSelectorView extends SelectorView {
|
|
|
100
100
|
withdrawFromList: FundingAccount[];
|
|
101
101
|
billPayInfo?: BillPayInfo;
|
|
102
102
|
bookCloseDate?: ZeniDate;
|
|
103
|
+
/**
|
|
104
|
+
* Bill-level accounting class id. Approval Rules 3.0 'department'
|
|
105
|
+
* criteria match against this — selectors needing to evaluate a
|
|
106
|
+
* department-narrowed rule against the current bill should read
|
|
107
|
+
* this rather than digging through 'state.billTransactionState'.
|
|
108
|
+
*/
|
|
109
|
+
classId?: ID;
|
|
103
110
|
createTime?: ZeniDate;
|
|
104
111
|
editBillInitialDetails?: EditBillInitialDetails;
|
|
105
112
|
internationalWireOnboardingStatus?: AllowedValueWithCode;
|
|
@@ -157,4 +164,4 @@ export declare const getDefaultWithdrawFromAccount: (state: RootState, depositAc
|
|
|
157
164
|
accountId: ID;
|
|
158
165
|
accountType: AccountTypeSubConfigCodeKeyType;
|
|
159
166
|
}) => FundingAccount | undefined;
|
|
160
|
-
export declare const checkIfCreatorIsApprover: (billAmount: number, approvalRules: ApprovalRuleWithUser[], signedInUser?: LoggedInUser) => boolean;
|
|
167
|
+
export declare const checkIfCreatorIsApprover: (billAmount: number, approvalRules: ApprovalRuleWithUser[], signedInUser?: LoggedInUser, billVendorId?: ID, billDepartmentId?: ID) => boolean;
|
|
@@ -10,6 +10,7 @@ exports.toPaymentToOption = toPaymentToOption;
|
|
|
10
10
|
const get_1 = __importDefault(require("lodash/get"));
|
|
11
11
|
const has_1 = __importDefault(require("lodash/has"));
|
|
12
12
|
const reduceFetchState_1 = require("../../../../commonStateTypes/reduceFetchState");
|
|
13
|
+
const approvalRuleSelector_1 = require("../../../../entity/approvalRule/approvalRuleSelector");
|
|
13
14
|
const bankAccountSelector_1 = require("../../../../entity/bankAccount/bankAccountSelector");
|
|
14
15
|
const contactSelector_1 = require("../../../../entity/billPay/contact/contactSelector");
|
|
15
16
|
const companySelector_1 = require("../../../../entity/company/companySelector");
|
|
@@ -365,6 +366,14 @@ const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAc
|
|
|
365
366
|
isDeleted,
|
|
366
367
|
showAutofill,
|
|
367
368
|
addBillAutoFields,
|
|
369
|
+
// Bill-level accounting class. Approval Rules 3.0 'department'
|
|
370
|
+
// criteria match against this. Lives on BillTransaction; not on
|
|
371
|
+
// any sub-section. Empty-string is normalised to 'undefined'
|
|
372
|
+
// so downstream readers treat "no class" uniformly regardless
|
|
373
|
+
// of whether the wire used '' or omitted the field.
|
|
374
|
+
classId: transaction?.classId != null && transaction.classId !== ''
|
|
375
|
+
? transaction.classId
|
|
376
|
+
: undefined,
|
|
368
377
|
billStage,
|
|
369
378
|
deleteStatus,
|
|
370
379
|
billActivities,
|
|
@@ -695,12 +704,59 @@ const getDefaultWithdrawFromAccount = (state, depositAccounts, companyId, lastSe
|
|
|
695
704
|
return undefined;
|
|
696
705
|
};
|
|
697
706
|
exports.getDefaultWithdrawFromAccount = getDefaultWithdrawFromAccount;
|
|
698
|
-
const checkIfCreatorIsApprover = (billAmount, approvalRules, signedInUser) => {
|
|
707
|
+
const checkIfCreatorIsApprover = (billAmount, approvalRules, signedInUser, billVendorId, billDepartmentId) => {
|
|
699
708
|
let isCreatorAlsoApprover = false;
|
|
709
|
+
// Approval Rules 3.0 — a rule applies to a bill only when all of
|
|
710
|
+
// its present criteria are satisfied. Criteria not declared on
|
|
711
|
+
// the rule are treated as "no narrowing on this axis".
|
|
712
|
+
//
|
|
713
|
+
// Strict-match semantics for vendor / department: if the rule
|
|
714
|
+
// narrows by an axis but the bill has no value on that axis, the
|
|
715
|
+
// rule does NOT apply (an absent bill-side value can't satisfy
|
|
716
|
+
// either 'is' or 'is_not'). Amount is always present on a rule
|
|
717
|
+
// (the form enforces this), but bounds may be one-sided.
|
|
700
718
|
const approvalRule = approvalRules.find((rule) => {
|
|
701
|
-
const
|
|
702
|
-
|
|
703
|
-
(
|
|
719
|
+
const vendorCriteria = (0, approvalRuleSelector_1.getVendorCriteria)(rule.criteria);
|
|
720
|
+
if (vendorCriteria != null) {
|
|
721
|
+
if (billVendorId == null) {
|
|
722
|
+
return false;
|
|
723
|
+
}
|
|
724
|
+
const includesVendor = vendorCriteria.vendorIds.includes(billVendorId);
|
|
725
|
+
if (vendorCriteria.operator === 'is' && !includesVendor) {
|
|
726
|
+
return false;
|
|
727
|
+
}
|
|
728
|
+
if (vendorCriteria.operator === 'is_not' && includesVendor) {
|
|
729
|
+
return false;
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
const departmentCriteria = (0, approvalRuleSelector_1.getDepartmentCriteria)(rule.criteria);
|
|
733
|
+
if (departmentCriteria != null) {
|
|
734
|
+
if (billDepartmentId == null) {
|
|
735
|
+
return false;
|
|
736
|
+
}
|
|
737
|
+
const includesDepartment = departmentCriteria.departmentIds.includes(billDepartmentId);
|
|
738
|
+
if (departmentCriteria.operator === 'is' && !includesDepartment) {
|
|
739
|
+
return false;
|
|
740
|
+
}
|
|
741
|
+
if (departmentCriteria.operator === 'is_not' && includesDepartment) {
|
|
742
|
+
return false;
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
const amountCriteria = (0, approvalRuleSelector_1.getAmountCriteria)(rule.criteria);
|
|
746
|
+
if (amountCriteria == null) {
|
|
747
|
+
// The form guarantees an amount criterion on every rule, so
|
|
748
|
+
// this branch is defensive against backend drift. Keep
|
|
749
|
+
// pre-3.0 behaviour: a rule that doesn't declare amount
|
|
750
|
+
// doesn't participate here.
|
|
751
|
+
return false;
|
|
752
|
+
}
|
|
753
|
+
// Bounds use the wire's inclusive 'gte' / 'lte' semantics, and
|
|
754
|
+
// either side may be absent for a one-sided 'greater_than' /
|
|
755
|
+
// 'less_than' rule.
|
|
756
|
+
const { min, max } = amountCriteria;
|
|
757
|
+
const matchesMin = min == null || billAmount >= min.amount;
|
|
758
|
+
const matchesMax = max == null || billAmount <= max.amount;
|
|
759
|
+
return matchesMin && matchesMax;
|
|
704
760
|
});
|
|
705
761
|
if (approvalRule != null) {
|
|
706
762
|
const requireApprovalSteps = approvalRule.steps.filter((step) => step.action === 'require_approval');
|
|
@@ -41,7 +41,10 @@ const fetchEditBillDetailPageEpic = (actions$, state$) => actions$.pipe((0, oper
|
|
|
41
41
|
else {
|
|
42
42
|
billDetailActions.push((0, editBillViewReducer_1.updateShowAutofill)(true));
|
|
43
43
|
}
|
|
44
|
-
|
|
44
|
+
// Side-fetch from the edit-bill page bootstrap. The triggering
|
|
45
|
+
// action doesn't carry the V3 flag, so we explicitly target v1
|
|
46
|
+
// here; tenants on v3 re-fetch through their own screen connector.
|
|
47
|
+
billDetailActions.push((0, billPaySetupApproverViewReducer_1.fetchBillPaySetupApproverView)(true, true, false));
|
|
45
48
|
}
|
|
46
49
|
else {
|
|
47
50
|
if (state.ownerListState.fetchState !== 'In-Progress' &&
|
|
@@ -84,7 +87,10 @@ const fetchEditBillDetailPageEpic = (actions$, state$) => actions$.pipe((0, oper
|
|
|
84
87
|
// While opening New Bill Refresh Approval Rules and Payment Accounts
|
|
85
88
|
if (approvalViewFetchState !== 'In-Progress' &&
|
|
86
89
|
approvalViewFetchState !== 'Completed') {
|
|
87
|
-
|
|
90
|
+
// Side-fetch from the edit-bill page bootstrap. The triggering
|
|
91
|
+
// action doesn't carry the V3 flag, so we explicitly target v1
|
|
92
|
+
// here; tenants on v3 re-fetch through their own screen connector.
|
|
93
|
+
billDetailActions.push((0, billPaySetupApproverViewReducer_1.fetchBillPaySetupApproverView)(true, true, false));
|
|
88
94
|
}
|
|
89
95
|
}
|
|
90
96
|
return (0, rxjs_1.concat)((0, rxjs_1.from)(billDetailActions));
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Amount } from '../../../../commonStateTypes/amount';
|
|
2
|
+
import { ID } from '../../../../commonStateTypes/common';
|
|
3
|
+
import { DepositAccountPayload } from '../../../../entity/depositAccount/depositAccountPayload';
|
|
4
|
+
import { ZeniAPIResponse } from '../../../../responsePayload';
|
|
5
|
+
import { ZeniDate } from '../../../../zeniDayJS';
|
|
6
|
+
import { AutoSweepFlowState, AutoSweepFrequency } from './autoSweepFlowState';
|
|
7
|
+
/**
|
|
8
|
+
* Body sent to `PUT /cash-management/settings`. Field names match the
|
|
9
|
+
* cash-management-agent contract; `minimum_buffer_usd` is a plain number
|
|
10
|
+
* (the slice tracks the canonical `Amount` value).
|
|
11
|
+
*/
|
|
12
|
+
export type SaveAutoSweepSettingsBody = {
|
|
13
|
+
frequency: string;
|
|
14
|
+
memo: string;
|
|
15
|
+
minimum_buffer_usd: number;
|
|
16
|
+
};
|
|
17
|
+
export type SaveAutoSweepSettingsResponse = ZeniAPIResponse<unknown>;
|
|
18
|
+
export declare const toSaveAutoSweepSettingsBody: (state: Pick<AutoSweepFlowState, "bufferAmount" | "frequency" | "memo">) => SaveAutoSweepSettingsBody;
|
|
19
|
+
/**
|
|
20
|
+
* `source_bank_account` on the cash-management settings response matches the
|
|
21
|
+
* shared `DepositAccountPayload` shape, so the fetch epic dispatches it into
|
|
22
|
+
* the deposit-account entity bucket and the auto-sweep slice only keeps the
|
|
23
|
+
* id. The selector hydrates the full `FundingAccount` on read.
|
|
24
|
+
*/
|
|
25
|
+
export interface CashManagementSettingsPayload {
|
|
26
|
+
cash_management_settings_id: string | null;
|
|
27
|
+
frequency: string;
|
|
28
|
+
minimum_buffer_usd: number;
|
|
29
|
+
next_transfer_date: string;
|
|
30
|
+
source_bank_account: DepositAccountPayload;
|
|
31
|
+
}
|
|
32
|
+
export type CashManagementSettingsResponse = ZeniAPIResponse<CashManagementSettingsPayload>;
|
|
33
|
+
/**
|
|
34
|
+
* Map a `GET /cash-management/settings` payload into the slice's writable
|
|
35
|
+
* fields. Defensive on the frequency (string-from-the-wire → union via
|
|
36
|
+
* `toAutoSweepFrequency`, falling back to `'weekly'` if the server returns
|
|
37
|
+
* something we don't model yet). Only the source account *id* is stored
|
|
38
|
+
* here — the full deposit-account payload is published to the entity bucket
|
|
39
|
+
* by the fetch epic.
|
|
40
|
+
*/
|
|
41
|
+
export declare const toAutoSweepFlowStatePatch: (payload: CashManagementSettingsPayload) => {
|
|
42
|
+
bufferAmount: Amount;
|
|
43
|
+
frequency: AutoSweepFrequency;
|
|
44
|
+
nextTransferDate?: ZeniDate;
|
|
45
|
+
primaryFundingAccountId?: ID;
|
|
46
|
+
settingsId?: ID;
|
|
47
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toAutoSweepFlowStatePatch = exports.toSaveAutoSweepSettingsBody = void 0;
|
|
4
|
+
const amount_1 = require("../../../../commonStateTypes/amount");
|
|
5
|
+
const zeniDayJS_1 = require("../../../../zeniDayJS");
|
|
6
|
+
const autoSweepFlowState_1 = require("./autoSweepFlowState");
|
|
7
|
+
const toSaveAutoSweepSettingsBody = (state) => ({
|
|
8
|
+
frequency: state.frequency,
|
|
9
|
+
memo: state.memo,
|
|
10
|
+
minimum_buffer_usd: state.bufferAmount.amount,
|
|
11
|
+
});
|
|
12
|
+
exports.toSaveAutoSweepSettingsBody = toSaveAutoSweepSettingsBody;
|
|
13
|
+
/**
|
|
14
|
+
* Map a `GET /cash-management/settings` payload into the slice's writable
|
|
15
|
+
* fields. Defensive on the frequency (string-from-the-wire → union via
|
|
16
|
+
* `toAutoSweepFrequency`, falling back to `'weekly'` if the server returns
|
|
17
|
+
* something we don't model yet). Only the source account *id* is stored
|
|
18
|
+
* here — the full deposit-account payload is published to the entity bucket
|
|
19
|
+
* by the fetch epic.
|
|
20
|
+
*/
|
|
21
|
+
const toAutoSweepFlowStatePatch = (payload) => {
|
|
22
|
+
const currencyCode = payload.source_bank_account.balances?.currency_code;
|
|
23
|
+
const currencySymbol = payload.source_bank_account.balances?.currency_symbol;
|
|
24
|
+
return {
|
|
25
|
+
bufferAmount: (0, amount_1.toAmount)(payload.minimum_buffer_usd, currencyCode ?? 'USD', currencySymbol ?? '$'),
|
|
26
|
+
frequency: (0, autoSweepFlowState_1.toAutoSweepFrequency)(payload.frequency) ?? 'weekly',
|
|
27
|
+
nextTransferDate: payload.next_transfer_date != null && payload.next_transfer_date !== ''
|
|
28
|
+
? (0, zeniDayJS_1.date)(payload.next_transfer_date)
|
|
29
|
+
: undefined,
|
|
30
|
+
primaryFundingAccountId: payload.source_bank_account.deposit_account_id ?? undefined,
|
|
31
|
+
settingsId: payload.cash_management_settings_id ?? undefined,
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
exports.toAutoSweepFlowStatePatch = toAutoSweepFlowStatePatch;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Amount } from '../../../../commonStateTypes/amount';
|
|
2
|
+
import { FetchState } from '../../../../commonStateTypes/common';
|
|
3
|
+
import { ZeniAPIStatus } from '../../../../responsePayload';
|
|
4
|
+
import { CashManagementSettingsPayload } from './autoSweepFlowPayload';
|
|
5
|
+
import { AutoSweepFlowState, AutoSweepFrequency } from './autoSweepFlowState';
|
|
6
|
+
export declare const initialState: AutoSweepFlowState;
|
|
7
|
+
export declare const fetchCashManagementSettings: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"autoSweepFlow/fetchCashManagementSettings">, updateCashManagementSettings: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
8
|
+
data: CashManagementSettingsPayload;
|
|
9
|
+
}, "autoSweepFlow/updateCashManagementSettings">, updateCashManagementSettingsFetchStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
10
|
+
fetchState: FetchState;
|
|
11
|
+
error?: ZeniAPIStatus;
|
|
12
|
+
}, "autoSweepFlow/updateCashManagementSettingsFetchStatus">, updateAutoSweepRisk: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
13
|
+
bufferAmount: Amount;
|
|
14
|
+
}, "autoSweepFlow/updateAutoSweepRisk">, updateAutoSweepDraft: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
15
|
+
bufferAmount: Amount;
|
|
16
|
+
frequency: AutoSweepFrequency;
|
|
17
|
+
memo: string;
|
|
18
|
+
}, "autoSweepFlow/updateAutoSweepDraft">, saveAutoSweepSettings: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"autoSweepFlow/saveAutoSweepSettings">, updateAutoSweepSettingsFetchStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
19
|
+
fetchState: FetchState;
|
|
20
|
+
error?: ZeniAPIStatus;
|
|
21
|
+
}, "autoSweepFlow/updateAutoSweepSettingsFetchStatus">, clearAutoSweepFlow: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"autoSweepFlow/clearAutoSweepFlow">;
|
|
22
|
+
declare const _default: import("redux").Reducer<AutoSweepFlowState>;
|
|
23
|
+
export default _default;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.clearAutoSweepFlow = exports.updateAutoSweepSettingsFetchStatus = exports.saveAutoSweepSettings = exports.updateAutoSweepDraft = exports.updateAutoSweepRisk = exports.updateCashManagementSettingsFetchStatus = exports.updateCashManagementSettings = exports.fetchCashManagementSettings = exports.initialState = void 0;
|
|
5
|
+
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
+
const autoSweepFlowPayload_1 = require("./autoSweepFlowPayload");
|
|
7
|
+
const autoSweepFlowState_1 = require("./autoSweepFlowState");
|
|
8
|
+
exports.initialState = autoSweepFlowState_1.initialAutoSweepFlowState;
|
|
9
|
+
const autoSweepFlow = (0, toolkit_1.createSlice)({
|
|
10
|
+
name: 'autoSweepFlow',
|
|
11
|
+
initialState: exports.initialState,
|
|
12
|
+
reducers: {
|
|
13
|
+
/**
|
|
14
|
+
* Kicks off `GET /cash-management/settings`. Flips the top-level
|
|
15
|
+
* fetchState to `In-Progress`; the fetch epic picks this up.
|
|
16
|
+
*/
|
|
17
|
+
fetchCashManagementSettings(draft) {
|
|
18
|
+
draft.fetchState = 'In-Progress';
|
|
19
|
+
draft.error = undefined;
|
|
20
|
+
},
|
|
21
|
+
/**
|
|
22
|
+
* Hydrates the form fields with the server-side settings (and stashes
|
|
23
|
+
* the settings id for subsequent saves). Marks the GET as `Completed`.
|
|
24
|
+
*/
|
|
25
|
+
updateCashManagementSettings(draft, action) {
|
|
26
|
+
const patch = (0, autoSweepFlowPayload_1.toAutoSweepFlowStatePatch)(action.payload.data);
|
|
27
|
+
draft.bufferAmount = patch.bufferAmount;
|
|
28
|
+
draft.frequency = patch.frequency;
|
|
29
|
+
draft.nextTransferDate = patch.nextTransferDate;
|
|
30
|
+
draft.primaryFundingAccountId = patch.primaryFundingAccountId;
|
|
31
|
+
draft.settingsId = patch.settingsId;
|
|
32
|
+
draft.fetchState = 'Completed';
|
|
33
|
+
draft.error = undefined;
|
|
34
|
+
},
|
|
35
|
+
updateCashManagementSettingsFetchStatus(draft, action) {
|
|
36
|
+
draft.fetchState = action.payload.fetchState;
|
|
37
|
+
draft.error = action.payload.error;
|
|
38
|
+
},
|
|
39
|
+
/**
|
|
40
|
+
* Live-update the buffer (risk band) as the user toggles the risk picker
|
|
41
|
+
* on the setup page, without staging frequency/memo. The selector derives
|
|
42
|
+
* the risk-adjusted sweep amount off `bufferAmount`, so dispatching this on
|
|
43
|
+
* every risk change keeps the setup and review screens in sync.
|
|
44
|
+
*/
|
|
45
|
+
updateAutoSweepRisk(draft, action) {
|
|
46
|
+
draft.bufferAmount = action.payload.bufferAmount;
|
|
47
|
+
},
|
|
48
|
+
/**
|
|
49
|
+
* Stage the in-flight form values without submitting them — fired from
|
|
50
|
+
* the setup→review transition so other selectors (and devtools) can see
|
|
51
|
+
* what the user is about to confirm. Leaves `saveStatus` untouched; the
|
|
52
|
+
* actual PUT only kicks off when the user clicks "Confirm Sweep" via
|
|
53
|
+
* `saveAutoSweepSettings`.
|
|
54
|
+
*/
|
|
55
|
+
updateAutoSweepDraft(draft, action) {
|
|
56
|
+
draft.bufferAmount = action.payload.bufferAmount;
|
|
57
|
+
draft.frequency = action.payload.frequency;
|
|
58
|
+
draft.memo = action.payload.memo;
|
|
59
|
+
},
|
|
60
|
+
/**
|
|
61
|
+
* Trigger the PUT for the auto-sweep settings already staged via
|
|
62
|
+
* `updateAutoSweepDraft`. Carries no payload — flips `saveStatus` to
|
|
63
|
+
* `In-Progress` and the save epic reads `bufferAmount` / `frequency` /
|
|
64
|
+
* `memo` straight from the slice. Callers must ensure those fields
|
|
65
|
+
* reflect the user's latest input before dispatching.
|
|
66
|
+
*/
|
|
67
|
+
saveAutoSweepSettings(draft) {
|
|
68
|
+
draft.saveStatus = { fetchState: 'In-Progress', error: undefined };
|
|
69
|
+
},
|
|
70
|
+
updateAutoSweepSettingsFetchStatus(draft, action) {
|
|
71
|
+
draft.saveStatus = {
|
|
72
|
+
fetchState: action.payload.fetchState,
|
|
73
|
+
error: action.payload.error,
|
|
74
|
+
};
|
|
75
|
+
},
|
|
76
|
+
clearAutoSweepFlow() {
|
|
77
|
+
return autoSweepFlowState_1.initialAutoSweepFlowState;
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
_a = autoSweepFlow.actions, exports.fetchCashManagementSettings = _a.fetchCashManagementSettings, exports.updateCashManagementSettings = _a.updateCashManagementSettings, exports.updateCashManagementSettingsFetchStatus = _a.updateCashManagementSettingsFetchStatus, exports.updateAutoSweepRisk = _a.updateAutoSweepRisk, exports.updateAutoSweepDraft = _a.updateAutoSweepDraft, exports.saveAutoSweepSettings = _a.saveAutoSweepSettings, exports.updateAutoSweepSettingsFetchStatus = _a.updateAutoSweepSettingsFetchStatus, exports.clearAutoSweepFlow = _a.clearAutoSweepFlow;
|
|
82
|
+
exports.default = autoSweepFlow.reducer;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Amount } from '../../../../commonStateTypes/amount';
|
|
2
|
+
import { FetchStateAndError, ID } from '../../../../commonStateTypes/common';
|
|
3
|
+
import { SelectorView } from '../../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
4
|
+
import { RootState } from '../../../../reducer';
|
|
5
|
+
import { FundingAccount } from '../../commonSetup/setupViewSelector';
|
|
6
|
+
import { TreasurySummaryWithBalance } from '../../treasury/treasuryList/treasuryDetailState';
|
|
7
|
+
import { AutoSweepFrequency, RiskLevel } from './autoSweepFlowState';
|
|
8
|
+
/**
|
|
9
|
+
* The editable form state behind `<AutoSweepSetupPage>`. Kept as a nested
|
|
10
|
+
* object on the selector view so the screen can pass it through as a single
|
|
11
|
+
* unit and the rest of the view (server-derived data + statuses) stays
|
|
12
|
+
* separate from "what the user is currently editing".
|
|
13
|
+
*/
|
|
14
|
+
export interface AutoSweepFlowFormData {
|
|
15
|
+
bufferAmount: Amount;
|
|
16
|
+
frequency: AutoSweepFrequency;
|
|
17
|
+
memo: string;
|
|
18
|
+
/** Derived from `bufferAmount` — the matching preset risk level, falling
|
|
19
|
+
* back to `'moderate'` for custom server-side values. */
|
|
20
|
+
risk: RiskLevel;
|
|
21
|
+
}
|
|
22
|
+
export interface AutoSweepFlowSelectorView extends SelectorView {
|
|
23
|
+
formData: AutoSweepFlowFormData;
|
|
24
|
+
saveStatus: FetchStateAndError;
|
|
25
|
+
/**
|
|
26
|
+
* Recommended sweep amount. Sourced from the cash management banner
|
|
27
|
+
* (the first money_movements[0].movements[0].amount returned by the
|
|
28
|
+
* agent's `/recommend` endpoint). Defaults to zero when the agent
|
|
29
|
+
* hasn't returned a movement yet.
|
|
30
|
+
*/
|
|
31
|
+
sweepAmount: Amount;
|
|
32
|
+
/** Resolved from `primaryFundingAccountId` against the deposit-account
|
|
33
|
+
* entity bucket. `undefined` until the GET fetch publishes the account. */
|
|
34
|
+
primaryFundingAccount?: FundingAccount;
|
|
35
|
+
settingsId?: ID;
|
|
36
|
+
/** Treasury account summary used by the setup / review flow to render the
|
|
37
|
+
* destination column. Mirrors `getTreasuryDetail().accountSummary`. */
|
|
38
|
+
treasurySummary?: TreasurySummaryWithBalance;
|
|
39
|
+
}
|
|
40
|
+
export declare const getAutoSweepFlow: (state: RootState) => AutoSweepFlowSelectorView;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAutoSweepFlow = void 0;
|
|
4
|
+
const depositAccountSelector_1 = require("../../../../entity/depositAccount/depositAccountSelector");
|
|
5
|
+
const setupViewSelector_1 = require("../../commonSetup/setupViewSelector");
|
|
6
|
+
const treasuryDetailSelector_1 = require("../../treasury/treasuryList/treasuryDetailSelector");
|
|
7
|
+
const cashManagementOverviewSelector_1 = require("../cashManagementOverview/cashManagementOverviewSelector");
|
|
8
|
+
const autoSweepFlowState_1 = require("./autoSweepFlowState");
|
|
9
|
+
/**
|
|
10
|
+
* Risk band the agent's recommended sweep amount is computed against. The
|
|
11
|
+
* `sweepAmount` returned by the banner assumes this buffer, so the selector
|
|
12
|
+
* adjusts the displayed sweep by the delta between the user's selected band
|
|
13
|
+
* and this default.
|
|
14
|
+
*/
|
|
15
|
+
const DEFAULT_RISK_LEVEL = 'moderate';
|
|
16
|
+
const getAutoSweepFlow = (state) => {
|
|
17
|
+
const { bufferAmount, frequency, memo, saveStatus, settingsId, primaryFundingAccountId, fetchState, error, } = state.autoSweepFlowState;
|
|
18
|
+
const depositAccount = primaryFundingAccountId != null
|
|
19
|
+
? (0, depositAccountSelector_1.getDepositAccountByDepositAccountId)(state.depositAccountState, primaryFundingAccountId)
|
|
20
|
+
: undefined;
|
|
21
|
+
const risk = (0, autoSweepFlowState_1.bufferAmountToRisk)(bufferAmount.amount);
|
|
22
|
+
// The banner's recommended sweep assumes the default buffer band; shift it
|
|
23
|
+
// by the delta between the user's selected band and that default so a
|
|
24
|
+
// tighter buffer sweeps more and a looser buffer sweeps less.
|
|
25
|
+
const baseSweepAmount = (0, cashManagementOverviewSelector_1.getCashManagementOverviewBanner)(state).amount;
|
|
26
|
+
const sweepAmount = {
|
|
27
|
+
...baseSweepAmount,
|
|
28
|
+
amount: baseSweepAmount.amount +
|
|
29
|
+
autoSweepFlowState_1.RISK_BUFFER_AMOUNT[risk] -
|
|
30
|
+
autoSweepFlowState_1.RISK_BUFFER_AMOUNT[DEFAULT_RISK_LEVEL],
|
|
31
|
+
};
|
|
32
|
+
return {
|
|
33
|
+
fetchState,
|
|
34
|
+
error,
|
|
35
|
+
formData: {
|
|
36
|
+
bufferAmount,
|
|
37
|
+
frequency,
|
|
38
|
+
memo,
|
|
39
|
+
risk,
|
|
40
|
+
},
|
|
41
|
+
primaryFundingAccount: depositAccount != null
|
|
42
|
+
? (0, setupViewSelector_1.mapDepositAccToFundingAccount)(depositAccount)
|
|
43
|
+
: undefined,
|
|
44
|
+
saveStatus,
|
|
45
|
+
settingsId,
|
|
46
|
+
sweepAmount,
|
|
47
|
+
treasurySummary: (0, treasuryDetailSelector_1.getTreasuryDetail)(state).accountSummary,
|
|
48
|
+
version: 0,
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
exports.getAutoSweepFlow = getAutoSweepFlow;
|