@zeniai/client-epic-state 5.1.11-betaAY0 → 5.1.11
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 +0 -1
- package/lib/commonStateTypes/amount.js +1 -9
- package/lib/commonStateTypes/animations.d.ts +1 -1
- package/lib/commonStateTypes/animations.js +0 -1
- package/lib/commonStateTypes/workingDayHelper.d.ts +0 -9
- package/lib/commonStateTypes/workingDayHelper.js +1 -28
- package/lib/entity/aiCfo/aiCfoPayload.d.ts +5 -63
- package/lib/entity/aiCfo/aiCfoReducer.d.ts +2 -23
- package/lib/entity/aiCfo/aiCfoReducer.js +9 -249
- package/lib/entity/aiCfo/aiCfoSelector.d.ts +1 -4
- package/lib/entity/aiCfo/aiCfoSelector.js +1 -19
- package/lib/entity/aiCfo/aiCfoState.d.ts +4 -97
- package/lib/entity/aiCfo/aiCfoState.js +1 -20
- package/lib/entity/approvalRule/approvalRulePayload.d.ts +5 -34
- package/lib/entity/approvalRule/approvalRulePayload.js +10 -149
- package/lib/entity/approvalRule/approvalRuleSelector.d.ts +1 -25
- package/lib/entity/approvalRule/approvalRuleSelector.js +0 -40
- package/lib/entity/approvalRule/approvalRuleState.d.ts +7 -59
- package/lib/entity/company/companyPayload.d.ts +0 -4
- package/lib/entity/company/companyPayload.js +0 -6
- package/lib/entity/company/companyStateTypes.d.ts +0 -7
- package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +0 -1
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +0 -19
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +0 -2
- 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 +0 -1
- package/lib/entity/paymentAccount/paymentAccountSelector.js +0 -9
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -5
- package/lib/entity/task/taskPayload.d.ts +1 -3
- package/lib/entity/task/taskPayload.js +0 -2
- package/lib/entity/task/taskState.d.ts +0 -2
- package/lib/entity/tenant/clearAllEpic.d.ts +2 -8
- package/lib/entity/tenant/clearAllEpic.js +0 -12
- package/lib/entity/tenant/epic/deleteConnectionEpic.d.ts +1 -1
- 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 +0 -1
- package/lib/entity/tenant/tenantReducer.d.ts +25 -38
- package/lib/entity/tenant/tenantReducer.js +10 -70
- package/lib/entity/tenant/tenantState.d.ts +0 -1
- package/lib/entity/transaction/payloadTypes/transactionPayload.js +2 -14
- package/lib/entity/transactionActivityLog/transactionActivityLogPayload.js +1 -1
- package/lib/entity/vendor/vendorPayload.d.ts +1 -1
- package/lib/entity/vendor/vendorPayload.js +12 -5
- package/lib/epic.d.ts +3 -31
- package/lib/epic.js +3 -32
- package/lib/esm/commonStateTypes/amount.js +0 -7
- package/lib/esm/commonStateTypes/animations.js +0 -1
- package/lib/esm/commonStateTypes/workingDayHelper.js +0 -26
- package/lib/esm/entity/aiCfo/aiCfoReducer.js +9 -249
- package/lib/esm/entity/aiCfo/aiCfoSelector.js +1 -17
- package/lib/esm/entity/aiCfo/aiCfoState.js +0 -17
- package/lib/esm/entity/approvalRule/approvalRulePayload.js +10 -149
- package/lib/esm/entity/approvalRule/approvalRuleSelector.js +0 -35
- package/lib/esm/entity/company/companyPayload.js +0 -6
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +0 -19
- package/lib/esm/entity/paymentAccount/paymentAccountSelector.js +0 -8
- package/lib/esm/entity/snackbar/snackbarTypes.js +0 -5
- package/lib/esm/entity/task/taskPayload.js +0 -2
- package/lib/esm/entity/tenant/clearAllEpic.js +0 -12
- package/lib/esm/entity/tenant/tenantReducer.js +8 -68
- package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +2 -14
- package/lib/esm/entity/transactionActivityLog/transactionActivityLogPayload.js +2 -2
- package/lib/esm/entity/vendor/vendorPayload.js +12 -5
- package/lib/esm/epic.js +3 -32
- package/lib/esm/index.js +25 -66
- package/lib/esm/reducer.js +0 -18
- package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +3 -6
- package/lib/esm/view/aiCfoView/epics/createSessionAndSubmitEpic.js +2 -5
- package/lib/esm/view/aiCfoView/epics/createSessionEpic.js +1 -2
- package/lib/esm/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +2 -12
- package/lib/esm/view/companyTaskManagerView/companyTaskManagerViewReducer.js +11 -39
- package/lib/esm/view/companyTaskManagerView/companyTaskManagerViewSelector.js +4 -14
- package/lib/esm/view/companyTaskManagerView/epics/fetchCompanyTaskManagerViewEpic.js +28 -37
- 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/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/customerDetails/updateOnboardingCustomerViewEpic.js +18 -24
- package/lib/esm/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewLocalStoreDataEpic.js +17 -29
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewReducer.js +51 -223
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewSelector.js +18 -36
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewState.js +6 -45
- package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesSelector.js +2 -22
- package/lib/esm/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +0 -14
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewReducer.js +12 -109
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/deleteBillPayApprovalRuleEpic.js +2 -10
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPaySetupApproverViewEpic.js +4 -8
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/initializeBillPaySetupApproverViewUpdateDataEpic.js +7 -11
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/saveBillPaySetupApproverViewUpdatesEpic.js +4 -13
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js +16 -144
- package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +4 -60
- package/lib/esm/view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic.js +2 -8
- package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +0 -25
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardEpic.js +2 -2
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.js +4 -42
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.js +0 -35
- package/lib/esm/view/spendManagement/commonSetup/setupViewReducer.js +52 -106
- package/lib/esm/view/spendManagement/commonSetup/setupViewSelector.js +1 -6
- package/lib/esm/view/spendManagement/reimbursement/editRemiView/epics/fetchEditRemiDetailPageEpic.js +1 -5
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/deleteRemiApprovalRuleEpic.js +2 -10
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/fetchRemiSetupApproverViewEpic.js +2 -8
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/initializeRemiSetupApproverViewUpdateDataEpic.js +7 -11
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/saveRemiSetupApproverViewUpdatesEpic.js +4 -13
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewReducer.js +11 -80
- package/lib/esm/view/transactionDetail/epics/saveTransactionHelper.js +0 -1
- package/lib/esm/view/transactionDetail/epics/updateTransactionDetailEpic.js +0 -6
- package/lib/esm/view/transactionDetail/transactionDetailLocalDataHelper.js +1 -7
- package/lib/index.d.ts +32 -82
- package/lib/index.js +34 -266
- package/lib/reducer.d.ts +0 -18
- package/lib/reducer.js +0 -18
- package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +2 -11
- package/lib/view/aiCfoView/aiCfoViewReducer.js +3 -6
- package/lib/view/aiCfoView/epics/createSessionAndSubmitEpic.js +2 -5
- package/lib/view/aiCfoView/epics/createSessionEpic.js +1 -2
- package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.d.ts +1 -8
- package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +2 -12
- package/lib/view/companyTaskManagerView/companyTaskManagerViewPayload.d.ts +11 -19
- package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.d.ts +5 -11
- package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.js +12 -40
- package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.d.ts +0 -2
- package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.js +3 -13
- package/lib/view/companyTaskManagerView/companyTaskManagerViewState.d.ts +3 -11
- package/lib/view/companyTaskManagerView/epics/fetchCompanyTaskManagerViewEpic.d.ts +3 -1
- package/lib/view/companyTaskManagerView/epics/fetchCompanyTaskManagerViewEpic.js +28 -37
- 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 +2 -3
- 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/customerDetails/updateOnboardingCustomerViewEpic.js +18 -24
- package/lib/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewLocalStoreDataEpic.d.ts +2 -2
- package/lib/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewLocalStoreDataEpic.js +15 -27
- package/lib/view/onboardingView/customerView/onboardingCustomerViewPayload.d.ts +0 -3
- package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.d.ts +5 -44
- package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.js +52 -225
- package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.d.ts +1 -6
- package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.js +18 -39
- package/lib/view/onboardingView/customerView/onboardingCustomerViewState.d.ts +8 -53
- package/lib/view/onboardingView/customerView/onboardingCustomerViewState.js +7 -47
- package/lib/view/people/peopleTypes.d.ts +1 -1
- package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
- package/lib/view/spendManagement/autotransferRules/autoTransferRulesSelector.d.ts +1 -8
- package/lib/view/spendManagement/autotransferRules/autoTransferRulesSelector.js +1 -21
- package/lib/view/spendManagement/autotransferRules/autoTransferRulesState.d.ts +0 -22
- package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.d.ts +0 -7
- package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +0 -14
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewReducer.d.ts +3 -14
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewReducer.js +13 -110
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewState.d.ts +0 -16
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/deleteBillPayApprovalRuleEpic.js +2 -10
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPaySetupApproverViewEpic.js +4 -8
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/initializeBillPaySetupApproverViewUpdateDataEpic.js +6 -10
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/saveBillPaySetupApproverViewUpdatesEpic.js +3 -12
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.d.ts +1 -59
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js +17 -146
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonState.d.ts +5 -31
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +1 -8
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +4 -60
- package/lib/view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic.js +2 -8
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.d.ts +0 -14
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +1 -27
- 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 +2 -12
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.js +5 -43
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.d.ts +0 -7
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.js +1 -42
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardState.d.ts +0 -5
- package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +2 -28
- package/lib/view/spendManagement/commonSetup/setupViewReducer.js +53 -107
- package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +2 -7
- package/lib/view/spendManagement/commonSetup/setupViewSelector.js +1 -6
- package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +0 -19
- package/lib/view/spendManagement/reimbursement/editRemiView/epics/fetchEditRemiDetailPageEpic.js +1 -5
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/deleteRemiApprovalRuleEpic.js +2 -10
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/fetchRemiSetupApproverViewEpic.js +2 -8
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/initializeRemiSetupApproverViewUpdateDataEpic.js +6 -10
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/saveRemiSetupApproverViewUpdatesEpic.js +3 -12
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewReducer.d.ts +3 -14
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewReducer.js +12 -81
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewState.d.ts +0 -12
- 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 +0 -1
- package/lib/view/transactionDetail/epics/updateTransactionDetailEpic.js +0 -6
- package/lib/view/transactionDetail/journalEntryLinesViewModel.d.ts +1 -1
- package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +1 -7
- package/lib/view/transactionDetail/transactionDetailState.d.ts +0 -1
- package/lib/view/transactionDetail/transactionDetailTypes.d.ts +0 -1
- package/lib/zeniAPI.d.ts +0 -1
- package/package.json +34 -65
- package/lib/entity/approvalRule/approvalRuleConflict.d.ts +0 -56
- package/lib/entity/approvalRule/approvalRuleConflict.js +0 -77
- package/lib/entity/cardPolicy/cardPolicyPayload.d.ts +0 -277
- package/lib/entity/cardPolicy/cardPolicyPayload.js +0 -143
- package/lib/entity/cardPolicy/cardPolicyReducer.d.ts +0 -19
- package/lib/entity/cardPolicy/cardPolicyReducer.js +0 -175
- package/lib/entity/cardPolicy/cardPolicySelector.d.ts +0 -32
- package/lib/entity/cardPolicy/cardPolicySelector.js +0 -99
- package/lib/entity/cardPolicy/cardPolicyState.d.ts +0 -205
- package/lib/entity/cardPolicy/cardPolicyState.js +0 -14
- package/lib/entity/cardPolicy/extractPolicyDocumentEpic.d.ts +0 -18
- package/lib/entity/cardPolicy/extractPolicyDocumentEpic.js +0 -68
- package/lib/entity/cardPolicy/fetchCardPolicyVendorOptionsEpic.d.ts +0 -26
- package/lib/entity/cardPolicy/fetchCardPolicyVendorOptionsEpic.js +0 -47
- package/lib/entity/cardPolicy/policyDocumentExtractionToRecommendationBridgeEpic.d.ts +0 -25
- package/lib/entity/cardPolicy/policyDocumentExtractionToRecommendationBridgeEpic.js +0 -39
- package/lib/entity/cardPolicy/policyRecommendationFromUploadEpic.d.ts +0 -24
- package/lib/entity/cardPolicy/policyRecommendationFromUploadEpic.js +0 -105
- package/lib/entity/tenant/epic/initEmailConnectOAuthEpic.d.ts +0 -21
- package/lib/entity/tenant/epic/initEmailConnectOAuthEpic.js +0 -59
- package/lib/esm/entity/approvalRule/approvalRuleConflict.js +0 -74
- package/lib/esm/entity/cardPolicy/cardPolicyPayload.js +0 -130
- package/lib/esm/entity/cardPolicy/cardPolicyReducer.js +0 -171
- package/lib/esm/entity/cardPolicy/cardPolicySelector.js +0 -75
- package/lib/esm/entity/cardPolicy/cardPolicyState.js +0 -9
- package/lib/esm/entity/cardPolicy/extractPolicyDocumentEpic.js +0 -64
- package/lib/esm/entity/cardPolicy/fetchCardPolicyVendorOptionsEpic.js +0 -43
- package/lib/esm/entity/cardPolicy/policyDocumentExtractionToRecommendationBridgeEpic.js +0 -35
- package/lib/esm/entity/cardPolicy/policyRecommendationFromUploadEpic.js +0 -101
- package/lib/esm/entity/tenant/epic/initEmailConnectOAuthEpic.js +0 -55
- package/lib/esm/view/companyTaskManagerView/epics/fetchCockpitContextEpic.js +0 -38
- package/lib/esm/view/companyTaskManagerView/epics/updateCompanyTaskManagerViewFiltersEpic.js +0 -16
- package/lib/esm/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.js +0 -40
- package/lib/esm/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiActivationViewedEpic.js +0 -29
- package/lib/esm/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiFinanceTeamEpic.js +0 -40
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/reorderBillPayApprovalRulesEpic.js +0 -54
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowPayload.js +0 -29
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowReducer.js +0 -78
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowSelector.js +0 -49
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowState.js +0 -47
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/epics/fetchCashManagementSettingsEpic.js +0 -32
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/epics/saveAutoSweepSettingsEpic.js +0 -32
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewPayload.js +0 -54
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewReducer.js +0 -92
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector.js +0 -212
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewState.js +0 -10
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementBannerEpic.js +0 -23
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementOverviewPageEpic.js +0 -36
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementRecommendationEpic.js +0 -27
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchRecentTransferEpic.js +0 -28
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailReducer.js +0 -52
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailSelector.js +0 -22
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailState.js +0 -1
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/fetchCardPolicyDetailEpic.js +0 -36
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/updateCardPolicyEpic.js +0 -39
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/archiveCardPolicyEpic.js +0 -34
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer.js +0 -71
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListSelector.js +0 -21
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListState.js +0 -1
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/fetchCardPolicyListEpic.js +0 -38
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyAiCardPolicyFormDraftUpdate.js +0 -289
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToAiCardPolicyDraft.js +0 -109
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToDraftEpic.js +0 -44
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToManualCardPolicyDraft.js +0 -111
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyUploadPlanToAiCardPolicyDraft.js +0 -25
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/buildAiCardPolicyFormDraftSeed.js +0 -363
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/buildManualCardPolicyFormDraftSeed.js +0 -36
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyChipIds.js +0 -19
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyFormDraftTypes.js +0 -6
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyRequestParts.js +0 -119
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyReducer.js +0 -154
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicySelector.js +0 -22
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyState.js +0 -1
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyTemplateEpic.js +0 -49
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/deriveAiPolicyReviewRowsFromInputs.js +0 -140
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/fetchCardPolicyMccCategoriesEpic.js +0 -20
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/seedAiCardPolicyFormDraftEpic.js +0 -100
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toBulkCardPolicyTemplateRequestsFromDraft.js +0 -96
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toCardPolicyTemplateRequestFromDraft.js +0 -59
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toManualCardPolicyTemplateRequestFromDraft.js +0 -24
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/aiCardCreationFormDraftTypes.js +0 -1
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/applyAiCardCreationFormDraftUpdate.js +0 -34
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/buildAiCardCreationFormDraftSeed.js +0 -57
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/deriveAiCardRowsFromTeams.js +0 -35
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/seedAiCardCreationFormDraftEpic.js +0 -62
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/toIssueChargeCardLocalDataFromDraft.js +0 -44
- package/lib/esm/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.js +0 -58
- package/lib/esm/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.js +0 -77
- package/lib/esm/view/spendManagement/commonSetup/kycKybAutofillActions.js +0 -14
- package/lib/esm/view/spendManagement/commonSetup/kycKybParseMapper.js +0 -221
- package/lib/esm/view/spendManagement/commonSetup/types/kycKybAutofill.js +0 -41
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/reorderRemiApprovalRulesEpic.js +0 -61
- package/lib/view/companyTaskManagerView/epics/fetchCockpitContextEpic.d.ts +0 -10
- package/lib/view/companyTaskManagerView/epics/fetchCockpitContextEpic.js +0 -42
- package/lib/view/companyTaskManagerView/epics/updateCompanyTaskManagerViewFiltersEpic.d.ts +0 -6
- package/lib/view/companyTaskManagerView/epics/updateCompanyTaskManagerViewFiltersEpic.js +0 -20
- package/lib/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.d.ts +0 -7
- package/lib/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.js +0 -44
- package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiActivationViewedEpic.d.ts +0 -8
- package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiActivationViewedEpic.js +0 -33
- package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiFinanceTeamEpic.d.ts +0 -9
- package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiFinanceTeamEpic.js +0 -44
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/reorderBillPayApprovalRulesEpic.d.ts +0 -23
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/reorderBillPayApprovalRulesEpic.js +0 -58
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowPayload.d.ts +0 -47
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowPayload.js +0 -34
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowReducer.d.ts +0 -23
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowReducer.js +0 -82
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowSelector.d.ts +0 -40
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowSelector.js +0 -53
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowState.d.ts +0 -37
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowState.js +0 -53
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/fetchCashManagementSettingsEpic.d.ts +0 -14
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/fetchCashManagementSettingsEpic.js +0 -36
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/saveAutoSweepSettingsEpic.d.ts +0 -7
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/saveAutoSweepSettingsEpic.js +0 -36
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewPayload.d.ts +0 -56
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewPayload.js +0 -60
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewReducer.d.ts +0 -22
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewReducer.js +0 -96
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector.d.ts +0 -59
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector.js +0 -217
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewState.d.ts +0 -122
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewState.js +0 -13
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementBannerEpic.d.ts +0 -7
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementBannerEpic.js +0 -27
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementOverviewPageEpic.d.ts +0 -9
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementOverviewPageEpic.js +0 -40
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementRecommendationEpic.d.ts +0 -7
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementRecommendationEpic.js +0 -31
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchRecentTransferEpic.d.ts +0 -15
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchRecentTransferEpic.js +0 -32
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailReducer.d.ts +0 -14
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailReducer.js +0 -56
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailSelector.d.ts +0 -15
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailSelector.js +0 -28
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailState.d.ts +0 -8
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailState.js +0 -2
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/fetchCardPolicyDetailEpic.d.ts +0 -8
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/fetchCardPolicyDetailEpic.js +0 -40
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/updateCardPolicyEpic.d.ts +0 -8
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/updateCardPolicyEpic.js +0 -43
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/archiveCardPolicyEpic.d.ts +0 -8
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/archiveCardPolicyEpic.js +0 -38
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer.d.ts +0 -15
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer.js +0 -75
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListSelector.d.ts +0 -15
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListSelector.js +0 -27
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListState.d.ts +0 -7
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListState.js +0 -2
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/fetchCardPolicyListEpic.d.ts +0 -8
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/fetchCardPolicyListEpic.js +0 -42
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyAiCardPolicyFormDraftUpdate.d.ts +0 -8
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyAiCardPolicyFormDraftUpdate.js +0 -294
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToAiCardPolicyDraft.d.ts +0 -8
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToAiCardPolicyDraft.js +0 -113
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToDraftEpic.d.ts +0 -9
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToDraftEpic.js +0 -48
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToManualCardPolicyDraft.d.ts +0 -8
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToManualCardPolicyDraft.js +0 -115
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyUploadPlanToAiCardPolicyDraft.d.ts +0 -13
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyUploadPlanToAiCardPolicyDraft.js +0 -29
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/buildAiCardPolicyFormDraftSeed.d.ts +0 -14
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/buildAiCardPolicyFormDraftSeed.js +0 -369
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/buildManualCardPolicyFormDraftSeed.d.ts +0 -6
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/buildManualCardPolicyFormDraftSeed.js +0 -40
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyChipIds.d.ts +0 -7
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyChipIds.js +0 -26
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyFormDraftTypes.d.ts +0 -116
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyFormDraftTypes.js +0 -10
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyRequestParts.d.ts +0 -33
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyRequestParts.js +0 -126
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyReducer.d.ts +0 -52
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyReducer.js +0 -158
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicySelector.d.ts +0 -11
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicySelector.js +0 -31
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyState.d.ts +0 -12
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyState.js +0 -2
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyTemplateEpic.d.ts +0 -9
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyTemplateEpic.js +0 -53
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/deriveAiPolicyReviewRowsFromInputs.d.ts +0 -10
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/deriveAiPolicyReviewRowsFromInputs.js +0 -144
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/fetchCardPolicyMccCategoriesEpic.d.ts +0 -7
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/fetchCardPolicyMccCategoriesEpic.js +0 -24
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/seedAiCardPolicyFormDraftEpic.d.ts +0 -11
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/seedAiCardPolicyFormDraftEpic.js +0 -104
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toBulkCardPolicyTemplateRequestsFromDraft.d.ts +0 -22
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toBulkCardPolicyTemplateRequestsFromDraft.js +0 -100
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toCardPolicyTemplateRequestFromDraft.d.ts +0 -8
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toCardPolicyTemplateRequestFromDraft.js +0 -63
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toManualCardPolicyTemplateRequestFromDraft.d.ts +0 -3
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toManualCardPolicyTemplateRequestFromDraft.js +0 -28
- package/lib/view/spendManagement/chargeCards/issueChargeCard/aiCardCreationFormDraftTypes.d.ts +0 -34
- package/lib/view/spendManagement/chargeCards/issueChargeCard/aiCardCreationFormDraftTypes.js +0 -2
- package/lib/view/spendManagement/chargeCards/issueChargeCard/applyAiCardCreationFormDraftUpdate.d.ts +0 -7
- package/lib/view/spendManagement/chargeCards/issueChargeCard/applyAiCardCreationFormDraftUpdate.js +0 -38
- package/lib/view/spendManagement/chargeCards/issueChargeCard/buildAiCardCreationFormDraftSeed.d.ts +0 -12
- package/lib/view/spendManagement/chargeCards/issueChargeCard/buildAiCardCreationFormDraftSeed.js +0 -61
- package/lib/view/spendManagement/chargeCards/issueChargeCard/deriveAiCardRowsFromTeams.d.ts +0 -9
- package/lib/view/spendManagement/chargeCards/issueChargeCard/deriveAiCardRowsFromTeams.js +0 -39
- package/lib/view/spendManagement/chargeCards/issueChargeCard/seedAiCardCreationFormDraftEpic.d.ts +0 -11
- package/lib/view/spendManagement/chargeCards/issueChargeCard/seedAiCardCreationFormDraftEpic.js +0 -66
- package/lib/view/spendManagement/chargeCards/issueChargeCard/toIssueChargeCardLocalDataFromDraft.d.ts +0 -3
- package/lib/view/spendManagement/chargeCards/issueChargeCard/toIssueChargeCardLocalDataFromDraft.js +0 -48
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.d.ts +0 -28
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.js +0 -62
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.d.ts +0 -9
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.js +0 -81
- package/lib/view/spendManagement/commonSetup/kycKybAutofillActions.d.ts +0 -24
- package/lib/view/spendManagement/commonSetup/kycKybAutofillActions.js +0 -17
- package/lib/view/spendManagement/commonSetup/kycKybParseMapper.d.ts +0 -29
- package/lib/view/spendManagement/commonSetup/kycKybParseMapper.js +0 -229
- package/lib/view/spendManagement/commonSetup/types/kycKybAutofill.d.ts +0 -154
- package/lib/view/spendManagement/commonSetup/types/kycKybAutofill.js +0 -46
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/reorderRemiApprovalRulesEpic.d.ts +0 -14
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/reorderRemiApprovalRulesEpic.js +0 -65
|
@@ -1,77 +0,0 @@
|
|
|
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,277 +0,0 @@
|
|
|
1
|
-
import { ID } from '../../commonStateTypes/common';
|
|
2
|
-
import { ZeniAPIResponse } from '../../responsePayload';
|
|
3
|
-
import { CardPolicyStats, CardPolicyTemplate, CardPolicyTemplateEntityList, CardPolicyTemplateMode, CardPolicyTemplateSpendLimits, ExtractedCardPolicyRules, MccCategory } from './cardPolicyState';
|
|
4
|
-
export interface MccCategoryPayload {
|
|
5
|
-
count: number;
|
|
6
|
-
mcc_codes: string[];
|
|
7
|
-
name: string;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Wire shape for `GET /cards/1.0/cards/mcc-codes`. Beyond the universe of
|
|
11
|
-
* MCC categories used to populate the category search dropdown, the
|
|
12
|
-
* endpoint also ships **suggested** allow / block merchants and categories
|
|
13
|
-
* that the chip-pickers seed into their cloud body before the user starts
|
|
14
|
-
* editing.
|
|
15
|
-
*
|
|
16
|
-
* Field spellings (`*_catagories`) preserve the BE wire format verbatim;
|
|
17
|
-
* the camelCase mapper below corrects to `Categories`.
|
|
18
|
-
*/
|
|
19
|
-
export interface CardPolicyMccCategoriesPayload {
|
|
20
|
-
categories: MccCategoryPayload[];
|
|
21
|
-
suggested_allow_catagories?: MccCategoryPayload[];
|
|
22
|
-
suggested_allow_merchants?: string[];
|
|
23
|
-
suggested_block_catagories?: MccCategoryPayload[];
|
|
24
|
-
suggested_block_merchants?: string[];
|
|
25
|
-
}
|
|
26
|
-
export type CardPolicyMccCategoriesResponse = ZeniAPIResponse<CardPolicyMccCategoriesPayload>;
|
|
27
|
-
export declare const toMccCategory: (payload: MccCategoryPayload) => MccCategory;
|
|
28
|
-
/**
|
|
29
|
-
* Vendor row returned by `/accounting/1.0/vendors`. The card-policy
|
|
30
|
-
* vendor search dropdown only needs `vendor_id` + `vendor_name`; we
|
|
31
|
-
* deliberately ignore the rest of the payload to keep this slice
|
|
32
|
-
* independent of the heavy `vendor` entity store.
|
|
33
|
-
*/
|
|
34
|
-
export interface CardPolicyVendorSearchVendorPayload {
|
|
35
|
-
vendor_id: string;
|
|
36
|
-
vendor_name: string;
|
|
37
|
-
}
|
|
38
|
-
export interface CardPolicyVendorSearchData {
|
|
39
|
-
vendors: CardPolicyVendorSearchVendorPayload[];
|
|
40
|
-
}
|
|
41
|
-
export type CardPolicyVendorSearchResponse = ZeniAPIResponse<CardPolicyVendorSearchData>;
|
|
42
|
-
export interface CardPolicyVendorSearchOption {
|
|
43
|
-
name: string;
|
|
44
|
-
vendorId: string;
|
|
45
|
-
}
|
|
46
|
-
export declare const toCardPolicyVendorSearchOption: (payload: CardPolicyVendorSearchVendorPayload) => CardPolicyVendorSearchOption;
|
|
47
|
-
interface CardPolicyTemplateEntityListPayload {
|
|
48
|
-
category_codes: string[];
|
|
49
|
-
merchant_names: string[];
|
|
50
|
-
}
|
|
51
|
-
interface CardPolicyTemplateSpendLimitsPayload {
|
|
52
|
-
transaction: number | null;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Per-template request shape. `POST /cards/1.0/policy-templates` now
|
|
56
|
-
* accepts a bulk wrapper (`CreateCardPolicyTemplatesRequest`); this
|
|
57
|
-
* interface describes a single entry inside the `templates` array.
|
|
58
|
-
*
|
|
59
|
-
* `PUT /cards/1.0/policy-templates/{id}` (update) still consumes this
|
|
60
|
-
* shape directly — see `UpdateCardPolicyTemplateRequest` below.
|
|
61
|
-
*/
|
|
62
|
-
export interface CreateCardPolicyTemplateRequest {
|
|
63
|
-
allowedEntity: CardPolicyTemplateEntityList;
|
|
64
|
-
applyToCards: ID[];
|
|
65
|
-
blockedEntity: CardPolicyTemplateEntityList;
|
|
66
|
-
description: string;
|
|
67
|
-
mode: CardPolicyTemplateMode;
|
|
68
|
-
name: string;
|
|
69
|
-
/**
|
|
70
|
-
* `null` indicates the require-receipt toggle is off (no threshold
|
|
71
|
-
* configured). The BE accepts `null` and treats it as "no requirement";
|
|
72
|
-
* `0` means the user explicitly entered zero with the toggle on.
|
|
73
|
-
*/
|
|
74
|
-
requiredReceiptThreshold: number | null;
|
|
75
|
-
spendLimits: CardPolicyTemplateSpendLimits;
|
|
76
|
-
}
|
|
77
|
-
export interface CreateCardPolicyTemplateRequestBody {
|
|
78
|
-
allowed_entity: CardPolicyTemplateEntityListPayload;
|
|
79
|
-
apply_to_cards: ID[];
|
|
80
|
-
blocked_entity: CardPolicyTemplateEntityListPayload;
|
|
81
|
-
description: string;
|
|
82
|
-
mode: string;
|
|
83
|
-
name: string;
|
|
84
|
-
required_receipt_threshold: number | null;
|
|
85
|
-
spend_limits: CardPolicyTemplateSpendLimitsPayload;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Bulk request for `POST /cards/1.0/policy-templates`. The single-policy
|
|
89
|
-
* create flow wraps its one request in a length-1 `templates` array;
|
|
90
|
-
* future multi-policy submit (AI CFO review step) sends N entries in a
|
|
91
|
-
* single round-trip.
|
|
92
|
-
*
|
|
93
|
-
* `sourceChatSessionId` ties the submit back to an AI CFO chat session so
|
|
94
|
-
* the BE can attribute the created templates to it. Manual create-page
|
|
95
|
-
* callers omit it.
|
|
96
|
-
*/
|
|
97
|
-
export interface CreateCardPolicyTemplatesRequest {
|
|
98
|
-
templates: CreateCardPolicyTemplateRequest[];
|
|
99
|
-
sourceChatSessionId?: string;
|
|
100
|
-
}
|
|
101
|
-
export interface CreateCardPolicyTemplatesRequestBody {
|
|
102
|
-
templates: CreateCardPolicyTemplateRequestBody[];
|
|
103
|
-
source_chat_session_id?: string;
|
|
104
|
-
}
|
|
105
|
-
export interface CardPolicyTemplatePayload {
|
|
106
|
-
allowed_entity: CardPolicyTemplateEntityListPayload;
|
|
107
|
-
applied_cards: ID[];
|
|
108
|
-
blocked_entity: CardPolicyTemplateEntityListPayload;
|
|
109
|
-
cards_count: number;
|
|
110
|
-
category_restrictions: unknown[];
|
|
111
|
-
created_at: string;
|
|
112
|
-
created_by: ID;
|
|
113
|
-
description: string;
|
|
114
|
-
mode: string;
|
|
115
|
-
name: string;
|
|
116
|
-
required_receipt_threshold: number | null;
|
|
117
|
-
spend_limits: CardPolicyTemplateSpendLimitsPayload;
|
|
118
|
-
status: string;
|
|
119
|
-
template_id: ID;
|
|
120
|
-
tenant_id: ID;
|
|
121
|
-
updated_at: string;
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Per-template response envelope. Still returned by `PUT /policy-templates/{id}`,
|
|
125
|
-
* `GET /policy-templates/{id}`, and (as the row payload) the list endpoint.
|
|
126
|
-
* Also nested inside `CreateCardPolicyTemplatesResponseData.templates_created`.
|
|
127
|
-
*/
|
|
128
|
-
export interface CreateCardPolicyTemplateResponseData {
|
|
129
|
-
cards_applied: number;
|
|
130
|
-
template: CardPolicyTemplatePayload;
|
|
131
|
-
}
|
|
132
|
-
export type CreateCardPolicyTemplateResponse = ZeniAPIResponse<CreateCardPolicyTemplateResponseData>;
|
|
133
|
-
/**
|
|
134
|
-
* Per-item error returned by the bulk POST when one or more templates in
|
|
135
|
-
* the request fail validation / persistence. The exact field shape is
|
|
136
|
-
* **TBD** with the BE — `message` is the only guaranteed field today; the
|
|
137
|
-
* rest are best-effort placeholders that callers should not assume to be
|
|
138
|
-
* present.
|
|
139
|
-
*
|
|
140
|
-
* TODO: lock down the shape (`index`, `name`, `code`) once the BE
|
|
141
|
-
* documents it. See plan §"Open question to resolve with BE".
|
|
142
|
-
*/
|
|
143
|
-
export interface BulkCreateCardPolicyTemplateErrorPayload {
|
|
144
|
-
message: string;
|
|
145
|
-
code?: string;
|
|
146
|
-
index?: number;
|
|
147
|
-
name?: string;
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
* Wire shape returned by the bulk `POST /cards/1.0/policy-templates`.
|
|
151
|
-
* Partial success is allowed — `templates_created` holds the successfully
|
|
152
|
-
* created rows (each in the same envelope as the single endpoint), and
|
|
153
|
-
* `errors` holds per-item failures for the rest. `status.message` follows
|
|
154
|
-
* the "N of M templates created" convention.
|
|
155
|
-
*/
|
|
156
|
-
export interface CreateCardPolicyTemplatesResponseData {
|
|
157
|
-
errors: BulkCreateCardPolicyTemplateErrorPayload[];
|
|
158
|
-
templates_created: CreateCardPolicyTemplateResponseData[];
|
|
159
|
-
}
|
|
160
|
-
export type CreateCardPolicyTemplatesResponse = ZeniAPIResponse<CreateCardPolicyTemplatesResponseData>;
|
|
161
|
-
/**
|
|
162
|
-
* Camel-cased mirror of `BulkCreateCardPolicyTemplateErrorPayload` stored
|
|
163
|
-
* on the create-card-policy view slice so the UI can render a partial-success
|
|
164
|
-
* banner without re-touching the wire types.
|
|
165
|
-
*/
|
|
166
|
-
export interface BulkCreateCardPolicyTemplateError {
|
|
167
|
-
message: string;
|
|
168
|
-
code?: string;
|
|
169
|
-
index?: number;
|
|
170
|
-
name?: string;
|
|
171
|
-
}
|
|
172
|
-
export type UpdateCardPolicyTemplateRequest = CreateCardPolicyTemplateRequest;
|
|
173
|
-
export type UpdateCardPolicyTemplateRequestBody = CreateCardPolicyTemplateRequestBody;
|
|
174
|
-
export type UpdateCardPolicyTemplateResponseData = CreateCardPolicyTemplateResponseData;
|
|
175
|
-
export type UpdateCardPolicyTemplateResponse = CreateCardPolicyTemplateResponse;
|
|
176
|
-
export type CardPolicyDetailResponseData = CreateCardPolicyTemplateResponseData;
|
|
177
|
-
export type CardPolicyDetailResponse = CreateCardPolicyTemplateResponse;
|
|
178
|
-
/**
|
|
179
|
-
* Aggregate counters returned alongside the templates list. Stored on
|
|
180
|
-
* the entity slice (alongside `cardPolicyTemplateById`) so any list
|
|
181
|
-
* surface can read it without re-fetching.
|
|
182
|
-
*/
|
|
183
|
-
export interface CardPolicyStatsPayload {
|
|
184
|
-
active_policies: number;
|
|
185
|
-
total_cards: number;
|
|
186
|
-
total_templates: number;
|
|
187
|
-
}
|
|
188
|
-
/**
|
|
189
|
-
* Each list row is wrapped in the same `{cards_applied, template}`
|
|
190
|
-
* envelope the create endpoint returns. Only the `template` portion is
|
|
191
|
-
* stored on the entity slice; `cards_applied` is a one-shot summary
|
|
192
|
-
* carried over from create and not surfaced in the list state today.
|
|
193
|
-
*/
|
|
194
|
-
export interface CardPolicyListRowPayload {
|
|
195
|
-
data: CreateCardPolicyTemplateResponseData;
|
|
196
|
-
}
|
|
197
|
-
export interface ListCardPolicyTemplatesResponseData {
|
|
198
|
-
stats: CardPolicyStatsPayload;
|
|
199
|
-
templates: CardPolicyListRowPayload[];
|
|
200
|
-
}
|
|
201
|
-
export type ListCardPolicyTemplatesResponse = ZeniAPIResponse<ListCardPolicyTemplatesResponseData>;
|
|
202
|
-
export declare const toCardPolicyStats: (payload: CardPolicyStatsPayload) => CardPolicyStats;
|
|
203
|
-
export declare const toCardPolicyTemplateList: (data: ListCardPolicyTemplatesResponseData) => CardPolicyTemplate[];
|
|
204
|
-
export declare const toCardPolicyTemplate: (payload: CardPolicyTemplatePayload) => CardPolicyTemplate;
|
|
205
|
-
/**
|
|
206
|
-
* Re-shape a single camelCase create request into the snake_case wire
|
|
207
|
-
* body. Used by the bulk-create mapper to build each entry of the
|
|
208
|
-
* `templates` array, and directly by the update epic (PUT) since the
|
|
209
|
-
* update endpoint still consumes a single object.
|
|
210
|
-
*/
|
|
211
|
-
export declare const toCreateCardPolicyTemplateRequestBody: (request: CreateCardPolicyTemplateRequest) => CreateCardPolicyTemplateRequestBody;
|
|
212
|
-
/**
|
|
213
|
-
* Re-shape a bulk create request into the snake_case wire body for
|
|
214
|
-
* `POST /cards/1.0/policy-templates`. Maps each entry through
|
|
215
|
-
* `toCreateCardPolicyTemplateRequestBody` and only emits
|
|
216
|
-
* `source_chat_session_id` when the camelCase counterpart is defined,
|
|
217
|
-
* so manual-create callers don't ship a stray `undefined` over the wire.
|
|
218
|
-
*/
|
|
219
|
-
export declare const toCreateCardPolicyTemplatesRequestBody: (request: CreateCardPolicyTemplatesRequest) => CreateCardPolicyTemplatesRequestBody;
|
|
220
|
-
/**
|
|
221
|
-
* Map a single bulk-response error payload to its camelCased view shape.
|
|
222
|
-
* Defensive against missing optional fields (see `BulkCreateCardPolicyTemplateErrorPayload`
|
|
223
|
-
* docstring — the BE contract isn't fully locked yet).
|
|
224
|
-
*/
|
|
225
|
-
export declare const toBulkCreateCardPolicyTemplateError: (payload: BulkCreateCardPolicyTemplateErrorPayload) => BulkCreateCardPolicyTemplateError;
|
|
226
|
-
export declare const toUpdateCardPolicyTemplateRequestBody: (request: CreateCardPolicyTemplateRequest) => CreateCardPolicyTemplateRequestBody;
|
|
227
|
-
/**
|
|
228
|
-
* Seed an edit-form draft (`CreateCardPolicyTemplateRequest`) from an
|
|
229
|
-
* existing camelCased `CardPolicyTemplate`. Used by the detail-fetch
|
|
230
|
-
* epic so the edit page can render with the saved values pre-populated.
|
|
231
|
-
*/
|
|
232
|
-
export declare const toCardPolicyEditFormDraft: (template: CardPolicyTemplate) => CreateCardPolicyTemplateRequest;
|
|
233
|
-
/**
|
|
234
|
-
* Wire shape returned by `POST /cards/1.0/policy-documents/extract`.
|
|
235
|
-
* The backend OCRs / parses an uploaded policy document (PDF, image, etc.)
|
|
236
|
-
* and returns a best-effort set of policy rules + a confidence score.
|
|
237
|
-
*
|
|
238
|
-
* Consumers (manual `CardPolicyCreatePage` + AI CFO `CardPolicyInteractiveForm`)
|
|
239
|
-
* use `toExtractedCardPolicyRules` to map this onto the camelCase FE shape
|
|
240
|
-
* and then feed the result through `applyExtractedPolicyRulesToFormValues`
|
|
241
|
-
* (`@zeniai/web-components`) to seed the RHF form.
|
|
242
|
-
*/
|
|
243
|
-
export interface ExtractedCardPolicyRulesPayload {
|
|
244
|
-
allowed_entity: CardPolicyTemplateEntityListPayload;
|
|
245
|
-
blocked_entity: CardPolicyTemplateEntityListPayload;
|
|
246
|
-
confidence_score: number;
|
|
247
|
-
policy_name: string;
|
|
248
|
-
required_receipt_threshold: number;
|
|
249
|
-
transaction_limit: number;
|
|
250
|
-
}
|
|
251
|
-
export interface PolicyDocumentExtractResponseData {
|
|
252
|
-
extracted_rules: ExtractedCardPolicyRulesPayload;
|
|
253
|
-
message: string;
|
|
254
|
-
}
|
|
255
|
-
export type PolicyDocumentExtractResponse = ZeniAPIResponse<PolicyDocumentExtractResponseData>;
|
|
256
|
-
export declare const toExtractedCardPolicyRules: (payload: ExtractedCardPolicyRulesPayload) => ExtractedCardPolicyRules;
|
|
257
|
-
/**
|
|
258
|
-
* Wire shape returned by `POST /cards/1.0/ai-cfo/policy-recommendation-from-upload`.
|
|
259
|
-
* Chained after `extractPolicyDocument` succeeds in the AI CFO `upload`
|
|
260
|
-
* flow: the FE forwards the just-returned `extracted_rules` and the BE
|
|
261
|
-
* synthesizes a wizard plan + upload source metadata.
|
|
262
|
-
*
|
|
263
|
-
* The response mirrors the same `mode`-discriminated envelope the
|
|
264
|
-
* controller API ships for `auto` / `guided`, but always with `mode:
|
|
265
|
-
* "upload"` and a populated `wizard_plan.step_5_review`. The FE merges
|
|
266
|
-
* the returned `wizard_plan` + `source` into the in-flight AI CFO
|
|
267
|
-
* answer's `CardPolicyInitialData` via
|
|
268
|
-
* `updateAiCfoAnswerCardPolicyWizardPlan`.
|
|
269
|
-
*/
|
|
270
|
-
export interface CardPolicyRecommendationFromUploadResponseData {
|
|
271
|
-
mode: 'upload';
|
|
272
|
-
source: import('../aiCfo/aiCfoPayload').CardPolicyUploadSourcePayload;
|
|
273
|
-
tenant_id: string;
|
|
274
|
-
wizard_plan: import('../aiCfo/aiCfoPayload').CardPolicyWizardPlanPayload;
|
|
275
|
-
}
|
|
276
|
-
export type CardPolicyRecommendationFromUploadResponse = ZeniAPIResponse<CardPolicyRecommendationFromUploadResponseData>;
|
|
277
|
-
export {};
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toExtractedCardPolicyRules = exports.toCardPolicyEditFormDraft = exports.toUpdateCardPolicyTemplateRequestBody = exports.toBulkCreateCardPolicyTemplateError = exports.toCreateCardPolicyTemplatesRequestBody = exports.toCreateCardPolicyTemplateRequestBody = exports.toCardPolicyTemplate = exports.toCardPolicyTemplateList = exports.toCardPolicyStats = exports.toCardPolicyVendorSearchOption = exports.toMccCategory = void 0;
|
|
4
|
-
const zeniDayJS_1 = require("../../zeniDayJS");
|
|
5
|
-
const cardPolicyState_1 = require("./cardPolicyState");
|
|
6
|
-
const toMccCategory = (payload) => ({
|
|
7
|
-
count: payload.count,
|
|
8
|
-
mccCodes: payload.mcc_codes ?? [],
|
|
9
|
-
name: payload.name,
|
|
10
|
-
});
|
|
11
|
-
exports.toMccCategory = toMccCategory;
|
|
12
|
-
const toCardPolicyVendorSearchOption = (payload) => ({
|
|
13
|
-
vendorId: payload.vendor_id,
|
|
14
|
-
name: payload.vendor_name,
|
|
15
|
-
});
|
|
16
|
-
exports.toCardPolicyVendorSearchOption = toCardPolicyVendorSearchOption;
|
|
17
|
-
const toCardPolicyStats = (payload) => ({
|
|
18
|
-
activePolicies: payload.active_policies,
|
|
19
|
-
totalCards: payload.total_cards,
|
|
20
|
-
totalTemplates: payload.total_templates,
|
|
21
|
-
});
|
|
22
|
-
exports.toCardPolicyStats = toCardPolicyStats;
|
|
23
|
-
const toCardPolicyTemplateList = (data) => (data.templates ?? []).map((row) => (0, exports.toCardPolicyTemplate)(row.data.template));
|
|
24
|
-
exports.toCardPolicyTemplateList = toCardPolicyTemplateList;
|
|
25
|
-
const toCardPolicyTemplateEntityList = (payload) => ({
|
|
26
|
-
categoryCodes: payload.category_codes ?? [],
|
|
27
|
-
merchantNames: payload.merchant_names ?? [],
|
|
28
|
-
});
|
|
29
|
-
const toCardPolicyTemplate = (payload) => ({
|
|
30
|
-
allowedEntity: toCardPolicyTemplateEntityList(payload.allowed_entity),
|
|
31
|
-
appliedCards: payload.applied_cards ?? [],
|
|
32
|
-
blockedEntity: toCardPolicyTemplateEntityList(payload.blocked_entity),
|
|
33
|
-
cardsCount: payload.cards_count,
|
|
34
|
-
categoryRestrictions: payload.category_restrictions ?? [],
|
|
35
|
-
createdAt: (0, zeniDayJS_1.date)(payload.created_at),
|
|
36
|
-
createdBy: payload.created_by,
|
|
37
|
-
description: payload.description,
|
|
38
|
-
mode: (0, cardPolicyState_1.toCardPolicyTemplateMode)(payload.mode),
|
|
39
|
-
name: payload.name,
|
|
40
|
-
requiredReceiptThreshold: payload.required_receipt_threshold,
|
|
41
|
-
spendLimits: {
|
|
42
|
-
transaction: payload.spend_limits.transaction,
|
|
43
|
-
},
|
|
44
|
-
status: (0, cardPolicyState_1.toCardPolicyTemplateStatus)(payload.status),
|
|
45
|
-
templateId: payload.template_id,
|
|
46
|
-
tenantId: payload.tenant_id,
|
|
47
|
-
updatedAt: (0, zeniDayJS_1.date)(payload.updated_at),
|
|
48
|
-
});
|
|
49
|
-
exports.toCardPolicyTemplate = toCardPolicyTemplate;
|
|
50
|
-
/**
|
|
51
|
-
* Re-shape a single camelCase create request into the snake_case wire
|
|
52
|
-
* body. Used by the bulk-create mapper to build each entry of the
|
|
53
|
-
* `templates` array, and directly by the update epic (PUT) since the
|
|
54
|
-
* update endpoint still consumes a single object.
|
|
55
|
-
*/
|
|
56
|
-
const toCreateCardPolicyTemplateRequestBody = (request) => ({
|
|
57
|
-
allowed_entity: {
|
|
58
|
-
category_codes: request.allowedEntity.categoryCodes,
|
|
59
|
-
merchant_names: request.allowedEntity.merchantNames,
|
|
60
|
-
},
|
|
61
|
-
apply_to_cards: request.applyToCards,
|
|
62
|
-
blocked_entity: {
|
|
63
|
-
category_codes: request.blockedEntity.categoryCodes,
|
|
64
|
-
merchant_names: request.blockedEntity.merchantNames,
|
|
65
|
-
},
|
|
66
|
-
description: request.description,
|
|
67
|
-
mode: request.mode ?? 'strict',
|
|
68
|
-
name: request.name,
|
|
69
|
-
required_receipt_threshold: request.requiredReceiptThreshold,
|
|
70
|
-
spend_limits: {
|
|
71
|
-
transaction: request.spendLimits.transaction,
|
|
72
|
-
},
|
|
73
|
-
});
|
|
74
|
-
exports.toCreateCardPolicyTemplateRequestBody = toCreateCardPolicyTemplateRequestBody;
|
|
75
|
-
/**
|
|
76
|
-
* Re-shape a bulk create request into the snake_case wire body for
|
|
77
|
-
* `POST /cards/1.0/policy-templates`. Maps each entry through
|
|
78
|
-
* `toCreateCardPolicyTemplateRequestBody` and only emits
|
|
79
|
-
* `source_chat_session_id` when the camelCase counterpart is defined,
|
|
80
|
-
* so manual-create callers don't ship a stray `undefined` over the wire.
|
|
81
|
-
*/
|
|
82
|
-
const toCreateCardPolicyTemplatesRequestBody = (request) => {
|
|
83
|
-
const body = {
|
|
84
|
-
templates: request.templates.map(exports.toCreateCardPolicyTemplateRequestBody),
|
|
85
|
-
};
|
|
86
|
-
if (request.sourceChatSessionId != null) {
|
|
87
|
-
body.source_chat_session_id = request.sourceChatSessionId;
|
|
88
|
-
}
|
|
89
|
-
return body;
|
|
90
|
-
};
|
|
91
|
-
exports.toCreateCardPolicyTemplatesRequestBody = toCreateCardPolicyTemplatesRequestBody;
|
|
92
|
-
/**
|
|
93
|
-
* Map a single bulk-response error payload to its camelCased view shape.
|
|
94
|
-
* Defensive against missing optional fields (see `BulkCreateCardPolicyTemplateErrorPayload`
|
|
95
|
-
* docstring — the BE contract isn't fully locked yet).
|
|
96
|
-
*/
|
|
97
|
-
const toBulkCreateCardPolicyTemplateError = (payload) => ({
|
|
98
|
-
message: payload.message,
|
|
99
|
-
code: payload.code,
|
|
100
|
-
index: payload.index,
|
|
101
|
-
name: payload.name,
|
|
102
|
-
});
|
|
103
|
-
exports.toBulkCreateCardPolicyTemplateError = toBulkCreateCardPolicyTemplateError;
|
|
104
|
-
// Update body uses the exact same wire shape as create — the PUT
|
|
105
|
-
// endpoint is a full replace and was not affected by the bulk migration.
|
|
106
|
-
exports.toUpdateCardPolicyTemplateRequestBody = exports.toCreateCardPolicyTemplateRequestBody;
|
|
107
|
-
/**
|
|
108
|
-
* Seed an edit-form draft (`CreateCardPolicyTemplateRequest`) from an
|
|
109
|
-
* existing camelCased `CardPolicyTemplate`. Used by the detail-fetch
|
|
110
|
-
* epic so the edit page can render with the saved values pre-populated.
|
|
111
|
-
*/
|
|
112
|
-
const toCardPolicyEditFormDraft = (template) => ({
|
|
113
|
-
allowedEntity: {
|
|
114
|
-
categoryCodes: [...template.allowedEntity.categoryCodes],
|
|
115
|
-
merchantNames: [...template.allowedEntity.merchantNames],
|
|
116
|
-
},
|
|
117
|
-
applyToCards: [...template.appliedCards],
|
|
118
|
-
blockedEntity: {
|
|
119
|
-
categoryCodes: [...template.blockedEntity.categoryCodes],
|
|
120
|
-
merchantNames: [...template.blockedEntity.merchantNames],
|
|
121
|
-
},
|
|
122
|
-
description: template.description,
|
|
123
|
-
mode: template.mode,
|
|
124
|
-
name: template.name,
|
|
125
|
-
requiredReceiptThreshold: template.requiredReceiptThreshold,
|
|
126
|
-
spendLimits: { transaction: template.spendLimits.transaction },
|
|
127
|
-
});
|
|
128
|
-
exports.toCardPolicyEditFormDraft = toCardPolicyEditFormDraft;
|
|
129
|
-
const toExtractedCardPolicyRules = (payload) => ({
|
|
130
|
-
allowedEntity: {
|
|
131
|
-
categoryCodes: payload.allowed_entity?.category_codes ?? [],
|
|
132
|
-
merchantNames: payload.allowed_entity?.merchant_names ?? [],
|
|
133
|
-
},
|
|
134
|
-
blockedEntity: {
|
|
135
|
-
categoryCodes: payload.blocked_entity?.category_codes ?? [],
|
|
136
|
-
merchantNames: payload.blocked_entity?.merchant_names ?? [],
|
|
137
|
-
},
|
|
138
|
-
confidenceScore: payload.confidence_score,
|
|
139
|
-
policyName: payload.policy_name,
|
|
140
|
-
requiredReceiptThreshold: payload.required_receipt_threshold,
|
|
141
|
-
transactionLimit: payload.transaction_limit,
|
|
142
|
-
});
|
|
143
|
-
exports.toExtractedCardPolicyRules = toExtractedCardPolicyRules;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ZeniAPIStatus } from '../../responsePayload';
|
|
2
|
-
import { CardPolicyMccCategoriesPayload, CardPolicyTemplatePayload, CardPolicyVendorSearchData, ExtractedCardPolicyRulesPayload } from './cardPolicyPayload';
|
|
3
|
-
import { CardPolicyState, CardPolicyStats, CardPolicyTemplate, ExtractedCardPolicyRules } from './cardPolicyState';
|
|
4
|
-
export declare const initialState: CardPolicyState;
|
|
5
|
-
export declare const fetchCardPolicyMccCategories: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"cardPolicy/fetchCardPolicyMccCategories">, fetchCardPolicyVendorOptions: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[searchString?: string | undefined], {
|
|
6
|
-
searchString: string;
|
|
7
|
-
}, "cardPolicy/fetchCardPolicyVendorOptions", never, never>, updateCardPolicyMccCategories: import("@reduxjs/toolkit").ActionCreatorWithPayload<CardPolicyMccCategoriesPayload, "cardPolicy/updateCardPolicyMccCategories">, updateCardPolicyMccCategoriesFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "cardPolicy/updateCardPolicyMccCategoriesFailure">, updateCardPolicyVendorOptions: import("@reduxjs/toolkit").ActionCreatorWithPayload<CardPolicyVendorSearchData, "cardPolicy/updateCardPolicyVendorOptions">, updateCardPolicyVendorOptionsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "cardPolicy/updateCardPolicyVendorOptionsFailure">, updateCreatedCardPolicyTemplate: import("@reduxjs/toolkit").ActionCreatorWithPayload<CardPolicyTemplatePayload, "cardPolicy/updateCreatedCardPolicyTemplate">, updateCardPolicyTemplates: import("@reduxjs/toolkit").ActionCreatorWithPayload<CardPolicyTemplate[], "cardPolicy/updateCardPolicyTemplates">, removeCardPolicyTemplate: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "cardPolicy/removeCardPolicyTemplate">, updateCardPolicyStats: import("@reduxjs/toolkit").ActionCreatorWithPayload<CardPolicyStats, "cardPolicy/updateCardPolicyStats">, extractPolicyDocument: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[files: File[], aiCfoAnswerId?: string | undefined, aiCfoChatSessionId?: string | undefined], {
|
|
8
|
-
files: File[];
|
|
9
|
-
aiCfoAnswerId: string | undefined;
|
|
10
|
-
aiCfoChatSessionId: string | undefined;
|
|
11
|
-
}, "cardPolicy/extractPolicyDocument", never, {
|
|
12
|
-
uploadedFileName: string;
|
|
13
|
-
}>, updatePolicyDocumentExtractionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<ExtractedCardPolicyRulesPayload, "cardPolicy/updatePolicyDocumentExtractionSuccess">, updatePolicyDocumentExtractionFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "cardPolicy/updatePolicyDocumentExtractionFailure">, clearPolicyDocumentExtraction: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"cardPolicy/clearPolicyDocumentExtraction">, fetchCardPolicyRecommendationFromUpload: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[answerId: string, chatSessionId: string, extractedRules: ExtractedCardPolicyRules], {
|
|
14
|
-
answerId: string;
|
|
15
|
-
chatSessionId: string;
|
|
16
|
-
extractedRules: ExtractedCardPolicyRules;
|
|
17
|
-
}, "cardPolicy/fetchCardPolicyRecommendationFromUpload", never, never>, updatePolicyRecommendationFromUploadSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"cardPolicy/updatePolicyRecommendationFromUploadSuccess">, updatePolicyRecommendationFromUploadFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "cardPolicy/updatePolicyRecommendationFromUploadFailure">, clearCardPolicy: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"cardPolicy/clearCardPolicy">;
|
|
18
|
-
declare const _default: import("redux").Reducer<CardPolicyState>;
|
|
19
|
-
export default _default;
|