@zeniai/client-epic-state 5.0.81 → 5.0.82-betaAK1
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/commonStateTypes/amount.d.ts +2 -1
- package/lib/commonStateTypes/amount.js +5 -2
- package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
- package/lib/commonStateTypes/viewAndReport/viewAndReport.js +2 -0
- package/lib/commonStateTypes/workingDayHelper.d.ts +11 -0
- package/lib/commonStateTypes/workingDayHelper.js +31 -1
- package/lib/entity/account/accountSelector.d.ts +9 -0
- package/lib/entity/account/accountSelector.js +14 -1
- package/lib/entity/account/accountState.d.ts +1 -1
- package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
- package/lib/entity/class/classReducer.d.ts +4 -4
- package/lib/entity/class/classState.d.ts +1 -1
- package/lib/entity/forecast/forecastState.d.ts +1 -1
- package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
- package/lib/entity/sectionProjectView/sectionProjectView.d.ts +1 -1
- package/lib/entity/sectionProjectView/sectionProjectViewReducer.d.ts +2 -2
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +1 -0
- package/lib/entity/tenant/clearAllEpic.d.ts +2 -1
- package/lib/entity/tenant/clearAllEpic.js +2 -0
- package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +4 -0
- package/lib/entity/transaction/payloadTypes/transactionPayload.js +18 -10
- package/lib/entity/transaction/stateTypes/transaction.d.ts +3 -0
- package/lib/epic.d.ts +7 -1
- package/lib/epic.js +7 -1
- package/lib/esm/commonStateTypes/amount.js +3 -1
- package/lib/esm/commonStateTypes/viewAndReport/viewAndReport.js +2 -0
- package/lib/esm/commonStateTypes/workingDayHelper.js +29 -0
- package/lib/esm/entity/account/accountSelector.js +11 -0
- package/lib/esm/entity/snackbar/snackbarTypes.js +1 -0
- package/lib/esm/entity/tenant/clearAllEpic.js +2 -0
- package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +18 -10
- package/lib/esm/epic.js +7 -1
- package/lib/esm/index.js +12 -6
- package/lib/esm/reducer.js +9 -0
- package/lib/esm/view/createTransferEntry/createTransferEntryReducer.js +82 -0
- package/lib/esm/view/createTransferEntry/createTransferEntrySelector.js +64 -0
- package/lib/esm/view/createTransferEntry/createTransferEntryState.js +17 -0
- package/lib/esm/view/createTransferEntry/epics/createTransferEntryEpic.js +130 -0
- package/lib/esm/view/createTransferEntry/epics/fetchTransferAccountsEpic.js +36 -0
- package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +13 -1
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +9 -1
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowPayload.js +24 -0
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowReducer.js +55 -0
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowSelector.js +15 -0
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowState.js +45 -0
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/epics/fetchCashManagementSettingsEpic.js +28 -0
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/epics/saveAutoSweepSettingsEpic.js +27 -0
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewPayload.js +37 -0
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewReducer.js +49 -0
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector.js +179 -0
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewState.js +5 -0
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementBannerEpic.js +28 -0
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementOverviewPageEpic.js +39 -0
- package/lib/esm/view/transactionDetail/transactionDetailSelector.js +6 -1
- package/lib/index.d.ts +15 -6
- package/lib/index.js +62 -33
- package/lib/reducer.d.ts +9 -0
- package/lib/reducer.js +9 -0
- package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
- package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
- package/lib/view/cardBalance/cardBalanceSelector.d.ts +1 -1
- package/lib/view/cashBalance/cashBalanceSelector.d.ts +1 -1
- package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
- package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
- package/lib/view/createTransferEntry/createTransferEntryReducer.d.ts +32 -0
- package/lib/view/createTransferEntry/createTransferEntryReducer.js +86 -0
- package/lib/view/createTransferEntry/createTransferEntrySelector.d.ts +39 -0
- package/lib/view/createTransferEntry/createTransferEntrySelector.js +69 -0
- package/lib/view/createTransferEntry/createTransferEntryState.d.ts +30 -0
- package/lib/view/createTransferEntry/createTransferEntryState.js +20 -0
- package/lib/view/createTransferEntry/epics/createTransferEntryEpic.d.ts +11 -0
- package/lib/view/createTransferEntry/epics/createTransferEntryEpic.js +134 -0
- package/lib/view/createTransferEntry/epics/fetchTransferAccountsEpic.d.ts +14 -0
- package/lib/view/createTransferEntry/epics/fetchTransferAccountsEpic.js +40 -0
- package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +3 -1
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +14 -2
- package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +4 -1
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.d.ts +1 -0
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +11 -2
- package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
- package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
- package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
- package/lib/view/reportsResync/reportsResyncReducer.d.ts +2 -2
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowPayload.d.ts +52 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowPayload.js +29 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowReducer.d.ts +21 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowReducer.js +59 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowSelector.d.ts +16 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowSelector.js +19 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowState.d.ts +44 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowState.js +51 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/fetchCashManagementSettingsEpic.d.ts +16 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/fetchCashManagementSettingsEpic.js +32 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/saveAutoSweepSettingsEpic.d.ts +14 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/saveAutoSweepSettingsEpic.js +31 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewPayload.d.ts +32 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewPayload.js +42 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewReducer.d.ts +15 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewReducer.js +53 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector.d.ts +41 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector.js +184 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewState.d.ts +71 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewState.js +8 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementBannerEpic.d.ts +16 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementBannerEpic.js +32 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementOverviewPageEpic.d.ts +10 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementOverviewPageEpic.js +43 -0
- package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
- package/lib/view/topEx/topExSelector.d.ts +1 -1
- package/lib/view/transactionDetail/transactionDetailPayload.d.ts +1 -1
- package/lib/view/transactionDetail/transactionDetailSelector.d.ts +6 -1
- package/lib/view/transactionDetail/transactionDetailSelector.js +6 -1
- package/package.json +34 -62
package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/epics/saveAutoSweepSettingsEpic.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { of } from 'rxjs';
|
|
2
|
+
import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
|
|
3
|
+
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../../responsePayload';
|
|
4
|
+
import { toSaveAutoSweepSettingsBody, } from '../autoSweepFlowPayload';
|
|
5
|
+
import { saveAutoSweepSettings, updateAutoSweepSettingsFetchStatus, } from '../autoSweepFlowReducer';
|
|
6
|
+
/**
|
|
7
|
+
* Hits `PUT /cash-management/settings` with the values the user just
|
|
8
|
+
* confirmed in the auto-sweep flow.
|
|
9
|
+
*
|
|
10
|
+
* TODO: switch the endpoint to a base URL constant once the prod endpoint
|
|
11
|
+
* lands; right now this hits the dev environment directly.
|
|
12
|
+
*/
|
|
13
|
+
export const saveAutoSweepSettingsEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(saveAutoSweepSettings.match), switchMap((action) => zeniAPI
|
|
14
|
+
.putAndGetJSON(`https://dev.api.zeni.ai/cash-management-agent/1.0/cash-management/settings`, toSaveAutoSweepSettingsBody(action.payload))
|
|
15
|
+
.pipe(mergeMap((response) => {
|
|
16
|
+
if (isSuccessResponse(response)) {
|
|
17
|
+
return of(updateAutoSweepSettingsFetchStatus({ fetchState: 'Completed' }));
|
|
18
|
+
}
|
|
19
|
+
return of(updateAutoSweepSettingsFetchStatus({
|
|
20
|
+
fetchState: 'Error',
|
|
21
|
+
error: response.status,
|
|
22
|
+
}));
|
|
23
|
+
}), catchError((error) => of(updateAutoSweepSettingsFetchStatus({
|
|
24
|
+
fetchState: 'Error',
|
|
25
|
+
error: createZeniAPIStatus('Unexpected Error', 'Save auto-sweep settings REST API call errored out' +
|
|
26
|
+
JSON.stringify(error)),
|
|
27
|
+
}))))));
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { toAmount } from '../../../../commonStateTypes/amount';
|
|
2
|
+
import { date as zeniDate } from '../../../../zeniDayJS';
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
// Converters
|
|
5
|
+
// ---------------------------------------------------------------------------
|
|
6
|
+
export const toUpcomingPaymentEvent = (event) => ({
|
|
7
|
+
accountId: event.account_id,
|
|
8
|
+
accountType: event.account_type,
|
|
9
|
+
amount: toAmount(event.amount_usd, event.currency_code),
|
|
10
|
+
label: event.label,
|
|
11
|
+
paymentDate: zeniDate(event.payment_date),
|
|
12
|
+
});
|
|
13
|
+
/**
|
|
14
|
+
* The agent reports a `null` account id whenever the "account" in question is
|
|
15
|
+
* a singleton inferred from the account type (today: the treasury account —
|
|
16
|
+
* there's only one per company, so the type alone identifies it). Callers
|
|
17
|
+
* already branch on `*BankAccountType`, so collapsing the id to `""` keeps the
|
|
18
|
+
* state type a plain `ID` (string) without losing information.
|
|
19
|
+
*/
|
|
20
|
+
const toCashManagementMovement = (payload) => ({
|
|
21
|
+
amount: toAmount(payload.amount, payload.currency_code),
|
|
22
|
+
destinationBankAccountId: payload.destination_bank_account_id ?? '',
|
|
23
|
+
destinationBankAccountType: payload.destination_bank_account_type,
|
|
24
|
+
reasoning: payload.reasoning,
|
|
25
|
+
sourceBankAccountId: payload.source_bank_account_id ?? '',
|
|
26
|
+
sourceBankAccountType: payload.source_bank_account_type,
|
|
27
|
+
subMovementType: payload.sub_movement_type,
|
|
28
|
+
});
|
|
29
|
+
const toCashManagementMoneyMovementGroup = (payload) => ({
|
|
30
|
+
movements: payload.movements.map(toCashManagementMovement),
|
|
31
|
+
movementType: payload.movement_type,
|
|
32
|
+
});
|
|
33
|
+
export const toCashManagementBannerData = (payload) => ({
|
|
34
|
+
inflows: payload.inflows.map(toUpcomingPaymentEvent),
|
|
35
|
+
moneyMovements: payload.money_movements.map(toCashManagementMoneyMovementGroup),
|
|
36
|
+
outflows: payload.outflows.map(toUpcomingPaymentEvent),
|
|
37
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { createSlice } from '@reduxjs/toolkit';
|
|
2
|
+
import { toCashManagementBannerData, } from './cashManagementOverviewPayload';
|
|
3
|
+
import { initialCashManagementBannerState, } from './cashManagementOverviewState';
|
|
4
|
+
export const initialState = {
|
|
5
|
+
banner: initialCashManagementBannerState,
|
|
6
|
+
fetchState: 'Not-Started',
|
|
7
|
+
error: undefined,
|
|
8
|
+
hasValidState() {
|
|
9
|
+
return this.fetchState == 'Completed';
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
const cashManagementOverview = createSlice({
|
|
13
|
+
name: 'cashManagementOverview',
|
|
14
|
+
initialState,
|
|
15
|
+
reducers: {
|
|
16
|
+
fetchCashManagementOverviewPage: {
|
|
17
|
+
reducer() { },
|
|
18
|
+
prepare(cacheOverride) {
|
|
19
|
+
return { payload: { cacheOverride } };
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
fetchCashManagementBanner(draft) {
|
|
23
|
+
draft.banner = {
|
|
24
|
+
...initialCashManagementBannerState,
|
|
25
|
+
fetchState: 'In-Progress',
|
|
26
|
+
error: undefined,
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
updateCashManagementBanner(draft, action) {
|
|
30
|
+
draft.banner = {
|
|
31
|
+
fetchState: 'Completed',
|
|
32
|
+
error: undefined,
|
|
33
|
+
data: toCashManagementBannerData(action.payload.data),
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
updateCashManagementBannerFetchStatus(draft, action) {
|
|
37
|
+
draft.banner = {
|
|
38
|
+
...draft.banner,
|
|
39
|
+
fetchState: action.payload.fetchState,
|
|
40
|
+
error: action.payload.error,
|
|
41
|
+
};
|
|
42
|
+
},
|
|
43
|
+
clearCashManagementOverview(draft) {
|
|
44
|
+
Object.assign(draft, initialState);
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
export const { fetchCashManagementOverviewPage, fetchCashManagementBanner, updateCashManagementBanner, updateCashManagementBannerFetchStatus, clearCashManagementOverview, } = cashManagementOverview.actions;
|
|
49
|
+
export default cashManagementOverview.reducer;
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { zeroAmount } from '../../../../commonStateTypes/amount';
|
|
2
|
+
import { reduceAllFetchState } from '../../../../commonStateTypes/reduceFetchState';
|
|
3
|
+
/**
|
|
4
|
+
* Default account type used when the recommend payload has no movement to
|
|
5
|
+
* expose yet (e.g. before the first fetch resolves). Callers that care about
|
|
6
|
+
* the movement should also gate on `fetchState === 'Completed'`.
|
|
7
|
+
*/
|
|
8
|
+
const DEFAULT_BANK_ACCOUNT_TYPE = 'deposit_account';
|
|
9
|
+
const DEFAULT_SUB_MOVEMENT_TYPE = 'push';
|
|
10
|
+
export const getCashManagementOverviewBanner = (state) => {
|
|
11
|
+
const { banner } = state.cashManagementOverviewState;
|
|
12
|
+
const autoSweep = state.autoSweepFlowState;
|
|
13
|
+
// The banner today surfaces a single recommended movement (the first one
|
|
14
|
+
// returned by the agent). When the agent returns multiple groups/movements
|
|
15
|
+
// we'll need to broaden this — for now consumers only render one.
|
|
16
|
+
const movement = banner.data?.moneyMovements[0]?.movements[0];
|
|
17
|
+
const aggregate = reduceAllFetchState([
|
|
18
|
+
{ fetchState: banner.fetchState, error: banner.error },
|
|
19
|
+
{ fetchState: autoSweep.fetchState, error: autoSweep.error },
|
|
20
|
+
]);
|
|
21
|
+
return {
|
|
22
|
+
fetchState: aggregate.fetchState,
|
|
23
|
+
error: aggregate.error,
|
|
24
|
+
amount: movement?.amount ?? zeroAmount(),
|
|
25
|
+
cashManagementSettingsId: autoSweep.settingsId,
|
|
26
|
+
destinationBankAccountId: movement?.destinationBankAccountId ?? '',
|
|
27
|
+
destinationBankAccountType: movement?.destinationBankAccountType ?? DEFAULT_BANK_ACCOUNT_TYPE,
|
|
28
|
+
reasoning: movement?.reasoning ?? '',
|
|
29
|
+
sourceBankAccountId: movement?.sourceBankAccountId ?? '',
|
|
30
|
+
sourceBankAccountType: movement?.sourceBankAccountType ?? DEFAULT_BANK_ACCOUNT_TYPE,
|
|
31
|
+
subMovementType: movement?.subMovementType ?? DEFAULT_SUB_MOVEMENT_TYPE,
|
|
32
|
+
version: 0,
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export const getCashManagementOverview = (state) => {
|
|
36
|
+
const { cashManagementOverviewState, depositAccountListState, depositAccountState, paymentAccountListState, paymentAccountState, treasuryDetailState, } = state;
|
|
37
|
+
const aggregate = reduceAllFetchState([
|
|
38
|
+
{
|
|
39
|
+
fetchState: paymentAccountListState.fetchState,
|
|
40
|
+
error: paymentAccountListState.error,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
fetchState: depositAccountListState.fetchState,
|
|
44
|
+
error: depositAccountListState.error,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
fetchState: treasuryDetailState.fetchState,
|
|
48
|
+
error: treasuryDetailState.error,
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
fetchState: cashManagementOverviewState.banner.fetchState,
|
|
52
|
+
error: cashManagementOverviewState.banner.error,
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
fetchState: state.autoSweepFlowState.fetchState,
|
|
56
|
+
error: state.autoSweepFlowState.error,
|
|
57
|
+
},
|
|
58
|
+
]);
|
|
59
|
+
const treasuryBalance = treasuryDetailState.accountSummary?.totalBalance ?? zeroAmount();
|
|
60
|
+
const cashBalance = sumCashBalances(paymentAccountListState.paymentAccountIds, paymentAccountState, depositAccountListState.accountIds, depositAccountState);
|
|
61
|
+
const totalCash = addAmounts(treasuryBalance, cashBalance);
|
|
62
|
+
const bannerData = cashManagementOverviewState.banner.data;
|
|
63
|
+
const inflowEvents = bannerData?.inflows ?? [];
|
|
64
|
+
const outflowEvents = bannerData?.outflows ?? [];
|
|
65
|
+
const totalInFlow = sumEventAmounts(inflowEvents);
|
|
66
|
+
const totalOutFlow = sumEventAmounts(outflowEvents);
|
|
67
|
+
const cashflow = subtractAmounts(totalInFlow, totalOutFlow);
|
|
68
|
+
const projectionData = buildProjectionData(cashBalance, inflowEvents, outflowEvents);
|
|
69
|
+
return {
|
|
70
|
+
banner: getCashManagementOverviewBanner(state),
|
|
71
|
+
cashBalance,
|
|
72
|
+
cashflow,
|
|
73
|
+
inflowEvents,
|
|
74
|
+
outflowEvents,
|
|
75
|
+
projectionData,
|
|
76
|
+
totalCash,
|
|
77
|
+
totalInFlow,
|
|
78
|
+
totalOutFlow,
|
|
79
|
+
treasuryBalance,
|
|
80
|
+
fetchState: aggregate.fetchState,
|
|
81
|
+
error: aggregate.error,
|
|
82
|
+
version: 0,
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Walks the inflow / outflow events in chronological order, stepping the
|
|
87
|
+
* running balance from today's `cashBalance`. Emits a point per event so the
|
|
88
|
+
* chart can render colored markers at each cash event. Events with the same
|
|
89
|
+
* payment date are kept as separate steps (preserves the marker count even
|
|
90
|
+
* if Recharts overlays them at the same X position).
|
|
91
|
+
*/
|
|
92
|
+
const buildProjectionData = (cashBalance, inflowEvents, outflowEvents) => {
|
|
93
|
+
const events = [
|
|
94
|
+
...inflowEvents.map((e) => ({
|
|
95
|
+
date: e.paymentDate,
|
|
96
|
+
delta: e.amount.amount,
|
|
97
|
+
isInflow: true,
|
|
98
|
+
})),
|
|
99
|
+
...outflowEvents.map((e) => ({
|
|
100
|
+
date: e.paymentDate,
|
|
101
|
+
delta: -e.amount.amount,
|
|
102
|
+
isOutflow: true,
|
|
103
|
+
})),
|
|
104
|
+
].sort((a, b) => a.date.valueOf() - b.date.valueOf());
|
|
105
|
+
let balance = cashBalance.amount;
|
|
106
|
+
const points = [{ balance, date: 'Today' }];
|
|
107
|
+
events.forEach((event) => {
|
|
108
|
+
balance += event.delta;
|
|
109
|
+
points.push({
|
|
110
|
+
balance,
|
|
111
|
+
date: event.date.format('MMM D'),
|
|
112
|
+
isInflow: event.isInflow,
|
|
113
|
+
isOutflow: event.isOutflow,
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
return points;
|
|
117
|
+
};
|
|
118
|
+
const sumEventAmounts = (events) => events.reduce((acc, event) => addAmounts(acc, event.amount), zeroAmount());
|
|
119
|
+
/**
|
|
120
|
+
* Subtracts `b` from `a`, sharing the currency-match guard with `addAmounts`.
|
|
121
|
+
* Used to compute net cash flow (`inflow - outflow`).
|
|
122
|
+
*/
|
|
123
|
+
const subtractAmounts = (a, b) => {
|
|
124
|
+
if (isZeroAmount(b)) {
|
|
125
|
+
return { ...a };
|
|
126
|
+
}
|
|
127
|
+
if (isZeroAmount(a)) {
|
|
128
|
+
return { ...b, amount: -b.amount };
|
|
129
|
+
}
|
|
130
|
+
if (a.currencyCode !== b.currencyCode ||
|
|
131
|
+
a.currencySymbol !== b.currencySymbol) {
|
|
132
|
+
console.warn(`cashManagementOverview: skipping balance with mismatched currency. Expected ${a.currencyCode} (${a.currencySymbol}), got ${b.currencyCode} (${b.currencySymbol}).`);
|
|
133
|
+
return a;
|
|
134
|
+
}
|
|
135
|
+
return {
|
|
136
|
+
amount: a.amount - b.amount,
|
|
137
|
+
currencyCode: a.currencyCode,
|
|
138
|
+
currencySymbol: a.currencySymbol,
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
const isZeroAmount = (a) => a.amount === 0 && a.currencyCode === 'USD' && a.currencySymbol === '$';
|
|
142
|
+
/**
|
|
143
|
+
* Adds two Amounts. Currencies must match (the seeded zeroAmount() counts as
|
|
144
|
+
* "no currency yet" and adopts `b`'s currency). Mismatches return `a`
|
|
145
|
+
* unchanged and warn — mixing currencies in a total is a bug, not silent
|
|
146
|
+
* conversion.
|
|
147
|
+
*/
|
|
148
|
+
const addAmounts = (a, b) => {
|
|
149
|
+
if (isZeroAmount(a)) {
|
|
150
|
+
return { ...b };
|
|
151
|
+
}
|
|
152
|
+
if (a.currencyCode !== b.currencyCode ||
|
|
153
|
+
a.currencySymbol !== b.currencySymbol) {
|
|
154
|
+
console.warn(`cashManagementOverview: skipping balance with mismatched currency. Expected ${a.currencyCode} (${a.currencySymbol}), got ${b.currencyCode} (${b.currencySymbol}).`);
|
|
155
|
+
return a;
|
|
156
|
+
}
|
|
157
|
+
return {
|
|
158
|
+
amount: a.amount + b.amount,
|
|
159
|
+
currencyCode: a.currencyCode,
|
|
160
|
+
currencySymbol: a.currencySymbol,
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
const sumCashBalances = (paymentAccountIds, paymentAccountState, depositAccountIds, depositAccountState) => {
|
|
164
|
+
let total = zeroAmount();
|
|
165
|
+
paymentAccountIds.forEach((id) => {
|
|
166
|
+
const balance = paymentAccountState.paymentAccountByID[id]?.balances
|
|
167
|
+
?.available;
|
|
168
|
+
if (balance != null) {
|
|
169
|
+
total = addAmounts(total, balance);
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
depositAccountIds.forEach((id) => {
|
|
173
|
+
const balance = depositAccountState.depositAccountByID[id]?.accountBalance?.available;
|
|
174
|
+
if (balance != null) {
|
|
175
|
+
total = addAmounts(total, balance);
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
return total;
|
|
179
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { of } from 'rxjs';
|
|
2
|
+
import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
|
|
3
|
+
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../../responsePayload';
|
|
4
|
+
import { fetchCashManagementBanner, updateCashManagementBanner, updateCashManagementBannerFetchStatus, } from '../cashManagementOverviewReducer';
|
|
5
|
+
/**
|
|
6
|
+
* Hits the cash agent's recommend endpoint and stores the full response on
|
|
7
|
+
* the banner state — `inflows[]`, `outflows[]`, and `money_movements[]` all
|
|
8
|
+
* live there, so consumers can read them directly without an entity-bucket
|
|
9
|
+
* lookup.
|
|
10
|
+
*
|
|
11
|
+
* TODO: switch the endpoint to a base URL constant once the prod endpoint
|
|
12
|
+
* lands; right now this hits the dev environment directly.
|
|
13
|
+
*/
|
|
14
|
+
export const fetchCashManagementBannerEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(fetchCashManagementBanner.match), switchMap(() => zeniAPI
|
|
15
|
+
.getJSON(`https://dev.api.zeni.ai/cash-management-agent/1.0/cash-agent/recommend?horizon_days=30`)
|
|
16
|
+
.pipe(mergeMap((response) => {
|
|
17
|
+
if (isSuccessResponse(response) && response.data != null) {
|
|
18
|
+
return of(updateCashManagementBanner({ data: response.data }));
|
|
19
|
+
}
|
|
20
|
+
return of(updateCashManagementBannerFetchStatus({
|
|
21
|
+
fetchState: 'Error',
|
|
22
|
+
error: response.status,
|
|
23
|
+
}));
|
|
24
|
+
}), catchError((error) => of(updateCashManagementBannerFetchStatus({
|
|
25
|
+
fetchState: 'Error',
|
|
26
|
+
error: createZeniAPIStatus('Unexpected Error', 'Fetch cash management banner REST API call errored out' +
|
|
27
|
+
JSON.stringify(error)),
|
|
28
|
+
}))))));
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { concat, from } from 'rxjs';
|
|
2
|
+
import { filter, mergeMap } from 'rxjs/operators';
|
|
3
|
+
import { fetchAutoTransferRules } from '../../../autotransferRules/autoTransferRulesReducer';
|
|
4
|
+
import { fetchCashManagementSettings } from '../../autoSweepFlow/autoSweepFlowReducer';
|
|
5
|
+
import { fetchTreasuryOverviewDetail } from '../../../treasury/treasuryList/treasuryDetailReducer';
|
|
6
|
+
import { fetchZeniAccountList } from '../../../zeniAccounts/zeniAccountList/zeniAccountListReducer';
|
|
7
|
+
import { fetchCashManagementBanner, fetchCashManagementOverviewPage, } from '../cashManagementOverviewReducer';
|
|
8
|
+
export const fetchCashManagementOverviewPageEpic = (actions$, state$) => actions$.pipe(filter(fetchCashManagementOverviewPage.match), mergeMap((action) => {
|
|
9
|
+
const { cacheOverride } = action.payload;
|
|
10
|
+
const state = state$.value;
|
|
11
|
+
const pageActions = [];
|
|
12
|
+
if (cacheOverride === true) {
|
|
13
|
+
pageActions.push(fetchTreasuryOverviewDetail(true), fetchZeniAccountList(true), fetchCashManagementBanner(), fetchCashManagementSettings(), fetchAutoTransferRules(true));
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
const treasuryDetailState = state.treasuryDetailState;
|
|
17
|
+
if (treasuryDetailState.hasValidState() === false &&
|
|
18
|
+
treasuryDetailState.fetchState !== 'In-Progress') {
|
|
19
|
+
pageActions.push(fetchTreasuryOverviewDetail(false));
|
|
20
|
+
}
|
|
21
|
+
pageActions.push(fetchZeniAccountList(false));
|
|
22
|
+
const banner = state.cashManagementOverviewState.banner;
|
|
23
|
+
if (banner.fetchState !== 'Completed' &&
|
|
24
|
+
banner.fetchState !== 'In-Progress') {
|
|
25
|
+
pageActions.push(fetchCashManagementBanner());
|
|
26
|
+
}
|
|
27
|
+
const autoSweep = state.autoSweepFlowState;
|
|
28
|
+
if (autoSweep.fetchState !== 'Completed' &&
|
|
29
|
+
autoSweep.fetchState !== 'In-Progress') {
|
|
30
|
+
pageActions.push(fetchCashManagementSettings());
|
|
31
|
+
}
|
|
32
|
+
const autoTransferRules = state.autotransferRulesState;
|
|
33
|
+
if (autoTransferRules.fetchState !== 'Completed' &&
|
|
34
|
+
autoTransferRules.fetchState !== 'In-Progress') {
|
|
35
|
+
pageActions.push(fetchAutoTransferRules(false));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return concat(from(pageActions));
|
|
39
|
+
}));
|
|
@@ -8,6 +8,7 @@ import { getVendorsByVendorIds } from '../../entity/vendor/vendorSelector';
|
|
|
8
8
|
import { dateNow } from '../../zeniDayJS';
|
|
9
9
|
import { getAccountList, getNestedAccountListHierarchy, } from '../accountList/accountListSelector';
|
|
10
10
|
import { getClassList, getNestedClassListHierarchy, } from '../classList/classListSelector';
|
|
11
|
+
import { getResolvedTransferAccounts } from '../createTransferEntry/createTransferEntrySelector';
|
|
11
12
|
import { getProjectList, } from '../projectList/projectListSelector';
|
|
12
13
|
import { getAllLinkedTransactions, getTransactionDetailKey, initialSupportedTransactionDetail, } from './transactionDetailState';
|
|
13
14
|
// "Any line on this transaction is fetching category/class recommendations?"
|
|
@@ -31,7 +32,7 @@ export const getDetailInFlightRecommendations = (state, transactionId) => {
|
|
|
31
32
|
return false;
|
|
32
33
|
};
|
|
33
34
|
export const getTransactionDetail = (state, transactionId, fetchLinkedTransactions = true) => {
|
|
34
|
-
const { transactionDetailState, transactionState, vendorState, vendorListState, accountState, classState, classListState, accountListState, projectState, projectListState, } = state;
|
|
35
|
+
const { transactionDetailState, transactionState, vendorState, vendorListState, accountState, classState, classListState, accountListState, createTransferEntryState, projectState, projectListState, } = state;
|
|
35
36
|
const detailKey = getTransactionDetailKey(transactionId);
|
|
36
37
|
const transactionDetail = recordGet(transactionDetailState.transactionDetailById, detailKey);
|
|
37
38
|
let fetchState = {
|
|
@@ -98,6 +99,7 @@ export const getTransactionDetail = (state, transactionId, fetchLinkedTransactio
|
|
|
98
99
|
: [];
|
|
99
100
|
const transactionDetailAnyUpdateStatus = reduceUpdateFetchStates(transactionDetail);
|
|
100
101
|
const vendors = getVendorsByVendorIds(vendorState, vendorListState.vendorIds);
|
|
102
|
+
const { transferAccountsList, creditCardTransferAccountsList } = getResolvedTransferAccounts(state);
|
|
101
103
|
const hasInFlightCategoryClassRecommendations = getDetailInFlightRecommendations(state, transactionId);
|
|
102
104
|
return {
|
|
103
105
|
reportId: 'transaction_detail',
|
|
@@ -116,6 +118,9 @@ export const getTransactionDetail = (state, transactionId, fetchLinkedTransactio
|
|
|
116
118
|
classList: classList,
|
|
117
119
|
hasInFlightCategoryClassRecommendations,
|
|
118
120
|
isAccountingClassesEnabled,
|
|
121
|
+
createTransferEntryStatus: createTransferEntryState.createTransferEntryStatus,
|
|
122
|
+
creditCardTransferAccountsList,
|
|
123
|
+
transferAccounts: transferAccountsList,
|
|
119
124
|
isAccountingProjectsEnabled,
|
|
120
125
|
projectList,
|
|
121
126
|
isUpdateNotAllowed: transactionDetail?.isUpdateNotAllowed,
|
package/lib/index.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ import { TimeframeTick, TimeframeTickWithMetaData, mapTimePeriodtoTimeframeTick,
|
|
|
38
38
|
import { AgingDateSelectionType, AgingDetailReportInvoice, AgingDetailReportUIState, AgingReportId, AgingReportInvoice, AgingReportSortKey, AgingReportUIState } from './commonStateTypes/viewAndReport/agingReportStateTypes';
|
|
39
39
|
import { isAgingReport, isCashFlowOrBalanceSheetReport, isDashboardClassesViewReport, isDashboardReport, isFluxAnalysisOpExReport, isOpExByVendorReport, isPAndLClassesViewReport, isPAndLProjectViewReport, isPAndLReport } from './commonStateTypes/viewAndReport/reportIDHelper';
|
|
40
40
|
import { PageToken, Report, ReportFormat, ReportID, ReportIDPlusForecastID, SelectorReport, SelectorView, View, toReportFormatStrict, toReportID } from './commonStateTypes/viewAndReport/viewAndReport';
|
|
41
|
-
import { PAYMENT_BUSINESS_DAYS, filterDays, getNextNthWorkingDay, getPreviousNthWorkingDay, getYearsList, holidaysFormatted, isHoliday, isHolidayToday } from './commonStateTypes/workingDayHelper';
|
|
41
|
+
import { PAYMENT_BUSINESS_DAYS, filterDays, getNextNthWorkingDay, getNextTransferDate, getPreviousNthWorkingDay, getYearsList, holidaysFormatted, isHoliday, isHolidayToday } from './commonStateTypes/workingDayHelper';
|
|
42
42
|
import { AccountFilterOption, AccountReport, AccountWithBalanceReport, getAllAccounts, getTransactionFilterAccountOptions } from './entity/account/accountSelector';
|
|
43
43
|
import { Account, AccountBase, AccountType, RecommendedAccountBase, ReconciliationAccountSourceType, StatementCloseDay, toAccountType, toReconciliationAccountSource } from './entity/account/accountState';
|
|
44
44
|
import { NestedAccountReport } from './entity/account/subAccountSelector';
|
|
@@ -260,6 +260,7 @@ import { CompanyOfficerLocalData, CompanyOfficerType, PrimaryContactLocalData }
|
|
|
260
260
|
import { PortfolioUIState } from './view/companyView/types/companyPortfolioViewState';
|
|
261
261
|
import { CompanyView } from './view/companyView/types/companyView';
|
|
262
262
|
import { UserAndRole } from './view/companyView/types/userAndRole';
|
|
263
|
+
import { clearTransferEntryRouteReplacement, createTransferEntry, createTransferEntryFailure, createTransferEntryReplacedTransaction, createTransferEntrySuccess, fetchAccountsForTransferFlow, resetCreateTransferEntryStatus } from './view/createTransferEntry/createTransferEntryReducer';
|
|
263
264
|
import { fetchDashboard, updateTreasuryVideoClosed } from './view/dashboard/dashboardReducer';
|
|
264
265
|
import { DashboardReport, getDashboard } from './view/dashboard/dashboardSelector';
|
|
265
266
|
import { updateDashboardLayout } from './view/dashboardLayout/dashboardLayoutReducer';
|
|
@@ -274,7 +275,7 @@ import { clearExpenseAutomationFluxAnalysisView, fetchFluxAnalysisView, reviewFl
|
|
|
274
275
|
import { clearJeScheduleLocalData as clearExpenseAutomationJEScheduleLocalData, clearExpenseAutomationJESchedulesView, fetchJeSchedulesPage as fetchExpenseAutomationJESchedulesPage, ignoreRecommendedJeSchedule as ignoreExpenseAutomationJESchedule, initializeAccountSettingsView as initializeJeAccountSettingsView, initializeJeScheduleLocalData, removeJeScheduleTransactionKey, retryJeSchedule as retryExpenseAutomationJESchedule, saveAccountSettings as saveJeAccountSettings, saveAccountSettingsLocalData as saveJeAccountSettingsLocalData, updateJESchedulesUIState as updateExpenseAutomationJESchedulesUIState, updateJeScheduleLocalDataById, updateJeScheduleTransactionKeys } from './view/expenseAutomationView/reducers/jeSchedulesViewReducer';
|
|
275
276
|
import { acknowledgeBulkUploadConfirmMatchComplete, bulkUploadAutomatchingTimedOut, bulkUploadReceipts, bulkUploadReceiptsFailure, bulkUploadReceiptsSuccess, clearBulkUpload, clearBulkUploadBatchDetailsForScopeChange, clearManualSearchResults, clearMissingReceiptsTabNavigation, confirmBulkUploadMatch, confirmBulkUploadMatchFailure, confirmBulkUploadMatchSuccess, fetchBulkUploadBatchDetails, fetchBulkUploadBatchDetailsFailure, fetchBulkUploadBatchDetailsSuccess, fetchBulkUploadBatches, fetchBulkUploadBatchesFailure, fetchBulkUploadBatchesSuccess, fetchCompletedTransactions, fetchCompletedTransactionsFailure, fetchCompletedTransactionsSuccess, fetchMissingReceipts as fetchExpenseAutomationMissingReceipts, fetchMoreBatchDetails, fetchMoreBatchDetailsComplete, fetchMoreBatchDetailsFailure, markBatchDetailRefreshAttempted, markMissingReceiptAsDone as markExpenseAutomationMissingReceiptAsDone, pusherBatchStatusUpdate, refreshBatchDetailsForBatchId, requestMissingReceiptsTabNavigation, restoreBulkUploadAutomatchingOnMount, restoreBulkUploadMatchingState, searchTransactionsForManualMatch, searchTransactionsForManualMatchFailure, searchTransactionsForManualMatchSuccess, setBulkUploadCompletedSubTab, setBulkUploadResultsTab, setBulkUploadSortConfig, setBulkUploadUploadedFileCount, storeBatchDetails, updateBulkUploadProgress, updateMissingReceiptUploadState as updateExpenseAutomationMissingReceiptUploadState, updateMissingReceiptsUIState as updateExpenseAutomationMissingReceiptsUIState, uploadMissingReceiptSuccess as uploadExpenseAutomationMissingReceiptSuccess } from './view/expenseAutomationView/reducers/missingReceiptsViewReducer';
|
|
276
277
|
import { deleteAccountStatement, excludeAccountFromReconciliation, fetchReconciliation as fetchReconciliationView, includeAccountInReconciliation, saveReconciliationDetail as saveExpenseAutomationReconciliationDetail, saveReconciliationReview as saveExpenseAutomationReconciliationReview, setConnectionInProgressForAccount as setConnectionInProgressForAccountReconciliation, setStatementParseInProgress, updateAccountReconciliationLocalData as updateExpenseAutomationAccountReconciliationLocalData, updateSelectedAccountId as updateExpenseAutomationAccountReconciliationSelectedAccountId, updateSelectedTab as updateExpenseAutomationAccountReconciliationSelectedTab, updateReconListScrollPosition as updateExpenseAutomationReconListScrollPosition, updateReviewTabSortState as updateExpenseAutomationReconReviewTabListSortState, updateReviewTabLocalData as updateExpenseAutomationReconReviewTabLocalData, updateReconcileTabListScrollState as updateExpenseAutomationReconcileTabListScrollState, updateReconcileTabListSortState as updateExpenseAutomationReconcileTabListSortState, updateReconcileTabLocalData as updateExpenseAutomationReconcileTabLocalData, updateSelectedDrawerAccountId as updateExpenseAutomationSelectedDrawerAccountId, updateNodeCollapseState, updateStatementUploadChosen, uploadAccountStatement } from './view/expenseAutomationView/reducers/reconciliationViewReducer';
|
|
277
|
-
import { backgroundRefetchReviewTab, clearExpenseAutomationTransactionsView, fetchTransactionCategorization, fetchTransactionCategorizationFailure, fetchTransactionCategorizationView, initializeTransactionCategorizationViewLocalData, markCategoryClassRecommendationsFailureForCategorization, markTransactionAsNotMiscategorized, saveTransactionCategorization, saveTransactionCategorizationLocalData, setAllItemsToCategoryClassInLocalDataForCategorization, setEntityRecommendationForLineIdsForCategorization, syncTransactionCategorizationFromDetailSave, updateCurrentSelectedTransactionCategorizationTab, updateSelectedCheckboxTransactionIds, updateSelectedCustomerForTransaction, updateSelectedTransactionId, updateSelectedVendorForTransaction, updateTransactionCategorization, updateTransactionCategorizationCompletedSubTab, updateTransactionCategorizationSaveStatus, updateTransactionCategorizationUIState, updateTransactionCategorizationUploadReceiptState, updateTransactionFilters, uploadTransactionCategorizationReceiptSuccess } from './view/expenseAutomationView/reducers/transactionsViewReducer';
|
|
278
|
+
import { backgroundRefetchReviewTab, clearExpenseAutomationTransactionsView, fetchTransactionCategorization, fetchTransactionCategorizationFailure, fetchTransactionCategorizationView, initializeTransactionCategorizationViewLocalData, markCategoryClassRecommendationsFailureForCategorization, markTransactionAsNotMiscategorized, removeTransactionFromAllTabs, saveTransactionCategorization, saveTransactionCategorizationLocalData, setAllItemsToCategoryClassInLocalDataForCategorization, setEntityRecommendationForLineIdsForCategorization, syncTransactionCategorizationFromDetailSave, updateCurrentSelectedTransactionCategorizationTab, updateSelectedCheckboxTransactionIds, updateSelectedCustomerForTransaction, updateSelectedTransactionId, updateSelectedVendorForTransaction, updateTransactionCategorization, updateTransactionCategorizationCompletedSubTab, updateTransactionCategorizationSaveStatus, updateTransactionCategorizationUIState, updateTransactionCategorizationUploadReceiptState, updateTransactionFilters, uploadTransactionCategorizationReceiptSuccess } from './view/expenseAutomationView/reducers/transactionsViewReducer';
|
|
278
279
|
import { ExpenseAutomationStepDetails, ExpenseAutomationViewSelector } from './view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes';
|
|
279
280
|
import { ExpenseAutomationFluxAnalysisViewSelector, FluxAnalysisOperatingExpenseView, FluxAnalysisSectionType, FluxAnalysisVendorView, FluxAnalysisViewSectionReport, FluxVendorAccountsAndClassesView } from './view/expenseAutomationView/selectorTypes/fluxAnalysisViewSelectorTypes';
|
|
280
281
|
import { JEAccountSettingsView } from './view/expenseAutomationView/selectorTypes/jeAccountSettingsViewSelectorTypes';
|
|
@@ -286,7 +287,7 @@ import { ExpenseAutomationTransactionViewSelector, TransactionReviewLocalDataSel
|
|
|
286
287
|
import { getExpenseAutomationFluxAnalysisView } from './view/expenseAutomationView/selectors/fluxAnalysisViewSelector';
|
|
287
288
|
import { JEScheduledTransactionWithFailedEntries } from './view/expenseAutomationView/selectors/jeSchedulesViewSelector';
|
|
288
289
|
import { getExpenseAutomationReconciliationView, isAccountReconReport } from './view/expenseAutomationView/selectors/reconciliationViewSelector';
|
|
289
|
-
import { getExpenseAutomationTransactionView } from './view/expenseAutomationView/selectors/transactionCategorizationSelector';
|
|
290
|
+
import { getExpenseAutomationTransactionView, getLastTransferEntryReplacement } from './view/expenseAutomationView/selectors/transactionCategorizationSelector';
|
|
290
291
|
import { CompletedSubTab, DEFAULT_COMPLETED_SUB_TAB, toCompletedSubTab } from './view/expenseAutomationView/types/completedSubTab';
|
|
291
292
|
import { FluxAnalysisActionType, FluxAnalysisReviewStatus, FluxAnalysisSortKey, FluxAnalysisViewUIState, FluxBalancesByMonth } from './view/expenseAutomationView/types/fluxAnalysisViewState';
|
|
292
293
|
import { AccountSettingsLocalData, JEScheduleMainTab as ExpenseAutomationJEScheduleMainTab, JEScheduleSortKey as ExpenseAutomationJEScheduleSortKey, JESchedulesViewUIState as ExpenseAutomationJESchedulesViewUIState, JEScheduleLocalData, toJEScheduleMainTab as toExpenseAutomationJEScheduleMainTab, toJEScheduleSortKey as toExpenseAutomationJEScheduleSortKey } from './view/expenseAutomationView/types/jeSchedulesViewState';
|
|
@@ -661,10 +662,10 @@ export { TransactionsOrder, COABalancesSliceOrder, EntityOrder, Section, Section
|
|
|
661
662
|
export { ClassesViewSelectorReportV2 };
|
|
662
663
|
export { BalancesTimeseries, TrendTimeseries, BalanceKind };
|
|
663
664
|
export { fetchMonthEndCloseChecks, fetchMonthClosePerformanceTrend, MonthClosePerformanceTrend, MonthEndCloseCheck, getMonthEndCloseChecksViewByTenantId, MonthEndCloseChecksView, MonthEndCloseCheckFrequency, MonthCloseCheckMetrics, ALL_MONTH_END_CLOSE_CHECKS_FREQUENCY, MonthEndAuditSummary, };
|
|
664
|
-
export { ExpenseAutomationViewSelector, ExpenseAutomationStepDetails, ExpenseAutomationViewType, ExpenseAutomationMissingReceiptsViewSelector, BulkUploadSelectorData, ExpenseAutomationFluxAnalysisViewSelector, FluxAnalysisVendorView, FluxAnalysisViewSectionReport, FluxVendorAccountsAndClassesView, ExpenseAutomationMissingReceiptsViewUIState, ExpenseAutomationMissingReceiptsViewState, ExpenseAutomationViewState, ExpenseAutomationTransactionsTab, ExpenseAutomationMissingReceiptsSortKey, BATCH_FILE_STATUSES, BatchDetails, BatchFile, BatchFileStatus, BatchListItem, isUnmatchedTabFileStatus, BatchStatus, BatchStatusValue, BatchSummary, BulkUploadPhase, BulkUploadResultsTab, BulkUploadSortKey, BulkUploadState, CandidateRef, CompletedSubTab, CompletedTransactionsSelectorData, DEFAULT_COMPLETED_SUB_TAB, MatchCandidate, MatchSource, MissingReceiptsTab, toBatchFileStatus, toBatchStatusValue, toBulkUploadPhase, toBulkUploadResultsTab, toBulkUploadSortKey, toCompletedSubTab, toMatchSource, toMissingReceiptsTab, ResolvedBatchFile, ResolvedBatchDetails, ResolvedCandidate, ExpenseAutomationJEScheduleMainTab, ExpenseAutomationJEScheduleSortKey, ExpenseAutomationJESchedulesViewUIState, toExpenseAutomationJEScheduleMainTab, toExpenseAutomationJEScheduleSortKey, getExpenseAutomationView, toExpenseAutomationMissingReceiptsSortKey, toExpenseAutomationTransactionsTabKey, toExpenseAutomationViewType, uploadExpenseAutomationMissingReceiptSuccess, markExpenseAutomationMissingReceiptAsDone, fetchAllExpenseAutomationTabs, refreshExpenseAutomationCurrentTab, updateCurrentSelectedTransactionCategorizationTab, updateTransactionCategorizationCompletedSubTab, fetchExpenseAutomationMissingReceipts, bulkUploadReceipts, bulkUploadAutomatchingTimedOut, bulkUploadReceiptsSuccess, bulkUploadReceiptsFailure, restoreBulkUploadAutomatchingOnMount, restoreBulkUploadMatchingState, updateBulkUploadProgress, pusherBatchStatusUpdate, requestMissingReceiptsTabNavigation, clearMissingReceiptsTabNavigation, fetchBulkUploadBatchDetails, fetchBulkUploadBatchDetailsSuccess, fetchBulkUploadBatchDetailsFailure, storeBatchDetails, fetchMoreBatchDetails, fetchMoreBatchDetailsComplete, fetchMoreBatchDetailsFailure, fetchBulkUploadBatches, fetchBulkUploadBatchesSuccess, fetchBulkUploadBatchesFailure, clearBulkUploadBatchDetailsForScopeChange, markBatchDetailRefreshAttempted, refreshBatchDetailsForBatchId, confirmBulkUploadMatch, confirmBulkUploadMatchSuccess, confirmBulkUploadMatchFailure, setBulkUploadResultsTab, setBulkUploadCompletedSubTab, setBulkUploadSortConfig, setBulkUploadUploadedFileCount, clearBulkUpload, searchTransactionsForManualMatch, searchTransactionsForManualMatchSuccess, searchTransactionsForManualMatchFailure, clearManualSearchResults, acknowledgeBulkUploadConfirmMatchComplete, fetchCompletedTransactions, fetchCompletedTransactionsSuccess, fetchCompletedTransactionsFailure, fetchFluxAnalysisView, clearExpenseAutomationFluxAnalysisView, updateOperatingExpensesIdsForReview as updateFluxOperatingExpensesIdsForReview, updateSelectedSectionIdsForReview as updateFluxAnalysisSelectedSectionIdsForReview, reviewFluxAnalysisView, updateExpenseAutomationMissingReceiptUploadState, updateExpenseAutomationMissingReceiptsUIState, updateTransactionCategorizationUploadReceiptState, uploadTransactionCategorizationReceiptSuccess, FluxAnalysisOperatingExpenseView, FluxAnalysisSectionType, getExpenseAutomationFluxAnalysisView, FluxAnalysisSortKey, FluxAnalysisActionType, FluxBalancesByMonth, updateCurrentSelectedView, updateCurrentSelectedPeriod, getExpenseAutomationTransactionView, ReconReconcileSortKey, ReconciliationReconcileTabLocalData, FluxAnalysisReviewStatus, updateFluxAnalysisViewUIState, FluxAnalysisViewUIState, updateFluxAnalysisViewPageMetaData, MAX_SELECTION_LIMIT, checkIfAllLineItemsAreCategoryClassFilled, getLineItemsByTransactionIdsFromLocalData, isAnyItemWithUncategorizedExpenseAccount, SaveExpenseAutomationReconciliationActionType, ExcludeAccountFromReconciliationPayload, excludeAccountFromReconciliation, includeAccountInReconciliation, saveExpenseAutomationReconciliationDetail, updateExpenseAutomationReconcileTabListScrollState, updateExpenseAutomationReconReviewTabListSortState, updateExpenseAutomationReconcileTabListSortState, updateExpenseAutomationReconcileTabLocalData, updateExpenseAutomationAccountReconciliationSelectedTab, updateExpenseAutomationAccountReconciliationSelectedAccountId, ExpenseAutomationReconciliationViewSelector, getExpenseAutomationReconciliationView, AccountReconciliationBySection, fetchReconciliationView, uploadAccountStatementIntoDocumentAI, UploadStatementDocumentAIResponse, updateExpenseAutomationReconListScrollPosition, setConnectionInProgressForAccountReconciliation, AccountReconciliationByAccount, AccountReconciliationEntity, getAccountReconByAccountIdAndSelectedPeriod, ExpenseAutomationReconciliationViewTab, toReconciliationTabsType, isAccountReconReport, ReconReviewSortKey, AccountReconSectionID, ReconciliationReviewTabLocalData, TransactionsToReview, RecommendedActionCodeType, ReconciliationStatusCodeType, BalanceDataStatusCodeType, updateExpenseAutomationReconReviewTabLocalData, updateExpenseAutomationSelectedDrawerAccountId, saveExpenseAutomationReconciliationReview, updateExpenseAutomationAccountReconciliationLocalData, BankStatusCodeType, ReconciliationAccountSourceType, toReconciliationAccountSource, StatementStatusCodeType, AccountReconciliationLocalData, StatementDataStatusCodeType, deleteAccountStatement, uploadAccountStatement, updateNodeCollapseState, UploadStatementDocumentAIPayload, updateStatementUploadChosen, isReviewTransactionBankTransferType, isReviewTransactionBillPaymentType, isReviewTransactionCreditCardPaymentType, isReviewTransactionDepositType, isReviewTransactionExpenseType, isReviewTransactionCreditCardCreditType, setStatementParseInProgress, };
|
|
665
|
+
export { ExpenseAutomationViewSelector, ExpenseAutomationStepDetails, ExpenseAutomationViewType, ExpenseAutomationMissingReceiptsViewSelector, BulkUploadSelectorData, ExpenseAutomationFluxAnalysisViewSelector, FluxAnalysisVendorView, FluxAnalysisViewSectionReport, FluxVendorAccountsAndClassesView, ExpenseAutomationMissingReceiptsViewUIState, ExpenseAutomationMissingReceiptsViewState, ExpenseAutomationViewState, ExpenseAutomationTransactionsTab, ExpenseAutomationMissingReceiptsSortKey, BATCH_FILE_STATUSES, BatchDetails, BatchFile, BatchFileStatus, BatchListItem, isUnmatchedTabFileStatus, BatchStatus, BatchStatusValue, BatchSummary, BulkUploadPhase, BulkUploadResultsTab, BulkUploadSortKey, BulkUploadState, CandidateRef, CompletedSubTab, CompletedTransactionsSelectorData, DEFAULT_COMPLETED_SUB_TAB, MatchCandidate, MatchSource, MissingReceiptsTab, toBatchFileStatus, toBatchStatusValue, toBulkUploadPhase, toBulkUploadResultsTab, toBulkUploadSortKey, toCompletedSubTab, toMatchSource, toMissingReceiptsTab, ResolvedBatchFile, ResolvedBatchDetails, ResolvedCandidate, ExpenseAutomationJEScheduleMainTab, ExpenseAutomationJEScheduleSortKey, ExpenseAutomationJESchedulesViewUIState, toExpenseAutomationJEScheduleMainTab, toExpenseAutomationJEScheduleSortKey, getExpenseAutomationView, toExpenseAutomationMissingReceiptsSortKey, toExpenseAutomationTransactionsTabKey, toExpenseAutomationViewType, uploadExpenseAutomationMissingReceiptSuccess, markExpenseAutomationMissingReceiptAsDone, fetchAllExpenseAutomationTabs, refreshExpenseAutomationCurrentTab, updateCurrentSelectedTransactionCategorizationTab, updateTransactionCategorizationCompletedSubTab, fetchExpenseAutomationMissingReceipts, bulkUploadReceipts, bulkUploadAutomatchingTimedOut, bulkUploadReceiptsSuccess, bulkUploadReceiptsFailure, restoreBulkUploadAutomatchingOnMount, restoreBulkUploadMatchingState, updateBulkUploadProgress, pusherBatchStatusUpdate, requestMissingReceiptsTabNavigation, clearMissingReceiptsTabNavigation, fetchBulkUploadBatchDetails, fetchBulkUploadBatchDetailsSuccess, fetchBulkUploadBatchDetailsFailure, storeBatchDetails, fetchMoreBatchDetails, fetchMoreBatchDetailsComplete, fetchMoreBatchDetailsFailure, fetchBulkUploadBatches, fetchBulkUploadBatchesSuccess, fetchBulkUploadBatchesFailure, clearBulkUploadBatchDetailsForScopeChange, markBatchDetailRefreshAttempted, refreshBatchDetailsForBatchId, confirmBulkUploadMatch, confirmBulkUploadMatchSuccess, confirmBulkUploadMatchFailure, setBulkUploadResultsTab, setBulkUploadCompletedSubTab, setBulkUploadSortConfig, setBulkUploadUploadedFileCount, clearBulkUpload, searchTransactionsForManualMatch, searchTransactionsForManualMatchSuccess, searchTransactionsForManualMatchFailure, clearManualSearchResults, acknowledgeBulkUploadConfirmMatchComplete, fetchCompletedTransactions, fetchCompletedTransactionsSuccess, fetchCompletedTransactionsFailure, fetchFluxAnalysisView, clearExpenseAutomationFluxAnalysisView, updateOperatingExpensesIdsForReview as updateFluxOperatingExpensesIdsForReview, updateSelectedSectionIdsForReview as updateFluxAnalysisSelectedSectionIdsForReview, reviewFluxAnalysisView, updateExpenseAutomationMissingReceiptUploadState, updateExpenseAutomationMissingReceiptsUIState, updateTransactionCategorizationUploadReceiptState, uploadTransactionCategorizationReceiptSuccess, FluxAnalysisOperatingExpenseView, FluxAnalysisSectionType, getExpenseAutomationFluxAnalysisView, FluxAnalysisSortKey, FluxAnalysisActionType, FluxBalancesByMonth, updateCurrentSelectedView, updateCurrentSelectedPeriod, getExpenseAutomationTransactionView, getLastTransferEntryReplacement, ReconReconcileSortKey, ReconciliationReconcileTabLocalData, FluxAnalysisReviewStatus, updateFluxAnalysisViewUIState, FluxAnalysisViewUIState, updateFluxAnalysisViewPageMetaData, MAX_SELECTION_LIMIT, checkIfAllLineItemsAreCategoryClassFilled, getLineItemsByTransactionIdsFromLocalData, isAnyItemWithUncategorizedExpenseAccount, SaveExpenseAutomationReconciliationActionType, ExcludeAccountFromReconciliationPayload, excludeAccountFromReconciliation, includeAccountInReconciliation, saveExpenseAutomationReconciliationDetail, updateExpenseAutomationReconcileTabListScrollState, updateExpenseAutomationReconReviewTabListSortState, updateExpenseAutomationReconcileTabListSortState, updateExpenseAutomationReconcileTabLocalData, updateExpenseAutomationAccountReconciliationSelectedTab, updateExpenseAutomationAccountReconciliationSelectedAccountId, ExpenseAutomationReconciliationViewSelector, getExpenseAutomationReconciliationView, AccountReconciliationBySection, fetchReconciliationView, uploadAccountStatementIntoDocumentAI, UploadStatementDocumentAIResponse, updateExpenseAutomationReconListScrollPosition, setConnectionInProgressForAccountReconciliation, AccountReconciliationByAccount, AccountReconciliationEntity, getAccountReconByAccountIdAndSelectedPeriod, ExpenseAutomationReconciliationViewTab, toReconciliationTabsType, isAccountReconReport, ReconReviewSortKey, AccountReconSectionID, ReconciliationReviewTabLocalData, TransactionsToReview, RecommendedActionCodeType, ReconciliationStatusCodeType, BalanceDataStatusCodeType, updateExpenseAutomationReconReviewTabLocalData, updateExpenseAutomationSelectedDrawerAccountId, saveExpenseAutomationReconciliationReview, updateExpenseAutomationAccountReconciliationLocalData, BankStatusCodeType, ReconciliationAccountSourceType, toReconciliationAccountSource, StatementStatusCodeType, AccountReconciliationLocalData, StatementDataStatusCodeType, deleteAccountStatement, uploadAccountStatement, updateNodeCollapseState, UploadStatementDocumentAIPayload, updateStatementUploadChosen, isReviewTransactionBankTransferType, isReviewTransactionBillPaymentType, isReviewTransactionCreditCardPaymentType, isReviewTransactionDepositType, isReviewTransactionExpenseType, isReviewTransactionCreditCardCreditType, setStatementParseInProgress, };
|
|
665
666
|
export { JEScheduleLocalData };
|
|
666
667
|
export { ExpenseAutomationJESchedulesViewSelector, JEAccountSettingsView, JEScheduledTransactionWithFailedEntries, };
|
|
667
|
-
export { fetchTransactionCategorization, fetchTransactionCategorizationView, updateTransactionCategorizationUIState, updateTransactionFilters, updateSelectedCheckboxTransactionIds, markCategoryClassRecommendationsFailureForCategorization, setEntityRecommendationForLineIdsForCategorization, initializeTransactionCategorizationViewLocalData, setAllItemsToCategoryClassInLocalDataForCategorization, saveTransactionCategorizationLocalData, fetchTransactionCategorizationFailure, saveTransactionCategorization, updateTransactionCategorization, updateTransactionCategorizationSaveStatus, markTransactionAsNotMiscategorized, updateSelectedVendorForTransaction, updateSelectedCustomerForTransaction, updateSelectedTransactionId, syncTransactionCategorizationFromDetailSave, backgroundRefetchReviewTab, clearExpenseAutomationTransactionsView, TransactionsSortKey, toTransactionsSortKey, TransactionsTab, TransactionCategorizationLineItemData, TransactionReviewLocalData, SupportedTransactionCategorization, ExpenseAutomationTransactionsViewState, ExpenseAutomationTransactionsViewUIState, ExpenseAutomationTransactionViewSelector, TransactionReviewLocalDataSelectorView, };
|
|
668
|
+
export { fetchTransactionCategorization, fetchTransactionCategorizationView, updateTransactionCategorizationUIState, updateTransactionFilters, updateSelectedCheckboxTransactionIds, markCategoryClassRecommendationsFailureForCategorization, setEntityRecommendationForLineIdsForCategorization, initializeTransactionCategorizationViewLocalData, setAllItemsToCategoryClassInLocalDataForCategorization, saveTransactionCategorizationLocalData, fetchTransactionCategorizationFailure, saveTransactionCategorization, updateTransactionCategorization, updateTransactionCategorizationSaveStatus, markTransactionAsNotMiscategorized, updateSelectedVendorForTransaction, updateSelectedCustomerForTransaction, updateSelectedTransactionId, syncTransactionCategorizationFromDetailSave, backgroundRefetchReviewTab, createTransferEntry, createTransferEntryFailure, createTransferEntryReplacedTransaction, createTransferEntrySuccess, resetCreateTransferEntryStatus, clearTransferEntryRouteReplacement, fetchAccountsForTransferFlow, removeTransactionFromAllTabs, clearExpenseAutomationTransactionsView, TransactionsSortKey, toTransactionsSortKey, TransactionsTab, TransactionCategorizationLineItemData, TransactionReviewLocalData, SupportedTransactionCategorization, ExpenseAutomationTransactionsViewState, ExpenseAutomationTransactionsViewUIState, ExpenseAutomationTransactionViewSelector, TransactionReviewLocalDataSelectorView, };
|
|
668
669
|
export { TopExpense, TopExTimePeriod, TOP_EX_TIME_PERIODS };
|
|
669
670
|
export { TimeframeTick, TimeframeTickWithMetaData, toTimeframeTick, mapTimePeriodtoTimeframeTick, toTimePeriod, toAbsoluteDay, toMonthYearPeriodId, convertToPeriod, MonthYearPeriod, };
|
|
670
671
|
export { VendorSpendTrendFilterTabType, toVendorSpendTrendFilterTabsTypeStrict, } from './entity/vendorExpense/vendorExpenseSelector';
|
|
@@ -822,7 +823,7 @@ export { Merchant };
|
|
|
822
823
|
export { fetchEditRemiDetailPage, fetchRecommendationsAndUpdateMerchantRecommendations, fetchRemiAndInitializeLocalStore, initializeRemiToLocalStore, saveRemiUpdatesToLocalStore, fetchCurrencyConversionValue, discardRemiUpdatesInLocalStore, removeFileFromRemiUpdatesInLocalStore, saveRemiDetail, saveRemiSuccessOrFailure, parseReceiptsToRemi, clearEditRemiViewDetail, updateAddRemiAutoFields, updateUploadFetchState, updateTentativeMerchantNames, clearTentativeMerchantName, updateReimbursementType, updateHomeCurrencyConversion, clearAddRemiAutoFields, };
|
|
823
824
|
export { AnimationFileName };
|
|
824
825
|
export { reduceFetchState, reduceFetchStateParallelTimeframes, reduceAnyFetchState, reduceAllFetchState, reduceAnyCompletedFetchState, isAnyFetchInProgress, isAllFetchCompleted, SortOrder, ALL_FILE_TYPES, FileType, toFileTypeStrict, };
|
|
825
|
-
export { getNextNthWorkingDay, getPreviousNthWorkingDay, isHolidayToday, filterDays, getYearsList, isHoliday, holidaysFormatted, PAYMENT_BUSINESS_DAYS, };
|
|
826
|
+
export { getNextNthWorkingDay, getNextTransferDate, getPreviousNthWorkingDay, isHolidayToday, filterDays, getYearsList, isHoliday, holidaysFormatted, PAYMENT_BUSINESS_DAYS, };
|
|
826
827
|
export { CustomerRatingCodeType, TeamRatingCodeType };
|
|
827
828
|
export { CustomerSatisfactionInfo };
|
|
828
829
|
export { fetchCompanyOnboardingView, fetchQBOConnectionPool, updateQBOConnectionPoolExternalConnection, fetchOnboardingCompletedCompanies, saveOnboardingCustomerCompletedStatus, ProductType, ProductGroupType, toProductType, toProductTypeStrict, ProductInfo, getOnboardingCockpitView, getNewOnboardingCustomerView, getOnboardingEmailGroup, initializeOnboardingCustomerViewUpdateData, clearOnboardingCustomerViewUpdateData, saveOnboardingCustomerViewUpdateData, updateOnboardingCustomerListUIState, updateCustomerCreationStatus, updateStatusAfterOnboardingCompleted, saveOnboardingCustomerViewUpdates, saveOnboardingCustomerNotes, saveOnboardingCustomerDataInLocalStore, updateOnboardingCustomerDataInLocalStore, NewOnboardingCustomer, OnboardingCustomer, OnboardingCockpitView, NewOnboardingCustomerView, NewOnboardingCustomerLocalData, OnboardingCustomerCompletedStatus, OnboardingCustomerListUIState, QBOConnectionPool, CustomerCreationStatus, OnboardingCompanyDetails, resetNewOnboardedCustomerId, sendOnboardingCustomerViewInvite, retryBankAccountConnectionForOnboarding, };
|
|
@@ -936,3 +937,11 @@ export { UserGroup } from './entity/userGroups/userGroupsState';
|
|
|
936
937
|
export { SessionManager } from './entity/tenant/SessionManager';
|
|
937
938
|
export type { SessionCallbacks, SessionConfig, } from './entity/tenant/sessionTypes';
|
|
938
939
|
export { DEFAULT_SESSION_CONFIG } from './entity/tenant/sessionTypes';
|
|
940
|
+
export { fetchCashManagementBanner, fetchCashManagementOverviewPage, } from './view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewReducer';
|
|
941
|
+
export { clearAutoSweepFlow, fetchCashManagementSettings, saveAutoSweepSettings, updateAutoSweepSettingsFetchStatus, updateCashManagementSettings, updateCashManagementSettingsFetchStatus, } from './view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowReducer';
|
|
942
|
+
export { getAutoSweepFlow } from './view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowSelector';
|
|
943
|
+
export type { AutoSweepFlowSelectorView } from './view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowSelector';
|
|
944
|
+
export { RISK_BUFFER_AMOUNT, bufferAmountToRisk, } from './view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowState';
|
|
945
|
+
export type { AutoSweepFlowState, AutoSweepFrequency, RiskLevel, } from './view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowState';
|
|
946
|
+
export { CashManagementOverviewBannerSelectorView, CashManagementOverviewSelectorView, CashProjectionPoint, getCashManagementOverview, getCashManagementOverviewBanner, } from './view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector';
|
|
947
|
+
export type { UpcomingPaymentEvent, UpcomingPaymentEventAccountType, } from './view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewState';
|