@zeniai/client-epic-state 5.1.68-betaDI2 → 5.1.68-betaNB1
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/accountRecon/accountReconReducer.js +4 -0
- package/lib/entity/accountRecon/accountReconState.d.ts +4 -1
- package/lib/entity/accountRecon/accountReconState.js +1 -0
- package/lib/epic.d.ts +2 -1
- package/lib/epic.js +2 -1
- package/lib/esm/entity/accountRecon/accountReconReducer.js +4 -0
- package/lib/esm/entity/accountRecon/accountReconState.js +1 -0
- package/lib/esm/epic.js +2 -1
- package/lib/esm/index.js +5 -5
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/confirmStatementMappingEpic.js +37 -0
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/updateStatementInfoEpic.js +74 -5
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/uploadAccountStatementDocumentAIHelper.js +12 -4
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/uploadAccountStatementEpic.js +10 -2
- package/lib/esm/view/expenseAutomationView/helpers/mapStatementUpdateLocalDataToRequestBody.js +29 -5
- package/lib/esm/view/expenseAutomationView/payload/reconciliationPayload.js +106 -0
- package/lib/esm/view/expenseAutomationView/reducers/reconciliationViewReducer.js +86 -13
- package/lib/esm/view/expenseAutomationView/selectors/reconciliationViewSelector.js +29 -6
- package/lib/esm/view/expenseAutomationView/selectors/statementParseViewSelector.js +51 -10
- package/lib/esm/view/expenseAutomationView/types/reconciliationViewState.js +15 -1
- package/lib/esm/view/notificationPreferencesView/epics/saveNotificationPreferencesEpic.js +12 -9
- package/lib/esm/view/notificationPreferencesView/notificationPreferencesViewPayload.js +2 -7
- package/lib/esm/view/notificationPreferencesView/notificationPreferencesViewReducer.js +2 -47
- package/lib/esm/view/notificationPreferencesView/notificationPreferencesViewSelector.js +0 -9
- package/lib/esm/view/notificationPreferencesView/notificationPreferencesViewState.js +0 -1
- package/lib/index.d.ts +5 -5
- package/lib/index.js +54 -47
- package/lib/view/expenseAutomationView/epics/accountRecon/confirmStatementMappingEpic.d.ts +21 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/confirmStatementMappingEpic.js +41 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/updateStatementInfoEpic.js +73 -4
- package/lib/view/expenseAutomationView/epics/accountRecon/uploadAccountStatementDocumentAIHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/epics/accountRecon/uploadAccountStatementDocumentAIHelper.js +12 -4
- package/lib/view/expenseAutomationView/epics/accountRecon/uploadAccountStatementEpic.js +9 -1
- package/lib/view/expenseAutomationView/helpers/mapStatementUpdateLocalDataToRequestBody.d.ts +2 -0
- package/lib/view/expenseAutomationView/helpers/mapStatementUpdateLocalDataToRequestBody.js +30 -4
- package/lib/view/expenseAutomationView/payload/reconciliationPayload.d.ts +98 -4
- package/lib/view/expenseAutomationView/payload/reconciliationPayload.js +113 -0
- package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.d.ts +31 -4
- package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.js +87 -14
- package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.d.ts +4 -1
- package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +29 -6
- package/lib/view/expenseAutomationView/selectors/statementParseViewSelector.d.ts +4 -2
- package/lib/view/expenseAutomationView/selectors/statementParseViewSelector.js +53 -10
- package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +66 -0
- package/lib/view/expenseAutomationView/types/reconciliationViewState.js +19 -1
- package/lib/view/notificationPreferencesView/epics/saveNotificationPreferencesEpic.d.ts +8 -2
- package/lib/view/notificationPreferencesView/epics/saveNotificationPreferencesEpic.js +9 -6
- package/lib/view/notificationPreferencesView/notificationPreferencesViewPayload.d.ts +0 -1
- package/lib/view/notificationPreferencesView/notificationPreferencesViewPayload.js +2 -7
- package/lib/view/notificationPreferencesView/notificationPreferencesViewReducer.d.ts +1 -6
- package/lib/view/notificationPreferencesView/notificationPreferencesViewReducer.js +3 -48
- package/lib/view/notificationPreferencesView/notificationPreferencesViewSelector.js +0 -9
- package/lib/view/notificationPreferencesView/notificationPreferencesViewState.d.ts +0 -1
- package/lib/view/notificationPreferencesView/notificationPreferencesViewState.js +0 -1
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ import { MonthYearPeriod } from '../../../commonStateTypes/timePeriod';
|
|
|
5
5
|
import { ReconciliationDataPayload } from '../../../entity/accountRecon/accountReconPayload';
|
|
6
6
|
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
7
7
|
import { ExcludedAccountFromReconciliationPayload, ReconciliationPayload, UploadStatementDocumentAIPayload } from '../payload/reconciliationPayload';
|
|
8
|
-
import { AccountReconciliationLocalData, ActionFetchStates, ExcludeAccountFromReconciliationPayload, ParsedStatementData, ReconReconcileSortKey, ReconReviewSortKey, ReconciliationReviewTabLocalData, ReconciliationTabsState, ReconciliationViewState, ReconciliationViewTabType, SaveReconcileDetailActionPayload, SaveReconciliationDetailFailurePayload, StatementDateConflict, StatementUpdateLocalData, TransactionSummary } from '../types/reconciliationViewState';
|
|
8
|
+
import { AccountReconciliationLocalData, ActionFetchStates, ConfirmStatementMappingConflict, ConfirmedCombinedStatementUpload, ExcludeAccountFromReconciliationPayload, ParsedStatementData, ReconReconcileSortKey, ReconReviewSortKey, ReconciliationReviewTabLocalData, ReconciliationTabsState, ReconciliationViewState, ReconciliationViewTabType, SaveReconcileDetailActionPayload, SaveReconciliationDetailFailurePayload, StatementAccountScope, StatementDateConflict, StatementUpdateLocalData, TransactionSummary } from '../types/reconciliationViewState';
|
|
9
9
|
export declare const initialReconciliationTabsState: ReconciliationTabsState;
|
|
10
10
|
export declare const initialActionFetchState: ActionFetchStates;
|
|
11
11
|
export declare const initialState: ReconciliationViewState;
|
|
@@ -116,6 +116,7 @@ export declare const fetchReconciliation: import("@reduxjs/toolkit").ActionCreat
|
|
|
116
116
|
accountId: ID;
|
|
117
117
|
payload: UploadStatementDocumentAIPayload;
|
|
118
118
|
selectedPeriod: MonthYearPeriod;
|
|
119
|
+
statementAccountScope?: StatementAccountScope;
|
|
119
120
|
}, "expenseAutomationReconciliationView/uploadAccountStatement">, uploadAccountStatementSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
120
121
|
accountId: ID;
|
|
121
122
|
selectedPeriod: MonthYearPeriod;
|
|
@@ -152,11 +153,17 @@ export declare const fetchReconciliation: import("@reduxjs/toolkit").ActionCreat
|
|
|
152
153
|
accountId: ID;
|
|
153
154
|
parsedStatementData: ParsedStatementData;
|
|
154
155
|
selectedPeriod: MonthYearPeriod;
|
|
155
|
-
}, "expenseAutomationReconciliationView/updateParsedStatementData">, updateStatementUpdateLocalData: import("@reduxjs/toolkit").
|
|
156
|
+
}, "expenseAutomationReconciliationView/updateParsedStatementData">, updateStatementUpdateLocalData: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: {
|
|
156
157
|
accountId: ID;
|
|
157
158
|
selectedPeriod: MonthYearPeriod;
|
|
158
159
|
statementUpdateLocalData: StatementUpdateLocalData;
|
|
159
|
-
|
|
160
|
+
statementUploadId?: ID | string;
|
|
161
|
+
}], {
|
|
162
|
+
accountId: ID;
|
|
163
|
+
selectedPeriod: MonthYearPeriod;
|
|
164
|
+
statementUpdateLocalData: StatementUpdateLocalData;
|
|
165
|
+
statementUploadId?: ID | string;
|
|
166
|
+
}, "expenseAutomationReconciliationView/updateStatementUpdateLocalData", never, never>, submitStatementUpdate: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
160
167
|
accountId: ID;
|
|
161
168
|
selectedPeriod: MonthYearPeriod;
|
|
162
169
|
statementUploadId: ID;
|
|
@@ -171,7 +178,27 @@ export declare const fetchReconciliation: import("@reduxjs/toolkit").ActionCreat
|
|
|
171
178
|
}, "expenseAutomationReconciliationView/submitStatementUpdateFailure">, clearStatementDateConflict: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
172
179
|
accountId: ID;
|
|
173
180
|
selectedPeriod: MonthYearPeriod;
|
|
174
|
-
}, "expenseAutomationReconciliationView/clearStatementDateConflict">,
|
|
181
|
+
}, "expenseAutomationReconciliationView/clearStatementDateConflict">, confirmStatementMapping: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
182
|
+
accountId: ID;
|
|
183
|
+
accountMappings: Array<{
|
|
184
|
+
accountId: ID;
|
|
185
|
+
ledgerIdentifier: string;
|
|
186
|
+
}>;
|
|
187
|
+
selectedPeriod: MonthYearPeriod;
|
|
188
|
+
statementUploadId: ID;
|
|
189
|
+
}, "expenseAutomationReconciliationView/confirmStatementMapping">, confirmStatementMappingSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
190
|
+
accountId: ID;
|
|
191
|
+
selectedPeriod: MonthYearPeriod;
|
|
192
|
+
statementUploads: ConfirmedCombinedStatementUpload[];
|
|
193
|
+
}, "expenseAutomationReconciliationView/confirmStatementMappingSuccess">, confirmStatementMappingFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
194
|
+
accountId: ID;
|
|
195
|
+
error: ZeniAPIStatus;
|
|
196
|
+
selectedPeriod: MonthYearPeriod;
|
|
197
|
+
mappingConflict?: ConfirmStatementMappingConflict | null;
|
|
198
|
+
}, "expenseAutomationReconciliationView/confirmStatementMappingFailure">, clearConfirmStatementMappingConflict: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
199
|
+
accountId: ID;
|
|
200
|
+
selectedPeriod: MonthYearPeriod;
|
|
201
|
+
}, "expenseAutomationReconciliationView/clearConfirmStatementMappingConflict">, updateStatementUploadChosen: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
175
202
|
statementUploadChosen: boolean;
|
|
176
203
|
}, "expenseAutomationReconciliationView/updateStatementUploadChosen">, updateNodeCollapseState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
177
204
|
collapsed: boolean;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
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.updateStatementProcessingBackgroundCompletedSteps = exports.setStatementProcessingDismissedToBackground = 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 = exports.submitStatementUpdate = exports.updateStatementUpdateLocalData = void 0;
|
|
5
|
+
exports.updateNodeCollapseState = exports.updateStatementUploadChosen = exports.clearConfirmStatementMappingConflict = exports.confirmStatementMappingFailure = exports.confirmStatementMappingSuccess = exports.confirmStatementMapping = exports.clearStatementDateConflict = exports.submitStatementUpdateFailure = exports.submitStatementUpdateSuccess = exports.submitStatementUpdate = exports.updateStatementUpdateLocalData = void 0;
|
|
6
6
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
7
7
|
const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
|
|
8
8
|
const accountState_1 = require("../../../entity/account/accountState");
|
|
@@ -434,7 +434,7 @@ const expenseAutomationReconciliationView = (0, toolkit_1.createSlice)({
|
|
|
434
434
|
}
|
|
435
435
|
},
|
|
436
436
|
uploadAccountStatement: (draft, action) => {
|
|
437
|
-
const { accountId, selectedPeriod } = action.payload;
|
|
437
|
+
const { accountId, selectedPeriod, statementAccountScope } = action.payload;
|
|
438
438
|
const accountRecon = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]?.reconciliationByAccountID[accountId];
|
|
439
439
|
if (accountRecon != null) {
|
|
440
440
|
accountRecon.statementUploadStatus = {
|
|
@@ -459,6 +459,12 @@ const expenseAutomationReconciliationView = (0, toolkit_1.createSlice)({
|
|
|
459
459
|
fetchState: 'Not-Started',
|
|
460
460
|
error: undefined,
|
|
461
461
|
};
|
|
462
|
+
if (statementAccountScope != null) {
|
|
463
|
+
accountRecon.localData = {
|
|
464
|
+
...accountRecon.localData,
|
|
465
|
+
statementAccountScope,
|
|
466
|
+
};
|
|
467
|
+
}
|
|
462
468
|
}
|
|
463
469
|
},
|
|
464
470
|
uploadAccountStatementSuccess: (draft, action) => {
|
|
@@ -523,6 +529,7 @@ const expenseAutomationReconciliationView = (0, toolkit_1.createSlice)({
|
|
|
523
529
|
};
|
|
524
530
|
if (accountRecon.localData != null) {
|
|
525
531
|
accountRecon.localData.statementUpdateLocalData = undefined;
|
|
532
|
+
accountRecon.localData.statementUpdateLocalDataByUploadId = undefined;
|
|
526
533
|
}
|
|
527
534
|
}
|
|
528
535
|
},
|
|
@@ -603,6 +610,7 @@ const expenseAutomationReconciliationView = (0, toolkit_1.createSlice)({
|
|
|
603
610
|
accountRecon.statementParseInProgress = true;
|
|
604
611
|
if (accountRecon.localData != null) {
|
|
605
612
|
accountRecon.localData.statementUpdateLocalData = undefined;
|
|
613
|
+
accountRecon.localData.statementUpdateLocalDataByUploadId = undefined;
|
|
606
614
|
}
|
|
607
615
|
}
|
|
608
616
|
},
|
|
@@ -647,20 +655,29 @@ const expenseAutomationReconciliationView = (0, toolkit_1.createSlice)({
|
|
|
647
655
|
draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)].reconciliationByAccountID[accountId].parsedStatementData =
|
|
648
656
|
parsedStatementData;
|
|
649
657
|
},
|
|
650
|
-
updateStatementUpdateLocalData:
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
658
|
+
updateStatementUpdateLocalData: {
|
|
659
|
+
prepare(payload) {
|
|
660
|
+
return { payload };
|
|
661
|
+
},
|
|
662
|
+
reducer(draft, action) {
|
|
663
|
+
const { accountId, selectedPeriod, statementUpdateLocalData, statementUploadId, } = action.payload;
|
|
664
|
+
const accountRecon = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]?.reconciliationByAccountID[accountId];
|
|
665
|
+
if (accountRecon == null) {
|
|
666
|
+
return;
|
|
667
|
+
}
|
|
654
668
|
if (accountRecon.localData == null) {
|
|
655
|
-
accountRecon.localData = {
|
|
656
|
-
statementUpdateLocalData,
|
|
657
|
-
};
|
|
669
|
+
accountRecon.localData = {};
|
|
658
670
|
}
|
|
659
|
-
|
|
660
|
-
accountRecon.localData.
|
|
661
|
-
|
|
671
|
+
if (statementUploadId != null && statementUploadId !== '') {
|
|
672
|
+
accountRecon.localData.statementUpdateLocalDataByUploadId = {
|
|
673
|
+
...accountRecon.localData.statementUpdateLocalDataByUploadId,
|
|
674
|
+
[statementUploadId]: statementUpdateLocalData,
|
|
675
|
+
};
|
|
676
|
+
return;
|
|
662
677
|
}
|
|
663
|
-
|
|
678
|
+
accountRecon.localData.statementUpdateLocalData =
|
|
679
|
+
statementUpdateLocalData;
|
|
680
|
+
},
|
|
664
681
|
},
|
|
665
682
|
submitStatementUpdate: (draft, action) => {
|
|
666
683
|
const { accountId, selectedPeriod } = action.payload;
|
|
@@ -689,6 +706,7 @@ const expenseAutomationReconciliationView = (0, toolkit_1.createSlice)({
|
|
|
689
706
|
accountRecon.statementProcessingTotalDurationSeconds = undefined;
|
|
690
707
|
if (accountRecon.localData != null) {
|
|
691
708
|
accountRecon.localData.statementUpdateLocalData = undefined;
|
|
709
|
+
accountRecon.localData.statementUpdateLocalDataByUploadId = undefined;
|
|
692
710
|
}
|
|
693
711
|
}
|
|
694
712
|
},
|
|
@@ -710,6 +728,52 @@ const expenseAutomationReconciliationView = (0, toolkit_1.createSlice)({
|
|
|
710
728
|
accountRecon.statementDateConflict = null;
|
|
711
729
|
}
|
|
712
730
|
},
|
|
731
|
+
confirmStatementMapping: (draft, action) => {
|
|
732
|
+
const { accountId, selectedPeriod } = action.payload;
|
|
733
|
+
const accountRecon = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]?.reconciliationByAccountID[accountId];
|
|
734
|
+
if (accountRecon != null) {
|
|
735
|
+
accountRecon.confirmStatementMappingStatus = {
|
|
736
|
+
fetchState: 'In-Progress',
|
|
737
|
+
error: undefined,
|
|
738
|
+
};
|
|
739
|
+
accountRecon.confirmStatementMappingConflict = null;
|
|
740
|
+
}
|
|
741
|
+
},
|
|
742
|
+
confirmStatementMappingSuccess: (draft, action) => {
|
|
743
|
+
const { accountId, selectedPeriod, statementUploads } = action.payload;
|
|
744
|
+
const accountRecon = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]?.reconciliationByAccountID[accountId];
|
|
745
|
+
if (accountRecon != null) {
|
|
746
|
+
accountRecon.confirmStatementMappingStatus = {
|
|
747
|
+
fetchState: 'Completed',
|
|
748
|
+
error: undefined,
|
|
749
|
+
};
|
|
750
|
+
accountRecon.confirmStatementMappingConflict = null;
|
|
751
|
+
accountRecon.confirmedCombinedStatementUploads = statementUploads;
|
|
752
|
+
const combinedStatementDetails = accountRecon.parsedStatementData?.statementUpload
|
|
753
|
+
.combinedStatementDetails;
|
|
754
|
+
if (combinedStatementDetails != null) {
|
|
755
|
+
combinedStatementDetails.isMappingConfirmed = true;
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
},
|
|
759
|
+
confirmStatementMappingFailure: (draft, action) => {
|
|
760
|
+
const { accountId, selectedPeriod, mappingConflict } = action.payload;
|
|
761
|
+
const accountRecon = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]?.reconciliationByAccountID[accountId];
|
|
762
|
+
if (accountRecon != null) {
|
|
763
|
+
accountRecon.confirmStatementMappingStatus = {
|
|
764
|
+
fetchState: 'Error',
|
|
765
|
+
error: action.payload.error,
|
|
766
|
+
};
|
|
767
|
+
accountRecon.confirmStatementMappingConflict = mappingConflict ?? null;
|
|
768
|
+
}
|
|
769
|
+
},
|
|
770
|
+
clearConfirmStatementMappingConflict: (draft, action) => {
|
|
771
|
+
const { accountId, selectedPeriod } = action.payload;
|
|
772
|
+
const accountRecon = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]?.reconciliationByAccountID[accountId];
|
|
773
|
+
if (accountRecon != null) {
|
|
774
|
+
accountRecon.confirmStatementMappingConflict = null;
|
|
775
|
+
}
|
|
776
|
+
},
|
|
713
777
|
updateAccountReconciliationLocalData: (draft, action) => {
|
|
714
778
|
const { accountId, selectedPeriod, localData } = action.payload;
|
|
715
779
|
const oldLocalData = draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)].reconciliationByAccountID[accountId].localData;
|
|
@@ -815,7 +879,7 @@ const expenseAutomationReconciliationView = (0, toolkit_1.createSlice)({
|
|
|
815
879
|
},
|
|
816
880
|
});
|
|
817
881
|
// Export actions
|
|
818
|
-
_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.setStatementProcessingDismissedToBackground = _a.setStatementProcessingDismissedToBackground, exports.updateStatementProcessingBackgroundCompletedSteps = _a.updateStatementProcessingBackgroundCompletedSteps, 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;
|
|
882
|
+
_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.setStatementProcessingDismissedToBackground = _a.setStatementProcessingDismissedToBackground, exports.updateStatementProcessingBackgroundCompletedSteps = _a.updateStatementProcessingBackgroundCompletedSteps, 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.confirmStatementMapping = _a.confirmStatementMapping, exports.confirmStatementMappingSuccess = _a.confirmStatementMappingSuccess, exports.confirmStatementMappingFailure = _a.confirmStatementMappingFailure, exports.clearConfirmStatementMappingConflict = _a.clearConfirmStatementMappingConflict, exports.updateStatementUploadChosen = _a.updateStatementUploadChosen, exports.updateNodeCollapseState = _a.updateNodeCollapseState;
|
|
819
883
|
// Export reducer
|
|
820
884
|
exports.default = expenseAutomationReconciliationView.reducer;
|
|
821
885
|
function isEntityStatementParsing(reconciliation) {
|
|
@@ -829,6 +893,7 @@ function isEntityStatementParseTerminal(reconciliation) {
|
|
|
829
893
|
statusCode === 'parsing_failed' ||
|
|
830
894
|
statusCode === 'validation_failed' ||
|
|
831
895
|
statusCode === 'processing_failed' ||
|
|
896
|
+
statusCode === 'parsed_awaiting_mapping' ||
|
|
832
897
|
statusCode === 'deleting' ||
|
|
833
898
|
statusCode === 'deleted');
|
|
834
899
|
}
|
|
@@ -964,6 +1029,12 @@ function updateAllReconciliation(draft, accounts, selectedPeriod, reconciliation
|
|
|
964
1029
|
error: undefined,
|
|
965
1030
|
},
|
|
966
1031
|
statementDateConflict: oldRecord?.statementDateConflict ?? null,
|
|
1032
|
+
confirmStatementMappingStatus: oldRecord?.confirmStatementMappingStatus ?? {
|
|
1033
|
+
fetchState: 'Not-Started',
|
|
1034
|
+
error: undefined,
|
|
1035
|
+
},
|
|
1036
|
+
confirmStatementMappingConflict: oldRecord?.confirmStatementMappingConflict ?? null,
|
|
1037
|
+
confirmedCombinedStatementUploads: oldRecord?.confirmedCombinedStatementUploads,
|
|
967
1038
|
localData: {
|
|
968
1039
|
...oldRecord?.localData,
|
|
969
1040
|
accountSource: account?.reconciliation_source != null
|
|
@@ -1062,6 +1133,8 @@ const updateReconciliationByAccountIDOnIncludeAccount = (draft, accountId, recon
|
|
|
1062
1133
|
statementParseStatus: { fetchState: 'Not-Started', error: undefined },
|
|
1063
1134
|
reparseStatementStatus: { fetchState: 'Not-Started', error: undefined },
|
|
1064
1135
|
statementDateConflict: null,
|
|
1136
|
+
confirmStatementMappingStatus: { fetchState: 'Not-Started', error: undefined },
|
|
1137
|
+
confirmStatementMappingConflict: null,
|
|
1065
1138
|
localData: {},
|
|
1066
1139
|
accountDetectionReason: undefined,
|
|
1067
1140
|
};
|
|
@@ -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, ParsedStatementData, ReconListUIState, ReconciliationTabsState, ReconciliationViewSummary, ReconciliationViewTabType, StatementDateConflict, StatementTransaction } from '../types/reconciliationViewState';
|
|
12
|
+
import { AccountReconciliationLocalData, ActionFetchStates, ConfirmStatementMappingConflict, ConfirmedCombinedStatementUpload, ParsedStatementData, ReconListUIState, ReconciliationTabsState, ReconciliationViewSummary, ReconciliationViewTabType, StatementDateConflict, StatementTransaction } 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>;
|
|
@@ -55,6 +55,8 @@ export interface AccountReconciliationBySection {
|
|
|
55
55
|
export interface AccountReconciliationByAccount {
|
|
56
56
|
accountConnectionStatus: BankStatusCodeType;
|
|
57
57
|
accountReconEntity: AccountReconciliationEntity;
|
|
58
|
+
confirmStatementMappingConflict: ConfirmStatementMappingConflict | null;
|
|
59
|
+
confirmStatementMappingStatus: FetchStateAndError;
|
|
58
60
|
connectionInProgress: boolean;
|
|
59
61
|
localData: AccountReconciliationLocalData;
|
|
60
62
|
refreshStatus: FetchStateAndError;
|
|
@@ -72,6 +74,7 @@ export interface AccountReconciliationByAccount {
|
|
|
72
74
|
accountDetectionReason?: string;
|
|
73
75
|
/** Unfiltered parsed transactions for PDF citation highlights. */
|
|
74
76
|
allCitationTransactions?: StatementTransaction[];
|
|
77
|
+
confirmedCombinedStatementUploads?: ConfirmedCombinedStatementUpload[];
|
|
75
78
|
parsedStatementData?: ParsedStatementData;
|
|
76
79
|
paymentAccountId?: ID;
|
|
77
80
|
statementProcessingStartedAtMs?: number;
|
|
@@ -252,7 +252,28 @@ exports.getExpenseAutomationReconciliationView = (0, toolkit_1.createSelector)((
|
|
|
252
252
|
const accountReconState = accountReconForMonthYearPeriod.reconciliationByAccountID[accountID];
|
|
253
253
|
const rawParsedStatementData = accountReconState.parsedStatementData;
|
|
254
254
|
const statementUpdateLocalData = accountReconState.localData?.statementUpdateLocalData;
|
|
255
|
-
const
|
|
255
|
+
const statementUpdateLocalDataByUploadId = accountReconState.localData?.statementUpdateLocalDataByUploadId;
|
|
256
|
+
const parsedStatementDataForView = (0, statementParseViewSelector_1.getParsedStatementDataForView)(rawParsedStatementData, statementUpdateLocalData, statementUpdateLocalDataByUploadId);
|
|
257
|
+
const rawStatementUploads = rawParsedStatementData?.statementUploads != null &&
|
|
258
|
+
rawParsedStatementData.statementUploads.length > 0
|
|
259
|
+
? rawParsedStatementData.statementUploads
|
|
260
|
+
: rawParsedStatementData?.statementUpload != null
|
|
261
|
+
? [rawParsedStatementData.statementUpload]
|
|
262
|
+
: [];
|
|
263
|
+
const allCitationTransactions = rawStatementUploads.flatMap((statementUpload) => statementUpload.statementTransactions);
|
|
264
|
+
const statementTransactionPeriodById = rawStatementUploads.length > 0
|
|
265
|
+
? Object.assign({}, ...rawStatementUploads.map((statementUpload) => {
|
|
266
|
+
const uploadId = statementUpload.statementMeta.statementUploadId;
|
|
267
|
+
const localMeta = statementUpdateLocalDataByUploadId?.[uploadId]
|
|
268
|
+
?.statementMeta ??
|
|
269
|
+
(uploadId ===
|
|
270
|
+
rawParsedStatementData?.statementUpload.statementMeta
|
|
271
|
+
.statementUploadId
|
|
272
|
+
? statementUpdateLocalData?.statementMeta
|
|
273
|
+
: undefined);
|
|
274
|
+
return (0, statementParseViewSelector_1.getStatementTransactionPeriodById)(statementUpload.statementTransactions, statementUpload.statementMeta, localMeta);
|
|
275
|
+
}))
|
|
276
|
+
: undefined;
|
|
256
277
|
reconList[accountID] = {
|
|
257
278
|
accountConnectionStatus: accountConnectionStatus.status,
|
|
258
279
|
paymentAccountId: accountConnectionStatus.paymentAccountId,
|
|
@@ -263,6 +284,9 @@ exports.getExpenseAutomationReconciliationView = (0, toolkit_1.createSelector)((
|
|
|
263
284
|
statementParseStatus: accountReconState.statementParseStatus,
|
|
264
285
|
reparseStatementStatus: accountReconState.reparseStatementStatus,
|
|
265
286
|
statementDateConflict: accountReconState.statementDateConflict,
|
|
287
|
+
confirmStatementMappingStatus: accountReconState.confirmStatementMappingStatus,
|
|
288
|
+
confirmStatementMappingConflict: accountReconState.confirmStatementMappingConflict,
|
|
289
|
+
confirmedCombinedStatementUploads: accountReconState.confirmedCombinedStatementUploads,
|
|
266
290
|
statementUpdateStatus: accountReconState.statementUpdateStatus,
|
|
267
291
|
statementUploadStatus: accountReconState.statementUploadStatus,
|
|
268
292
|
localData: accountReconState.localData,
|
|
@@ -273,11 +297,8 @@ exports.getExpenseAutomationReconciliationView = (0, toolkit_1.createSelector)((
|
|
|
273
297
|
statementProcessingTotalDurationSeconds: accountReconState.statementProcessingTotalDurationSeconds,
|
|
274
298
|
statementProcessingFailed: accountReconState.statementProcessingFailed,
|
|
275
299
|
parsedStatementData: parsedStatementDataForView,
|
|
276
|
-
allCitationTransactions
|
|
277
|
-
statementTransactionPeriodById
|
|
278
|
-
? (0, statementParseViewSelector_1.getStatementTransactionPeriodById)(rawParsedStatementData.statementUpload.statementTransactions, rawParsedStatementData.statementUpload.statementMeta, accountReconState.localData?.statementUpdateLocalData
|
|
279
|
-
?.statementMeta)
|
|
280
|
-
: undefined,
|
|
300
|
+
allCitationTransactions,
|
|
301
|
+
statementTransactionPeriodById,
|
|
281
302
|
transactionFetchState: (0, reduceFetchState_1.reduceAnyFetchState)([
|
|
282
303
|
accountReconState.transactionFetchState,
|
|
283
304
|
accountListState.byReportId.accountList,
|
|
@@ -347,6 +368,8 @@ exports.getExpenseAutomationReconciliationView = (0, toolkit_1.createSelector)((
|
|
|
347
368
|
statementParseStatus: { fetchState: 'Not-Started' },
|
|
348
369
|
reparseStatementStatus: { fetchState: 'Not-Started' },
|
|
349
370
|
statementDateConflict: null,
|
|
371
|
+
confirmStatementMappingStatus: { fetchState: 'Not-Started' },
|
|
372
|
+
confirmStatementMappingConflict: null,
|
|
350
373
|
localData: {},
|
|
351
374
|
connectionInProgress: false,
|
|
352
375
|
statementParseInProgress: false,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { ParsedStatementData, StatementMeta, StatementTransaction, StatementUpdateLocalData } from '../types/reconciliationViewState';
|
|
1
|
+
import { ParsedStatementData, StatementMeta, StatementTransaction, StatementUpdateLocalData, StatementUpload } from '../types/reconciliationViewState';
|
|
2
|
+
export declare function getStatementUploadsFromParsedData(parsedStatementData: ParsedStatementData | undefined): StatementUpload[];
|
|
3
|
+
export declare function isCombinedParsedStatementData(parsedStatementData: ParsedStatementData | undefined): boolean;
|
|
2
4
|
export interface StatementPeriod {
|
|
3
5
|
statementEndDate: string;
|
|
4
6
|
statementStartDate: string;
|
|
@@ -6,7 +8,7 @@ export interface StatementPeriod {
|
|
|
6
8
|
export declare const getEffectiveStatementPeriod: (parsedMeta: StatementMeta, localMeta: StatementMeta | undefined) => StatementPeriod;
|
|
7
9
|
export declare const isStatementTransactionInPeriod: (transactionDate: string, statementStartDate: string, statementEndDate: string) => boolean;
|
|
8
10
|
export declare const filterStatementTransactionsByPeriod: (transactions: StatementTransaction[], statementPeriod: StatementPeriod) => StatementTransaction[];
|
|
9
|
-
export declare const getParsedStatementDataForView: (parsedStatementData: ParsedStatementData | undefined, statementUpdateLocalData: StatementUpdateLocalData | undefined) => ParsedStatementData | undefined;
|
|
11
|
+
export declare const getParsedStatementDataForView: (parsedStatementData: ParsedStatementData | undefined, statementUpdateLocalData: StatementUpdateLocalData | undefined, statementUpdateLocalDataByUploadId?: Record<string, StatementUpdateLocalData>) => ParsedStatementData | undefined;
|
|
10
12
|
export declare const getStatementTransactionPeriodById: (allParsedTransactions: StatementTransaction[], parsedMeta: StatementMeta, localMeta: StatementMeta | undefined) => Record<string, boolean>;
|
|
11
13
|
export declare const getDateFilteredDeletedTransactionIds: (allParsedTransactions: StatementTransaction[], statementPeriod: StatementPeriod) => string[];
|
|
12
14
|
export declare const mergeStatementParseDeletedTransactionIds: (originalTransactions: StatementTransaction[], statementPeriod: StatementPeriod, currentTransactionIds: Set<string>) => string[];
|
|
@@ -1,7 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.mergeStatementParseDeletedTransactionIds = exports.getDateFilteredDeletedTransactionIds = exports.getStatementTransactionPeriodById = exports.getParsedStatementDataForView = exports.filterStatementTransactionsByPeriod = exports.isStatementTransactionInPeriod = exports.getEffectiveStatementPeriod = void 0;
|
|
4
|
+
exports.getStatementUploadsFromParsedData = getStatementUploadsFromParsedData;
|
|
5
|
+
exports.isCombinedParsedStatementData = isCombinedParsedStatementData;
|
|
4
6
|
const zeniDayJS_1 = require("../../../zeniDayJS");
|
|
7
|
+
function getStatementUploadsFromParsedData(parsedStatementData) {
|
|
8
|
+
if (parsedStatementData == null) {
|
|
9
|
+
return [];
|
|
10
|
+
}
|
|
11
|
+
if (parsedStatementData.statementUploads != null &&
|
|
12
|
+
parsedStatementData.statementUploads.length > 0) {
|
|
13
|
+
return parsedStatementData.statementUploads;
|
|
14
|
+
}
|
|
15
|
+
if (parsedStatementData.statementUpload != null) {
|
|
16
|
+
return [parsedStatementData.statementUpload];
|
|
17
|
+
}
|
|
18
|
+
return [];
|
|
19
|
+
}
|
|
20
|
+
function isCombinedParsedStatementData(parsedStatementData) {
|
|
21
|
+
return (parsedStatementData?.statementUploads != null &&
|
|
22
|
+
parsedStatementData.statementUploads.length > 1);
|
|
23
|
+
}
|
|
5
24
|
const getEffectiveStatementPeriod = (parsedMeta, localMeta) => ({
|
|
6
25
|
statementStartDate: localMeta?.statementStartDate != null && localMeta.statementStartDate !== ''
|
|
7
26
|
? localMeta.statementStartDate
|
|
@@ -31,24 +50,48 @@ const filterStatementTransactionsByPeriod = (transactions, statementPeriod) => {
|
|
|
31
50
|
return transactions.filter((transaction) => (0, exports.isStatementTransactionInPeriod)(transaction.transactionDate, statementStartDate, statementEndDate));
|
|
32
51
|
};
|
|
33
52
|
exports.filterStatementTransactionsByPeriod = filterStatementTransactionsByPeriod;
|
|
34
|
-
const
|
|
53
|
+
const getStatementUploadForView = (statementUpload, statementUpdateLocalData) => {
|
|
54
|
+
const parsedMeta = statementUpload.statementMeta;
|
|
55
|
+
const localMeta = statementUpdateLocalData?.statementMeta;
|
|
56
|
+
const effectiveMeta = localMeta ?? parsedMeta;
|
|
57
|
+
const statementPeriod = (0, exports.getEffectiveStatementPeriod)(parsedMeta, localMeta);
|
|
58
|
+
return {
|
|
59
|
+
...statementUpload,
|
|
60
|
+
statementMeta: effectiveMeta,
|
|
61
|
+
statementTransactions: (0, exports.filterStatementTransactionsByPeriod)(statementUpload.statementTransactions, statementPeriod),
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
const getParsedStatementDataForView = (parsedStatementData, statementUpdateLocalData, statementUpdateLocalDataByUploadId) => {
|
|
35
65
|
if (parsedStatementData == null) {
|
|
36
66
|
return undefined;
|
|
37
67
|
}
|
|
68
|
+
const statementUploads = getStatementUploadsFromParsedData(parsedStatementData);
|
|
69
|
+
if (statementUploads.length === 0) {
|
|
70
|
+
return undefined;
|
|
71
|
+
}
|
|
72
|
+
if (isCombinedParsedStatementData(parsedStatementData) === true) {
|
|
73
|
+
const viewedUploads = statementUploads.map((statementUpload) => {
|
|
74
|
+
const uploadId = statementUpload.statementMeta.statementUploadId;
|
|
75
|
+
const localDataForUpload = statementUpdateLocalDataByUploadId?.[uploadId] ??
|
|
76
|
+
(uploadId ===
|
|
77
|
+
parsedStatementData.statementUpload.statementMeta.statementUploadId
|
|
78
|
+
? statementUpdateLocalData
|
|
79
|
+
: undefined);
|
|
80
|
+
return getStatementUploadForView(statementUpload, localDataForUpload);
|
|
81
|
+
});
|
|
82
|
+
const anchorUploadId = parsedStatementData.statementUpload.statementMeta.statementUploadId;
|
|
83
|
+
const viewedAnchor = viewedUploads.find((upload) => upload.statementMeta.statementUploadId === anchorUploadId) ?? viewedUploads[0];
|
|
84
|
+
return {
|
|
85
|
+
statementUpload: viewedAnchor,
|
|
86
|
+
statementUploads: viewedUploads,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
38
89
|
const statementUpload = parsedStatementData.statementUpload;
|
|
39
90
|
if (statementUpload == null) {
|
|
40
91
|
return undefined;
|
|
41
92
|
}
|
|
42
|
-
const parsedMeta = statementUpload.statementMeta;
|
|
43
|
-
const localMeta = statementUpdateLocalData?.statementMeta;
|
|
44
|
-
const effectiveMeta = localMeta ?? parsedMeta;
|
|
45
|
-
const statementPeriod = (0, exports.getEffectiveStatementPeriod)(parsedMeta, localMeta);
|
|
46
93
|
return {
|
|
47
|
-
statementUpload:
|
|
48
|
-
...statementUpload,
|
|
49
|
-
statementMeta: effectiveMeta,
|
|
50
|
-
statementTransactions: (0, exports.filterStatementTransactionsByPeriod)(statementUpload.statementTransactions, statementPeriod),
|
|
51
|
-
},
|
|
94
|
+
statementUpload: getStatementUploadForView(statementUpload, statementUpdateLocalData),
|
|
52
95
|
};
|
|
53
96
|
};
|
|
54
97
|
exports.getParsedStatementDataForView = getParsedStatementDataForView;
|
|
@@ -29,6 +29,9 @@ export interface StatementTransaction {
|
|
|
29
29
|
transactionDirection: 'debit' | 'credit';
|
|
30
30
|
transactionMemo: string;
|
|
31
31
|
}
|
|
32
|
+
export declare const toStatementBalanceSource: (v: string) => "ocr" | "prior_recon" | "default_zero";
|
|
33
|
+
export type StatementBalanceSource = ReturnType<typeof toStatementBalanceSource>;
|
|
34
|
+
export declare const toStatementBalanceSourceStrict: (v: string | null | undefined) => StatementBalanceSource | undefined;
|
|
32
35
|
export interface StatementMeta {
|
|
33
36
|
closingBalance: number;
|
|
34
37
|
openingBalance: number;
|
|
@@ -45,6 +48,10 @@ export interface StatementMeta {
|
|
|
45
48
|
statementUploadId: string;
|
|
46
49
|
totalDeposits: number;
|
|
47
50
|
totalPayments: number;
|
|
51
|
+
balanceSource?: StatementBalanceSource;
|
|
52
|
+
combinedStatementGroupId?: string;
|
|
53
|
+
isCombinedStatement?: boolean;
|
|
54
|
+
isCombinedStatementAnchor?: boolean;
|
|
48
55
|
}
|
|
49
56
|
export interface AccountInfo {
|
|
50
57
|
accountId: string;
|
|
@@ -92,15 +99,63 @@ export interface AiSummary {
|
|
|
92
99
|
fieldsCaptured: AiSummaryField[];
|
|
93
100
|
transactionsExtracted: number;
|
|
94
101
|
}
|
|
102
|
+
export interface CombinedStatementAccountSuggestion {
|
|
103
|
+
accountId: ID;
|
|
104
|
+
accountName: string;
|
|
105
|
+
matchConfidence: number;
|
|
106
|
+
matchedBy: string;
|
|
107
|
+
}
|
|
108
|
+
export interface CombinedStatementAccount {
|
|
109
|
+
accountName: string;
|
|
110
|
+
accountType: string;
|
|
111
|
+
closingBalance: number;
|
|
112
|
+
isUploadContext: boolean;
|
|
113
|
+
ledgerIdentifier: string;
|
|
114
|
+
maskedAccountNumber: string;
|
|
115
|
+
openingBalance: number;
|
|
116
|
+
transactionCount: number;
|
|
117
|
+
existingStatementStatus?: {
|
|
118
|
+
code: string;
|
|
119
|
+
label: string;
|
|
120
|
+
} | null;
|
|
121
|
+
suggestion?: CombinedStatementAccountSuggestion | null;
|
|
122
|
+
}
|
|
123
|
+
export interface CombinedStatementDetails {
|
|
124
|
+
accounts: CombinedStatementAccount[];
|
|
125
|
+
combinedStatementGroupId: string;
|
|
126
|
+
isMappingConfirmed: boolean;
|
|
127
|
+
statementUploads: ConfirmedCombinedStatementUpload[];
|
|
128
|
+
}
|
|
129
|
+
export interface ConfirmedCombinedStatementUpload {
|
|
130
|
+
accountId: ID;
|
|
131
|
+
isCombinedStatementAnchor: boolean;
|
|
132
|
+
ledgerIdentifiers: string[];
|
|
133
|
+
statementUploadId: ID;
|
|
134
|
+
}
|
|
135
|
+
export interface ConfirmStatementMappingConflict {
|
|
136
|
+
collidingLedgerIdentifiers: string[];
|
|
137
|
+
collidingAccountId?: ID;
|
|
138
|
+
previousReconciliationInfo?: PreviousReconciliationInfo | null;
|
|
139
|
+
}
|
|
95
140
|
export interface StatementUpload {
|
|
96
141
|
account: AccountInfo;
|
|
97
142
|
file: FileInfo | null;
|
|
98
143
|
statementMeta: StatementMeta;
|
|
99
144
|
statementTransactions: StatementTransaction[];
|
|
100
145
|
aiSummary?: AiSummary | null;
|
|
146
|
+
combinedStatementDetails?: CombinedStatementDetails;
|
|
101
147
|
}
|
|
102
148
|
export interface ParsedStatementData {
|
|
149
|
+
/**
|
|
150
|
+
* Single-account parse: the only upload.
|
|
151
|
+
* Combined-account parse: the anchor / PDF-owning upload (also in statementUploads).
|
|
152
|
+
*/
|
|
103
153
|
statementUpload: StatementUpload;
|
|
154
|
+
/**
|
|
155
|
+
* Present only for combined multi-account parse responses after mapping.
|
|
156
|
+
* When set, ParseInfo renders one section per upload.
|
|
157
|
+
*/
|
|
158
|
+
statementUploads?: StatementUpload[];
|
|
104
159
|
}
|
|
105
160
|
export interface ReconciliationSummaryAccounts {
|
|
106
161
|
done: number;
|
|
@@ -294,12 +349,22 @@ export interface StatementUpdateLocalDataPayload {
|
|
|
294
349
|
}>;
|
|
295
350
|
};
|
|
296
351
|
}
|
|
352
|
+
export declare const toStatementAccountScope: (v: string) => "single_account" | "multi_account";
|
|
353
|
+
export type StatementAccountScope = ReturnType<typeof toStatementAccountScope>;
|
|
354
|
+
export declare const toStatementAccountScopeStrict: (v: string | null | undefined) => StatementAccountScope | undefined;
|
|
355
|
+
export declare const STATEMENT_ACCOUNT_SCOPES: readonly StatementAccountScope[];
|
|
297
356
|
export interface AccountReconciliationLocalData {
|
|
298
357
|
accountSource?: ReconciliationAccountSourceType;
|
|
358
|
+
statementAccountScope?: StatementAccountScope;
|
|
359
|
+
/** Single-account Confirm & Save draft. */
|
|
299
360
|
statementUpdateLocalData?: StatementUpdateLocalData;
|
|
361
|
+
/** Combined multi-account drafts keyed by statementUploadId. */
|
|
362
|
+
statementUpdateLocalDataByUploadId?: Record<string, StatementUpdateLocalData>;
|
|
300
363
|
}
|
|
301
364
|
export interface AccountReconciliationDataWithTransactionFetchState {
|
|
302
365
|
accountId: ID;
|
|
366
|
+
confirmStatementMappingConflict: ConfirmStatementMappingConflict | null;
|
|
367
|
+
confirmStatementMappingStatus: FetchStateAndError;
|
|
303
368
|
localData: AccountReconciliationLocalData;
|
|
304
369
|
refreshStatus: FetchStateAndError;
|
|
305
370
|
reparseStatementStatus: FetchStateAndError;
|
|
@@ -319,6 +384,7 @@ export interface AccountReconciliationDataWithTransactionFetchState {
|
|
|
319
384
|
statementUploadStatus: FetchStateAndError;
|
|
320
385
|
transactionFetchState: FetchStateAndError;
|
|
321
386
|
accountDetectionReason?: string;
|
|
387
|
+
confirmedCombinedStatementUploads?: ConfirmedCombinedStatementUpload[];
|
|
322
388
|
parsedStatementData?: ParsedStatementData;
|
|
323
389
|
reconciliationId?: ID;
|
|
324
390
|
/** Wall-clock start used to recompute UI step progress after backgrounding. */
|
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toReconciliationTabsType = exports.toReconcileActions = exports.RECONCILE_ACTIONS = void 0;
|
|
3
|
+
exports.STATEMENT_ACCOUNT_SCOPES = exports.toStatementAccountScopeStrict = exports.toStatementAccountScope = exports.toReconciliationTabsType = exports.toReconcileActions = exports.RECONCILE_ACTIONS = exports.toStatementBalanceSourceStrict = exports.toStatementBalanceSource = void 0;
|
|
4
4
|
exports.toReconciliationViewSummary = toReconciliationViewSummary;
|
|
5
5
|
const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
|
|
6
|
+
const ALL_STATEMENT_BALANCE_SOURCES = [
|
|
7
|
+
'ocr',
|
|
8
|
+
'prior_recon',
|
|
9
|
+
'default_zero',
|
|
10
|
+
];
|
|
11
|
+
const toStatementBalanceSource = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_STATEMENT_BALANCE_SOURCES);
|
|
12
|
+
exports.toStatementBalanceSource = toStatementBalanceSource;
|
|
13
|
+
const toStatementBalanceSourceStrict = (v) => (0, stringToUnion_1.stringToUnionStrict)(v ?? '', ALL_STATEMENT_BALANCE_SOURCES);
|
|
14
|
+
exports.toStatementBalanceSourceStrict = toStatementBalanceSourceStrict;
|
|
6
15
|
function toReconciliationViewSummary(payload) {
|
|
7
16
|
return {
|
|
8
17
|
accounts: {
|
|
@@ -65,3 +74,12 @@ const RECON_REVIEW_SORT_KEYS = [
|
|
|
65
74
|
];
|
|
66
75
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
67
76
|
const toReconReviewSortKey = (v) => (0, stringToUnion_1.stringToUnion)(v, RECON_REVIEW_SORT_KEYS);
|
|
77
|
+
const ALL_STATEMENT_ACCOUNT_SCOPES = [
|
|
78
|
+
'single_account',
|
|
79
|
+
'multi_account',
|
|
80
|
+
];
|
|
81
|
+
const toStatementAccountScope = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_STATEMENT_ACCOUNT_SCOPES);
|
|
82
|
+
exports.toStatementAccountScope = toStatementAccountScope;
|
|
83
|
+
const toStatementAccountScopeStrict = (v) => (0, stringToUnion_1.stringToUnionStrict)(v ?? '', ALL_STATEMENT_ACCOUNT_SCOPES);
|
|
84
|
+
exports.toStatementAccountScopeStrict = toStatementAccountScopeStrict;
|
|
85
|
+
exports.STATEMENT_ACCOUNT_SCOPES = ALL_STATEMENT_ACCOUNT_SCOPES;
|
|
@@ -2,8 +2,8 @@ import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
|
2
2
|
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
3
3
|
import { RootState } from '../../../reducer';
|
|
4
4
|
import { ZeniAPI } from '../../../zeniAPI';
|
|
5
|
-
import { clearAllNotificationPreferencesView, clearNotificationPreferencesLocalOverrides, saveNotificationPreferences, saveNotificationPreferencesFailure, saveNotificationPreferencesSuccess } from '../notificationPreferencesViewReducer';
|
|
6
|
-
export type ActionType = ReturnType<typeof clearAllNotificationPreferencesView> | ReturnType<typeof clearNotificationPreferencesLocalOverrides> | ReturnType<typeof saveNotificationPreferences> | ReturnType<typeof saveNotificationPreferencesFailure> | ReturnType<typeof saveNotificationPreferencesSuccess> | ReturnType<typeof openSnackbar>;
|
|
5
|
+
import { clearAllNotificationPreferencesView, clearNotificationPreferencesLocalOverrides, saveNotificationPreferences, saveNotificationPreferencesFailure, saveNotificationPreferencesSuccess, setGroupFrequency, toggleEventChannel } from '../notificationPreferencesViewReducer';
|
|
6
|
+
export type ActionType = ReturnType<typeof clearAllNotificationPreferencesView> | ReturnType<typeof clearNotificationPreferencesLocalOverrides> | ReturnType<typeof saveNotificationPreferences> | ReturnType<typeof saveNotificationPreferencesFailure> | ReturnType<typeof saveNotificationPreferencesSuccess> | ReturnType<typeof setGroupFrequency> | ReturnType<typeof toggleEventChannel> | ReturnType<typeof openSnackbar>;
|
|
7
7
|
export declare const saveNotificationPreferencesEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
|
|
8
8
|
payload: undefined;
|
|
9
9
|
type: "notificationPreferencesView/clearAllNotificationPreferencesView";
|
|
@@ -31,4 +31,10 @@ export declare const saveNotificationPreferencesEpic: (actions$: ActionsObservab
|
|
|
31
31
|
} | {
|
|
32
32
|
payload: import("../notificationPreferencesViewReducer").SaveNotificationPreferencesSuccessPayload;
|
|
33
33
|
type: "notificationPreferencesView/saveNotificationPreferencesSuccess";
|
|
34
|
+
} | {
|
|
35
|
+
payload: import("../notificationPreferencesViewReducer").SetFrequencyPayload;
|
|
36
|
+
type: "notificationPreferencesView/setGroupFrequency";
|
|
37
|
+
} | {
|
|
38
|
+
payload: import("../notificationPreferencesViewReducer").TogglePreferencePayload;
|
|
39
|
+
type: "notificationPreferencesView/toggleEventChannel";
|
|
34
40
|
}>;
|