@zeniai/client-epic-state 5.1.18-betaDI10 → 5.1.18-betaDI12
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/README.md +3 -1
- package/lib/commonStateTypes/viewAndReport/agingReportStateTypes.d.ts +1 -1
- package/lib/entity/accountRecon/accountReconPayload.d.ts +22 -0
- package/lib/entity/accountRecon/accountReconPayload.js +26 -1
- package/lib/entity/accountRecon/accountReconReducer.d.ts +5 -2
- package/lib/entity/accountRecon/accountReconReducer.js +36 -2
- package/lib/entity/accountRecon/accountReconSelector.d.ts +6 -1
- package/lib/entity/accountRecon/accountReconSelector.js +5 -0
- package/lib/entity/accountRecon/accountReconState.d.ts +22 -0
- package/lib/entity/monthEndCloseChecks/monthEndCloseChecksPayload.d.ts +8 -0
- package/lib/entity/monthEndCloseChecks/monthEndCloseChecksPayload.js +10 -0
- package/lib/entity/monthEndCloseChecks/monthEndCloseChecksState.d.ts +8 -0
- package/lib/entity/task/taskReducer.js +3 -0
- package/lib/entity/task/taskState.d.ts +1 -1
- package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +1 -0
- package/lib/entity/transaction/payloadTypes/transactionPayload.js +5 -0
- package/lib/entity/transaction/stateTypes/transaction.d.ts +1 -0
- package/lib/epic.d.ts +7 -2
- package/lib/epic.js +7 -2
- package/lib/esm/entity/accountRecon/accountReconPayload.js +26 -1
- package/lib/esm/entity/accountRecon/accountReconReducer.js +35 -1
- package/lib/esm/entity/accountRecon/accountReconSelector.js +5 -0
- package/lib/esm/entity/monthEndCloseChecks/monthEndCloseChecksPayload.js +10 -0
- package/lib/esm/entity/task/taskReducer.js +3 -0
- package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +5 -0
- package/lib/esm/epic.js +7 -2
- package/lib/esm/index.js +9 -9
- package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +29 -3
- package/lib/esm/view/aiCfoView/aiCfoViewSelector.js +11 -0
- package/lib/esm/view/aiCfoView/epics/createSessionAndSubmitEpic.js +2 -2
- package/lib/esm/view/aiCfoView/epics/fetchSkillsEpic.js +34 -0
- package/lib/esm/view/aiCfoView/epics/submitQuestionEpic.js +7 -1
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/parseStatementEpic.js +34 -0
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/reparseStatementEpic.js +31 -0
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/updateStatementInfoEpic.js +57 -0
- package/lib/esm/view/expenseAutomationView/epics/fluxAnalysis/fetchFluxAnalysisViewEpic.js +1 -0
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +49 -11
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.js +30 -3
- package/lib/esm/view/expenseAutomationView/payload/reconciliationPayload.js +153 -0
- package/lib/esm/view/expenseAutomationView/reducers/fluxAnalysisViewReducer.js +6 -1
- package/lib/esm/view/expenseAutomationView/reducers/reconciliationViewReducer.js +188 -9
- package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +37 -17
- package/lib/esm/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +2 -1
- package/lib/esm/view/expenseAutomationView/selectors/reconciliationViewSelector.js +27 -0
- package/lib/esm/view/expenseAutomationView/types/reconciliationViewState.js +29 -0
- package/lib/esm/view/onboardingView/cockpitView/epic/initializeOnboardingCustomerViewUpdateDataEpic.js +4 -16
- package/lib/esm/view/onboardingView/cockpitView/onboardingCockpitViewPayload.js +2 -2
- package/lib/esm/view/opExByVendor/opExByVendorReducer.js +28 -5
- package/lib/esm/view/opExByVendor/opExByVendorSelector.js +1 -0
- package/lib/esm/view/opExByVendor/refreshOpExByVendorReportEpic.js +21 -0
- package/lib/esm/view/referralView/epics/sendReferralInviteEpic.js +9 -1
- package/lib/esm/view/referralView/referralReducer.js +3 -2
- package/lib/esm/view/spendManagement/commonSetup/setupViewReducer.js +5 -1
- package/lib/esm/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +2 -2
- package/lib/esm/view/taskManager/taskDetailView/epics/sendCommentMentionNotificationEpic.js +2 -2
- package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +1 -1
- package/lib/esm/view/taskManager/taskListView/taskListReducer.js +3 -1
- package/lib/esm/view/transactionDetail/epics/saveTransactionDetailEpic.js +3 -1
- package/lib/esm/view/transactionDetail/epics/saveTransactionHelper.js +11 -2
- package/lib/esm/view/transactionDetail/epics/updateTransactionDetailEpic.js +34 -5
- package/lib/esm/view/transactionDetail/transactionDetailLocalDataHelper.js +17 -0
- package/lib/index.d.ts +14 -14
- package/lib/index.js +57 -37
- package/lib/view/aiCfoView/aiCfoViewPayload.d.ts +14 -0
- package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +8 -4
- package/lib/view/aiCfoView/aiCfoViewReducer.js +30 -4
- package/lib/view/aiCfoView/aiCfoViewSelector.d.ts +2 -1
- package/lib/view/aiCfoView/aiCfoViewSelector.js +12 -0
- package/lib/view/aiCfoView/aiCfoViewState.d.ts +15 -0
- package/lib/view/aiCfoView/epics/createSessionAndSubmitEpic.js +2 -2
- package/lib/view/aiCfoView/epics/fetchSkillsEpic.d.ts +8 -0
- package/lib/view/aiCfoView/epics/fetchSkillsEpic.js +38 -0
- package/lib/view/aiCfoView/epics/submitQuestionEpic.js +7 -1
- package/lib/view/expenseAutomationView/epics/accountRecon/parseStatementEpic.d.ts +6 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/parseStatementEpic.js +38 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/reparseStatementEpic.d.ts +26 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/reparseStatementEpic.js +35 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/updateStatementInfoEpic.d.ts +27 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/updateStatementInfoEpic.js +61 -0
- package/lib/view/expenseAutomationView/epics/fluxAnalysis/fetchFluxAnalysisViewEpic.js +1 -0
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +47 -9
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.js +30 -3
- package/lib/view/expenseAutomationView/payload/fluxAnalysisPayload.d.ts +8 -0
- package/lib/view/expenseAutomationView/payload/reconciliationPayload.d.ts +176 -10
- package/lib/view/expenseAutomationView/payload/reconciliationPayload.js +159 -0
- package/lib/view/expenseAutomationView/payload/transactionCategorizationPayload.d.ts +7 -0
- package/lib/view/expenseAutomationView/reducers/fluxAnalysisViewReducer.d.ts +2 -1
- package/lib/view/expenseAutomationView/reducers/fluxAnalysisViewReducer.js +6 -1
- package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.d.ts +53 -3
- package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.js +190 -10
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +37 -17
- package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.d.ts +7 -1
- package/lib/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +2 -1
- package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.d.ts +2 -0
- package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +29 -1
- package/lib/view/expenseAutomationView/types/fluxAnalysisViewState.d.ts +2 -0
- package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +175 -0
- package/lib/view/expenseAutomationView/types/reconciliationViewState.js +30 -0
- package/lib/view/onboardingView/cockpitView/epic/initializeOnboardingCustomerViewUpdateDataEpic.js +3 -15
- package/lib/view/onboardingView/cockpitView/onboardingCockpitViewPayload.js +2 -2
- package/lib/view/opExByVendor/opExByVendorReducer.d.ts +6 -1
- package/lib/view/opExByVendor/opExByVendorReducer.js +29 -6
- package/lib/view/opExByVendor/opExByVendorSelector.d.ts +1 -0
- package/lib/view/opExByVendor/opExByVendorSelector.js +1 -0
- package/lib/view/opExByVendor/opExByVendorState.d.ts +1 -0
- package/lib/view/opExByVendor/refreshOpExByVendorReportEpic.d.ts +17 -0
- package/lib/view/opExByVendor/refreshOpExByVendorReportEpic.js +25 -0
- package/lib/view/referralView/epics/sendReferralInviteEpic.js +9 -1
- package/lib/view/referralView/referralReducer.d.ts +1 -0
- package/lib/view/referralView/referralReducer.js +4 -3
- package/lib/view/spendManagement/commonSetup/setupViewReducer.js +5 -1
- package/lib/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +2 -2
- package/lib/view/taskManager/taskDetailView/epics/sendCommentMentionNotificationEpic.d.ts +1 -1
- package/lib/view/taskManager/taskDetailView/epics/sendCommentMentionNotificationEpic.js +1 -1
- package/lib/view/taskManager/taskDetailView/taskDetail.d.ts +1 -1
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +1 -1
- package/lib/view/taskManager/taskListView/taskListReducer.js +3 -1
- package/lib/view/transactionDetail/epics/saveTransactionDetailEpic.js +3 -1
- package/lib/view/transactionDetail/epics/saveTransactionHelper.d.ts +1 -1
- package/lib/view/transactionDetail/epics/saveTransactionHelper.js +11 -2
- package/lib/view/transactionDetail/epics/updateTransactionDetailEpic.d.ts +8 -0
- package/lib/view/transactionDetail/epics/updateTransactionDetailEpic.js +36 -6
- package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +17 -0
- package/lib/view/transactionDetail/transactionDetailState.d.ts +1 -0
- package/lib/view/transactionDetail/transactionDetailTypes.d.ts +1 -0
- package/lib/view/vendorFiling1099/vendorFiling1099List/vendorFiling1099ListState.d.ts +1 -1
- package/package.json +5 -2
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.submitStatementUpdate = exports.updateStatementUpdateLocalData = exports.updateParsedStatementData = exports.resetReparseStatementStatus = exports.reparseStatementFailure = exports.reparseStatementSuccess = exports.reparseStatement = exports.parseStatementFailure = exports.parseStatementSuccess = exports.parseStatement = exports.uploadAccountStatementFailure = exports.uploadAccountStatementSuccess = exports.uploadAccountStatement = exports.includeAccountInReconciliationFailure = exports.includeAccountInReconciliationSuccess = exports.includeAccountInReconciliation = exports.excludeAccountFromReconciliationFailure = exports.excludeAccountFromReconciliationSuccess = exports.excludeAccountFromReconciliation = exports.deleteAccountStatementFailure = exports.deleteAccountStatementSuccess = exports.deleteAccountStatement = exports.updateAccountReconciliationLocalData = exports.updateReconListScrollPosition = exports.updateSaveReconciliationReviewFetchStatus = exports.saveReconciliationReview = exports.updateReviewTabLocalData = exports.initializeReconciliationReviewTabLocalData = exports.updateReviewTabSortState = exports.updateStatementProcessingFailed = exports.updateSelectedDrawerAccountId = exports.clearExpenseAutomationReconciliationView = exports.initialiseLocalDataForSelectedAccountId = exports.updateBalancesLocalData = exports.updateSelectedTab = exports.saveReconciliationDetailSuccess = exports.updateReconcileTabListScrollState = exports.updateReconcileTabListSortState = exports.updateReconcileTabLocalData = exports.setStatementParseInProgress = exports.setConnectionInProgressForAccount = exports.updateSelectedAccountId = exports.saveReconciliationDetailFailure = exports.saveReconciliationDetail = exports.fetchReconciliationSuccess = exports.fetchReconciliationFailure = exports.fetchReconciliation = exports.initialState = exports.initialActionFetchState = exports.initialReconciliationTabsState = void 0;
|
|
5
|
+
exports.updateNodeCollapseState = exports.updateStatementUploadChosen = exports.clearStatementDateConflict = exports.submitStatementUpdateFailure = exports.submitStatementUpdateSuccess = void 0;
|
|
5
6
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
7
|
const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
|
|
7
8
|
const accountState_1 = require("../../../entity/account/accountState");
|
|
8
9
|
const accountReconState_1 = require("../../../entity/accountRecon/accountReconState");
|
|
10
|
+
const reconciliationViewState_1 = require("../types/reconciliationViewState");
|
|
9
11
|
// Initial state
|
|
10
12
|
exports.initialReconciliationTabsState = {
|
|
11
13
|
balances: {
|
|
@@ -71,6 +73,7 @@ exports.initialState = {
|
|
|
71
73
|
refreshStatus: { fetchState: 'Not-Started', error: undefined },
|
|
72
74
|
actionFetchState: exports.initialActionFetchState,
|
|
73
75
|
selectedAccountId: undefined,
|
|
76
|
+
statementProcessingFailed: false,
|
|
74
77
|
statementUploadChosen: false,
|
|
75
78
|
reconListUIState: {
|
|
76
79
|
nodeCollapseState: {},
|
|
@@ -79,6 +82,7 @@ exports.initialState = {
|
|
|
79
82
|
},
|
|
80
83
|
},
|
|
81
84
|
excludedAccountIDs: [],
|
|
85
|
+
summary: undefined,
|
|
82
86
|
};
|
|
83
87
|
// Create slice with reducers
|
|
84
88
|
const expenseAutomationReconciliationView = (0, toolkit_1.createSlice)({
|
|
@@ -147,7 +151,7 @@ const expenseAutomationReconciliationView = (0, toolkit_1.createSlice)({
|
|
|
147
151
|
fetchReconciliationSuccess: {
|
|
148
152
|
reducer(draft, action) {
|
|
149
153
|
if (action.payload.accountId == null) {
|
|
150
|
-
updateAllReconciliation(draft, action.payload.reconciliation.accounts, action.payload.selectedPeriod, action.payload.reconciliation.reconciliation, action.payload.refreshViewInBackground, action.payload.reconciliation.excluded_accounts ?? []);
|
|
154
|
+
updateAllReconciliation(draft, action.payload.reconciliation.accounts, action.payload.selectedPeriod, action.payload.reconciliation.reconciliation, action.payload.refreshViewInBackground, action.payload.reconciliation.excluded_accounts ?? [], action.payload.reconciliation.summary);
|
|
151
155
|
}
|
|
152
156
|
else if (action.payload.reconciliation.reconciliation.length > 0 &&
|
|
153
157
|
action.payload.reconciliation.accounts.length > 0) {
|
|
@@ -291,6 +295,10 @@ const expenseAutomationReconciliationView = (0, toolkit_1.createSlice)({
|
|
|
291
295
|
updateSelectedDrawerAccountId: (draft, action) => {
|
|
292
296
|
draft.selectedDrawerAccountId = action.payload.selectedDrawerAccountId;
|
|
293
297
|
},
|
|
298
|
+
updateStatementProcessingFailed: (draft, action) => {
|
|
299
|
+
draft.statementProcessingFailed =
|
|
300
|
+
action.payload.statementProcessingFailed;
|
|
301
|
+
},
|
|
294
302
|
initialiseLocalDataForSelectedAccountId: () => { },
|
|
295
303
|
updateSelectedTab: (draft, action) => {
|
|
296
304
|
const { selectedTab } = action.payload;
|
|
@@ -382,10 +390,22 @@ const expenseAutomationReconciliationView = (0, toolkit_1.createSlice)({
|
|
|
382
390
|
},
|
|
383
391
|
uploadAccountStatement: (draft, action) => {
|
|
384
392
|
const { accountId, selectedPeriod } = action.payload;
|
|
385
|
-
draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
393
|
+
const accountRecon = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]?.reconciliationByAccountID[accountId];
|
|
394
|
+
if (accountRecon != null) {
|
|
395
|
+
accountRecon.statementUploadStatus = {
|
|
396
|
+
fetchState: 'In-Progress',
|
|
397
|
+
error: undefined,
|
|
398
|
+
};
|
|
399
|
+
accountRecon.parsedStatementData = undefined;
|
|
400
|
+
accountRecon.statementParseStatus = {
|
|
401
|
+
fetchState: 'Not-Started',
|
|
402
|
+
error: undefined,
|
|
403
|
+
};
|
|
404
|
+
accountRecon.reparseStatementStatus = {
|
|
405
|
+
fetchState: 'Not-Started',
|
|
406
|
+
error: undefined,
|
|
407
|
+
};
|
|
408
|
+
}
|
|
389
409
|
},
|
|
390
410
|
uploadAccountStatementSuccess: (draft, action) => {
|
|
391
411
|
const { accountId, selectedPeriod } = action.payload;
|
|
@@ -423,6 +443,143 @@ const expenseAutomationReconciliationView = (0, toolkit_1.createSlice)({
|
|
|
423
443
|
error: action.payload.error,
|
|
424
444
|
};
|
|
425
445
|
},
|
|
446
|
+
parseStatement: (draft, action) => {
|
|
447
|
+
const { accountId, selectedPeriod } = action.payload;
|
|
448
|
+
const accountRecon = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]?.reconciliationByAccountID[accountId];
|
|
449
|
+
if (accountRecon != null) {
|
|
450
|
+
accountRecon.parsedStatementData = undefined;
|
|
451
|
+
accountRecon.statementParseStatus = {
|
|
452
|
+
fetchState: 'In-Progress',
|
|
453
|
+
error: undefined,
|
|
454
|
+
};
|
|
455
|
+
}
|
|
456
|
+
},
|
|
457
|
+
parseStatementSuccess: (draft, action) => {
|
|
458
|
+
const { accountId, selectedPeriod } = action.payload;
|
|
459
|
+
draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)].reconciliationByAccountID[accountId].statementParseStatus = {
|
|
460
|
+
fetchState: 'Completed',
|
|
461
|
+
error: undefined,
|
|
462
|
+
};
|
|
463
|
+
draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)].reconciliationByAccountID[accountId].statementParseInProgress = false;
|
|
464
|
+
draft.statementProcessingFailed = false;
|
|
465
|
+
},
|
|
466
|
+
parseStatementFailure: (draft, action) => {
|
|
467
|
+
const { accountId, selectedPeriod } = action.payload;
|
|
468
|
+
draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)].reconciliationByAccountID[accountId].statementParseStatus = {
|
|
469
|
+
fetchState: 'Error',
|
|
470
|
+
error: action.payload.error,
|
|
471
|
+
};
|
|
472
|
+
draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)].reconciliationByAccountID[accountId].statementParseInProgress = false;
|
|
473
|
+
draft.statementProcessingFailed = true;
|
|
474
|
+
},
|
|
475
|
+
reparseStatement: (draft, action) => {
|
|
476
|
+
const { accountId, selectedPeriod } = action.payload;
|
|
477
|
+
const accountRecon = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]?.reconciliationByAccountID[accountId];
|
|
478
|
+
if (accountRecon != null) {
|
|
479
|
+
accountRecon.parsedStatementData = undefined;
|
|
480
|
+
accountRecon.reparseStatementStatus = {
|
|
481
|
+
fetchState: 'In-Progress',
|
|
482
|
+
error: undefined,
|
|
483
|
+
};
|
|
484
|
+
accountRecon.statementParseStatus = {
|
|
485
|
+
fetchState: 'Not-Started',
|
|
486
|
+
error: undefined,
|
|
487
|
+
};
|
|
488
|
+
accountRecon.statementParseInProgress = false;
|
|
489
|
+
}
|
|
490
|
+
},
|
|
491
|
+
reparseStatementSuccess: (draft, action) => {
|
|
492
|
+
const { accountId, selectedPeriod } = action.payload;
|
|
493
|
+
draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)].reconciliationByAccountID[accountId].reparseStatementStatus = {
|
|
494
|
+
fetchState: 'Completed',
|
|
495
|
+
error: undefined,
|
|
496
|
+
};
|
|
497
|
+
draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)].reconciliationByAccountID[accountId].statementParseStatus = {
|
|
498
|
+
fetchState: 'Not-Started',
|
|
499
|
+
error: undefined,
|
|
500
|
+
};
|
|
501
|
+
draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)].reconciliationByAccountID[accountId].statementParseInProgress = false;
|
|
502
|
+
draft.statementProcessingFailed = false;
|
|
503
|
+
},
|
|
504
|
+
reparseStatementFailure: (draft, action) => {
|
|
505
|
+
const { accountId, selectedPeriod } = action.payload;
|
|
506
|
+
draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)].reconciliationByAccountID[accountId].reparseStatementStatus = {
|
|
507
|
+
fetchState: 'Error',
|
|
508
|
+
error: action.payload.error,
|
|
509
|
+
};
|
|
510
|
+
draft.statementProcessingFailed = true;
|
|
511
|
+
},
|
|
512
|
+
resetReparseStatementStatus: (draft, action) => {
|
|
513
|
+
const { accountId, selectedPeriod } = action.payload;
|
|
514
|
+
draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)].reconciliationByAccountID[accountId].reparseStatementStatus = {
|
|
515
|
+
fetchState: 'Not-Started',
|
|
516
|
+
error: undefined,
|
|
517
|
+
};
|
|
518
|
+
},
|
|
519
|
+
updateParsedStatementData: (draft, action) => {
|
|
520
|
+
const { accountId, selectedPeriod, parsedStatementData } = action.payload;
|
|
521
|
+
draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)].reconciliationByAccountID[accountId].parsedStatementData =
|
|
522
|
+
parsedStatementData;
|
|
523
|
+
},
|
|
524
|
+
updateStatementUpdateLocalData: (draft, action) => {
|
|
525
|
+
const { accountId, selectedPeriod, statementUpdateLocalData } = action.payload;
|
|
526
|
+
const accountRecon = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]?.reconciliationByAccountID[accountId];
|
|
527
|
+
if (accountRecon != null) {
|
|
528
|
+
if (accountRecon.localData == null) {
|
|
529
|
+
accountRecon.localData = {
|
|
530
|
+
statementUpdateLocalData,
|
|
531
|
+
};
|
|
532
|
+
}
|
|
533
|
+
else {
|
|
534
|
+
accountRecon.localData.statementUpdateLocalData =
|
|
535
|
+
statementUpdateLocalData;
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
},
|
|
539
|
+
submitStatementUpdate: (draft, action) => {
|
|
540
|
+
const { accountId, selectedPeriod } = action.payload;
|
|
541
|
+
const accountRecon = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]?.reconciliationByAccountID[accountId];
|
|
542
|
+
if (accountRecon != null) {
|
|
543
|
+
accountRecon.statementUpdateStatus = {
|
|
544
|
+
fetchState: 'In-Progress',
|
|
545
|
+
error: undefined,
|
|
546
|
+
};
|
|
547
|
+
// Clear any stale date conflict from a previous attempt.
|
|
548
|
+
accountRecon.statementDateConflict = null;
|
|
549
|
+
}
|
|
550
|
+
},
|
|
551
|
+
submitStatementUpdateSuccess: (draft, action) => {
|
|
552
|
+
const { accountId, selectedPeriod } = action.payload;
|
|
553
|
+
const accountRecon = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]?.reconciliationByAccountID[accountId];
|
|
554
|
+
if (accountRecon != null) {
|
|
555
|
+
accountRecon.statementUpdateStatus = {
|
|
556
|
+
fetchState: 'Completed',
|
|
557
|
+
error: undefined,
|
|
558
|
+
};
|
|
559
|
+
accountRecon.statementDateConflict = null;
|
|
560
|
+
if (accountRecon.localData != null) {
|
|
561
|
+
accountRecon.localData.statementUpdateLocalData = undefined;
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
},
|
|
565
|
+
submitStatementUpdateFailure: (draft, action) => {
|
|
566
|
+
const { accountId, selectedPeriod, dateConflict } = action.payload;
|
|
567
|
+
const accountRecon = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]?.reconciliationByAccountID[accountId];
|
|
568
|
+
if (accountRecon != null) {
|
|
569
|
+
accountRecon.statementUpdateStatus = {
|
|
570
|
+
fetchState: 'Error',
|
|
571
|
+
error: action.payload.error,
|
|
572
|
+
};
|
|
573
|
+
accountRecon.statementDateConflict = dateConflict ?? null;
|
|
574
|
+
}
|
|
575
|
+
},
|
|
576
|
+
clearStatementDateConflict: (draft, action) => {
|
|
577
|
+
const { accountId, selectedPeriod } = action.payload;
|
|
578
|
+
const accountRecon = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]?.reconciliationByAccountID[accountId];
|
|
579
|
+
if (accountRecon != null) {
|
|
580
|
+
accountRecon.statementDateConflict = null;
|
|
581
|
+
}
|
|
582
|
+
},
|
|
426
583
|
updateAccountReconciliationLocalData: (draft, action) => {
|
|
427
584
|
const { accountId, selectedPeriod, localData } = action.payload;
|
|
428
585
|
const oldLocalData = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)].reconciliationByAccountID[accountId].localData;
|
|
@@ -528,10 +685,10 @@ const expenseAutomationReconciliationView = (0, toolkit_1.createSlice)({
|
|
|
528
685
|
},
|
|
529
686
|
});
|
|
530
687
|
// Export actions
|
|
531
|
-
_a = expenseAutomationReconciliationView.actions, exports.fetchReconciliation = _a.fetchReconciliation, exports.fetchReconciliationFailure = _a.fetchReconciliationFailure, exports.fetchReconciliationSuccess = _a.fetchReconciliationSuccess, exports.saveReconciliationDetail = _a.saveReconciliationDetail, exports.saveReconciliationDetailFailure = _a.saveReconciliationDetailFailure, exports.updateSelectedAccountId = _a.updateSelectedAccountId, exports.setConnectionInProgressForAccount = _a.setConnectionInProgressForAccount, exports.setStatementParseInProgress = _a.setStatementParseInProgress, exports.updateReconcileTabLocalData = _a.updateReconcileTabLocalData, exports.updateReconcileTabListSortState = _a.updateReconcileTabListSortState, exports.updateReconcileTabListScrollState = _a.updateReconcileTabListScrollState, exports.saveReconciliationDetailSuccess = _a.saveReconciliationDetailSuccess, exports.updateSelectedTab = _a.updateSelectedTab, exports.updateBalancesLocalData = _a.updateBalancesLocalData, exports.initialiseLocalDataForSelectedAccountId = _a.initialiseLocalDataForSelectedAccountId, exports.clearExpenseAutomationReconciliationView = _a.clearExpenseAutomationReconciliationView, exports.updateSelectedDrawerAccountId = _a.updateSelectedDrawerAccountId, exports.updateReviewTabSortState = _a.updateReviewTabSortState, exports.initializeReconciliationReviewTabLocalData = _a.initializeReconciliationReviewTabLocalData, exports.updateReviewTabLocalData = _a.updateReviewTabLocalData, exports.saveReconciliationReview = _a.saveReconciliationReview, exports.updateSaveReconciliationReviewFetchStatus = _a.updateSaveReconciliationReviewFetchStatus, exports.updateReconListScrollPosition = _a.updateReconListScrollPosition, exports.updateAccountReconciliationLocalData = _a.updateAccountReconciliationLocalData, exports.deleteAccountStatement = _a.deleteAccountStatement, exports.deleteAccountStatementSuccess = _a.deleteAccountStatementSuccess, exports.deleteAccountStatementFailure = _a.deleteAccountStatementFailure, exports.excludeAccountFromReconciliation = _a.excludeAccountFromReconciliation, exports.excludeAccountFromReconciliationSuccess = _a.excludeAccountFromReconciliationSuccess, exports.excludeAccountFromReconciliationFailure = _a.excludeAccountFromReconciliationFailure, exports.includeAccountInReconciliation = _a.includeAccountInReconciliation, exports.includeAccountInReconciliationSuccess = _a.includeAccountInReconciliationSuccess, exports.includeAccountInReconciliationFailure = _a.includeAccountInReconciliationFailure, exports.uploadAccountStatement = _a.uploadAccountStatement, exports.uploadAccountStatementSuccess = _a.uploadAccountStatementSuccess, exports.uploadAccountStatementFailure = _a.uploadAccountStatementFailure, exports.updateStatementUploadChosen = _a.updateStatementUploadChosen, exports.updateNodeCollapseState = _a.updateNodeCollapseState;
|
|
688
|
+
_a = expenseAutomationReconciliationView.actions, exports.fetchReconciliation = _a.fetchReconciliation, exports.fetchReconciliationFailure = _a.fetchReconciliationFailure, exports.fetchReconciliationSuccess = _a.fetchReconciliationSuccess, exports.saveReconciliationDetail = _a.saveReconciliationDetail, exports.saveReconciliationDetailFailure = _a.saveReconciliationDetailFailure, exports.updateSelectedAccountId = _a.updateSelectedAccountId, exports.setConnectionInProgressForAccount = _a.setConnectionInProgressForAccount, exports.setStatementParseInProgress = _a.setStatementParseInProgress, exports.updateReconcileTabLocalData = _a.updateReconcileTabLocalData, exports.updateReconcileTabListSortState = _a.updateReconcileTabListSortState, exports.updateReconcileTabListScrollState = _a.updateReconcileTabListScrollState, exports.saveReconciliationDetailSuccess = _a.saveReconciliationDetailSuccess, exports.updateSelectedTab = _a.updateSelectedTab, exports.updateBalancesLocalData = _a.updateBalancesLocalData, exports.initialiseLocalDataForSelectedAccountId = _a.initialiseLocalDataForSelectedAccountId, exports.clearExpenseAutomationReconciliationView = _a.clearExpenseAutomationReconciliationView, exports.updateSelectedDrawerAccountId = _a.updateSelectedDrawerAccountId, exports.updateStatementProcessingFailed = _a.updateStatementProcessingFailed, exports.updateReviewTabSortState = _a.updateReviewTabSortState, exports.initializeReconciliationReviewTabLocalData = _a.initializeReconciliationReviewTabLocalData, exports.updateReviewTabLocalData = _a.updateReviewTabLocalData, exports.saveReconciliationReview = _a.saveReconciliationReview, exports.updateSaveReconciliationReviewFetchStatus = _a.updateSaveReconciliationReviewFetchStatus, exports.updateReconListScrollPosition = _a.updateReconListScrollPosition, exports.updateAccountReconciliationLocalData = _a.updateAccountReconciliationLocalData, exports.deleteAccountStatement = _a.deleteAccountStatement, exports.deleteAccountStatementSuccess = _a.deleteAccountStatementSuccess, exports.deleteAccountStatementFailure = _a.deleteAccountStatementFailure, exports.excludeAccountFromReconciliation = _a.excludeAccountFromReconciliation, exports.excludeAccountFromReconciliationSuccess = _a.excludeAccountFromReconciliationSuccess, exports.excludeAccountFromReconciliationFailure = _a.excludeAccountFromReconciliationFailure, exports.includeAccountInReconciliation = _a.includeAccountInReconciliation, exports.includeAccountInReconciliationSuccess = _a.includeAccountInReconciliationSuccess, exports.includeAccountInReconciliationFailure = _a.includeAccountInReconciliationFailure, exports.uploadAccountStatement = _a.uploadAccountStatement, exports.uploadAccountStatementSuccess = _a.uploadAccountStatementSuccess, exports.uploadAccountStatementFailure = _a.uploadAccountStatementFailure, exports.parseStatement = _a.parseStatement, exports.parseStatementSuccess = _a.parseStatementSuccess, exports.parseStatementFailure = _a.parseStatementFailure, exports.reparseStatement = _a.reparseStatement, exports.reparseStatementSuccess = _a.reparseStatementSuccess, exports.reparseStatementFailure = _a.reparseStatementFailure, exports.resetReparseStatementStatus = _a.resetReparseStatementStatus, exports.updateParsedStatementData = _a.updateParsedStatementData, exports.updateStatementUpdateLocalData = _a.updateStatementUpdateLocalData, exports.submitStatementUpdate = _a.submitStatementUpdate, exports.submitStatementUpdateSuccess = _a.submitStatementUpdateSuccess, exports.submitStatementUpdateFailure = _a.submitStatementUpdateFailure, exports.clearStatementDateConflict = _a.clearStatementDateConflict, exports.updateStatementUploadChosen = _a.updateStatementUploadChosen, exports.updateNodeCollapseState = _a.updateNodeCollapseState;
|
|
532
689
|
// Export reducer
|
|
533
690
|
exports.default = expenseAutomationReconciliationView.reducer;
|
|
534
|
-
function updateAllReconciliation(draft, accounts, selectedPeriod, reconciliationData, refreshViewInBackground, excludedAccounts) {
|
|
691
|
+
function updateAllReconciliation(draft, accounts, selectedPeriod, reconciliationData, refreshViewInBackground, excludedAccounts, summary) {
|
|
535
692
|
draft.excludedAccountIDs = excludedAccounts.map((ea) => ea.account_id);
|
|
536
693
|
draft.excludedAccountExclusionInfo = {};
|
|
537
694
|
excludedAccounts.forEach((ea) => {
|
|
@@ -560,6 +717,7 @@ function updateAllReconciliation(draft, accounts, selectedPeriod, reconciliation
|
|
|
560
717
|
: undefined,
|
|
561
718
|
};
|
|
562
719
|
});
|
|
720
|
+
const oldReconciliationByAccountID = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]?.reconciliationByAccountID ?? {};
|
|
563
721
|
draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = {
|
|
564
722
|
accountIDs: [],
|
|
565
723
|
reconciliationByAccountID: {},
|
|
@@ -583,6 +741,7 @@ function updateAllReconciliation(draft, accounts, selectedPeriod, reconciliation
|
|
|
583
741
|
paymentAccountId: account?.payment_account_id ?? undefined,
|
|
584
742
|
};
|
|
585
743
|
}
|
|
744
|
+
const oldRecord = oldReconciliationByAccountID[reconciliation.account_id];
|
|
586
745
|
accountReconciliationRecords.reconciliationByAccountID[reconciliation.account_id] = {
|
|
587
746
|
accountId: reconciliation.account_id,
|
|
588
747
|
reconciliationId: reconciliation.reconciliation_id ?? undefined,
|
|
@@ -590,16 +749,30 @@ function updateAllReconciliation(draft, accounts, selectedPeriod, reconciliation
|
|
|
590
749
|
refreshStatus: { fetchState: 'Not-Started', error: undefined },
|
|
591
750
|
statementDeleteStatus: { fetchState: 'Not-Started', error: undefined },
|
|
592
751
|
statementUploadStatus: { fetchState: 'Not-Started', error: undefined },
|
|
593
|
-
statementUpdateStatus:
|
|
752
|
+
statementUpdateStatus: oldRecord?.statementUpdateStatus ?? {
|
|
753
|
+
fetchState: 'Not-Started',
|
|
754
|
+
error: undefined,
|
|
755
|
+
},
|
|
594
756
|
statementParseInProgress: reconciliation.bank_status.code === 'parsing',
|
|
757
|
+
statementParseStatus: oldRecord?.statementParseStatus ?? {
|
|
758
|
+
fetchState: 'Not-Started',
|
|
759
|
+
error: undefined,
|
|
760
|
+
},
|
|
761
|
+
reparseStatementStatus: oldRecord?.reparseStatementStatus ?? {
|
|
762
|
+
fetchState: 'Not-Started',
|
|
763
|
+
error: undefined,
|
|
764
|
+
},
|
|
765
|
+
statementDateConflict: oldRecord?.statementDateConflict ?? null,
|
|
595
766
|
localData: {
|
|
767
|
+
...oldRecord?.localData,
|
|
596
768
|
accountSource: account?.reconciliation_source != null
|
|
597
769
|
? (0, accountState_1.toReconciliationAccountSource)(account.reconciliation_source)
|
|
598
|
-
:
|
|
770
|
+
: oldRecord?.localData?.accountSource,
|
|
599
771
|
},
|
|
600
772
|
accountDetectionReason: account?.detection_info != null && account.detection_reason != null
|
|
601
773
|
? account.detection_reason
|
|
602
774
|
: undefined,
|
|
775
|
+
parsedStatementData: oldRecord?.parsedStatementData,
|
|
603
776
|
};
|
|
604
777
|
accountReconciliationRecords.accountIDs.push(reconciliation.account_id);
|
|
605
778
|
});
|
|
@@ -613,6 +786,10 @@ function updateAllReconciliation(draft, accounts, selectedPeriod, reconciliation
|
|
|
613
786
|
draft.fetchState = 'Completed';
|
|
614
787
|
draft.error = undefined;
|
|
615
788
|
}
|
|
789
|
+
if (summary !== undefined) {
|
|
790
|
+
draft.summary =
|
|
791
|
+
summary != null ? (0, reconciliationViewState_1.toReconciliationViewSummary)(summary) : undefined;
|
|
792
|
+
}
|
|
616
793
|
}
|
|
617
794
|
function updateReconciliationByAccountID(draft, accounts, selectedPeriod, accountId, reconciliationData, refreshViewInBackground) {
|
|
618
795
|
const oldRecord = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)].reconciliationByAccountID[accountId];
|
|
@@ -680,6 +857,9 @@ const updateReconciliationByAccountIDOnIncludeAccount = (draft, accountId, recon
|
|
|
680
857
|
statementUploadStatus: { fetchState: 'Not-Started', error: undefined },
|
|
681
858
|
statementUpdateStatus: { fetchState: 'Not-Started', error: undefined },
|
|
682
859
|
statementParseInProgress: reconciliation.bank_status.code === 'parsing',
|
|
860
|
+
statementParseStatus: { fetchState: 'Not-Started', error: undefined },
|
|
861
|
+
reparseStatementStatus: { fetchState: 'Not-Started', error: undefined },
|
|
862
|
+
statementDateConflict: null,
|
|
683
863
|
localData: {},
|
|
684
864
|
accountDetectionReason: undefined,
|
|
685
865
|
};
|
|
@@ -160,27 +160,39 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
160
160
|
draft.transactionCategorizationView[selectedTab].fetchState =
|
|
161
161
|
'In-Progress';
|
|
162
162
|
draft.transactionCategorizationView[selectedTab].error = undefined;
|
|
163
|
+
// A foreground fetch supersedes any in-flight background preload.
|
|
164
|
+
// Reset refreshStatus so a cancelled preload doesn't leave the
|
|
165
|
+
// spinner stuck at In-Progress.
|
|
166
|
+
draft.transactionCategorizationView[selectedTab].refreshStatus = {
|
|
167
|
+
fetchState: 'Not-Started',
|
|
168
|
+
error: undefined,
|
|
169
|
+
};
|
|
163
170
|
}
|
|
164
171
|
draft.transactionCategorizationView[selectedTab].uiState.pageToken =
|
|
165
172
|
pageToken ?? null;
|
|
166
|
-
|
|
167
|
-
|
|
173
|
+
// Only overwrite when explicitly set; undefined means a non-search fetch
|
|
174
|
+
// (tab switch, period change) should preserve the existing search string.
|
|
175
|
+
if (searchString !== undefined) {
|
|
176
|
+
draft.transactionCategorizationView[selectedTab].uiState.searchString =
|
|
177
|
+
searchString;
|
|
178
|
+
}
|
|
168
179
|
draft.transactionCategorizationView[selectedTab].error = undefined;
|
|
180
|
+
const monthYearPeriod = {
|
|
181
|
+
month: period.start.month,
|
|
182
|
+
year: period.start.year,
|
|
183
|
+
};
|
|
184
|
+
const periodId = (0, timePeriod_1.toMonthYearPeriodId)(monthYearPeriod);
|
|
185
|
+
const transactionIdsBySelectedPeriod = draft.transactionCategorizationView[selectedTab]
|
|
186
|
+
.transactionIdsBySelectedPeriod[periodId] ?? [];
|
|
169
187
|
// Reset list when we change the sort order and fetch list again
|
|
170
188
|
if (resetListItems === true) {
|
|
171
|
-
const monthYearPeriod = {
|
|
172
|
-
month: period.start.month,
|
|
173
|
-
year: period.start.year,
|
|
174
|
-
};
|
|
175
|
-
const transactionIdsBySelectedPeriod = draft.transactionCategorizationView[selectedTab]
|
|
176
|
-
.transactionIdsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(monthYearPeriod)];
|
|
177
189
|
transactionIdsBySelectedPeriod.forEach((transactionId) => {
|
|
178
190
|
delete draft.transactionCategorizationView[selectedTab]
|
|
179
191
|
.transactionReviewLocalDataById[transactionId];
|
|
180
192
|
});
|
|
181
193
|
draft.transactionCategorizationView[selectedTab].selectedCheckBoxTransactionIds =
|
|
182
194
|
draft.transactionCategorizationView[selectedTab].selectedCheckBoxTransactionIds.filter((selectedCheckBoxTransactionId) => transactionIdsBySelectedPeriod.includes(selectedCheckBoxTransactionId));
|
|
183
|
-
draft.transactionCategorizationView[selectedTab].transactionIdsBySelectedPeriod[
|
|
195
|
+
draft.transactionCategorizationView[selectedTab].transactionIdsBySelectedPeriod[periodId] = [];
|
|
184
196
|
draft.transactionCategorizationView[selectedTab].refreshStatus = {
|
|
185
197
|
fetchState: 'Not-Started',
|
|
186
198
|
error: undefined,
|
|
@@ -312,10 +324,12 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
312
324
|
}
|
|
313
325
|
},
|
|
314
326
|
updateTransactionFilters(draft, action) {
|
|
315
|
-
const {
|
|
316
|
-
//
|
|
317
|
-
//
|
|
318
|
-
|
|
327
|
+
const { filters } = action.payload;
|
|
328
|
+
// Filters are tab-agnostic (payee/category/class/amount), so apply to
|
|
329
|
+
// all tabs so switching tabs after filtering shows consistent results.
|
|
330
|
+
transactionsViewState_1.TRANSACTIONS_TABS.forEach((tab) => {
|
|
331
|
+
draft.transactionCategorizationView[tab].filters = filters;
|
|
332
|
+
});
|
|
319
333
|
},
|
|
320
334
|
saveTransactionCategorization: {
|
|
321
335
|
prepare(selectedTab, transactionIds, cotTrackingByTransactionId, isUncategorizedExpenseCategoryEnabled) {
|
|
@@ -667,18 +681,24 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
667
681
|
resetOtherTabsFetchState(draft, action) {
|
|
668
682
|
const { tabs, refreshViewInBackground } = action.payload;
|
|
669
683
|
tabs.forEach((tab) => {
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
684
|
+
const tabFetchState = draft.transactionCategorizationView[tab].fetchState;
|
|
685
|
+
if (refreshViewInBackground !== true) {
|
|
686
|
+
// Foreground fetch completed: mark other tabs as Completed.
|
|
673
687
|
draft.transactionCategorizationView[tab].fetchState = 'Completed';
|
|
674
688
|
draft.transactionCategorizationView[tab].error = undefined;
|
|
675
689
|
}
|
|
676
|
-
else {
|
|
690
|
+
else if (tabFetchState !== 'In-Progress') {
|
|
691
|
+
// Background fetch completed: reset the other tab's refreshStatus,
|
|
692
|
+
// but only when it is not mid-load. During a dual-search the active
|
|
693
|
+
// tab has its own foreground fetch in flight — clobbering its
|
|
694
|
+
// fetchState here would drop the skeleton and show an empty list.
|
|
677
695
|
draft.transactionCategorizationView[tab].refreshStatus = {
|
|
678
696
|
fetchState: 'Not-Started',
|
|
679
697
|
error: undefined,
|
|
680
698
|
};
|
|
681
699
|
}
|
|
700
|
+
// If tabFetchState === 'In-Progress' and refreshViewInBackground === true,
|
|
701
|
+
// leave the other tab's state untouched — it has its own active fetch.
|
|
682
702
|
});
|
|
683
703
|
},
|
|
684
704
|
fetchTransactionCategorizationFailure(draft, action) {
|
|
@@ -9,7 +9,7 @@ import { BankStatusCodeType } from '../../../entity/accountRecon/accountReconSta
|
|
|
9
9
|
import { ClassBase } from '../../../entity/class/classState';
|
|
10
10
|
import { Vendor } from '../../../entity/vendor/vendorState';
|
|
11
11
|
import { PlaidConnectionDetails } from '../../spendManagement/plaidAccount/plaidAccountViewState';
|
|
12
|
-
import { AccountReconciliationLocalData, ActionFetchStates, ReconListUIState, ReconciliationTabsState, ReconciliationViewTabType } from '../types/reconciliationViewState';
|
|
12
|
+
import { AccountReconciliationLocalData, ActionFetchStates, ParsedStatementData, ReconListUIState, ReconciliationTabsState, ReconciliationViewSummary, ReconciliationViewTabType, StatementDateConflict } from '../types/reconciliationViewState';
|
|
13
13
|
export declare const ALL_ACCOUNT_RECON_SECTION_IDS: readonly ["assets", "liabilities"];
|
|
14
14
|
export declare const toAccountReconSectionID: (v: string) => "assets" | "liabilities";
|
|
15
15
|
export type AccountReconSectionID = ReturnType<typeof toAccountReconSectionID>;
|
|
@@ -37,10 +37,12 @@ export interface ExpenseAutomationReconciliationViewSelector {
|
|
|
37
37
|
refreshStatus: FetchStateAndError;
|
|
38
38
|
reviewTabSelectedVendorByTransactionId: Record<ID, Vendor>;
|
|
39
39
|
selectedTab: ReconciliationViewTabType;
|
|
40
|
+
statementProcessingFailed: boolean;
|
|
40
41
|
statementUploadChosen: boolean;
|
|
41
42
|
selectedAccountId?: ID;
|
|
42
43
|
selectedDrawerAccountId?: ID;
|
|
43
44
|
selectedReconAccount?: AccountReconciliationByAccount;
|
|
45
|
+
summary?: ReconciliationViewSummary;
|
|
44
46
|
}
|
|
45
47
|
export interface AccountReconciliationBySection {
|
|
46
48
|
accountIDs: ID[];
|
|
@@ -57,11 +59,15 @@ export interface AccountReconciliationByAccount {
|
|
|
57
59
|
connectionInProgress: boolean;
|
|
58
60
|
localData: AccountReconciliationLocalData;
|
|
59
61
|
refreshStatus: FetchStateAndError;
|
|
62
|
+
reparseStatementStatus: FetchStateAndError;
|
|
63
|
+
statementDateConflict: StatementDateConflict | null;
|
|
60
64
|
statementDeleteStatus: FetchStateAndError;
|
|
61
65
|
statementParseInProgress: boolean;
|
|
66
|
+
statementParseStatus: FetchStateAndError;
|
|
62
67
|
statementUpdateStatus: FetchStateAndError;
|
|
63
68
|
statementUploadStatus: FetchStateAndError;
|
|
64
69
|
transactionFetchState: FetchStateAndError;
|
|
65
70
|
accountDetectionReason?: string;
|
|
71
|
+
parsedStatementData?: ParsedStatementData;
|
|
66
72
|
paymentAccountId?: ID;
|
|
67
73
|
}
|
|
@@ -11,7 +11,7 @@ const vendorSelector_1 = require("../../../entity/vendor/vendorSelector");
|
|
|
11
11
|
const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
|
|
12
12
|
function getExpenseAutomationFluxAnalysisView(state) {
|
|
13
13
|
const { expenseAutomationFluxAnalysisViewState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
|
|
14
|
-
const { fetchState, error, refreshStatus, uiState, reviewOperatingExpenseIdsByPeriod, selectedSectionIdsByPeriod, groupsBySelectedPeriod, fluxAnalysisEntities, bulkReviewStatus, currency, totalBalancesAndVariance, } = expenseAutomationFluxAnalysisViewState;
|
|
14
|
+
const { fetchState, error, lastRefreshSuccessTime, refreshStatus, uiState, reviewOperatingExpenseIdsByPeriod, selectedSectionIdsByPeriod, groupsBySelectedPeriod, fluxAnalysisEntities, bulkReviewStatus, currency, totalBalancesAndVariance, } = expenseAutomationFluxAnalysisViewState;
|
|
15
15
|
const fetchStateAndError = {
|
|
16
16
|
fetchState,
|
|
17
17
|
error,
|
|
@@ -113,6 +113,7 @@ function getExpenseAutomationFluxAnalysisView(state) {
|
|
|
113
113
|
refreshStatus,
|
|
114
114
|
currency,
|
|
115
115
|
completionStatus,
|
|
116
|
+
lastRefreshSuccessTime,
|
|
116
117
|
};
|
|
117
118
|
}
|
|
118
119
|
// Helper function to transform operating expense to vendor view
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { ID } from '../../../commonStateTypes/common';
|
|
1
2
|
import { ReportIDPlusForecastID } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
2
3
|
import { RootState } from '../../../reducer';
|
|
3
4
|
import { ExpenseAutomationReconciliationViewSelector } from '../selectorTypes/reconciliationViewSelectorTypes';
|
|
4
5
|
export declare const getExpenseAutomationReconciliationView: (state: RootState) => ExpenseAutomationReconciliationViewSelector;
|
|
6
|
+
export declare const getReparseStatementStatusByAccountId: (state: RootState, accountId: ID) => import("../../../commonStateTypes/common").FetchStateAndError;
|
|
5
7
|
export declare const isAccountReconReport: (reportId: ReportIDPlusForecastID) => boolean;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.isAccountReconReport = exports.getExpenseAutomationReconciliationView = void 0;
|
|
6
|
+
exports.isAccountReconReport = exports.getReparseStatementStatusByAccountId = exports.getExpenseAutomationReconciliationView = void 0;
|
|
7
7
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
8
8
|
const big_js_1 = __importDefault(require("big.js"));
|
|
9
9
|
const keys_1 = __importDefault(require("lodash/keys"));
|
|
@@ -49,6 +49,17 @@ exports.getExpenseAutomationReconciliationView = (0, toolkit_1.createSelector)((
|
|
|
49
49
|
error: undefined,
|
|
50
50
|
})
|
|
51
51
|
: { fetchState: 'Not-Started', error: undefined };
|
|
52
|
+
const monthEndChecksForPeriod = selectedPeriod != null
|
|
53
|
+
? monthEndCloseChecksState.monthEndCloseChecksByTenantId[currentTenant.tenantId]?.[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]
|
|
54
|
+
: undefined;
|
|
55
|
+
const reconCheckTimeSavedHours = monthEndChecksForPeriod?.monthEndCloseCheckList?.find((check) => check.id === 'reconciliation')?.progressJson?.timeSavedHours;
|
|
56
|
+
const summaryWithTimeSaved = reconciliationViewState.summary != null
|
|
57
|
+
? {
|
|
58
|
+
...reconciliationViewState.summary,
|
|
59
|
+
timeSavedHours: reconCheckTimeSavedHours ??
|
|
60
|
+
reconciliationViewState.summary.timeSavedHours,
|
|
61
|
+
}
|
|
62
|
+
: undefined;
|
|
52
63
|
if (accountReconForMonthYearPeriod == null) {
|
|
53
64
|
return {
|
|
54
65
|
bankAccounts: [],
|
|
@@ -72,6 +83,7 @@ exports.getExpenseAutomationReconciliationView = (0, toolkit_1.createSelector)((
|
|
|
72
83
|
selectedTab: reconciliationViewState.selectedTab,
|
|
73
84
|
monthYearPeriod: selectedPeriod,
|
|
74
85
|
selectedAccountId: reconciliationViewState.selectedAccountId,
|
|
86
|
+
statementProcessingFailed: reconciliationViewState.statementProcessingFailed,
|
|
75
87
|
statementUploadChosen: reconciliationViewState.statementUploadChosen,
|
|
76
88
|
accountReconciliationsByAccountID: {},
|
|
77
89
|
reconciliationTabsState: reconciliationViewReducer_1.initialReconciliationTabsState,
|
|
@@ -121,6 +133,7 @@ exports.getExpenseAutomationReconciliationView = (0, toolkit_1.createSelector)((
|
|
|
121
133
|
excludeAccountFetchState: reconciliationViewState.actionFetchState.excludeAccountFetch,
|
|
122
134
|
includeAccountFetchState: reconciliationViewState.actionFetchState.includeAccountFetch,
|
|
123
135
|
excludedAccountIDs: reconciliationViewState.excludedAccountIDs,
|
|
136
|
+
summary: summaryWithTimeSaved,
|
|
124
137
|
};
|
|
125
138
|
}
|
|
126
139
|
const allAccountIDs = accountReconForMonthYearPeriod.accountIDs;
|
|
@@ -245,6 +258,12 @@ exports.getExpenseAutomationReconciliationView = (0, toolkit_1.createSelector)((
|
|
|
245
258
|
.refreshStatus,
|
|
246
259
|
statementDeleteStatus: accountReconForMonthYearPeriod.reconciliationByAccountID[accountID]
|
|
247
260
|
.statementDeleteStatus,
|
|
261
|
+
statementParseStatus: accountReconForMonthYearPeriod.reconciliationByAccountID[accountID]
|
|
262
|
+
.statementParseStatus,
|
|
263
|
+
reparseStatementStatus: accountReconForMonthYearPeriod.reconciliationByAccountID[accountID]
|
|
264
|
+
.reparseStatementStatus,
|
|
265
|
+
statementDateConflict: accountReconForMonthYearPeriod.reconciliationByAccountID[accountID]
|
|
266
|
+
.statementDateConflict,
|
|
248
267
|
statementUpdateStatus: accountReconForMonthYearPeriod.reconciliationByAccountID[accountID]
|
|
249
268
|
.statementUpdateStatus,
|
|
250
269
|
statementUploadStatus: accountReconForMonthYearPeriod.reconciliationByAccountID[accountID]
|
|
@@ -253,6 +272,8 @@ exports.getExpenseAutomationReconciliationView = (0, toolkit_1.createSelector)((
|
|
|
253
272
|
.localData,
|
|
254
273
|
statementParseInProgress: accountReconForMonthYearPeriod.reconciliationByAccountID[accountID]
|
|
255
274
|
.statementParseInProgress,
|
|
275
|
+
parsedStatementData: accountReconForMonthYearPeriod.reconciliationByAccountID[accountID]
|
|
276
|
+
.parsedStatementData,
|
|
256
277
|
transactionFetchState: (0, reduceFetchState_1.reduceAnyFetchState)([
|
|
257
278
|
accountReconForMonthYearPeriod.reconciliationByAccountID[accountID]
|
|
258
279
|
.transactionFetchState,
|
|
@@ -321,6 +342,9 @@ exports.getExpenseAutomationReconciliationView = (0, toolkit_1.createSelector)((
|
|
|
321
342
|
statementUpdateStatus: { fetchState: 'Not-Started' },
|
|
322
343
|
statementUploadStatus: { fetchState: 'Not-Started' },
|
|
323
344
|
statementDeleteStatus: { fetchState: 'Not-Started' },
|
|
345
|
+
statementParseStatus: { fetchState: 'Not-Started' },
|
|
346
|
+
reparseStatementStatus: { fetchState: 'Not-Started' },
|
|
347
|
+
statementDateConflict: null,
|
|
324
348
|
localData: {},
|
|
325
349
|
connectionInProgress: false,
|
|
326
350
|
statementParseInProgress: false,
|
|
@@ -409,6 +433,7 @@ exports.getExpenseAutomationReconciliationView = (0, toolkit_1.createSelector)((
|
|
|
409
433
|
refreshStatus: reconciliationViewState.refreshStatus,
|
|
410
434
|
selectedTab: reconciliationViewState.selectedTab,
|
|
411
435
|
selectedDrawerAccountId: reconciliationViewState.selectedDrawerAccountId,
|
|
436
|
+
statementProcessingFailed: reconciliationViewState.statementProcessingFailed,
|
|
412
437
|
statementUploadChosen: reconciliationViewState.statementUploadChosen,
|
|
413
438
|
monthYearPeriod: selectedPeriod,
|
|
414
439
|
accountReconciliationBySectionID,
|
|
@@ -429,8 +454,11 @@ exports.getExpenseAutomationReconciliationView = (0, toolkit_1.createSelector)((
|
|
|
429
454
|
excludeAccountFetchState: reconciliationViewState.actionFetchState.excludeAccountFetch,
|
|
430
455
|
includeAccountFetchState: reconciliationViewState.actionFetchState.includeAccountFetch,
|
|
431
456
|
excludedAccountIDs: reconciliationViewState.excludedAccountIDs,
|
|
457
|
+
summary: summaryWithTimeSaved,
|
|
432
458
|
};
|
|
433
459
|
});
|
|
460
|
+
const getReparseStatementStatusByAccountId = (state, accountId) => (0, exports.getExpenseAutomationReconciliationView)(state).accountReconciliationsByAccountID[accountId]?.reparseStatementStatus;
|
|
461
|
+
exports.getReparseStatementStatusByAccountId = getReparseStatementStatusByAccountId;
|
|
434
462
|
const isAccountReconReport = (reportId) => {
|
|
435
463
|
return reportId.endsWith('reconciliation');
|
|
436
464
|
};
|
|
@@ -5,6 +5,7 @@ import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderType
|
|
|
5
5
|
import { MonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
|
|
6
6
|
import { PageToken } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
7
7
|
import { FluxAnalysisSectionType } from '../selectorTypes/fluxAnalysisViewSelectorTypes';
|
|
8
|
+
import { ZeniDate } from '../../../zeniDayJS';
|
|
8
9
|
declare const toFluxAnalysisSortKey: (v: string) => "vendor" | "status" | "variance";
|
|
9
10
|
export type FluxAnalysisSortKey = ReturnType<typeof toFluxAnalysisSortKey>;
|
|
10
11
|
export type FluxAnalysisActionType = 'review' | 'unreview';
|
|
@@ -75,5 +76,6 @@ export interface FluxAnalysisViewState extends FetchedState {
|
|
|
75
76
|
selectedSectionIdsByPeriod: Record<MonthYearPeriodId, FluxAnalysisSectionType[]>;
|
|
76
77
|
totalBalancesAndVariance: BalancesAndVariance | undefined;
|
|
77
78
|
uiState: FluxAnalysisViewUIState;
|
|
79
|
+
lastRefreshSuccessTime?: ZeniDate;
|
|
78
80
|
}
|
|
79
81
|
export {};
|