@zeniai/client-epic-state 5.0.96 → 5.0.97
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/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 +18 -1
- 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/jeSchedules/jeSchedulesPayload.d.ts +1 -0
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +7 -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/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +3 -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/epic.d.ts +24 -3
- package/lib/epic.js +24 -3
- package/lib/esm/commonStateTypes/amount.js +7 -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 +15 -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/jeSchedules/jeSchedulesPayload.js +7 -0
- package/lib/esm/entity/snackbar/snackbarTypes.js +3 -0
- package/lib/esm/entity/task/taskPayload.js +2 -0
- package/lib/esm/entity/tenant/clearAllEpic.js +12 -0
- package/lib/esm/epic.js +24 -3
- package/lib/esm/index.js +47 -12
- 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/fetchAllCockpitViewsEpic.js +2 -2
- package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesSelector.js +22 -2
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowPayload.js +29 -0
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowReducer.js +78 -0
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowSelector.js +47 -0
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowState.js +47 -0
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/epics/fetchCashManagementSettingsEpic.js +34 -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 +225 -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 +58 -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 +39 -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/index.d.ts +59 -15
- package/lib/index.js +213 -22
- 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 +10 -4
- 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/fetchAllCockpitViewsEpic.js +2 -2
- package/lib/view/companyView/types/cockpitTypes.d.ts +2 -1
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +1 -1
- 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 +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/cashManagement/autoSweepFlow/autoSweepFlowPayload.d.ts +47 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowPayload.js +34 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowReducer.d.ts +23 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowReducer.js +82 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowSelector.d.ts +40 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowSelector.js +51 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowState.d.ts +37 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowState.js +53 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/fetchCashManagementSettingsEpic.d.ts +14 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/fetchCashManagementSettingsEpic.js +38 -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 +230 -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 +62 -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 +8 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyTemplateEpic.js +43 -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/taskManager/taskListView/taskListReducer.d.ts +1 -1
- package/lib/view/transactionDetail/journalEntryLinesViewModel.d.ts +1 -1
- package/lib/zeniAPI.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { updateCompanies } from '../../../entity/company/companyReducer';
|
|
4
|
+
import { updateAllUsers } from '../../../entity/user/userReducer';
|
|
5
|
+
import { updateAllUserGroups } from '../../../entity/userGroups/userGroupsReducer';
|
|
6
|
+
import { RootState } from '../../../reducer';
|
|
7
|
+
import { ZeniAPI } from '../../../zeniAPI';
|
|
8
|
+
import { fetchCockpitContext, updateCockpitContextOnFailure, updateCockpitContextOnSuccess } from '../companyTaskManagerViewReducer';
|
|
9
|
+
export type ActionType = ReturnType<typeof fetchCockpitContext> | ReturnType<typeof updateCockpitContextOnSuccess> | ReturnType<typeof updateCockpitContextOnFailure> | ReturnType<typeof updateCompanies> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateAllUserGroups>;
|
|
10
|
+
export declare const fetchCockpitContextEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchCockpitContextEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const companyReducer_1 = require("../../../entity/company/companyReducer");
|
|
7
|
+
const userReducer_1 = require("../../../entity/user/userReducer");
|
|
8
|
+
const userGroupsReducer_1 = require("../../../entity/userGroups/userGroupsReducer");
|
|
9
|
+
const responsePayload_1 = require("../../../responsePayload");
|
|
10
|
+
const companyTaskManagerViewReducer_1 = require("../companyTaskManagerViewReducer");
|
|
11
|
+
const fetchCockpitContextEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(companyTaskManagerViewReducer_1.fetchCockpitContext.match), (0, operators_1.switchMap)(() => zeniAPI
|
|
12
|
+
.getJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/cockpit-panels/cockpit-context`)
|
|
13
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
14
|
+
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
15
|
+
const companies = response.data?.companies ?? [];
|
|
16
|
+
const users = response.data?.users ?? [];
|
|
17
|
+
const userGroups = response.data?.user_groups ?? [];
|
|
18
|
+
const companyIds = companies.map((company) => company.company_id);
|
|
19
|
+
const userIds = users.map((user) => user.user_id);
|
|
20
|
+
const userGroupIds = userGroups.map((userGroup) => userGroup.id);
|
|
21
|
+
const actions = [
|
|
22
|
+
(0, companyReducer_1.updateCompanies)({
|
|
23
|
+
payload: response.data.companies,
|
|
24
|
+
schema: {},
|
|
25
|
+
}),
|
|
26
|
+
(0, userReducer_1.updateAllUsers)({ users: response.data.users }),
|
|
27
|
+
(0, userGroupsReducer_1.updateAllUserGroups)({
|
|
28
|
+
userGroups: response.data.user_groups,
|
|
29
|
+
}),
|
|
30
|
+
(0, companyTaskManagerViewReducer_1.updateCockpitContextOnSuccess)({
|
|
31
|
+
companyIds,
|
|
32
|
+
userIds,
|
|
33
|
+
userGroupIds,
|
|
34
|
+
}),
|
|
35
|
+
];
|
|
36
|
+
return (0, rxjs_1.from)(actions);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
return (0, rxjs_1.of)((0, companyTaskManagerViewReducer_1.updateCockpitContextOnFailure)(response.status));
|
|
40
|
+
}
|
|
41
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, companyTaskManagerViewReducer_1.updateCockpitContextOnFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'Cockpit context fetch errored out' + JSON.stringify(error))))))));
|
|
42
|
+
exports.fetchCockpitContextEpic = fetchCockpitContextEpic;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
-
import { updateCompanies } from '../../../entity/company/companyReducer';
|
|
4
3
|
import { updateTags } from '../../../entity/tag/tagReducer';
|
|
5
4
|
import { updateTasks } from '../../../entity/task/taskReducer';
|
|
6
|
-
import { updateAllUsers } from '../../../entity/user/userReducer';
|
|
7
5
|
import { RootState } from '../../../reducer';
|
|
8
6
|
import { ZeniAPI } from '../../../zeniAPI';
|
|
9
7
|
import { fetchCompanyTaskManagerView, updateCompanyTaskManagerViewOnFailure, updateCompanyTaskManagerViewOnSuccess } from '../companyTaskManagerViewReducer';
|
|
10
|
-
export type ActionType = ReturnType<typeof fetchCompanyTaskManagerView> | ReturnType<typeof updateCompanyTaskManagerViewOnSuccess> | ReturnType<typeof updateTasks> | ReturnType<typeof
|
|
8
|
+
export type ActionType = ReturnType<typeof fetchCompanyTaskManagerView> | ReturnType<typeof updateCompanyTaskManagerViewOnSuccess> | ReturnType<typeof updateTasks> | ReturnType<typeof updateTags> | ReturnType<typeof updateCompanyTaskManagerViewOnFailure>;
|
|
11
9
|
export declare const fetchCompanyTaskManagerViewEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -4,51 +4,35 @@ exports.fetchCompanyTaskManagerViewEpic = void 0;
|
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
6
|
const sortOrderPayload_1 = require("../../../commonPayloadTypes/sortOrderPayload");
|
|
7
|
-
const companyReducer_1 = require("../../../entity/company/companyReducer");
|
|
8
7
|
const tagReducer_1 = require("../../../entity/tag/tagReducer");
|
|
9
8
|
const taskReducer_1 = require("../../../entity/task/taskReducer");
|
|
10
|
-
const userReducer_1 = require("../../../entity/user/userReducer");
|
|
11
9
|
const responsePayload_1 = require("../../../responsePayload");
|
|
12
10
|
const companyTaskManagerViewReducer_1 = require("../companyTaskManagerViewReducer");
|
|
13
|
-
const
|
|
14
|
-
switch (sortKey) {
|
|
15
|
-
case 'taskName':
|
|
16
|
-
return 'name';
|
|
17
|
-
case 'dueDate':
|
|
18
|
-
return 'due_date';
|
|
19
|
-
case 'createdBy':
|
|
20
|
-
return 'created_by';
|
|
21
|
-
case 'name':
|
|
22
|
-
return 'company_name';
|
|
23
|
-
default:
|
|
24
|
-
return sortKey;
|
|
25
|
-
}
|
|
26
|
-
};
|
|
11
|
+
const DEFAULT_PAGE_SIZE = 100;
|
|
27
12
|
const fetchCompanyTaskManagerViewEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(companyTaskManagerViewReducer_1.fetchCompanyTaskManagerView.match), (0, operators_1.switchMap)((action) => {
|
|
28
|
-
const {
|
|
13
|
+
const { from: fromOffset, searchString, sortKey, sortOrder, filters, } = action.payload;
|
|
29
14
|
const queryValue = {
|
|
30
|
-
|
|
15
|
+
size: DEFAULT_PAGE_SIZE,
|
|
16
|
+
from: fromOffset,
|
|
17
|
+
global_search: searchString ?? '',
|
|
31
18
|
sort_by: toSortKeyPayload(sortKey),
|
|
32
19
|
sort_order: (0, sortOrderPayload_1.getSortOrder)(sortOrder),
|
|
33
|
-
|
|
34
|
-
|
|
20
|
+
filter_join: filters?.categoryCombinationOperator === 'AND' ? 'and' : 'or',
|
|
21
|
+
...(filters?.categories != null && filters.categories.length > 0
|
|
22
|
+
? { filter_by: toFilterByPayload(filters) }
|
|
23
|
+
: {}),
|
|
35
24
|
};
|
|
36
25
|
return zeniAPI
|
|
37
|
-
.getJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/cockpit-panels/tasks?query=${encodeURIComponent(JSON.stringify(queryValue))}`)
|
|
26
|
+
.getJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/cockpit-panels/tasks-es?query=${encodeURIComponent(JSON.stringify(queryValue))}`)
|
|
38
27
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
39
28
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
40
|
-
const tasksList = response.data.tasks;
|
|
29
|
+
const tasksList = response.data.aggregations.group_by_company_name.buckets.flatMap((bucket) => bucket.tasks);
|
|
41
30
|
const actions = [
|
|
42
31
|
(0, companyTaskManagerViewReducer_1.updateCompanyTaskManagerViewOnSuccess)({
|
|
43
32
|
data: response.data,
|
|
44
33
|
}),
|
|
45
34
|
(0, taskReducer_1.updateTasks)(tasksList),
|
|
46
|
-
(0,
|
|
47
|
-
payload: response.data.companies,
|
|
48
|
-
schema: {},
|
|
49
|
-
}),
|
|
50
|
-
(0, tagReducer_1.updateTags)(tasksList.map((task) => task.tags).flat()),
|
|
51
|
-
(0, userReducer_1.updateAllUsers)({ users: response.data.users }),
|
|
35
|
+
(0, tagReducer_1.updateTags)(tasksList.flatMap((task) => task.tags)),
|
|
52
36
|
];
|
|
53
37
|
return (0, rxjs_1.from)(actions);
|
|
54
38
|
}
|
|
@@ -66,3 +50,28 @@ const fetchCompanyTaskManagerViewEpic = (actions$, _state$, zeniAPI) => actions$
|
|
|
66
50
|
}));
|
|
67
51
|
}));
|
|
68
52
|
exports.fetchCompanyTaskManagerViewEpic = fetchCompanyTaskManagerViewEpic;
|
|
53
|
+
const toSortKeyPayload = (sortKey) => {
|
|
54
|
+
switch (sortKey) {
|
|
55
|
+
case 'taskName':
|
|
56
|
+
return 'name';
|
|
57
|
+
case 'dueDate':
|
|
58
|
+
return 'due_date';
|
|
59
|
+
case 'createdBy':
|
|
60
|
+
return 'created_by';
|
|
61
|
+
case 'name':
|
|
62
|
+
return 'company_name';
|
|
63
|
+
default:
|
|
64
|
+
return sortKey;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
const toFilterByPayload = (filters) => {
|
|
68
|
+
if (filters.categories == null) {
|
|
69
|
+
return [];
|
|
70
|
+
}
|
|
71
|
+
return filters.categories.map((category) => ({
|
|
72
|
+
field: category.field ?? '',
|
|
73
|
+
operator: category.matchingOperator === 'equal' ? 'is' : 'is_not',
|
|
74
|
+
values: category.values.map((v) => String(v)),
|
|
75
|
+
join: category.valuesCombinationOperator === 'ALL' ? 'and' : 'or',
|
|
76
|
+
}));
|
|
77
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RootState } from '../../../reducer';
|
|
4
|
+
import { fetchCompanyTaskManagerView, updateCompanyTaskManagerViewFilters } from '../companyTaskManagerViewReducer';
|
|
5
|
+
export type ActionType = ReturnType<typeof updateCompanyTaskManagerViewFilters> | ReturnType<typeof fetchCompanyTaskManagerView>;
|
|
6
|
+
export declare const updateCompanyTaskManagerViewFiltersEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateCompanyTaskManagerViewFiltersEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const companyTaskManagerViewReducer_1 = require("../companyTaskManagerViewReducer");
|
|
7
|
+
const updateCompanyTaskManagerViewFiltersEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(companyTaskManagerViewReducer_1.updateCompanyTaskManagerViewFilters.match), (0, operators_1.switchMap)((action) => {
|
|
8
|
+
const filters = action.payload.filters;
|
|
9
|
+
const allCategoriesValid = filters?.categories == null
|
|
10
|
+
? true
|
|
11
|
+
: filters?.categories?.every((category) => category.field != null &&
|
|
12
|
+
category.values != null &&
|
|
13
|
+
category.values.length > 0);
|
|
14
|
+
if (!allCategoriesValid) {
|
|
15
|
+
return rxjs_1.EMPTY;
|
|
16
|
+
}
|
|
17
|
+
const { uiState } = state$.value.companyTaskManagerViewState;
|
|
18
|
+
return (0, rxjs_1.of)((0, companyTaskManagerViewReducer_1.fetchCompanyTaskManagerView)(0, uiState.sortKey, uiState.sortOrder, false, uiState.filterText, filters));
|
|
19
|
+
}));
|
|
20
|
+
exports.updateCompanyTaskManagerViewFiltersEpic = updateCompanyTaskManagerViewFiltersEpic;
|
|
@@ -24,7 +24,7 @@ const fetchAllCockpitViewsEpic = (actions$, state$) => actions$.pipe((0, operato
|
|
|
24
24
|
(0, reviewCompanyViewReducer_1.fetchReviewCompanyView)(),
|
|
25
25
|
(0, companyHealthMetricViewReducer_1.fetchCompanyHealthMetricView)(),
|
|
26
26
|
(0, companyViewReducer_1.fetchCompanyMetaData)(),
|
|
27
|
-
(0, companyTaskManagerViewReducer_1.fetchCompanyTaskManagerView)(
|
|
27
|
+
(0, companyTaskManagerViewReducer_1.fetchCompanyTaskManagerView)(0, 'dueDate', 'descending', false),
|
|
28
28
|
(0, companyHealthMetricConfigReducer_1.fetchCompanyHealthMetricConfig)(),
|
|
29
29
|
]);
|
|
30
30
|
}
|
|
@@ -77,7 +77,7 @@ const fetchAllCockpitViewsEpic = (actions$, state$) => actions$.pipe((0, operato
|
|
|
77
77
|
}
|
|
78
78
|
if (state.companyTaskManagerViewState.fetchState !== 'In-Progress' &&
|
|
79
79
|
state.companyTaskManagerViewState.hasValidState() === false) {
|
|
80
|
-
fetchActions.push((0, companyTaskManagerViewReducer_1.fetchCompanyTaskManagerView)(
|
|
80
|
+
fetchActions.push((0, companyTaskManagerViewReducer_1.fetchCompanyTaskManagerView)(0, 'dueDate', 'descending', false));
|
|
81
81
|
}
|
|
82
82
|
return (0, rxjs_1.from)(fetchActions);
|
|
83
83
|
}
|
|
@@ -18,11 +18,12 @@ export type ManagementViewFilterCategoryField = 'controllerUserIds' | 'customerS
|
|
|
18
18
|
export type SubscriptionViewFilterCategoryField = 'controllerUserIds' | 'statusCode' | 'recommendedActionCode' | 'subscriptionPlans' | 'subscriptionAddOns' | 'avg2MonthExpenses' | 'slabLowerLimit' | 'slabUpperLimit' | 'monthlyRecurringRevenue';
|
|
19
19
|
export type PortfolioViewFilterCategoryField = 'netBurnOrIncome' | 'cashPosition' | 'income' | 'expenses' | 'runway';
|
|
20
20
|
export type HealthMonitorViewFilterCategoryField = 'verticalProductServices' | 'runway' | 'netPromoterScore' | 'customerSatisfactionScore' | 'churnProbabilityPercentage' | 'controller' | 'customerSuccessManager' | 'lastReportSent' | 'subscriptionStartDate' | 'subscriptionRenewalDate' | 'externalProductServiceExposure' | 'companyEngagementMetricsUpdatedAt' | 'companyGroupId' | 'monthlyRecurringRevenue';
|
|
21
|
+
export type TaskManagerViewFilterCategoryField = 'assignees' | 'creationDate' | 'dueDate' | 'priority' | 'status' | 'company_id' | 'tag';
|
|
21
22
|
export interface CockpitFilterCategory {
|
|
22
23
|
matchingOperator: 'equal' | 'not_equal';
|
|
23
24
|
values: FilterCategoryValueType[];
|
|
24
25
|
valuesCombinationOperator: 'ANY' | 'ALL';
|
|
25
|
-
field?: AiAccountantFilterCategoryField | ManagementViewFilterCategoryField | SubscriptionViewFilterCategoryField | PortfolioViewFilterCategoryField | HealthMonitorViewFilterCategoryField;
|
|
26
|
+
field?: AiAccountantFilterCategoryField | ManagementViewFilterCategoryField | SubscriptionViewFilterCategoryField | PortfolioViewFilterCategoryField | HealthMonitorViewFilterCategoryField | TaskManagerViewFilterCategoryField;
|
|
26
27
|
}
|
|
27
28
|
export interface CockpitFilters {
|
|
28
29
|
categories?: CockpitFilterCategory[];
|
package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ export declare const getLineItemsByTransactionsIdsFromResponse: (transactions: S
|
|
|
39
39
|
export declare const getLineItemsByTransactionIdsFromLocalData: (transactionLocalData: TransactionReviewLocalDataSelectorView[], selectedTab: TransactionsTab) => Record<ID, string[]>;
|
|
40
40
|
export declare const mergeTabSpecificLineItems: (currentTabSpecificLineItems: TabSpecificLineItems, selectedTab: TransactionsTab, newLineItems: TabSpecificLineItems) => TabSpecificLineItems;
|
|
41
41
|
export declare const getSnackbarMessageForTransactionReview: (updatedCount: number, failedCount: number, categorizedCount: number) => {
|
|
42
|
-
messageSection: "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "je_bill_link" | "je_posted" | "audit_score_updated" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "reimbursement_bulk_submit" | "reimbursement_bulk_processed" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "bill_pay_bulk_submit" | "bill_pay_bulk_processed" | "bill_pay_refund" | "bill_pay_retry" | "bill_pay_marked_as_paid" | "zeni_account_accept_term" | "update_vendor" | "data_refresh_update" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "save_vendor_marked_as_employee" | "save_vendor_marked_as_local_contractor" | "charge_card_setup" | "charge_card_accept_term" | "charge_card_receipt_upload" | "charge_card_resend_invite" | "charge_card_revoke_invite" | "charge_card_update_limit" | "charge_cards_update_limit" | "close_charge_card" | "lock_charge_card" | "lock_charge_card_card_user" | "lock_charge_cards" | "unlock_charge_card" | "unlock_charge_card_card_user" | "unlock_charge_cards" | "close_charge_cards" | "revoke_invite_charge_cards" | "charge_card_express_interest" | "create_schedule" | "save_schedule" | "delete_schedule" | "ignore_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "snooze_task" | "unsnooze_task" | "create_tag" | "delete_tag" | "update_charge_card" | "update_charge_card_name" | "update_charge_card_name_card_user" | "issue_charge_card" | "issue_charge_cards" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "cancel_journal_entry" | "settings_accounting_accounts_updated" | "create_card_setup" | "confirm_card_setup" | "add_card_payment_source" | "fetch_payment_sources" | "task_assigned_toast_notification" | "task_due_tomorrow_toast_notification" | "task_deleted_toast_notification" | "task_archived_toast_notification" | "task_overdue_toast_notification" | "task_overdue_toast_notification_creator" | "task_notification_count" | "task_activities_toast_notification" | "task_created_toast_notification" | "task_group_creation_success" | "task_group_deletion_success" | "task_group_update_success" | "primary_funding_account_updated" | "task_time_spent_validation" | "missing_receipts_attachment" | "flux_analysis_unreviewed" | "flux_analysis_reviewed" | "receipt_match" | "receipts_upload" | "receipts_bulk_match" | "billing_address_view" | "express_pay_submit" | "exclude_transaction" | "reconcile" | "save_reconcile_for_later" | "recon_transaction_categorize" | "recon_transaction_match" | "update_debit_card_pin_attempt" | "set_debit_card_pin" | "ai_cfo_create_session_and_submit" | "ai_cfo_chat_session_deleted" | "charge_card_auto_pay_enable" | "charge_card_auto_pay_disable" | "treasury_setup" | "treasury_accept_term" | "treasury_transfer_money" | "treasury_transfer_money_failed" | "auto_transfer_rule_create" | "auto_transfer_rule_update" | "auto_transfer_rule_delete" | "auto_transfer_rule_pause" | "auto_transfer_rule_resume" | "treasury_update_portfolio_allocation" | "send_email_magic_link_to_user" | "complete_profile_done" | "create_transfer_entry" | "reports_resync" | "invalid_phone_number" | "transactions_categorized_updated_failed" | "transaction_categorized_updated_failed" | "transactionsCategorized_transactionsUpdated" | "transactionsCategorized_transactionUpdated" | "transactionCategorized_transactionsUpdated" | "transactionCategorized_transactionUpdated" | "transactionsCategorized_transactionsFailed" | "transactionsCategorized_transactionFailed" | "transactionCategorized_transactionsFailed" | "transactionCategorized_transactionFailed" | "transactionsUpdated_transactionsFailed" | "transactionsUpdated_transactionFailed" | "transactionUpdated_transactionsFailed" | "transactionUpdated_transactionFailed" | "transactionsCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionsUpdated_transactionFailed" | "transactionsCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionUpdated_transactionFailed" | "transactionCategorized_transactionsUpdated_transactionFailed" | "transactionCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionUpdated_transactionFailed" | "accounting_classes_enabled_update" | "capitalization_threshold_update" | "account_excluded_from_reconciliation" | "account_included_in_reconciliation" | "ai_accountant_trigger_job" | "oauth_consent_approve" | "oauth_consent_invalid_request" | "credit_agent_update_profile" | "credit_agent_save_macro" | "credit_agent_schedule_cron";
|
|
42
|
+
messageSection: "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "je_bill_link" | "je_posted" | "audit_score_updated" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "reimbursement_bulk_submit" | "reimbursement_bulk_processed" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "bill_pay_bulk_submit" | "bill_pay_bulk_processed" | "bill_pay_refund" | "bill_pay_retry" | "bill_pay_marked_as_paid" | "zeni_account_accept_term" | "update_vendor" | "data_refresh_update" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "save_vendor_marked_as_employee" | "save_vendor_marked_as_local_contractor" | "charge_card_setup" | "charge_card_accept_term" | "charge_card_receipt_upload" | "charge_card_resend_invite" | "charge_card_revoke_invite" | "card_policy_created" | "card_policy_updated" | "card_policy_deleted" | "charge_card_update_limit" | "charge_cards_update_limit" | "close_charge_card" | "lock_charge_card" | "lock_charge_card_card_user" | "lock_charge_cards" | "unlock_charge_card" | "unlock_charge_card_card_user" | "unlock_charge_cards" | "close_charge_cards" | "revoke_invite_charge_cards" | "charge_card_express_interest" | "create_schedule" | "save_schedule" | "delete_schedule" | "ignore_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "snooze_task" | "unsnooze_task" | "create_tag" | "delete_tag" | "update_charge_card" | "update_charge_card_name" | "update_charge_card_name_card_user" | "issue_charge_card" | "issue_charge_cards" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "cancel_journal_entry" | "settings_accounting_accounts_updated" | "create_card_setup" | "confirm_card_setup" | "add_card_payment_source" | "fetch_payment_sources" | "task_assigned_toast_notification" | "task_due_tomorrow_toast_notification" | "task_deleted_toast_notification" | "task_archived_toast_notification" | "task_overdue_toast_notification" | "task_overdue_toast_notification_creator" | "task_notification_count" | "task_activities_toast_notification" | "task_created_toast_notification" | "task_group_creation_success" | "task_group_deletion_success" | "task_group_update_success" | "primary_funding_account_updated" | "task_time_spent_validation" | "missing_receipts_attachment" | "flux_analysis_unreviewed" | "flux_analysis_reviewed" | "receipt_match" | "receipts_upload" | "receipts_bulk_match" | "billing_address_view" | "express_pay_submit" | "exclude_transaction" | "reconcile" | "save_reconcile_for_later" | "recon_transaction_categorize" | "recon_transaction_match" | "update_debit_card_pin_attempt" | "set_debit_card_pin" | "ai_cfo_create_session_and_submit" | "ai_cfo_chat_session_deleted" | "charge_card_auto_pay_enable" | "charge_card_auto_pay_disable" | "treasury_setup" | "treasury_accept_term" | "treasury_transfer_money" | "treasury_transfer_money_failed" | "auto_transfer_rule_create" | "auto_transfer_rule_update" | "auto_transfer_rule_delete" | "auto_transfer_rule_pause" | "auto_transfer_rule_resume" | "treasury_update_portfolio_allocation" | "send_email_magic_link_to_user" | "complete_profile_done" | "create_transfer_entry" | "reports_resync" | "invalid_phone_number" | "transactions_categorized_updated_failed" | "transaction_categorized_updated_failed" | "transactionsCategorized_transactionsUpdated" | "transactionsCategorized_transactionUpdated" | "transactionCategorized_transactionsUpdated" | "transactionCategorized_transactionUpdated" | "transactionsCategorized_transactionsFailed" | "transactionsCategorized_transactionFailed" | "transactionCategorized_transactionsFailed" | "transactionCategorized_transactionFailed" | "transactionsUpdated_transactionsFailed" | "transactionsUpdated_transactionFailed" | "transactionUpdated_transactionsFailed" | "transactionUpdated_transactionFailed" | "transactionsCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionsUpdated_transactionFailed" | "transactionsCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionUpdated_transactionFailed" | "transactionCategorized_transactionsUpdated_transactionFailed" | "transactionCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionUpdated_transactionFailed" | "accounting_classes_enabled_update" | "capitalization_threshold_update" | "account_excluded_from_reconciliation" | "account_included_in_reconciliation" | "ai_accountant_trigger_job" | "oauth_consent_approve" | "oauth_consent_invalid_request" | "credit_agent_update_profile" | "credit_agent_save_macro" | "credit_agent_schedule_cron";
|
|
43
43
|
messageText: "notification" | "failed" | "success";
|
|
44
44
|
type: "error" | "success" | "info";
|
|
45
45
|
variables: {
|
|
@@ -20,7 +20,7 @@ export interface SaveReconciliationDetailFailurePayload {
|
|
|
20
20
|
error: ZeniAPIStatus;
|
|
21
21
|
fetchStateByAction: SaveReconcileDetailActionPayload;
|
|
22
22
|
}
|
|
23
|
-
export declare const toReconciliationTabsType: (v: string) => "
|
|
23
|
+
export declare const toReconciliationTabsType: (v: string) => "review" | "reconcile";
|
|
24
24
|
export declare type ReconciliationViewTabType = ReturnType<typeof toReconciliationTabsType>;
|
|
25
25
|
declare const toReconReconcileSortKeysType: (v: string) => "date" | "amount" | "type" | "account" | "memo" | "clearedDate" | "payee" | "transactionDirection" | "recommended";
|
|
26
26
|
export declare type ReconReconcileSortKey = ReturnType<typeof toReconReconcileSortKeysType>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const toPeopleSortKeyType: (v: string) => "
|
|
1
|
+
declare const toPeopleSortKeyType: (v: string) => "department" | "name" | "role" | "manager" | "lastSeen";
|
|
2
2
|
export type PeopleViewSortKey = ReturnType<typeof toPeopleSortKeyType>;
|
|
3
3
|
export {};
|
|
@@ -7,7 +7,7 @@ export declare const getScheduleListKey: (selectedCategory: ID, selectedTimefram
|
|
|
7
7
|
export type ScheduleListKey = ReturnType<typeof getScheduleListKey>;
|
|
8
8
|
export declare const toScheduleSubTabType: (v: string) => "completed" | "new" | "ongoing" | "all";
|
|
9
9
|
export type ScheduleSubTabType = ReturnType<typeof toScheduleSubTabType>;
|
|
10
|
-
declare const toScheduleSortKeyType: (v: string) => "months" | "amount" | "vendor" | "status" | "
|
|
10
|
+
declare const toScheduleSortKeyType: (v: string) => "months" | "amount" | "vendor" | "status" | "class" | "user" | "createTime" | "memo" | "balanceAsOfToday" | "transactionDate" | "transactionType" | "assetId" | "scheduleCategory" | "startMonth" | "accruedExpenseCategory" | "expenseCategory" | "accumulatedDepreciationCategory" | "endMonth";
|
|
11
11
|
export declare type ScheduleListSortKey = ReturnType<typeof toScheduleSortKeyType>;
|
|
12
12
|
export interface DownloadJEScheduleTabOptions {
|
|
13
13
|
categoryId: ID;
|
|
@@ -6,7 +6,7 @@ import { FundingAccount } from '../commonSetup/setupViewSelector';
|
|
|
6
6
|
import { TreasuryAccount } from '../treasury/treasuryTransferMoney/treasuryTransferMoneyState';
|
|
7
7
|
import { ReviewTransferDetail } from '../zeniAccounts/transferDetail/transferDetailState';
|
|
8
8
|
import { AutoTransferRuleLocalData } from './autoTransferRulesPayload';
|
|
9
|
-
import { AutoTransferRule } from './autoTransferRulesState';
|
|
9
|
+
import { AutoTransferRule, CashManagementRule } from './autoTransferRulesState';
|
|
10
10
|
export interface AutoTransferRulesSelectorView extends SelectorView {
|
|
11
11
|
autoTransferReviewDetail: ReviewTransferDetail;
|
|
12
12
|
createRuleFetchState: FetchStateAndError;
|
|
@@ -17,6 +17,13 @@ export interface AutoTransferRulesSelectorView extends SelectorView {
|
|
|
17
17
|
transferMoneyParties: FundingAccount[];
|
|
18
18
|
transferMoneyPartiesFetchState: FetchState;
|
|
19
19
|
treasuryAccount: TreasuryAccount;
|
|
20
|
+
/**
|
|
21
|
+
* The user's saved auto-sweep cash-management config, surfaced here so the
|
|
22
|
+
* rules list page can render it alongside the auto-transfer rules.
|
|
23
|
+
* `undefined` when the user hasn't saved auto-sweep settings yet
|
|
24
|
+
* (i.e. `autoSweepFlowState.settingsId == null`).
|
|
25
|
+
*/
|
|
26
|
+
cashManagementRule?: CashManagementRule;
|
|
20
27
|
ruleHistory?: Record<string, CommonHistoryView>;
|
|
21
28
|
}
|
|
22
29
|
export declare const getAutoTransferRules: (state: RootState) => AutoTransferRulesSelectorView;
|
|
@@ -6,11 +6,30 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.getAutoTransferRuleHistory = exports.getAutoTransferRuleById = exports.getAutoTransferRules = void 0;
|
|
7
7
|
const get_1 = __importDefault(require("lodash/get"));
|
|
8
8
|
const reduceFetchState_1 = require("../../../commonStateTypes/reduceFetchState");
|
|
9
|
+
const depositAccountSelector_1 = require("../../../entity/depositAccount/depositAccountSelector");
|
|
9
10
|
const setupViewSelector_1 = require("../commonSetup/setupViewSelector");
|
|
10
11
|
const depositAccountListSelector_1 = require("../zeniAccounts/depositAccountList/depositAccountListSelector");
|
|
11
12
|
const paymentAccountListSelector_1 = require("../zeniAccounts/paymentAccountList/paymentAccountListSelector");
|
|
13
|
+
const buildCashManagementRule = (autoSweepFlowState, depositAccountState, treasuryDetailState) => {
|
|
14
|
+
const { settingsId, bufferAmount, frequency, memo, primaryFundingAccountId, nextTransferDate } = autoSweepFlowState;
|
|
15
|
+
if (settingsId == null || primaryFundingAccountId == null) {
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
const depositAccount = (0, depositAccountSelector_1.getDepositAccountByDepositAccountId)(depositAccountState, primaryFundingAccountId);
|
|
19
|
+
return {
|
|
20
|
+
bufferAmount,
|
|
21
|
+
frequency,
|
|
22
|
+
memo,
|
|
23
|
+
settingsId,
|
|
24
|
+
primaryFundingAccount: depositAccount != null
|
|
25
|
+
? (0, setupViewSelector_1.mapDepositAccToFundingAccount)(depositAccount)
|
|
26
|
+
: undefined,
|
|
27
|
+
treasurySummary: treasuryDetailState.accountSummary,
|
|
28
|
+
nextTransferDate,
|
|
29
|
+
};
|
|
30
|
+
};
|
|
12
31
|
const getAutoTransferRules = (state) => {
|
|
13
|
-
const { autotransferRulesState, depositAccountState, paymentAccountState, depositAccountListState, paymentAccountListState, treasuryDetailState, } = state;
|
|
32
|
+
const { autotransferRulesState, autoSweepFlowState, depositAccountState, paymentAccountState, depositAccountListState, paymentAccountListState, treasuryDetailState, } = state;
|
|
14
33
|
const { rules, error, historyByRuleId, ruleUpdateLocalData, ruleUpdateStatusById, ruleDeleteStatusById, createRuleFetchState, autoTransferReviewDetail, } = autotransferRulesState;
|
|
15
34
|
const depositAccountsView = (0, depositAccountListSelector_1.getAllDepositAccounts)(depositAccountState, depositAccountListState);
|
|
16
35
|
const paymentAccountsView = (0, paymentAccountListSelector_1.getAllPaymentAccounts)(paymentAccountState, paymentAccountListState);
|
|
@@ -45,6 +64,7 @@ const getAutoTransferRules = (state) => {
|
|
|
45
64
|
transferMoneyParties,
|
|
46
65
|
transferMoneyPartiesFetchState,
|
|
47
66
|
createRuleFetchState,
|
|
67
|
+
cashManagementRule: buildCashManagementRule(autoSweepFlowState, depositAccountState, treasuryDetailState),
|
|
48
68
|
fetchState,
|
|
49
69
|
error,
|
|
50
70
|
version: 0,
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
import { Amount } from '../../../commonStateTypes/amount';
|
|
1
2
|
import { FetchStateAndError, FetchedState, ID } from '../../../commonStateTypes/common';
|
|
2
3
|
import { ZeniDate } from '../../../zeniDayJS';
|
|
4
|
+
import { AutoSweepFrequency } from '../cashManagement/autoSweepFlow/autoSweepFlowState';
|
|
5
|
+
import { FundingAccount } from '../commonSetup/setupViewSelector';
|
|
3
6
|
import { CommonHistoryView } from '../commonHistoryView/commonHistory';
|
|
7
|
+
import { TreasurySummaryWithBalance } from '../treasury/treasuryList/treasuryDetailState';
|
|
4
8
|
import { ReviewTransferDetail } from '../zeniAccounts/transferDetail/transferDetailState';
|
|
5
9
|
import { AutoTransferRuleFrequency, AutoTransferRuleLocalData, AutoTransferRuleType } from './autoTransferRulesPayload';
|
|
6
10
|
export interface AutoTransferRule {
|
|
@@ -27,6 +31,24 @@ export interface DestinationBankAccountMetadata {
|
|
|
27
31
|
accountType: string;
|
|
28
32
|
percentage: number;
|
|
29
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Render-ready view of the user's auto-sweep cash-management config,
|
|
36
|
+
* surfaced alongside `AutoTransferRule[]` in `AutoTransferRulesSelectorView`.
|
|
37
|
+
* Kept as a distinct shape (not folded into `AutoTransferRule`) so the rules
|
|
38
|
+
* list can special-case its rendering without polluting the rule type union.
|
|
39
|
+
*
|
|
40
|
+
* Present only when `autoSweepFlowState.settingsId` is set — i.e. the user
|
|
41
|
+
* has saved their auto-sweep settings at least once.
|
|
42
|
+
*/
|
|
43
|
+
export interface CashManagementRule {
|
|
44
|
+
bufferAmount: Amount;
|
|
45
|
+
frequency: AutoSweepFrequency;
|
|
46
|
+
memo: string;
|
|
47
|
+
settingsId: ID;
|
|
48
|
+
nextTransferDate?: ZeniDate;
|
|
49
|
+
primaryFundingAccount?: FundingAccount;
|
|
50
|
+
treasurySummary?: TreasurySummaryWithBalance;
|
|
51
|
+
}
|
|
30
52
|
export interface AutoTransferRulesState extends FetchedState {
|
|
31
53
|
autoTransferReviewDetail: ReviewTransferDetail;
|
|
32
54
|
createRuleFetchState: FetchStateAndError;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Amount } from '../../../../commonStateTypes/amount';
|
|
2
|
+
import { ID } from '../../../../commonStateTypes/common';
|
|
3
|
+
import { DepositAccountPayload } from '../../../../entity/depositAccount/depositAccountPayload';
|
|
4
|
+
import { ZeniAPIResponse } from '../../../../responsePayload';
|
|
5
|
+
import { ZeniDate } from '../../../../zeniDayJS';
|
|
6
|
+
import { AutoSweepFlowState, AutoSweepFrequency } from './autoSweepFlowState';
|
|
7
|
+
/**
|
|
8
|
+
* Body sent to `PUT /cash-management/settings`. Field names match the
|
|
9
|
+
* cash-management-agent contract; `minimum_buffer_usd` is a plain number
|
|
10
|
+
* (the slice tracks the canonical `Amount` value).
|
|
11
|
+
*/
|
|
12
|
+
export type SaveAutoSweepSettingsBody = {
|
|
13
|
+
frequency: string;
|
|
14
|
+
memo: string;
|
|
15
|
+
minimum_buffer_usd: number;
|
|
16
|
+
};
|
|
17
|
+
export type SaveAutoSweepSettingsResponse = ZeniAPIResponse<unknown>;
|
|
18
|
+
export declare const toSaveAutoSweepSettingsBody: (state: Pick<AutoSweepFlowState, "bufferAmount" | "frequency" | "memo">) => SaveAutoSweepSettingsBody;
|
|
19
|
+
/**
|
|
20
|
+
* `source_bank_account` on the cash-management settings response matches the
|
|
21
|
+
* shared `DepositAccountPayload` shape, so the fetch epic dispatches it into
|
|
22
|
+
* the deposit-account entity bucket and the auto-sweep slice only keeps the
|
|
23
|
+
* id. The selector hydrates the full `FundingAccount` on read.
|
|
24
|
+
*/
|
|
25
|
+
export interface CashManagementSettingsPayload {
|
|
26
|
+
cash_management_settings_id: string | null;
|
|
27
|
+
frequency: string;
|
|
28
|
+
minimum_buffer_usd: number;
|
|
29
|
+
next_transfer_date: string;
|
|
30
|
+
source_bank_account: DepositAccountPayload;
|
|
31
|
+
}
|
|
32
|
+
export type CashManagementSettingsResponse = ZeniAPIResponse<CashManagementSettingsPayload>;
|
|
33
|
+
/**
|
|
34
|
+
* Map a `GET /cash-management/settings` payload into the slice's writable
|
|
35
|
+
* fields. Defensive on the frequency (string-from-the-wire → union via
|
|
36
|
+
* `toAutoSweepFrequency`, falling back to `'weekly'` if the server returns
|
|
37
|
+
* something we don't model yet). Only the source account *id* is stored
|
|
38
|
+
* here — the full deposit-account payload is published to the entity bucket
|
|
39
|
+
* by the fetch epic.
|
|
40
|
+
*/
|
|
41
|
+
export declare const toAutoSweepFlowStatePatch: (payload: CashManagementSettingsPayload) => {
|
|
42
|
+
bufferAmount: Amount;
|
|
43
|
+
frequency: AutoSweepFrequency;
|
|
44
|
+
nextTransferDate?: ZeniDate;
|
|
45
|
+
primaryFundingAccountId?: ID;
|
|
46
|
+
settingsId?: ID;
|
|
47
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toAutoSweepFlowStatePatch = exports.toSaveAutoSweepSettingsBody = void 0;
|
|
4
|
+
const amount_1 = require("../../../../commonStateTypes/amount");
|
|
5
|
+
const zeniDayJS_1 = require("../../../../zeniDayJS");
|
|
6
|
+
const autoSweepFlowState_1 = require("./autoSweepFlowState");
|
|
7
|
+
const toSaveAutoSweepSettingsBody = (state) => ({
|
|
8
|
+
frequency: state.frequency,
|
|
9
|
+
memo: state.memo,
|
|
10
|
+
minimum_buffer_usd: state.bufferAmount.amount,
|
|
11
|
+
});
|
|
12
|
+
exports.toSaveAutoSweepSettingsBody = toSaveAutoSweepSettingsBody;
|
|
13
|
+
/**
|
|
14
|
+
* Map a `GET /cash-management/settings` payload into the slice's writable
|
|
15
|
+
* fields. Defensive on the frequency (string-from-the-wire → union via
|
|
16
|
+
* `toAutoSweepFrequency`, falling back to `'weekly'` if the server returns
|
|
17
|
+
* something we don't model yet). Only the source account *id* is stored
|
|
18
|
+
* here — the full deposit-account payload is published to the entity bucket
|
|
19
|
+
* by the fetch epic.
|
|
20
|
+
*/
|
|
21
|
+
const toAutoSweepFlowStatePatch = (payload) => {
|
|
22
|
+
const currencyCode = payload.source_bank_account.balances?.currency_code;
|
|
23
|
+
const currencySymbol = payload.source_bank_account.balances?.currency_symbol;
|
|
24
|
+
return {
|
|
25
|
+
bufferAmount: (0, amount_1.toAmount)(payload.minimum_buffer_usd, currencyCode ?? 'USD', currencySymbol ?? '$'),
|
|
26
|
+
frequency: (0, autoSweepFlowState_1.toAutoSweepFrequency)(payload.frequency) ?? 'weekly',
|
|
27
|
+
nextTransferDate: payload.next_transfer_date != null && payload.next_transfer_date !== ''
|
|
28
|
+
? (0, zeniDayJS_1.date)(payload.next_transfer_date)
|
|
29
|
+
: undefined,
|
|
30
|
+
primaryFundingAccountId: payload.source_bank_account.deposit_account_id ?? undefined,
|
|
31
|
+
settingsId: payload.cash_management_settings_id ?? undefined,
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
exports.toAutoSweepFlowStatePatch = toAutoSweepFlowStatePatch;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Amount } from '../../../../commonStateTypes/amount';
|
|
2
|
+
import { FetchState } from '../../../../commonStateTypes/common';
|
|
3
|
+
import { ZeniAPIStatus } from '../../../../responsePayload';
|
|
4
|
+
import { CashManagementSettingsPayload } from './autoSweepFlowPayload';
|
|
5
|
+
import { AutoSweepFlowState, AutoSweepFrequency } from './autoSweepFlowState';
|
|
6
|
+
export declare const initialState: AutoSweepFlowState;
|
|
7
|
+
export declare const fetchCashManagementSettings: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"autoSweepFlow/fetchCashManagementSettings">, updateCashManagementSettings: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
8
|
+
data: CashManagementSettingsPayload;
|
|
9
|
+
}, "autoSweepFlow/updateCashManagementSettings">, updateCashManagementSettingsFetchStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
10
|
+
fetchState: FetchState;
|
|
11
|
+
error?: ZeniAPIStatus;
|
|
12
|
+
}, "autoSweepFlow/updateCashManagementSettingsFetchStatus">, updateAutoSweepRisk: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
13
|
+
bufferAmount: Amount;
|
|
14
|
+
}, "autoSweepFlow/updateAutoSweepRisk">, updateAutoSweepDraft: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
15
|
+
bufferAmount: Amount;
|
|
16
|
+
frequency: AutoSweepFrequency;
|
|
17
|
+
memo: string;
|
|
18
|
+
}, "autoSweepFlow/updateAutoSweepDraft">, saveAutoSweepSettings: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"autoSweepFlow/saveAutoSweepSettings">, updateAutoSweepSettingsFetchStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
19
|
+
fetchState: FetchState;
|
|
20
|
+
error?: ZeniAPIStatus;
|
|
21
|
+
}, "autoSweepFlow/updateAutoSweepSettingsFetchStatus">, clearAutoSweepFlow: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"autoSweepFlow/clearAutoSweepFlow">;
|
|
22
|
+
declare const _default: import("redux").Reducer<AutoSweepFlowState>;
|
|
23
|
+
export default _default;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.clearAutoSweepFlow = exports.updateAutoSweepSettingsFetchStatus = exports.saveAutoSweepSettings = exports.updateAutoSweepDraft = exports.updateAutoSweepRisk = exports.updateCashManagementSettingsFetchStatus = exports.updateCashManagementSettings = exports.fetchCashManagementSettings = exports.initialState = void 0;
|
|
5
|
+
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
+
const autoSweepFlowPayload_1 = require("./autoSweepFlowPayload");
|
|
7
|
+
const autoSweepFlowState_1 = require("./autoSweepFlowState");
|
|
8
|
+
exports.initialState = autoSweepFlowState_1.initialAutoSweepFlowState;
|
|
9
|
+
const autoSweepFlow = (0, toolkit_1.createSlice)({
|
|
10
|
+
name: 'autoSweepFlow',
|
|
11
|
+
initialState: exports.initialState,
|
|
12
|
+
reducers: {
|
|
13
|
+
/**
|
|
14
|
+
* Kicks off `GET /cash-management/settings`. Flips the top-level
|
|
15
|
+
* fetchState to `In-Progress`; the fetch epic picks this up.
|
|
16
|
+
*/
|
|
17
|
+
fetchCashManagementSettings(draft) {
|
|
18
|
+
draft.fetchState = 'In-Progress';
|
|
19
|
+
draft.error = undefined;
|
|
20
|
+
},
|
|
21
|
+
/**
|
|
22
|
+
* Hydrates the form fields with the server-side settings (and stashes
|
|
23
|
+
* the settings id for subsequent saves). Marks the GET as `Completed`.
|
|
24
|
+
*/
|
|
25
|
+
updateCashManagementSettings(draft, action) {
|
|
26
|
+
const patch = (0, autoSweepFlowPayload_1.toAutoSweepFlowStatePatch)(action.payload.data);
|
|
27
|
+
draft.bufferAmount = patch.bufferAmount;
|
|
28
|
+
draft.frequency = patch.frequency;
|
|
29
|
+
draft.nextTransferDate = patch.nextTransferDate;
|
|
30
|
+
draft.primaryFundingAccountId = patch.primaryFundingAccountId;
|
|
31
|
+
draft.settingsId = patch.settingsId;
|
|
32
|
+
draft.fetchState = 'Completed';
|
|
33
|
+
draft.error = undefined;
|
|
34
|
+
},
|
|
35
|
+
updateCashManagementSettingsFetchStatus(draft, action) {
|
|
36
|
+
draft.fetchState = action.payload.fetchState;
|
|
37
|
+
draft.error = action.payload.error;
|
|
38
|
+
},
|
|
39
|
+
/**
|
|
40
|
+
* Live-update the buffer (risk band) as the user toggles the risk picker
|
|
41
|
+
* on the setup page, without staging frequency/memo. The selector derives
|
|
42
|
+
* the risk-adjusted sweep amount off `bufferAmount`, so dispatching this on
|
|
43
|
+
* every risk change keeps the setup and review screens in sync.
|
|
44
|
+
*/
|
|
45
|
+
updateAutoSweepRisk(draft, action) {
|
|
46
|
+
draft.bufferAmount = action.payload.bufferAmount;
|
|
47
|
+
},
|
|
48
|
+
/**
|
|
49
|
+
* Stage the in-flight form values without submitting them — fired from
|
|
50
|
+
* the setup→review transition so other selectors (and devtools) can see
|
|
51
|
+
* what the user is about to confirm. Leaves `saveStatus` untouched; the
|
|
52
|
+
* actual PUT only kicks off when the user clicks "Confirm Sweep" via
|
|
53
|
+
* `saveAutoSweepSettings`.
|
|
54
|
+
*/
|
|
55
|
+
updateAutoSweepDraft(draft, action) {
|
|
56
|
+
draft.bufferAmount = action.payload.bufferAmount;
|
|
57
|
+
draft.frequency = action.payload.frequency;
|
|
58
|
+
draft.memo = action.payload.memo;
|
|
59
|
+
},
|
|
60
|
+
/**
|
|
61
|
+
* Trigger the PUT for the auto-sweep settings already staged via
|
|
62
|
+
* `updateAutoSweepDraft`. Carries no payload — flips `saveStatus` to
|
|
63
|
+
* `In-Progress` and the save epic reads `bufferAmount` / `frequency` /
|
|
64
|
+
* `memo` straight from the slice. Callers must ensure those fields
|
|
65
|
+
* reflect the user's latest input before dispatching.
|
|
66
|
+
*/
|
|
67
|
+
saveAutoSweepSettings(draft) {
|
|
68
|
+
draft.saveStatus = { fetchState: 'In-Progress', error: undefined };
|
|
69
|
+
},
|
|
70
|
+
updateAutoSweepSettingsFetchStatus(draft, action) {
|
|
71
|
+
draft.saveStatus = {
|
|
72
|
+
fetchState: action.payload.fetchState,
|
|
73
|
+
error: action.payload.error,
|
|
74
|
+
};
|
|
75
|
+
},
|
|
76
|
+
clearAutoSweepFlow() {
|
|
77
|
+
return autoSweepFlowState_1.initialAutoSweepFlowState;
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
_a = autoSweepFlow.actions, exports.fetchCashManagementSettings = _a.fetchCashManagementSettings, exports.updateCashManagementSettings = _a.updateCashManagementSettings, exports.updateCashManagementSettingsFetchStatus = _a.updateCashManagementSettingsFetchStatus, exports.updateAutoSweepRisk = _a.updateAutoSweepRisk, exports.updateAutoSweepDraft = _a.updateAutoSweepDraft, exports.saveAutoSweepSettings = _a.saveAutoSweepSettings, exports.updateAutoSweepSettingsFetchStatus = _a.updateAutoSweepSettingsFetchStatus, exports.clearAutoSweepFlow = _a.clearAutoSweepFlow;
|
|
82
|
+
exports.default = autoSweepFlow.reducer;
|