@zeniai/client-epic-state 5.1.12 → 5.1.13
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/workingDayHelper.d.ts +9 -0
- package/lib/commonStateTypes/workingDayHelper.js +28 -1
- package/lib/entity/aiCfo/aiCfoPayload.d.ts +63 -5
- package/lib/entity/aiCfo/aiCfoReducer.d.ts +23 -2
- package/lib/entity/aiCfo/aiCfoReducer.js +249 -9
- package/lib/entity/aiCfo/aiCfoSelector.d.ts +4 -1
- package/lib/entity/aiCfo/aiCfoSelector.js +19 -1
- package/lib/entity/aiCfo/aiCfoState.d.ts +97 -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 +149 -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/company/cardsVisibilityHelpers.d.ts +4 -0
- package/lib/entity/company/cardsVisibilityHelpers.js +14 -0
- package/lib/entity/company/companyPayload.d.ts +4 -0
- package/lib/entity/company/companyPayload.js +6 -0
- package/lib/entity/company/companyStateTypes.d.ts +7 -0
- 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/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +5 -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 +8 -2
- package/lib/entity/tenant/clearAllEpic.js +12 -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 +59 -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 +1 -0
- package/lib/entity/tenant/tenantReducer.d.ts +38 -25
- package/lib/entity/tenant/tenantReducer.js +70 -10
- package/lib/entity/tenant/tenantState.d.ts +1 -0
- package/lib/entity/transaction/payloadTypes/transactionPayload.js +14 -2
- package/lib/epic.d.ts +31 -3
- package/lib/epic.js +32 -3
- package/lib/esm/commonStateTypes/amount.js +7 -0
- package/lib/esm/commonStateTypes/animations.js +1 -0
- package/lib/esm/commonStateTypes/workingDayHelper.js +26 -0
- package/lib/esm/entity/aiCfo/aiCfoReducer.js +249 -9
- 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 +149 -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/cardsVisibilityHelpers.js +9 -0
- package/lib/esm/entity/company/companyPayload.js +6 -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 +5 -0
- package/lib/esm/entity/task/taskPayload.js +2 -0
- package/lib/esm/entity/tenant/clearAllEpic.js +12 -0
- package/lib/esm/entity/tenant/epic/initEmailConnectOAuthEpic.js +55 -0
- package/lib/esm/entity/tenant/tenantReducer.js +68 -8
- package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +14 -2
- package/lib/esm/epic.js +32 -3
- package/lib/esm/index.js +68 -26
- package/lib/esm/reducer.js +18 -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/epic/companyPassport/updateCapitalizationAccountThresholdEpic.js +3 -3
- package/lib/esm/view/companyView/epic/fetchAllCockpitViewsEpic.js +2 -2
- package/lib/esm/view/dashboard/dashboardSelector.js +8 -43
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +1 -1
- package/lib/esm/view/fileView/epic/deleteFileEpic.js +2 -2
- package/lib/esm/view/fileView/epic/deleteFileListEpic.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/epic/customerDetails/updateOnboardingCustomerViewEpic.js +24 -18
- package/lib/esm/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewLocalStoreDataEpic.js +29 -17
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewReducer.js +223 -51
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewSelector.js +36 -18
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewState.js +45 -6
- package/lib/esm/view/people/initializeEditPersonEpic.js +5 -1
- package/lib/esm/view/people/invitePeopleEpic.js +6 -3
- package/lib/esm/view/people/peopleSaveUpdatesEpic.js +7 -3
- package/lib/esm/view/settingsView/settingsViewHelpers.js +5 -2
- 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 +144 -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 +49 -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 +212 -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 +221 -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/transactionDetail/epics/saveTransactionHelper.js +1 -0
- package/lib/esm/view/transactionDetail/epics/updateTransactionDetailEpic.js +6 -0
- package/lib/esm/view/transactionDetail/transactionDetailLocalDataHelper.js +7 -1
- package/lib/index.d.ts +83 -32
- package/lib/index.js +264 -29
- package/lib/reducer.d.ts +18 -0
- package/lib/reducer.js +18 -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/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/epic/companyPassport/updateCapitalizationAccountThresholdEpic.d.ts +1 -1
- package/lib/view/companyView/epic/companyPassport/updateCapitalizationAccountThresholdEpic.js +2 -2
- package/lib/view/companyView/epic/fetchAllCockpitViewsEpic.js +2 -2
- package/lib/view/companyView/types/cockpitTypes.d.ts +3 -2
- package/lib/view/dashboard/dashboardSelector.js +8 -43
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +1 -1
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.d.ts +1 -1
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +1 -1
- package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +1 -1
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +1 -1
- package/lib/view/fileView/epic/deleteFileEpic.js +1 -1
- package/lib/view/fileView/epic/deleteFileListEpic.js +1 -1
- 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/epic/customerDetails/updateOnboardingCustomerViewEpic.js +24 -18
- package/lib/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewLocalStoreDataEpic.d.ts +2 -2
- package/lib/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewLocalStoreDataEpic.js +27 -15
- package/lib/view/onboardingView/customerView/onboardingCustomerViewPayload.d.ts +3 -0
- package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.d.ts +44 -5
- package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.js +225 -52
- package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.d.ts +6 -1
- package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.js +39 -18
- package/lib/view/onboardingView/customerView/onboardingCustomerViewState.d.ts +53 -8
- package/lib/view/onboardingView/customerView/onboardingCustomerViewState.js +47 -7
- package/lib/view/people/initializeEditPersonEpic.js +5 -1
- package/lib/view/people/invitePeopleEpic.js +6 -3
- package/lib/view/people/peopleSaveUpdatesEpic.js +7 -3
- package/lib/view/people/peopleTypes.d.ts +1 -1
- package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
- package/lib/view/settingsView/settingsViewHelpers.js +5 -2
- 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 +146 -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 +53 -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 +217 -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 +229 -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/taskManager/taskListView/taskList.d.ts +3 -3
- package/lib/view/taskManager/taskListView/taskListReducer.d.ts +1 -1
- package/lib/view/transactionDetail/epics/saveTransactionHelper.js +1 -0
- package/lib/view/transactionDetail/epics/updateTransactionDetailEpic.js +6 -0
- package/lib/view/transactionDetail/journalEntryLinesViewModel.d.ts +1 -1
- package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +7 -1
- package/lib/view/transactionDetail/transactionDetailState.d.ts +1 -0
- package/lib/view/transactionDetail/transactionDetailTypes.d.ts +1 -0
- package/lib/zeniAPI.d.ts +1 -0
- package/package.json +6 -4
|
@@ -9,9 +9,13 @@ export interface AiCfoAnswerParagraph {
|
|
|
9
9
|
}>;
|
|
10
10
|
}
|
|
11
11
|
export declare const ALL_AI_CFO_CHARTS_TYPES: readonly ["bar_chart", "pie_chart", "line_chart"];
|
|
12
|
-
export declare const ALL_AI_CFO_VISUALIZATION_TYPES: readonly ["bar_chart", "pie_chart", "line_chart", "table"];
|
|
13
|
-
export declare const
|
|
14
|
-
export declare const
|
|
12
|
+
export declare const ALL_AI_CFO_VISUALIZATION_TYPES: readonly ["bar_chart", "pie_chart", "line_chart", "table", "interactive_form"];
|
|
13
|
+
export declare const ALL_INTERACTIVE_FORM_TYPES: readonly ["cards_creation", "card_policy"];
|
|
14
|
+
export declare const toInteractiveFormType: (v: string) => "cards_creation" | "card_policy";
|
|
15
|
+
export declare const toInteractiveFormTypeStrict: (v: string) => "cards_creation" | "card_policy" | undefined;
|
|
16
|
+
export type InteractiveFormType = ReturnType<typeof toInteractiveFormType>;
|
|
17
|
+
export declare const toAiCfoVisualizationType: (v: string) => "bar_chart" | "pie_chart" | "line_chart" | "table" | "interactive_form";
|
|
18
|
+
export declare const toAiCfoVisualizationTypeStrict: (v: string) => "bar_chart" | "pie_chart" | "line_chart" | "table" | "interactive_form" | undefined;
|
|
15
19
|
export type AiCfoVisualizationType = ReturnType<typeof toAiCfoVisualizationType>;
|
|
16
20
|
export declare const toAiCfoChartType: (v: string) => "bar_chart" | "pie_chart" | "line_chart";
|
|
17
21
|
export declare const toAiCfoChartTypeStrict: (v: string) => "bar_chart" | "pie_chart" | "line_chart" | undefined;
|
|
@@ -53,8 +57,87 @@ export interface ChartVisualization {
|
|
|
53
57
|
lines?: string[];
|
|
54
58
|
yFormat?: YFormat;
|
|
55
59
|
}
|
|
60
|
+
export type CardsCardKind = 'vendor' | 'class' | 'category';
|
|
61
|
+
export interface CardNameOption {
|
|
62
|
+
id: string;
|
|
63
|
+
kind: CardsCardKind;
|
|
64
|
+
label: string;
|
|
65
|
+
}
|
|
66
|
+
export interface CardsCreationCommonData {
|
|
67
|
+
cardNameOptions: CardNameOption[];
|
|
68
|
+
suggestedOwnerUserIdByTeamId: Record<string, ID | undefined>;
|
|
69
|
+
}
|
|
70
|
+
export type CardsCreationInitialData = (CardsCreationCommonData & {
|
|
71
|
+
mode: 'review';
|
|
72
|
+
teamRows: Array<{
|
|
73
|
+
avgMonthlySpend: string;
|
|
74
|
+
cardKind: CardsCardKind;
|
|
75
|
+
id: string;
|
|
76
|
+
label: string;
|
|
77
|
+
recommendedLimit: string;
|
|
78
|
+
recommendedLimitCadence?: string;
|
|
79
|
+
}>;
|
|
80
|
+
}) | (CardsCreationCommonData & {
|
|
81
|
+
cardRows: Array<{
|
|
82
|
+
cardKind: CardsCardKind;
|
|
83
|
+
id: string;
|
|
84
|
+
label: string;
|
|
85
|
+
recommendedLimit?: number;
|
|
86
|
+
suggestedOwnerUserId?: ID;
|
|
87
|
+
}>;
|
|
88
|
+
mode: 'create';
|
|
89
|
+
});
|
|
90
|
+
export interface CardPolicyDraftPolicyEntity {
|
|
91
|
+
categoryCodes: string[];
|
|
92
|
+
merchantNames: string[];
|
|
93
|
+
}
|
|
94
|
+
export interface CardPolicySpendLimits {
|
|
95
|
+
transaction: number;
|
|
96
|
+
}
|
|
97
|
+
export interface CardPolicyDraftPolicy {
|
|
98
|
+
allowedEntity: CardPolicyDraftPolicyEntity;
|
|
99
|
+
applyToCards: string[];
|
|
100
|
+
blockedEntity: CardPolicyDraftPolicyEntity;
|
|
101
|
+
description: string;
|
|
102
|
+
id: string;
|
|
103
|
+
mode: string;
|
|
104
|
+
name: string;
|
|
105
|
+
requiredReceiptThreshold: number;
|
|
106
|
+
spendLimits: CardPolicySpendLimits;
|
|
107
|
+
}
|
|
108
|
+
export interface CardPolicyStep5Review {
|
|
109
|
+
draftPolicies: CardPolicyDraftPolicy[];
|
|
110
|
+
groupingSource: string;
|
|
111
|
+
prompt: string;
|
|
112
|
+
}
|
|
113
|
+
export interface CardPolicyWizardPlan {
|
|
114
|
+
step5Review: CardPolicyStep5Review;
|
|
115
|
+
}
|
|
116
|
+
export interface CardPolicyUploadSource {
|
|
117
|
+
confidenceScore: number;
|
|
118
|
+
fileName: string;
|
|
119
|
+
lowConfidenceFields: string[];
|
|
120
|
+
}
|
|
121
|
+
export type CardPolicyInitialData = {
|
|
122
|
+
policyKind: 'auto';
|
|
123
|
+
wizardPlan: CardPolicyWizardPlan;
|
|
124
|
+
} | {
|
|
125
|
+
policyKind: 'guided';
|
|
126
|
+
wizardPlan: CardPolicyWizardPlan;
|
|
127
|
+
} | {
|
|
128
|
+
policyKind: 'upload';
|
|
129
|
+
source?: CardPolicyUploadSource;
|
|
130
|
+
wizardPlan?: CardPolicyWizardPlan;
|
|
131
|
+
};
|
|
132
|
+
export type InteractiveFormVisualization = {
|
|
133
|
+
formType: 'cards_creation';
|
|
134
|
+
payload: CardsCreationInitialData;
|
|
135
|
+
} | {
|
|
136
|
+
formType: 'card_policy';
|
|
137
|
+
payload: CardPolicyInitialData;
|
|
138
|
+
};
|
|
56
139
|
export interface AiCfoVisualization {
|
|
57
|
-
data: TableVisualization | ChartVisualization;
|
|
140
|
+
data: TableVisualization | ChartVisualization | InteractiveFormVisualization;
|
|
58
141
|
type: AiCfoVisualizationType;
|
|
59
142
|
}
|
|
60
143
|
export declare const toMessageSender: (v: string) => "user" | "agent";
|
|
@@ -113,7 +196,17 @@ export interface ChatSessionWithMessages {
|
|
|
113
196
|
chatSession: ChatSession;
|
|
114
197
|
questionAnswers: AiCfoQuestionWithAnswer[];
|
|
115
198
|
}
|
|
199
|
+
export declare const ALL_SYNTHETIC_AI_CFO_ANSWER_KINDS: readonly ["creating_cards", "creating_policy", "created_cards", "created_policy", "errored_cards", "errored_policy"];
|
|
200
|
+
export type SyntheticAiCfoAnswerKind = (typeof ALL_SYNTHETIC_AI_CFO_ANSWER_KINDS)[number];
|
|
201
|
+
export interface SyntheticAiCfoAnswer {
|
|
202
|
+
createdAt: ZeniDate;
|
|
203
|
+
entityIds: ID[];
|
|
204
|
+
id: ID;
|
|
205
|
+
kind: SyntheticAiCfoAnswerKind;
|
|
206
|
+
sourceQuestionAnswerId: ID;
|
|
207
|
+
}
|
|
116
208
|
export interface AiCfoState {
|
|
117
209
|
aiCfoByChatSessionId: Record<ID, ChatSessionWithMessages>;
|
|
118
210
|
partialQuestionAnswers: Record<ID, AiCfoQuestionWithAnswer | undefined>;
|
|
211
|
+
syntheticAnswersByChatSessionId: Record<ID, SyntheticAiCfoAnswer[]>;
|
|
119
212
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toMessageTypeStrict = exports.toMessageSenderStrict = exports.toMessageType = exports.toMessageSender = exports.toAiCfoAnswerResponseTypeStrict = exports.toAiCfoAnswerStateTypeStrict = exports.toAiCfoAnswerResponseType = exports.toAiCfoAnswerStateType = exports.toYFormatScaleStrict = exports.toYFormatUnitStrict = exports.toYFormatTypeStrict = exports.toYFormatScale = exports.toYFormatUnit = exports.toYFormatType = exports.ALL_Y_FORMAT_SCALES = exports.ALL_Y_FORMAT_NON_CURRENCY_UNITS = exports.ALL_Y_FORMAT_TYPES = exports.ALL_AI_CFO_ANSWER_RESPONSE_TYPES = exports.ALL_AI_CFO_ANSWER_STATE_TYPES = exports.toAiCfoChartTypeStrict = exports.toAiCfoChartType = exports.toAiCfoVisualizationTypeStrict = exports.toAiCfoVisualizationType = exports.ALL_AI_CFO_VISUALIZATION_TYPES = exports.ALL_AI_CFO_CHARTS_TYPES = void 0;
|
|
3
|
+
exports.ALL_SYNTHETIC_AI_CFO_ANSWER_KINDS = exports.toMessageTypeStrict = exports.toMessageSenderStrict = exports.toMessageType = exports.toMessageSender = exports.toAiCfoAnswerResponseTypeStrict = exports.toAiCfoAnswerStateTypeStrict = exports.toAiCfoAnswerResponseType = exports.toAiCfoAnswerStateType = exports.toYFormatScaleStrict = exports.toYFormatUnitStrict = exports.toYFormatTypeStrict = exports.toYFormatScale = exports.toYFormatUnit = exports.toYFormatType = exports.ALL_Y_FORMAT_SCALES = exports.ALL_Y_FORMAT_NON_CURRENCY_UNITS = exports.ALL_Y_FORMAT_TYPES = exports.ALL_AI_CFO_ANSWER_RESPONSE_TYPES = exports.ALL_AI_CFO_ANSWER_STATE_TYPES = exports.toAiCfoChartTypeStrict = exports.toAiCfoChartType = exports.toAiCfoVisualizationTypeStrict = exports.toAiCfoVisualizationType = exports.toInteractiveFormTypeStrict = exports.toInteractiveFormType = exports.ALL_INTERACTIVE_FORM_TYPES = exports.ALL_AI_CFO_VISUALIZATION_TYPES = exports.ALL_AI_CFO_CHARTS_TYPES = void 0;
|
|
4
4
|
const stringToUnion_1 = require("../../commonStateTypes/stringToUnion");
|
|
5
5
|
exports.ALL_AI_CFO_CHARTS_TYPES = [
|
|
6
6
|
'bar_chart',
|
|
@@ -10,7 +10,16 @@ exports.ALL_AI_CFO_CHARTS_TYPES = [
|
|
|
10
10
|
exports.ALL_AI_CFO_VISUALIZATION_TYPES = [
|
|
11
11
|
...exports.ALL_AI_CFO_CHARTS_TYPES,
|
|
12
12
|
'table',
|
|
13
|
+
'interactive_form',
|
|
13
14
|
];
|
|
15
|
+
exports.ALL_INTERACTIVE_FORM_TYPES = [
|
|
16
|
+
'cards_creation',
|
|
17
|
+
'card_policy',
|
|
18
|
+
];
|
|
19
|
+
const toInteractiveFormType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.ALL_INTERACTIVE_FORM_TYPES);
|
|
20
|
+
exports.toInteractiveFormType = toInteractiveFormType;
|
|
21
|
+
const toInteractiveFormTypeStrict = (v) => (0, stringToUnion_1.stringToUnionStrict)(v, exports.ALL_INTERACTIVE_FORM_TYPES);
|
|
22
|
+
exports.toInteractiveFormTypeStrict = toInteractiveFormTypeStrict;
|
|
14
23
|
const toAiCfoVisualizationType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.ALL_AI_CFO_VISUALIZATION_TYPES);
|
|
15
24
|
exports.toAiCfoVisualizationType = toAiCfoVisualizationType;
|
|
16
25
|
const toAiCfoVisualizationTypeStrict = (v) => (0, stringToUnion_1.stringToUnionStrict)(v, exports.ALL_AI_CFO_VISUALIZATION_TYPES);
|
|
@@ -79,3 +88,13 @@ const toMessageSenderStrict = (v) => (0, stringToUnion_1.stringToUnionStrict)(v,
|
|
|
79
88
|
exports.toMessageSenderStrict = toMessageSenderStrict;
|
|
80
89
|
const toMessageTypeStrict = (v) => (0, stringToUnion_1.stringToUnionStrict)(v, ALL_MESSAGE_TYPES);
|
|
81
90
|
exports.toMessageTypeStrict = toMessageTypeStrict;
|
|
91
|
+
// Client-synthesized AI CFO answer bubbles (Creating…/Created) pushed when the user
|
|
92
|
+
// submits an interactive form; not streamed from the backend.
|
|
93
|
+
exports.ALL_SYNTHETIC_AI_CFO_ANSWER_KINDS = [
|
|
94
|
+
'creating_cards',
|
|
95
|
+
'creating_policy',
|
|
96
|
+
'created_cards',
|
|
97
|
+
'created_policy',
|
|
98
|
+
'errored_cards',
|
|
99
|
+
'errored_policy',
|
|
100
|
+
];
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ID } from '../../commonStateTypes/common';
|
|
2
|
+
import { ApprovalRule, Criteria } from './approvalRuleState';
|
|
3
|
+
/**
|
|
4
|
+
* Approval Rules 3.0 — frontend overlap detection.
|
|
5
|
+
*
|
|
6
|
+
* Per product spec, two rules overlap iff:
|
|
7
|
+
* 1. Their vendor criteria are exactly equal (same operator and
|
|
8
|
+
* the same set of vendor IDs, or both absent), AND
|
|
9
|
+
* 2. Their department criteria are exactly equal (same shape), AND
|
|
10
|
+
* 3. Their amount intervals intersect.
|
|
11
|
+
*
|
|
12
|
+
* The intuition: we only flag overlap when the non-amount criteria
|
|
13
|
+
* are identical, because the typical mistake is "I tried to create a
|
|
14
|
+
* second rule for the same vendor / department slice at a different
|
|
15
|
+
* amount threshold and forgot the existing one". Subset / superset
|
|
16
|
+
* overlaps (e.g. one rule has a department condition and the other
|
|
17
|
+
* does not) are intentionally not flagged in this iteration.
|
|
18
|
+
*
|
|
19
|
+
* Amount intervals are:
|
|
20
|
+
* - greater_than(N) → [N, +∞)
|
|
21
|
+
* - less_than(N) → (-∞, N]
|
|
22
|
+
* - range(min, max) → [min, max]
|
|
23
|
+
* - amount absent → (-∞, +∞)
|
|
24
|
+
*
|
|
25
|
+
* Two intervals overlap iff max(lo) <= min(hi).
|
|
26
|
+
*
|
|
27
|
+
* Exclusions from the comparison pool:
|
|
28
|
+
* - The rule being edited (caller passes `excludeRuleId`).
|
|
29
|
+
* - Fallback rules — they are a separate concept (match-all-others)
|
|
30
|
+
* and not subject to the per-criteria overlap check.
|
|
31
|
+
*
|
|
32
|
+
* Callers should filter `existingRules` to the relevant entityType
|
|
33
|
+
* (BillPay vs Reimbursement) before passing — the function does not
|
|
34
|
+
* cross-check entityType.
|
|
35
|
+
*
|
|
36
|
+
* Pure function: no side effects, deterministic. Returns the list of
|
|
37
|
+
* overlapping rules. Empty list means no overlap.
|
|
38
|
+
*/
|
|
39
|
+
/**
|
|
40
|
+
* Structural shape of a rule the algorithm needs. The detector only
|
|
41
|
+
* reads `criteria`, `isFallback`, and `approvalRuleId`; it never
|
|
42
|
+
* touches `steps`, so callers may pass any 'ApprovalRule' subtype
|
|
43
|
+
* (e.g. `ApprovalRuleWithUser`) and we keep the richer type in the
|
|
44
|
+
* output.
|
|
45
|
+
*/
|
|
46
|
+
export type RuleForOverlapCheck = Pick<ApprovalRule, 'approvalRuleId' | 'criteria' | 'isFallback'>;
|
|
47
|
+
export interface RuleOverlap<TRule extends RuleForOverlapCheck = ApprovalRule> {
|
|
48
|
+
conflictingRule: TRule;
|
|
49
|
+
}
|
|
50
|
+
export interface DetectRuleOverlapInput<TRule extends RuleForOverlapCheck = ApprovalRule> {
|
|
51
|
+
candidateCriteria: Criteria[];
|
|
52
|
+
existingRules: TRule[];
|
|
53
|
+
/** When editing an existing rule, exclude it from the comparison. */
|
|
54
|
+
excludeRuleId?: ID;
|
|
55
|
+
}
|
|
56
|
+
export declare function detectRuleOverlap<TRule extends RuleForOverlapCheck>({ candidateCriteria, existingRules, excludeRuleId, }: DetectRuleOverlapInput<TRule>): RuleOverlap<TRule>[];
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.detectRuleOverlap = detectRuleOverlap;
|
|
4
|
+
function detectRuleOverlap({ candidateCriteria, existingRules, excludeRuleId, }) {
|
|
5
|
+
const candidateAmount = pickAmount(candidateCriteria);
|
|
6
|
+
const candidateVendor = pickVendor(candidateCriteria);
|
|
7
|
+
const candidateDepartment = pickDepartment(candidateCriteria);
|
|
8
|
+
const overlaps = [];
|
|
9
|
+
for (const rule of existingRules) {
|
|
10
|
+
if (rule.approvalRuleId === excludeRuleId) {
|
|
11
|
+
continue;
|
|
12
|
+
}
|
|
13
|
+
if (rule.isFallback === true) {
|
|
14
|
+
continue;
|
|
15
|
+
}
|
|
16
|
+
const ruleVendor = pickVendor(rule.criteria);
|
|
17
|
+
const ruleDepartment = pickDepartment(rule.criteria);
|
|
18
|
+
if (!areVendorCriteriaEqual(candidateVendor, ruleVendor)) {
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
if (!areDepartmentCriteriaEqual(candidateDepartment, ruleDepartment)) {
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
const ruleAmount = pickAmount(rule.criteria);
|
|
25
|
+
if (amountsOverlap(candidateAmount, ruleAmount)) {
|
|
26
|
+
overlaps.push({ conflictingRule: rule });
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return overlaps;
|
|
30
|
+
}
|
|
31
|
+
const pickAmount = (criteria) => criteria.find((c) => c.type === 'amount');
|
|
32
|
+
const pickVendor = (criteria) => criteria.find((c) => c.type === 'vendor');
|
|
33
|
+
const pickDepartment = (criteria) => criteria.find((c) => c.type === 'department');
|
|
34
|
+
const areVendorCriteriaEqual = (a, b) => {
|
|
35
|
+
if (a == null && b == null) {
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
if (a == null || b == null) {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
if (a.operator !== b.operator) {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
return idsEqual(a.vendorIds, b.vendorIds);
|
|
45
|
+
};
|
|
46
|
+
const areDepartmentCriteriaEqual = (a, b) => {
|
|
47
|
+
if (a == null && b == null) {
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
if (a == null || b == null) {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
if (a.operator !== b.operator) {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
return idsEqual(a.departmentIds, b.departmentIds);
|
|
57
|
+
};
|
|
58
|
+
const idsEqual = (a, b) => {
|
|
59
|
+
if (a.length !== b.length) {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
const aSorted = [...a].sort();
|
|
63
|
+
const bSorted = [...b].sort();
|
|
64
|
+
return aSorted.every((id, i) => id === bSorted[i]);
|
|
65
|
+
};
|
|
66
|
+
const amountsOverlap = (a, b) => {
|
|
67
|
+
// Absent amount criteria covers the whole real line, so any
|
|
68
|
+
// pairing involving an absent one is a guaranteed overlap.
|
|
69
|
+
if (a == null || b == null) {
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
const aLow = a.min?.amount ?? Number.NEGATIVE_INFINITY;
|
|
73
|
+
const aHigh = a.max?.amount ?? Number.POSITIVE_INFINITY;
|
|
74
|
+
const bLow = b.min?.amount ?? Number.NEGATIVE_INFINITY;
|
|
75
|
+
const bHigh = b.max?.amount ?? Number.POSITIVE_INFINITY;
|
|
76
|
+
return Math.max(aLow, bLow) <= Math.min(aHigh, bHigh);
|
|
77
|
+
};
|
|
@@ -1,11 +1,27 @@
|
|
|
1
1
|
import { ApprovalRule } from './approvalRuleState';
|
|
2
|
+
/**
|
|
3
|
+
* Condition Payload — one entry inside criteria.conditions[].
|
|
4
|
+
*
|
|
5
|
+
* field examples: 'amount' | 'vendor_id' | 'accounting_class_id'
|
|
6
|
+
* type examples: 'gte' | 'lte' | 'eq' | 'in' | 'not_in'
|
|
7
|
+
* value: number for amount comparisons; string[] for in / not_in lookups.
|
|
8
|
+
*/
|
|
9
|
+
export interface ConditionPayload {
|
|
10
|
+
field: string;
|
|
11
|
+
type: string;
|
|
12
|
+
value: number | string[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Criteria Payload — list of conditions joined by `criteria_operator`.
|
|
16
|
+
*
|
|
17
|
+
* `currency_code` / `currency_symbol` apply to amount conditions inside
|
|
18
|
+
* `conditions[]`. Kept here pending confirmation that they should remain.
|
|
19
|
+
*/
|
|
2
20
|
export interface CriteriaPayload {
|
|
21
|
+
conditions: ConditionPayload[];
|
|
22
|
+
criteria_operator: string;
|
|
3
23
|
currency_code: string;
|
|
4
24
|
currency_symbol: string;
|
|
5
|
-
min: number;
|
|
6
|
-
range_entity: string;
|
|
7
|
-
type: string;
|
|
8
|
-
max?: number | null;
|
|
9
25
|
}
|
|
10
26
|
export interface ActorPayload {
|
|
11
27
|
type: string;
|
|
@@ -25,11 +41,24 @@ export interface StepPayload {
|
|
|
25
41
|
export interface ApprovalRulePayload {
|
|
26
42
|
approval_rule_id: string;
|
|
27
43
|
create_time: string;
|
|
28
|
-
criteria: CriteriaPayload
|
|
44
|
+
criteria: CriteriaPayload;
|
|
29
45
|
entity_type: string;
|
|
30
46
|
name: string | null;
|
|
31
47
|
steps: StepPayload[];
|
|
32
48
|
update_time: string;
|
|
49
|
+
are_approvals_serialized?: boolean;
|
|
50
|
+
description?: string | null;
|
|
51
|
+
is_fallback?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Approval Rules 3.0 — when `true`, the rule enforces separation of
|
|
54
|
+
* duties (a user can't approve their own request even if they are
|
|
55
|
+
* also an approver). The list-page rule card surfaces this as a
|
|
56
|
+
* green "Separation of duties" capsule.
|
|
57
|
+
*/
|
|
58
|
+
is_separation_of_duty_enabled?: boolean;
|
|
59
|
+
pending_approvals_count?: number;
|
|
60
|
+
pending_entity_approval_update_status?: string;
|
|
61
|
+
priority?: number;
|
|
33
62
|
version?: number | string;
|
|
34
63
|
}
|
|
35
64
|
/**
|
|
@@ -17,19 +17,158 @@ const toApprovalRule = (payload) => ({
|
|
|
17
17
|
version: payload.version,
|
|
18
18
|
criteria: toApprovalCriteria(payload.criteria),
|
|
19
19
|
steps: toApprovalSteps(payload.steps),
|
|
20
|
+
description: payload.description ?? undefined,
|
|
21
|
+
priority: payload.priority,
|
|
22
|
+
isFallback: payload.is_fallback ?? false,
|
|
23
|
+
separationOfDuties: payload.is_separation_of_duty_enabled ?? false,
|
|
24
|
+
areApprovalsSerialized: payload.are_approvals_serialized,
|
|
25
|
+
pendingApprovalsCount: payload.pending_approvals_count,
|
|
26
|
+
pendingEntityApprovalUpdateStatus: payload.pending_entity_approval_update_status,
|
|
20
27
|
});
|
|
21
28
|
exports.toApprovalRule = toApprovalRule;
|
|
29
|
+
/**
|
|
30
|
+
* Maps the wire-level criteria block into the state-side discriminated
|
|
31
|
+
* `Criteria[]` union.
|
|
32
|
+
*
|
|
33
|
+
* The wire keeps each condition as a flat row inside `conditions[]`.
|
|
34
|
+
* Amount comparisons can show up as a `gte` only, a `lte` only, or a
|
|
35
|
+
* `gte` + `lte` pair — those collapse into a single AmountCriteria whose
|
|
36
|
+
* `comparator` is `greater_than`, `less_than`, or `range` respectively.
|
|
37
|
+
*
|
|
38
|
+
* Vendor and department conditions map one-to-one: `in` becomes `is`,
|
|
39
|
+
* `not_in` becomes `is_not`.
|
|
40
|
+
*
|
|
41
|
+
* Resilient to two forms of upstream drift:
|
|
42
|
+
* - Missing / null criteria → returns [].
|
|
43
|
+
* - Legacy criteria shape (array of amount-range objects, the pre-3.0
|
|
44
|
+
* wire) → converted to an AmountCriteria so existing rules in production
|
|
45
|
+
* still render while the backend rolls out.
|
|
46
|
+
*/
|
|
22
47
|
const toApprovalCriteria = (payload) => {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
48
|
+
if (payload == null) {
|
|
49
|
+
return [];
|
|
50
|
+
}
|
|
51
|
+
if (Array.isArray(payload)) {
|
|
52
|
+
// Legacy pre-3.0 wire: an array of amount-range entries.
|
|
53
|
+
return legacyAmountRangeToCriteria(payload);
|
|
54
|
+
}
|
|
55
|
+
if (!Array.isArray(payload.conditions)) {
|
|
56
|
+
return [];
|
|
57
|
+
}
|
|
58
|
+
const results = [];
|
|
59
|
+
const amountCriteria = toAmountCriteria(payload);
|
|
60
|
+
if (amountCriteria != null) {
|
|
61
|
+
results.push(amountCriteria);
|
|
62
|
+
}
|
|
63
|
+
payload.conditions
|
|
64
|
+
.filter((condition) => condition.field === 'vendor_id')
|
|
65
|
+
.forEach((condition) => {
|
|
66
|
+
const vendor = toVendorCriteria(condition);
|
|
67
|
+
if (vendor != null) {
|
|
68
|
+
results.push(vendor);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
payload.conditions
|
|
72
|
+
// Backend wire name is 'accounting_class_id' — kept in sync with
|
|
73
|
+
// the write-side mapper in 'commonPayload.ts'. State-side and
|
|
74
|
+
// form-side keep 'department' / 'departmentIds' to match product
|
|
75
|
+
// copy.
|
|
76
|
+
.filter((condition) => condition.field === 'accounting_class_id')
|
|
77
|
+
.forEach((condition) => {
|
|
78
|
+
const department = toDepartmentCriteria(condition);
|
|
79
|
+
if (department != null) {
|
|
80
|
+
results.push(department);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
return results;
|
|
84
|
+
};
|
|
85
|
+
const legacyAmountRangeToCriteria = (legacy) => {
|
|
86
|
+
if (legacy.length === 0) {
|
|
87
|
+
return [];
|
|
88
|
+
}
|
|
89
|
+
// The state-side 'Criteria[]' model allows at most one
|
|
90
|
+
// 'AmountCriteria' per rule (see 'approvalRuleState.ts'). The legacy
|
|
91
|
+
// wire was an array, so a multi-entry payload can't be represented
|
|
92
|
+
// here without losing data. Read the first entry and log a warning
|
|
93
|
+
// if production rules ever ship more — that would signal a backend
|
|
94
|
+
// regression we want to catch early rather than silently truncating.
|
|
95
|
+
if (legacy.length > 1) {
|
|
96
|
+
console.warn('[approvalRulePayload] legacyAmountRangeToCriteria: received ' +
|
|
97
|
+
legacy.length +
|
|
98
|
+
' entries but the state model only supports one; using the ' +
|
|
99
|
+
'first entry and dropping the rest.');
|
|
100
|
+
}
|
|
101
|
+
const first = legacy[0] ?? {};
|
|
102
|
+
const currency = first.currency_code ?? 'USD';
|
|
103
|
+
const symbol = first.currency_symbol ?? '$';
|
|
104
|
+
const min = typeof first.min === 'number'
|
|
105
|
+
? (0, amount_1.toAmount)(first.min, currency, symbol)
|
|
106
|
+
: undefined;
|
|
107
|
+
const max = typeof first.max === 'number'
|
|
108
|
+
? (0, amount_1.toAmount)(first.max, currency, symbol)
|
|
109
|
+
: undefined;
|
|
110
|
+
if (min == null && max == null) {
|
|
111
|
+
return [];
|
|
112
|
+
}
|
|
113
|
+
const comparator = min != null && max != null
|
|
114
|
+
? 'range'
|
|
115
|
+
: min != null
|
|
116
|
+
? 'greater_than'
|
|
117
|
+
: 'less_than';
|
|
118
|
+
return [{ type: 'amount', comparator, min, max }];
|
|
119
|
+
};
|
|
120
|
+
const toAmountCriteria = (payload) => {
|
|
121
|
+
if (!Array.isArray(payload.conditions)) {
|
|
122
|
+
return undefined;
|
|
123
|
+
}
|
|
124
|
+
const amountConditions = payload.conditions.filter((condition) => condition.field === 'amount');
|
|
125
|
+
// Approval Rules 3.0 — an 'eq' condition represents min === max. Fold
|
|
126
|
+
// it into both finders so it decodes as comparator: 'range' (closed
|
|
127
|
+
// single-point) rather than 'greater_than' (open upper).
|
|
128
|
+
const gteCondition = amountConditions.find((condition) => condition.type === 'gte' || condition.type === 'eq');
|
|
129
|
+
const lteCondition = amountConditions.find((condition) => condition.type === 'lte' || condition.type === 'eq');
|
|
130
|
+
if (gteCondition == null && lteCondition == null) {
|
|
131
|
+
return undefined;
|
|
132
|
+
}
|
|
133
|
+
const currencyCode = payload.currency_code ?? 'USD';
|
|
134
|
+
const currencySymbol = payload.currency_symbol ?? '$';
|
|
135
|
+
const min = typeof gteCondition?.value === 'number'
|
|
136
|
+
? (0, amount_1.toAmount)(gteCondition.value, currencyCode, currencySymbol)
|
|
137
|
+
: undefined;
|
|
138
|
+
const max = typeof lteCondition?.value === 'number'
|
|
139
|
+
? (0, amount_1.toAmount)(lteCondition.value, currencyCode, currencySymbol)
|
|
140
|
+
: undefined;
|
|
141
|
+
let comparator;
|
|
142
|
+
if (min != null && max != null) {
|
|
143
|
+
comparator = 'range';
|
|
144
|
+
}
|
|
145
|
+
else if (min != null) {
|
|
146
|
+
comparator = 'greater_than';
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
comparator = 'less_than';
|
|
150
|
+
}
|
|
151
|
+
return { type: 'amount', comparator, min, max };
|
|
152
|
+
};
|
|
153
|
+
const toVendorCriteria = (condition) => {
|
|
154
|
+
if (!Array.isArray(condition.value)) {
|
|
155
|
+
return undefined;
|
|
156
|
+
}
|
|
157
|
+
return {
|
|
158
|
+
type: 'vendor',
|
|
159
|
+
operator: condition.type === 'not_in' ? 'is_not' : 'is',
|
|
160
|
+
vendorIds: condition.value,
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
const toDepartmentCriteria = (condition) => {
|
|
164
|
+
if (!Array.isArray(condition.value)) {
|
|
165
|
+
return undefined;
|
|
166
|
+
}
|
|
167
|
+
return {
|
|
168
|
+
type: 'department',
|
|
169
|
+
operator: condition.type === 'not_in' ? 'is_not' : 'is',
|
|
170
|
+
departmentIds: condition.value,
|
|
171
|
+
};
|
|
33
172
|
};
|
|
34
173
|
const toApprovalSteps = (payload) => {
|
|
35
174
|
return payload.map((step) => ({
|
|
@@ -1,4 +1,28 @@
|
|
|
1
1
|
import { ID } from '../../commonStateTypes/common';
|
|
2
|
-
import {
|
|
2
|
+
import { EntityType } from '../entityApprovalStatus/entityApprovalStatusState';
|
|
3
|
+
import { AmountCriteria, ApprovalRule, ApprovalRuleState, Criteria, DepartmentCriteria, VendorCriteria } from './approvalRuleState';
|
|
3
4
|
export declare function getApprovalRuleById(approvalRuleState: ApprovalRuleState, approvalRuleId: ID): ApprovalRule | undefined;
|
|
4
5
|
export declare function getApprovalRulesByIds(approvalRuleState: ApprovalRuleState, approvalRuleIds: ID[]): ApprovalRule[];
|
|
6
|
+
/**
|
|
7
|
+
* Returns the amount-range portion of a rule's criteria, if any.
|
|
8
|
+
*
|
|
9
|
+
* Use this whenever a caller needs to read amount min/max from the new
|
|
10
|
+
* discriminated `Criteria` union without inlining a type guard.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getAmountCriteria(criteria: Criteria[]): AmountCriteria | undefined;
|
|
13
|
+
export declare function getVendorCriteria(criteria: Criteria[]): VendorCriteria | undefined;
|
|
14
|
+
export declare function getDepartmentCriteria(criteria: Criteria[]): DepartmentCriteria | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Returns all rules of the given entityType, sorted by `priority` ascending.
|
|
17
|
+
*
|
|
18
|
+
* Rules without a `priority` value sort to the end (treated as Infinity).
|
|
19
|
+
* Use this for the list page where rules render in evaluation order.
|
|
20
|
+
*/
|
|
21
|
+
export declare function getApprovalRulesByEntityType(approvalRuleState: ApprovalRuleState, entityType: EntityType): ApprovalRule[];
|
|
22
|
+
/**
|
|
23
|
+
* Returns the tenant's fallback rule for the given entityType, if one exists.
|
|
24
|
+
*
|
|
25
|
+
* The fallback rule is shown by the "fallback engine active" banner on the
|
|
26
|
+
* list page and is used to handle bills/reimbursements that match no other rule.
|
|
27
|
+
*/
|
|
28
|
+
export declare function getFallbackApprovalRule(approvalRuleState: ApprovalRuleState, entityType: EntityType): ApprovalRule | undefined;
|
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getApprovalRuleById = getApprovalRuleById;
|
|
4
4
|
exports.getApprovalRulesByIds = getApprovalRulesByIds;
|
|
5
|
+
exports.getAmountCriteria = getAmountCriteria;
|
|
6
|
+
exports.getVendorCriteria = getVendorCriteria;
|
|
7
|
+
exports.getDepartmentCriteria = getDepartmentCriteria;
|
|
8
|
+
exports.getApprovalRulesByEntityType = getApprovalRulesByEntityType;
|
|
9
|
+
exports.getFallbackApprovalRule = getFallbackApprovalRule;
|
|
5
10
|
function getApprovalRuleById(approvalRuleState, approvalRuleId) {
|
|
6
11
|
return approvalRuleState.approvalRuleById[approvalRuleId] ?? undefined;
|
|
7
12
|
}
|
|
@@ -11,3 +16,38 @@ function getApprovalRulesByIds(approvalRuleState, approvalRuleIds) {
|
|
|
11
16
|
.filter((value) => value != null);
|
|
12
17
|
return approvalRulesByIds;
|
|
13
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Returns the amount-range portion of a rule's criteria, if any.
|
|
21
|
+
*
|
|
22
|
+
* Use this whenever a caller needs to read amount min/max from the new
|
|
23
|
+
* discriminated `Criteria` union without inlining a type guard.
|
|
24
|
+
*/
|
|
25
|
+
function getAmountCriteria(criteria) {
|
|
26
|
+
return criteria.find((c) => c.type === 'amount');
|
|
27
|
+
}
|
|
28
|
+
function getVendorCriteria(criteria) {
|
|
29
|
+
return criteria.find((c) => c.type === 'vendor');
|
|
30
|
+
}
|
|
31
|
+
function getDepartmentCriteria(criteria) {
|
|
32
|
+
return criteria.find((c) => c.type === 'department');
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Returns all rules of the given entityType, sorted by `priority` ascending.
|
|
36
|
+
*
|
|
37
|
+
* Rules without a `priority` value sort to the end (treated as Infinity).
|
|
38
|
+
* Use this for the list page where rules render in evaluation order.
|
|
39
|
+
*/
|
|
40
|
+
function getApprovalRulesByEntityType(approvalRuleState, entityType) {
|
|
41
|
+
return Object.values(approvalRuleState.approvalRuleById)
|
|
42
|
+
.filter((rule) => rule.entityType === entityType)
|
|
43
|
+
.sort((a, b) => (a.priority ?? Infinity) - (b.priority ?? Infinity));
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Returns the tenant's fallback rule for the given entityType, if one exists.
|
|
47
|
+
*
|
|
48
|
+
* The fallback rule is shown by the "fallback engine active" banner on the
|
|
49
|
+
* list page and is used to handle bills/reimbursements that match no other rule.
|
|
50
|
+
*/
|
|
51
|
+
function getFallbackApprovalRule(approvalRuleState, entityType) {
|
|
52
|
+
return Object.values(approvalRuleState.approvalRuleById).find((rule) => rule.entityType === entityType && rule.isFallback === true);
|
|
53
|
+
}
|