@zeniai/client-epic-state 4.19.77-betaML1 → 4.19.77-betaSS1
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/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -1
- package/lib/epic.d.ts +5 -2
- package/lib/epic.js +5 -2
- package/lib/esm/entity/snackbar/snackbarTypes.js +0 -1
- package/lib/esm/epic.js +5 -2
- package/lib/esm/index.js +6 -4
- package/lib/esm/reducer.js +3 -0
- package/lib/esm/view/accountList/accountListReducer.js +1 -3
- package/lib/esm/view/accountList/accountListSelector.js +0 -8
- package/lib/esm/view/accountList/fetchAccountListEpic.js +10 -20
- package/lib/esm/view/creditAgentView/creditAgentViewPayload.js +1 -0
- package/lib/esm/view/creditAgentView/creditAgentViewReducer.js +113 -0
- package/lib/esm/view/creditAgentView/creditAgentViewSelector.js +3 -0
- package/lib/esm/view/creditAgentView/creditAgentViewState.js +18 -0
- package/lib/esm/view/creditAgentView/epics/fetchCreditAgentMacroEpic.js +16 -0
- package/lib/esm/view/creditAgentView/epics/fetchTenantCreditScoreReportEpic.js +16 -0
- package/lib/esm/view/creditAgentView/epics/saveCreditAgentMacroEpic.js +23 -0
- package/lib/esm/view/creditAgentView/epics/scheduleTenantCreditScoreCronEpic.js +19 -0
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.js +0 -5
- package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +1 -30
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +0 -3
- package/lib/esm/view/transactionDetail/epics/transactionDetailEpic.js +0 -5
- package/lib/esm/view/transactionDetail/transactionDetailSelector.js +0 -2
- package/lib/index.d.ts +7 -4
- package/lib/index.js +49 -35
- package/lib/reducer.d.ts +3 -0
- package/lib/reducer.js +3 -0
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
- package/lib/view/accountList/accountListReducer.d.ts +1 -2
- package/lib/view/accountList/accountListReducer.js +1 -3
- package/lib/view/accountList/accountListSelector.d.ts +1 -6
- package/lib/view/accountList/accountListSelector.js +1 -10
- package/lib/view/accountList/accountListState.d.ts +1 -1
- package/lib/view/accountList/fetchAccountListEpic.js +10 -20
- package/lib/view/creditAgentView/creditAgentViewPayload.d.ts +64 -0
- package/lib/view/creditAgentView/creditAgentViewPayload.js +2 -0
- package/lib/view/creditAgentView/creditAgentViewReducer.d.ts +11 -0
- package/lib/view/creditAgentView/creditAgentViewReducer.js +117 -0
- package/lib/view/creditAgentView/creditAgentViewSelector.d.ts +17 -0
- package/lib/view/creditAgentView/creditAgentViewSelector.js +9 -0
- package/lib/view/creditAgentView/creditAgentViewState.d.ts +58 -0
- package/lib/view/creditAgentView/creditAgentViewState.js +21 -0
- package/lib/view/creditAgentView/epics/fetchCreditAgentMacroEpic.d.ts +12 -0
- package/lib/view/creditAgentView/epics/fetchCreditAgentMacroEpic.js +20 -0
- package/lib/view/creditAgentView/epics/fetchTenantCreditScoreReportEpic.d.ts +12 -0
- package/lib/view/creditAgentView/epics/fetchTenantCreditScoreReportEpic.js +20 -0
- package/lib/view/creditAgentView/epics/saveCreditAgentMacroEpic.d.ts +12 -0
- package/lib/view/creditAgentView/epics/saveCreditAgentMacroEpic.js +27 -0
- package/lib/view/creditAgentView/epics/scheduleTenantCreditScoreCronEpic.d.ts +12 -0
- package/lib/view/creditAgentView/epics/scheduleTenantCreditScoreCronEpic.js +23 -0
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.js +0 -5
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +1 -17
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +2 -31
- package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +1 -10
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +0 -3
- package/lib/view/transactionDetail/epics/transactionDetailEpic.js +0 -5
- package/lib/view/transactionDetail/transactionDetailSelector.d.ts +1 -4
- package/lib/view/transactionDetail/transactionDetailSelector.js +0 -2
- package/lib/zeniAPI.d.ts +1 -0
- package/package.json +54 -28
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/convertTransactionTypeEpic.js +0 -78
- package/lib/view/expenseAutomationView/epics/transactionCategorization/convertTransactionTypeEpic.d.ts +0 -38
- package/lib/view/expenseAutomationView/epics/transactionCategorization/convertTransactionTypeEpic.js +0 -82
|
@@ -13,36 +13,26 @@ const getAccountTypes = (isLimitedCategoryEnabled, filterAccountTypes) => {
|
|
|
13
13
|
return [];
|
|
14
14
|
};
|
|
15
15
|
export const fetchAccountListEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(fetchAccountList.match), mergeMap((action) => {
|
|
16
|
-
const { accountListKey, fetchFullResponse, excludeAccountPayableAccounts, excludeAccountReceivableAccounts, isLimitedCategoryEnabled, filterAccountTypes, isIncludeDeleted,
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return {
|
|
26
|
-
is_bookkeeping_admin: fetchFullResponse,
|
|
27
|
-
is_exclude_account_payable_accounts: excludeAccountPayableAccounts,
|
|
28
|
-
is_exclude_account_receivable_accounts: excludeAccountReceivableAccounts,
|
|
29
|
-
account_types: accountTypes,
|
|
30
|
-
...(isIncludeDeleted === true && { is_include_deleted: true }),
|
|
31
|
-
};
|
|
32
|
-
})();
|
|
16
|
+
const { accountListKey, fetchFullResponse, excludeAccountPayableAccounts, excludeAccountReceivableAccounts, isLimitedCategoryEnabled, filterAccountTypes, isIncludeDeleted, } = action.payload;
|
|
17
|
+
const accountTypes = getAccountTypes(isLimitedCategoryEnabled, filterAccountTypes);
|
|
18
|
+
const queryValue = {
|
|
19
|
+
is_bookkeeping_admin: fetchFullResponse,
|
|
20
|
+
is_exclude_account_payable_accounts: excludeAccountPayableAccounts,
|
|
21
|
+
is_exclude_account_receivable_accounts: excludeAccountReceivableAccounts,
|
|
22
|
+
account_types: accountTypes,
|
|
23
|
+
...(isIncludeDeleted === true && { is_include_deleted: true }),
|
|
24
|
+
};
|
|
33
25
|
return zeniAPI
|
|
34
26
|
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/accounts?query=${encodeURIComponent(JSON.stringify(queryValue))}`)
|
|
35
27
|
.pipe(mergeMap((response) => {
|
|
36
28
|
if (isSuccessResponse(response)) {
|
|
37
29
|
const actions = [
|
|
30
|
+
updateAccounts(response.data?.accounts ?? [], 'account_list'),
|
|
38
31
|
updateAccountList({
|
|
39
32
|
accountListKey,
|
|
40
33
|
accountListResponse: response,
|
|
41
34
|
}),
|
|
42
35
|
];
|
|
43
|
-
if (accountListKey !== 'bankAndCreditCardAccounts') {
|
|
44
|
-
actions.unshift(updateAccounts(response.data?.accounts ?? [], 'account_list'));
|
|
45
|
-
}
|
|
46
36
|
return from(actions);
|
|
47
37
|
}
|
|
48
38
|
else {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { createSlice } from '@reduxjs/toolkit';
|
|
2
|
+
import { initialCreditAgentViewState, } from './creditAgentViewState';
|
|
3
|
+
const creditAgentView = createSlice({
|
|
4
|
+
name: 'creditAgentView',
|
|
5
|
+
initialState: initialCreditAgentViewState,
|
|
6
|
+
reducers: {
|
|
7
|
+
fetchTenantCreditScoreReport(draft) {
|
|
8
|
+
draft.report.fetchState = 'In-Progress';
|
|
9
|
+
draft.report.error = undefined;
|
|
10
|
+
},
|
|
11
|
+
updateTenantCreditScoreReport(draft, action) {
|
|
12
|
+
draft.report.fetchState = 'Completed';
|
|
13
|
+
draft.report.error = undefined;
|
|
14
|
+
draft.report.rows = action.payload.report.map((row) => ({
|
|
15
|
+
customerName: row.customer_name,
|
|
16
|
+
totalCashBalance: row.total_cash_balance,
|
|
17
|
+
totalCardBalance: row.total_card_balance,
|
|
18
|
+
cards: row.cards,
|
|
19
|
+
controllerName: row.controller_name,
|
|
20
|
+
period: row.period,
|
|
21
|
+
runway: row.runway,
|
|
22
|
+
burnRateMonthly: row.burn_rate_monthly,
|
|
23
|
+
healthMonitorScore: row.health_monitor_score,
|
|
24
|
+
creditScore: row.credit_score,
|
|
25
|
+
confidence: row.confidence,
|
|
26
|
+
creditAmount: row.credit_amount,
|
|
27
|
+
creditLimit: row.credit_limit,
|
|
28
|
+
conservativeLimitRationale: row.conservative_limit_rationale,
|
|
29
|
+
liberalCreditLimit: row.liberal_credit_limit,
|
|
30
|
+
liberalLimitRationale: row.liberal_limit_rationale,
|
|
31
|
+
pros: row.pros,
|
|
32
|
+
cons: row.cons,
|
|
33
|
+
reasoning: row.reasoning,
|
|
34
|
+
goingConcernAnalysis: row.going_concern_analysis,
|
|
35
|
+
keyRatios: row.key_ratios,
|
|
36
|
+
runDate: row.run_date,
|
|
37
|
+
status: row.status,
|
|
38
|
+
}));
|
|
39
|
+
draft.report.count = action.payload.count;
|
|
40
|
+
},
|
|
41
|
+
updateTenantCreditScoreReportFailure(draft, action) {
|
|
42
|
+
draft.report.fetchState = 'Error';
|
|
43
|
+
draft.report.error = action.payload;
|
|
44
|
+
},
|
|
45
|
+
scheduleTenantCreditScoreCron(draft,
|
|
46
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
47
|
+
_action) {
|
|
48
|
+
draft.scheduleCron.fetchState = 'In-Progress';
|
|
49
|
+
draft.scheduleCron.error = undefined;
|
|
50
|
+
},
|
|
51
|
+
scheduleTenantCreditScoreCronSuccess(draft) {
|
|
52
|
+
draft.scheduleCron.fetchState = 'Completed';
|
|
53
|
+
draft.scheduleCron.error = undefined;
|
|
54
|
+
},
|
|
55
|
+
scheduleTenantCreditScoreCronFailure(draft, action) {
|
|
56
|
+
draft.scheduleCron.fetchState = 'Error';
|
|
57
|
+
draft.scheduleCron.error = action.payload;
|
|
58
|
+
},
|
|
59
|
+
resetScheduleCronState(draft) {
|
|
60
|
+
draft.scheduleCron.fetchState = 'Not-Started';
|
|
61
|
+
draft.scheduleCron.error = undefined;
|
|
62
|
+
},
|
|
63
|
+
fetchCreditAgentMacro(draft) {
|
|
64
|
+
draft.macro.fetchState = 'In-Progress';
|
|
65
|
+
draft.macro.error = undefined;
|
|
66
|
+
},
|
|
67
|
+
updateCreditAgentMacro(draft, action) {
|
|
68
|
+
draft.macro.fetchState = 'Completed';
|
|
69
|
+
draft.macro.error = undefined;
|
|
70
|
+
draft.macro.data = mapMacroPayload(action.payload);
|
|
71
|
+
},
|
|
72
|
+
updateCreditAgentMacroFailure(draft, action) {
|
|
73
|
+
draft.macro.fetchState = 'Error';
|
|
74
|
+
draft.macro.error = action.payload;
|
|
75
|
+
},
|
|
76
|
+
saveCreditAgentMacro(draft,
|
|
77
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
78
|
+
_action) {
|
|
79
|
+
draft.macro.updateState = 'In-Progress';
|
|
80
|
+
draft.macro.error = undefined;
|
|
81
|
+
},
|
|
82
|
+
saveCreditAgentMacroSuccess(draft, action) {
|
|
83
|
+
draft.macro.updateState = 'Completed';
|
|
84
|
+
draft.macro.error = undefined;
|
|
85
|
+
draft.macro.data = mapMacroPayload(action.payload);
|
|
86
|
+
},
|
|
87
|
+
saveCreditAgentMacroFailure(draft, action) {
|
|
88
|
+
draft.macro.updateState = 'Error';
|
|
89
|
+
draft.macro.error = action.payload;
|
|
90
|
+
},
|
|
91
|
+
resetSaveMacroState(draft) {
|
|
92
|
+
draft.macro.updateState = 'Not-Started';
|
|
93
|
+
draft.macro.error = undefined;
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
});
|
|
97
|
+
function mapMacroPayload(payload) {
|
|
98
|
+
return {
|
|
99
|
+
macroId: payload.macro_id,
|
|
100
|
+
version: payload.version,
|
|
101
|
+
isLatest: payload.is_latest,
|
|
102
|
+
isActive: payload.is_active,
|
|
103
|
+
name: payload.name,
|
|
104
|
+
description: payload.description,
|
|
105
|
+
instructions: payload.instructions,
|
|
106
|
+
tenantId: payload.tenant_id,
|
|
107
|
+
createdAt: payload.created_at,
|
|
108
|
+
updatedAt: payload.updated_at,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
export const { fetchTenantCreditScoreReport, updateTenantCreditScoreReport, updateTenantCreditScoreReportFailure, scheduleTenantCreditScoreCron, scheduleTenantCreditScoreCronSuccess, scheduleTenantCreditScoreCronFailure, resetScheduleCronState, fetchCreditAgentMacro, updateCreditAgentMacro, updateCreditAgentMacroFailure, saveCreditAgentMacro, saveCreditAgentMacroSuccess, saveCreditAgentMacroFailure, resetSaveMacroState, } = creditAgentView.actions;
|
|
112
|
+
export { initialCreditAgentViewState as initialState };
|
|
113
|
+
export default creditAgentView.reducer;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const initialCreditAgentViewState = {
|
|
2
|
+
report: {
|
|
3
|
+
fetchState: 'Not-Started',
|
|
4
|
+
error: undefined,
|
|
5
|
+
rows: [],
|
|
6
|
+
count: 0,
|
|
7
|
+
},
|
|
8
|
+
scheduleCron: {
|
|
9
|
+
fetchState: 'Not-Started',
|
|
10
|
+
error: undefined,
|
|
11
|
+
},
|
|
12
|
+
macro: {
|
|
13
|
+
fetchState: 'Not-Started',
|
|
14
|
+
updateState: 'Not-Started',
|
|
15
|
+
error: undefined,
|
|
16
|
+
data: null,
|
|
17
|
+
},
|
|
18
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { of } from 'rxjs';
|
|
2
|
+
import { catchError, filter, switchMap, mergeMap } from 'rxjs/operators';
|
|
3
|
+
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
4
|
+
import { fetchCreditAgentMacro, updateCreditAgentMacro, updateCreditAgentMacroFailure, } from '../creditAgentViewReducer';
|
|
5
|
+
export const fetchCreditAgentMacroEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(fetchCreditAgentMacro.match), switchMap(() => {
|
|
6
|
+
const url = `${zeniAPI.apiEndPoints.chatMicroServiceBaseUrl}/1.0/macros/credit-agent`;
|
|
7
|
+
return zeniAPI.getJSON(url).pipe(mergeMap((response) => {
|
|
8
|
+
if (isSuccessResponse(response)) {
|
|
9
|
+
return of(updateCreditAgentMacro(response.data // eslint-disable-line @typescript-eslint/no-non-null-assertion
|
|
10
|
+
));
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
return of(updateCreditAgentMacroFailure(response.status));
|
|
14
|
+
}
|
|
15
|
+
}), catchError((error) => of(updateCreditAgentMacroFailure(createZeniAPIStatus('Unexpected error', 'REST API call errored out: ' + JSON.stringify(error))))));
|
|
16
|
+
}));
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { of } from 'rxjs';
|
|
2
|
+
import { catchError, filter, switchMap, mergeMap } from 'rxjs/operators';
|
|
3
|
+
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
4
|
+
import { fetchTenantCreditScoreReport, updateTenantCreditScoreReport, updateTenantCreditScoreReportFailure, } from '../creditAgentViewReducer';
|
|
5
|
+
export const fetchTenantCreditScoreReportEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(fetchTenantCreditScoreReport.match), switchMap(() => {
|
|
6
|
+
const url = `${zeniAPI.apiEndPoints.cardMicroServiceBaseUrl}/1.0/admin/tenant-credit-score-report`;
|
|
7
|
+
return zeniAPI.getJSON(url).pipe(mergeMap((response) => {
|
|
8
|
+
if (isSuccessResponse(response)) {
|
|
9
|
+
return of(updateTenantCreditScoreReport(response.data // eslint-disable-line @typescript-eslint/no-non-null-assertion
|
|
10
|
+
));
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
return of(updateTenantCreditScoreReportFailure(response.status));
|
|
14
|
+
}
|
|
15
|
+
}), catchError((error) => of(updateTenantCreditScoreReportFailure(createZeniAPIStatus('Unexpected error', 'REST API call errored out: ' + JSON.stringify(error))))));
|
|
16
|
+
}));
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { of } from 'rxjs';
|
|
2
|
+
import { catchError, filter, switchMap, mergeMap } from 'rxjs/operators';
|
|
3
|
+
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
4
|
+
import { saveCreditAgentMacro, saveCreditAgentMacroFailure, saveCreditAgentMacroSuccess, } from '../creditAgentViewReducer';
|
|
5
|
+
export const saveCreditAgentMacroEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(saveCreditAgentMacro.match), switchMap((action) => {
|
|
6
|
+
const { instructions } = action.payload;
|
|
7
|
+
const existingMacro = state$.value.creditAgentViewState.macro.data;
|
|
8
|
+
const url = `${zeniAPI.apiEndPoints.chatMicroServiceBaseUrl}/1.0/macros/credit-agent`;
|
|
9
|
+
const body = {
|
|
10
|
+
instructions,
|
|
11
|
+
name: existingMacro?.name ?? 'credit-agent',
|
|
12
|
+
description: existingMacro?.description ?? '',
|
|
13
|
+
};
|
|
14
|
+
return zeniAPI.putAndGetJSON(url, body).pipe(mergeMap((response) => {
|
|
15
|
+
if (isSuccessResponse(response)) {
|
|
16
|
+
return of(saveCreditAgentMacroSuccess(response.data // eslint-disable-line @typescript-eslint/no-non-null-assertion
|
|
17
|
+
));
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
return of(saveCreditAgentMacroFailure(response.status));
|
|
21
|
+
}
|
|
22
|
+
}), catchError((error) => of(saveCreditAgentMacroFailure(createZeniAPIStatus('Unexpected error', 'REST API call errored out: ' + JSON.stringify(error))))));
|
|
23
|
+
}));
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { of } from 'rxjs';
|
|
2
|
+
import { catchError, filter, switchMap, mergeMap } from 'rxjs/operators';
|
|
3
|
+
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
4
|
+
import { scheduleTenantCreditScoreCron, scheduleTenantCreditScoreCronFailure, scheduleTenantCreditScoreCronSuccess, } from '../creditAgentViewReducer';
|
|
5
|
+
export const scheduleTenantCreditScoreCronEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(scheduleTenantCreditScoreCron.match), switchMap((action) => {
|
|
6
|
+
const { tenantId } = action.payload;
|
|
7
|
+
const url = `${zeniAPI.apiEndPoints.cardMicroServiceBaseUrl}/1.0/crons/cards/tenant-credit-score`;
|
|
8
|
+
const body = tenantId != null ? { tenant_id: tenantId } : {};
|
|
9
|
+
return zeniAPI
|
|
10
|
+
.postAndGetJSON(url, body)
|
|
11
|
+
.pipe(mergeMap((response) => {
|
|
12
|
+
if (isSuccessResponse(response)) {
|
|
13
|
+
return of(scheduleTenantCreditScoreCronSuccess());
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
return of(scheduleTenantCreditScoreCronFailure(response.status));
|
|
17
|
+
}
|
|
18
|
+
}), catchError((error) => of(scheduleTenantCreditScoreCronFailure(createZeniAPIStatus('Unexpected error', 'REST API call errored out: ' + JSON.stringify(error))))));
|
|
19
|
+
}));
|
|
@@ -21,11 +21,6 @@ export const fetchTransactionCategorizationViewEpic = (actions$, state$) => acti
|
|
|
21
21
|
accountList.fetchState === 'Not-Started') {
|
|
22
22
|
updateActions.push(fetchAccountList('accountList', true));
|
|
23
23
|
}
|
|
24
|
-
const bankAndCreditCardAccounts = state$.value.accountListState.byReportId.bankAndCreditCardAccounts;
|
|
25
|
-
if (bankAndCreditCardAccounts.hasValidState() === false &&
|
|
26
|
-
bankAndCreditCardAccounts.fetchState === 'Not-Started') {
|
|
27
|
-
updateActions.push(fetchAccountList('bankAndCreditCardAccounts'));
|
|
28
|
-
}
|
|
29
24
|
const classList = state$.value.classListState;
|
|
30
25
|
if (classList.hasValidState() === false &&
|
|
31
26
|
classList.fetchState === 'Not-Started') {
|
|
@@ -699,35 +699,6 @@ const expenseAutomationTransactionsView = createSlice({
|
|
|
699
699
|
clearExpenseAutomationTransactionsView(draft) {
|
|
700
700
|
Object.assign(draft, initialState);
|
|
701
701
|
},
|
|
702
|
-
removeTransactionsFromCategorizationList(draft, action) {
|
|
703
|
-
const { selectedTab, selectedPeriod, transactionIds } = action.payload;
|
|
704
|
-
const periodId = toMonthYearPeriodId(selectedPeriod);
|
|
705
|
-
const tabView = draft.transactionCategorizationView[selectedTab];
|
|
706
|
-
const currentIds = tabView.transactionIdsBySelectedPeriod[periodId] ?? [];
|
|
707
|
-
tabView.transactionIdsBySelectedPeriod[periodId] = currentIds.filter((id) => !transactionIds.includes(id));
|
|
708
|
-
transactionIds.forEach((id) => {
|
|
709
|
-
delete tabView.transactionReviewLocalDataById[id];
|
|
710
|
-
});
|
|
711
|
-
tabView.selectedCheckBoxTransactionIds =
|
|
712
|
-
tabView.selectedCheckBoxTransactionIds.filter((id) => !transactionIds.includes(id));
|
|
713
|
-
tabView.transactionIdsWithUnsavedData =
|
|
714
|
-
tabView.transactionIdsWithUnsavedData.filter((id) => !transactionIds.includes(id));
|
|
715
|
-
},
|
|
716
|
-
convertTransactionType(_draft, _action) {
|
|
717
|
-
// Trigger only; epic performs the API call. No state change.
|
|
718
|
-
void _draft;
|
|
719
|
-
void _action;
|
|
720
|
-
},
|
|
721
|
-
convertTransactionTypeSuccess(_draft, _action) {
|
|
722
|
-
// UI can listen for this to close the convert drawer. No state change.
|
|
723
|
-
void _draft;
|
|
724
|
-
void _action;
|
|
725
|
-
},
|
|
726
|
-
convertTransactionTypeFailure(_draft, _action) {
|
|
727
|
-
// UI can listen for this to show error in the convert drawer. No state change.
|
|
728
|
-
void _draft;
|
|
729
|
-
void _action;
|
|
730
|
-
},
|
|
731
702
|
syncTransactionCategorizationFromDetailSave: {
|
|
732
703
|
prepare(transactionId, updatedTransaction, pendingReviewLineIds, uncategorizedIncomeExpense, isUncategorizedExpenseCategoryEnabled) {
|
|
733
704
|
return {
|
|
@@ -799,5 +770,5 @@ const expenseAutomationTransactionsView = createSlice({
|
|
|
799
770
|
},
|
|
800
771
|
},
|
|
801
772
|
});
|
|
802
|
-
export const { fetchTransactionCategorization, updateTransactionCategorizationUIState, initializeTransactionCategorizationViewLocalData, saveTransactionCategorizationLocalData, fetchTransactionCategorizationFailure, saveTransactionCategorization, updateTransactionCategorization, updateCurrentSelectedTransactionCategorizationTab, updateTransactionCategorizationSaveStatus, markTransactionAsNotMiscategorized, updateStatusForTransactionNotMiscategorizedUpdateForCategorization, updateSelectedVendorForTransaction, updateSelectedCustomerForTransaction, setAllItemsToCategoryClassInLocalDataForCategorization, updateTotalCountForTransactionCategorization, fetchTransactionCategorizationSuccess, resetOtherTabsFetchState, fetchTransactionCategorizationView, updateSelectedCheckboxTransactionIds, clearExpenseAutomationTransactionsViewPerTabView, clearExpenseAutomationTransactionsView, setEntityRecommendationForLineIdsForCategorization, updateSelectedTransactionId,
|
|
773
|
+
export const { fetchTransactionCategorization, updateTransactionCategorizationUIState, initializeTransactionCategorizationViewLocalData, saveTransactionCategorizationLocalData, fetchTransactionCategorizationFailure, saveTransactionCategorization, updateTransactionCategorization, updateCurrentSelectedTransactionCategorizationTab, updateTransactionCategorizationSaveStatus, markTransactionAsNotMiscategorized, updateStatusForTransactionNotMiscategorizedUpdateForCategorization, updateSelectedVendorForTransaction, updateSelectedCustomerForTransaction, setAllItemsToCategoryClassInLocalDataForCategorization, updateTotalCountForTransactionCategorization, fetchTransactionCategorizationSuccess, resetOtherTabsFetchState, fetchTransactionCategorizationView, updateSelectedCheckboxTransactionIds, clearExpenseAutomationTransactionsViewPerTabView, clearExpenseAutomationTransactionsView, setEntityRecommendationForLineIdsForCategorization, updateSelectedTransactionId, syncTransactionCategorizationFromDetailSave, backgroundRefetchReviewTab, } = expenseAutomationTransactionsView.actions;
|
|
803
774
|
export default expenseAutomationTransactionsView.reducer;
|
|
@@ -96,8 +96,5 @@ export function getExpenseAutomationTransactionView(state) {
|
|
|
96
96
|
fetchStateByTransactionTabs: fetchStateByTab,
|
|
97
97
|
selectedTransactionId,
|
|
98
98
|
selectedTransactionLineId,
|
|
99
|
-
createTransferEntryStatus: 'Not-Started',
|
|
100
|
-
transferAccounts: [],
|
|
101
|
-
debitAccountInfoByTransactionId: {},
|
|
102
99
|
};
|
|
103
100
|
}
|
|
@@ -34,11 +34,6 @@ export const fetchTransactionDetailEpic = (actions$, state$, zeniAPI) => actions
|
|
|
34
34
|
accountList.fetchState !== 'In-Progress') {
|
|
35
35
|
transactionActions.push(fetchAccountList('accountList'));
|
|
36
36
|
}
|
|
37
|
-
const bankAndCreditCardAccounts = state$.value.accountListState.byReportId.bankAndCreditCardAccounts;
|
|
38
|
-
if (bankAndCreditCardAccounts.hasValidState() === false &&
|
|
39
|
-
bankAndCreditCardAccounts.fetchState !== 'In-Progress') {
|
|
40
|
-
transactionActions.push(fetchAccountList('bankAndCreditCardAccounts'));
|
|
41
|
-
}
|
|
42
37
|
const classList = state$.value.classListState;
|
|
43
38
|
if (classList.hasValidState() === false &&
|
|
44
39
|
classList.fetchState !== 'In-Progress') {
|
|
@@ -76,8 +76,6 @@ export const getTransactionDetail = (state, transactionId, fetchLinkedTransactio
|
|
|
76
76
|
initialSupportedTransactionDetail.transactionDetailLocalData,
|
|
77
77
|
selectedVendor: transactionDetail?.transactionDetailLocalData.vendorUpdates,
|
|
78
78
|
allVendors: vendors,
|
|
79
|
-
createTransferEntryStatus: 'Not-Started',
|
|
80
|
-
transferAccounts: [],
|
|
81
79
|
};
|
|
82
80
|
};
|
|
83
81
|
export function getTransactionDetailForTransaction(rootState, transactionId) {
|
package/lib/index.d.ts
CHANGED
|
@@ -151,7 +151,7 @@ import initialize, { ZeniStore, disconnectPusher, initializePusher, initializeWi
|
|
|
151
151
|
import { RootState } from './reducer';
|
|
152
152
|
import { ZeniAPIStatus, isAccessDeniedError, isInvalidSessionError, isSuccessResponse } from './responsePayload';
|
|
153
153
|
import { fetchAccountList } from './view/accountList/accountListReducer';
|
|
154
|
-
import { AccountListSelectorView, UncategorizedAccounts,
|
|
154
|
+
import { AccountListSelectorView, UncategorizedAccounts, getNestedAccountListHierarchy, getUncategorizedAccounts } from './view/accountList/accountListSelector';
|
|
155
155
|
import { clearAccountMappingLocalData, initializeAccountMappingView, saveAccountMapping, saveAccountMappingLocalData } from './view/accountMappingView/accountMappingReducer';
|
|
156
156
|
import { AccountMappingLocalData, ExpenseCategory1099Filing } from './view/accountMappingView/accountMappingState';
|
|
157
157
|
import { VendorAccountMappingView } from './view/accountMappingView/accountMappingTypeHelper';
|
|
@@ -267,7 +267,7 @@ import { clearExpenseAutomationFluxAnalysisView, fetchFluxAnalysisView, reviewFl
|
|
|
267
267
|
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, updateJeScheduleLocalDataById, updateJeScheduleTransactionKeys } from './view/expenseAutomationView/reducers/jeSchedulesViewReducer';
|
|
268
268
|
import { fetchMissingReceipts as fetchExpenseAutomationMissingReceipts, markMissingReceiptAsDone as markExpenseAutomationMissingReceiptAsDone, updateMissingReceiptUploadState as updateExpenseAutomationMissingReceiptUploadState, updateMissingReceiptsUIState as updateExpenseAutomationMissingReceiptsUIState, uploadMissingReceiptSuccess as uploadExpenseAutomationMissingReceiptSuccess } from './view/expenseAutomationView/reducers/missingReceiptsViewReducer';
|
|
269
269
|
import { deleteAccountStatement, fetchReconciliation as fetchReconciliationView, 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, updateStatementUploadChosen, uploadAccountStatement } from './view/expenseAutomationView/reducers/reconciliationViewReducer';
|
|
270
|
-
import { backgroundRefetchReviewTab, clearExpenseAutomationTransactionsView, fetchTransactionCategorization, fetchTransactionCategorizationFailure, fetchTransactionCategorizationView, initializeTransactionCategorizationViewLocalData, markTransactionAsNotMiscategorized,
|
|
270
|
+
import { backgroundRefetchReviewTab, clearExpenseAutomationTransactionsView, fetchTransactionCategorization, fetchTransactionCategorizationFailure, fetchTransactionCategorizationView, initializeTransactionCategorizationViewLocalData, markTransactionAsNotMiscategorized, saveTransactionCategorization, saveTransactionCategorizationLocalData, setAllItemsToCategoryClassInLocalDataForCategorization, setEntityRecommendationForLineIdsForCategorization, syncTransactionCategorizationFromDetailSave, updateCurrentSelectedTransactionCategorizationTab, updateSelectedCheckboxTransactionIds, updateSelectedCustomerForTransaction, updateSelectedTransactionId, updateSelectedVendorForTransaction, updateTransactionCategorization, updateTransactionCategorizationSaveStatus, updateTransactionCategorizationUIState } from './view/expenseAutomationView/reducers/transactionsViewReducer';
|
|
271
271
|
import { ExpenseAutomationStepDetails, ExpenseAutomationViewSelector } from './view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes';
|
|
272
272
|
import { ExpenseAutomationFluxAnalysisViewSelector, FluxAnalysisOperatingExpenseView, FluxAnalysisSectionType, FluxAnalysisVendorView, FluxAnalysisViewSectionReport, FluxVendorAccountsAndClassesView } from './view/expenseAutomationView/selectorTypes/fluxAnalysisViewSelectorTypes';
|
|
273
273
|
import { JEAccountSettingsView } from './view/expenseAutomationView/selectorTypes/jeAccountSettingsViewSelectorTypes';
|
|
@@ -623,7 +623,7 @@ export { fetchMonthEndCloseChecks, fetchMonthClosePerformanceTrend, MonthClosePe
|
|
|
623
623
|
export { ExpenseAutomationViewSelector, ExpenseAutomationStepDetails, ExpenseAutomationViewType, ExpenseAutomationMissingReceiptsViewSelector, ExpenseAutomationFluxAnalysisViewSelector, FluxAnalysisVendorView, FluxAnalysisViewSectionReport, FluxVendorAccountsAndClassesView, ExpenseAutomationMissingReceiptsViewUIState, ExpenseAutomationMissingReceiptsViewState, ExpenseAutomationViewState, ExpenseAutomationTransactionsTab, ExpenseAutomationMissingReceiptsSortKey, getExpenseAutomationView, toExpenseAutomationMissingReceiptsSortKey, toExpenseAutomationTransactionsTabKey, toExpenseAutomationViewType, uploadExpenseAutomationMissingReceiptSuccess, markExpenseAutomationMissingReceiptAsDone, fetchAllExpenseAutomationTabs, refreshExpenseAutomationCurrentTab, updateCurrentSelectedTransactionCategorizationTab, fetchExpenseAutomationMissingReceipts, fetchFluxAnalysisView, clearExpenseAutomationFluxAnalysisView, updateOperatingExpensesIdsForReview as updateFluxOperatingExpensesIdsForReview, updateSelectedSectionIdsForReview as updateFluxAnalysisSelectedSectionIdsForReview, reviewFluxAnalysisView, updateExpenseAutomationMissingReceiptUploadState, updateExpenseAutomationMissingReceiptsUIState, FluxAnalysisOperatingExpenseView, FluxAnalysisSectionType, getExpenseAutomationFluxAnalysisView, FluxAnalysisSortKey, FluxAnalysisActionType, FluxBalancesByMonth, updateCurrentSelectedView, updateCurrentSelectedPeriod, getExpenseAutomationTransactionView, ReconReconcileSortKey, ReconciliationReconcileTabLocalData, FluxAnalysisReviewStatus, updateFluxAnalysisViewUIState, FluxAnalysisViewUIState, updateFluxAnalysisViewPageMetaData, MAX_SELECTION_LIMIT, checkIfAllLineItemsAreCategoryClassFilled, getLineItemsByTransactionIdsFromLocalData, isAnyItemWithUncategorizedExpenseAccount, SaveExpenseAutomationReconciliationActionType, 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, UploadStatementDocumentAIPayload, updateStatementUploadChosen, isReviewTransactionBankTransferType, isReviewTransactionBillPaymentType, isReviewTransactionCreditCardPaymentType, isReviewTransactionDepositType, isReviewTransactionExpenseType, isReviewTransactionCreditCardCreditType, setStatementParseInProgress, };
|
|
624
624
|
export { JEScheduleLocalData };
|
|
625
625
|
export { ExpenseAutomationJESchedulesViewSelector, JEAccountSettingsView, JEScheduledTransactionWithFailedEntries, };
|
|
626
|
-
export { fetchTransactionCategorization, fetchTransactionCategorizationView, updateTransactionCategorizationUIState, updateSelectedCheckboxTransactionIds, setEntityRecommendationForLineIdsForCategorization, initializeTransactionCategorizationViewLocalData, setAllItemsToCategoryClassInLocalDataForCategorization, saveTransactionCategorizationLocalData, fetchTransactionCategorizationFailure, saveTransactionCategorization, updateTransactionCategorization, updateTransactionCategorizationSaveStatus, markTransactionAsNotMiscategorized,
|
|
626
|
+
export { fetchTransactionCategorization, fetchTransactionCategorizationView, updateTransactionCategorizationUIState, updateSelectedCheckboxTransactionIds, 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, };
|
|
627
627
|
export { TopExpense, TopExTimePeriod, TOP_EX_TIME_PERIODS };
|
|
628
628
|
export { TimeframeTick, TimeframeTickWithMetaData, toTimeframeTick, mapTimePeriodtoTimeframeTick, toTimePeriod, toAbsoluteDay, toMonthYearPeriodId, convertToPeriod, MonthYearPeriod, };
|
|
629
629
|
export { VendorSpendTrendFilterTabType, toVendorSpendTrendFilterTabsTypeStrict, } from './entity/vendorExpense/vendorExpenseSelector';
|
|
@@ -733,7 +733,7 @@ export { AllowedValueWithCode, AllowedValue, AllowedValueWithID, isAllowedValueW
|
|
|
733
733
|
export { ManagementUIState, PortfolioUIState };
|
|
734
734
|
export { fetchCompanyPassportView, CompanyPassportView, getCompanyPassportView, getCompanyPassportLocalStoreData, isCompanyPassportDataToBeSaved, companyPassportSaveDataInLocalStore, saveIndustryAndIncDateInCompanyPassportLocalStore, deleteCompanyOfficerInLocalStore, companyPassportClearDataInLocalStore, updateCompanyPassportLocalStoreData, saveCompanyPassportDetails, clearCompanyView, UpdateActionType, CompanyPassportLocalStoreDataView, };
|
|
735
735
|
export { CompanyInfoLocalData, IncInfoLocalData, TaxDetailsLocalData, CompanyDetailsLocalData, PrimaryContactLocalData, CompanyOfficerLocalData, CompanyOfficerType, CompanyPassportLocalData, toCompanyPassportLocalData, };
|
|
736
|
-
export { getUncategorizedAccounts, UncategorizedAccounts,
|
|
736
|
+
export { getUncategorizedAccounts, UncategorizedAccounts, getNestedAccountListHierarchy, };
|
|
737
737
|
export { getBankAccount, BankAccountSelectorView };
|
|
738
738
|
export { AddOnEstimate, SubscriptionViewSortKey, toSubscriptionSortKeyType, SubscriptionView, SubscriptionListView as CompanySubscriptionView, getSubscriptionListView as getCompanySubscriptionView, SubscriptionListUIState as SubscriptionUIState, updateSubscriptionListUIState as updateCompanySubscriptionUIState, SubscriptionUpdateData, SubscriptionCreateData, SubscriptionActionType, SubscriptionDetails, SubscriptionEstimateWithSchema, fetchSubscriptionList, fetchSubscriptionPlans, fetchSubscriptionAddOns, fetchSubscriptionCoupons, fetchSubscriptionDetails, saveSubscriptionUpdates, saveSubscriptionNotesUpdates, fetchSubscriptionCreateEstimate, fetchSubscriptionUpdateEstimate, clearSubscriptionView, initializeSubscriptionLocalData, saveSubscriptionLocalData, clearSubscriptionUpdateViewDataByTenantId, clearSubscriptionLocalData, getSubscriptionsDetailView, getSubscriptionLocalStoreDataView, getSubscriptionEstimationData, SubscriptionEstimationData, SubscriptionLocalStoreDataView, SubscriptionsDetailView, };
|
|
739
739
|
export { SupportedFileType, SupportedAttachmentFileType, SupportedTransactionLineAttachmentFileType, SUPPORTED_ATTACHMENT_FILE_TYPES, SUPPORTED_TRANSACTION_LINE_ATTACHMENT_FILE_TYPES, File, AttachmentFile, FilePayload, AttachmentFilePayload, AllowedDocumentType, updateFiles, updateAttachmentFiles, removeAttachmentFiles, toSupportedFileTypeStrict, toSupportedAttachmentFileFormatType, toSupportedAttachmentFileType, toSupportedTransactionLineAttachmentFileType, };
|
|
@@ -867,3 +867,6 @@ export { TreasuryTransactionStatus } from './view/spendManagement/treasury/treas
|
|
|
867
867
|
export type { TransactionActivityLog } from './entity/transactionActivityLog/transactionActivityLogState';
|
|
868
868
|
export { fetchTransactionActivityLog } from './view/transactionActivityLogView/transactionActivityLogViewReducer';
|
|
869
869
|
export { TransactionActivityLogViewSelectorView, getTransactionActivityLogView, } from './view/transactionActivityLogView/transactionActivityLogViewSelector';
|
|
870
|
+
export { fetchTenantCreditScoreReport, updateTenantCreditScoreReport, updateTenantCreditScoreReportFailure, scheduleTenantCreditScoreCron, scheduleTenantCreditScoreCronSuccess, scheduleTenantCreditScoreCronFailure, resetScheduleCronState, fetchCreditAgentMacro, updateCreditAgentMacro, updateCreditAgentMacroFailure, saveCreditAgentMacro, saveCreditAgentMacroSuccess, saveCreditAgentMacroFailure, resetSaveMacroState, } from './view/creditAgentView/creditAgentViewReducer';
|
|
871
|
+
export { getCreditAgentReport, getCreditAgentMacro, getScheduleCronState, } from './view/creditAgentView/creditAgentViewSelector';
|
|
872
|
+
export type { TenantCreditScoreRow, CreditAgentMacro, CreditAgentViewState, } from './view/creditAgentView/creditAgentViewState';
|