@zeniai/client-epic-state 5.1.22 → 5.1.23-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/README.md +2 -1
- package/lib/commonStateTypes/viewAndReport/agingReportStateTypes.d.ts +1 -1
- package/lib/entity/accountRecon/accountReconPayload.d.ts +23 -1
- package/lib/entity/accountRecon/accountReconPayload.js +26 -1
- package/lib/entity/accountRecon/accountReconReducer.d.ts +5 -2
- package/lib/entity/accountRecon/accountReconReducer.js +33 -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/epic.d.ts +5 -1
- package/lib/epic.js +5 -1
- package/lib/esm/entity/accountRecon/accountReconPayload.js +26 -1
- package/lib/esm/entity/accountRecon/accountReconReducer.js +32 -1
- package/lib/esm/entity/accountRecon/accountReconSelector.js +5 -0
- package/lib/esm/entity/monthEndCloseChecks/monthEndCloseChecksPayload.js +10 -0
- package/lib/esm/epic.js +5 -1
- package/lib/esm/index.js +5 -5
- 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 -3
- package/lib/esm/view/expenseAutomationView/payload/reconciliationPayload.js +142 -0
- package/lib/esm/view/expenseAutomationView/reducers/reconciliationViewReducer.js +178 -8
- package/lib/esm/view/expenseAutomationView/selectors/reconciliationViewSelector.js +27 -0
- package/lib/esm/view/expenseAutomationView/types/reconciliationViewState.js +29 -0
- package/lib/index.d.ts +10 -10
- package/lib/index.js +55 -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 -3
- package/lib/view/expenseAutomationView/payload/reconciliationPayload.d.ts +163 -9
- package/lib/view/expenseAutomationView/payload/reconciliationPayload.js +146 -0
- package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.d.ts +53 -3
- package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.js +180 -9
- package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.d.ts +7 -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/reconciliationViewState.d.ts +172 -0
- package/lib/view/expenseAutomationView/types/reconciliationViewState.js +30 -0
- package/lib/view/vendorFiling1099/vendorFiling1099List/vendorFiling1099ListState.d.ts +1 -1
- package/package.json +4 -2
|
@@ -9,7 +9,7 @@ import { MatchedTransactionPayload } from '../../../entity/transaction/payloadTy
|
|
|
9
9
|
import { UserPayload } from '../../../entity/user/userPayload';
|
|
10
10
|
import { RootState } from '../../../reducer';
|
|
11
11
|
import { ZeniAPIResponse } from '../../../responsePayload';
|
|
12
|
-
import { BalancesLocalData, SaveReconcileDetailActionPayload } from '../types/reconciliationViewState';
|
|
12
|
+
import { BalancesLocalData, ParsedStatementData, SaveReconcileDetailActionPayload, StatementDateConflict, StatementUpdateLocalData, StatementUpdateLocalDataPayload } from '../types/reconciliationViewState';
|
|
13
13
|
export interface DetectionInfoPayload {
|
|
14
14
|
account_id: string;
|
|
15
15
|
bank_balance: number | null;
|
|
@@ -31,6 +31,31 @@ interface ExclusionInfoPayload {
|
|
|
31
31
|
export interface ExcludedAccountPayload extends AccountAndPaymentAccountPayload {
|
|
32
32
|
exclusion_info: ExclusionInfoPayload;
|
|
33
33
|
}
|
|
34
|
+
export interface ReconciliationProgressBarPayload {
|
|
35
|
+
ai_percentage_share: number;
|
|
36
|
+
complete_percentage: number;
|
|
37
|
+
human_percentage_share: number;
|
|
38
|
+
remaining_percentage: number;
|
|
39
|
+
}
|
|
40
|
+
export interface ReconciliationSummaryPayload {
|
|
41
|
+
accounts: {
|
|
42
|
+
done: number;
|
|
43
|
+
failed: number;
|
|
44
|
+
in_progress: number;
|
|
45
|
+
total: number;
|
|
46
|
+
};
|
|
47
|
+
accounts_to_connect_count: number;
|
|
48
|
+
auto_matched: {
|
|
49
|
+
matched_txns: number;
|
|
50
|
+
total_txns: number;
|
|
51
|
+
};
|
|
52
|
+
needs_review: {
|
|
53
|
+
account_count: number;
|
|
54
|
+
txn_count: number;
|
|
55
|
+
};
|
|
56
|
+
time_saved_percentage: number;
|
|
57
|
+
progress_bar?: ReconciliationProgressBarPayload;
|
|
58
|
+
}
|
|
34
59
|
export interface ReconciliationPayload {
|
|
35
60
|
accounts: AccountAndPaymentAccountPayload[];
|
|
36
61
|
files: FilePayload[];
|
|
@@ -39,6 +64,7 @@ export interface ReconciliationPayload {
|
|
|
39
64
|
detection_info?: DetectionInfoPayload;
|
|
40
65
|
detection_reason?: string;
|
|
41
66
|
excluded_accounts?: ExcludedAccountPayload[];
|
|
67
|
+
summary?: ReconciliationSummaryPayload;
|
|
42
68
|
}
|
|
43
69
|
export type ReconciliationResponse = ZeniAPIResponse<ReconciliationPayload>;
|
|
44
70
|
export interface SaveReconciliationReviewPayload {
|
|
@@ -86,16 +112,144 @@ export interface UploadStatementDocumentAIPayload {
|
|
|
86
112
|
processor_run_id: string;
|
|
87
113
|
}
|
|
88
114
|
export type UploadStatementDocumentAIResponse = ZeniAPIResponse<UploadStatementDocumentAIPayload>;
|
|
115
|
+
export interface StatementUploadSummaryPayload {
|
|
116
|
+
account_type: string;
|
|
117
|
+
statement_data_status: StatusCodeWithLabelPayload;
|
|
118
|
+
statement_end_date: string;
|
|
119
|
+
statement_start_date: string;
|
|
120
|
+
statement_status: StatusCodeWithLabelPayload;
|
|
121
|
+
statement_upload_id: string;
|
|
122
|
+
}
|
|
89
123
|
export interface UploadStatementResponsePayload {
|
|
90
124
|
file: FilePayload;
|
|
91
|
-
statement_upload:
|
|
92
|
-
account_type: string;
|
|
93
|
-
statement_data_status: StatusCodeWithLabelPayload;
|
|
94
|
-
statement_end_date: string;
|
|
95
|
-
statement_start_date: string;
|
|
96
|
-
statement_status: StatusCodeWithLabelPayload;
|
|
97
|
-
statement_upload_id: string;
|
|
98
|
-
};
|
|
125
|
+
statement_upload: StatementUploadSummaryPayload;
|
|
99
126
|
}
|
|
100
127
|
export type UploadStatementResponse = ZeniAPIResponse<UploadStatementResponsePayload>;
|
|
128
|
+
export interface PolygonPointPayload {
|
|
129
|
+
x: number;
|
|
130
|
+
y: number;
|
|
131
|
+
}
|
|
132
|
+
export interface CitationPayload {
|
|
133
|
+
page: number;
|
|
134
|
+
page_height: number;
|
|
135
|
+
page_width: number;
|
|
136
|
+
polygon: PolygonPointPayload[];
|
|
137
|
+
reference_text: string;
|
|
138
|
+
}
|
|
139
|
+
export interface StatementTransactionPayload {
|
|
140
|
+
amount: number;
|
|
141
|
+
citation: CitationPayload[];
|
|
142
|
+
is_user_added: boolean;
|
|
143
|
+
is_user_edited: boolean;
|
|
144
|
+
statement_transaction_id: string;
|
|
145
|
+
transaction_date: string;
|
|
146
|
+
transaction_direction: 'debit' | 'credit';
|
|
147
|
+
transaction_memo: string;
|
|
148
|
+
}
|
|
149
|
+
export interface ReconciliationMetaPayload {
|
|
150
|
+
end_date: string;
|
|
151
|
+
reconciliation_id: string;
|
|
152
|
+
start_date: string;
|
|
153
|
+
status: string;
|
|
154
|
+
}
|
|
155
|
+
export interface StatementMetaPayload {
|
|
156
|
+
closing_balance: number;
|
|
157
|
+
opening_balance: number;
|
|
158
|
+
statement_data_status: StatusCodeWithLabelPayload;
|
|
159
|
+
statement_end_date: string;
|
|
160
|
+
statement_start_date: string;
|
|
161
|
+
statement_status: StatusCodeWithLabelPayload;
|
|
162
|
+
statement_upload_id: string;
|
|
163
|
+
total_deposits: number;
|
|
164
|
+
total_payments: number;
|
|
165
|
+
}
|
|
166
|
+
export interface AccountInfoPayload {
|
|
167
|
+
account_id: string;
|
|
168
|
+
account_name: string;
|
|
169
|
+
account_type: string;
|
|
170
|
+
currency_code: string;
|
|
171
|
+
last_4_digits: string | null;
|
|
172
|
+
}
|
|
173
|
+
export interface FileInfoPayload {
|
|
174
|
+
file_id: string;
|
|
175
|
+
file_name: string;
|
|
176
|
+
signed_url: string;
|
|
177
|
+
}
|
|
178
|
+
export interface AiSummaryFieldPayload {
|
|
179
|
+
code: string;
|
|
180
|
+
label: string;
|
|
181
|
+
}
|
|
182
|
+
export interface PreviousReconciliationInfoPayload {
|
|
183
|
+
end_date: string;
|
|
184
|
+
reconciled_at: string;
|
|
185
|
+
reconciled_by_user_id: string;
|
|
186
|
+
reconciliation_id: string;
|
|
187
|
+
start_date: string;
|
|
188
|
+
}
|
|
189
|
+
export interface AiSummaryChainStatusPayload {
|
|
190
|
+
code: string;
|
|
191
|
+
expected_start_date: string | null;
|
|
192
|
+
label: string;
|
|
193
|
+
previous_reconciliation_info: PreviousReconciliationInfoPayload | null;
|
|
194
|
+
}
|
|
195
|
+
export interface AiSummaryPayload {
|
|
196
|
+
account_identified: string | null;
|
|
197
|
+
chain_status: AiSummaryChainStatusPayload;
|
|
198
|
+
exceptions_detected: number;
|
|
199
|
+
fields_captured: AiSummaryFieldPayload[];
|
|
200
|
+
transactions_extracted: number;
|
|
201
|
+
}
|
|
202
|
+
export interface StatementUploadPayload {
|
|
203
|
+
account: AccountInfoPayload;
|
|
204
|
+
file: FileInfoPayload | null;
|
|
205
|
+
statement_meta: StatementMetaPayload;
|
|
206
|
+
statement_transactions: StatementTransactionPayload[];
|
|
207
|
+
ai_summary?: AiSummaryPayload | null;
|
|
208
|
+
}
|
|
209
|
+
export interface ParseStatementResponsePayload {
|
|
210
|
+
reconciliation: ReconciliationMetaPayload;
|
|
211
|
+
statement_upload: StatementUploadPayload;
|
|
212
|
+
}
|
|
213
|
+
export interface ReparseStatementResponsePayload {
|
|
214
|
+
statement_upload: StatementUploadSummaryPayload;
|
|
215
|
+
}
|
|
216
|
+
export type ParseStatementResponse = ZeniAPIResponse<ParseStatementResponsePayload>;
|
|
217
|
+
export type ReparseStatementResponse = ZeniAPIResponse<ReparseStatementResponsePayload>;
|
|
218
|
+
/**
|
|
219
|
+
* Statement period chain validation (Confirm & Save).
|
|
220
|
+
*
|
|
221
|
+
* - 200 (auto-trim): the BE trimmed the start date and returns a
|
|
222
|
+
* `date_adjustment` block alongside the usual reconciliation /
|
|
223
|
+
* statement_upload data.
|
|
224
|
+
* - 409: the upload was rejected (total overlap or gap). The error fields
|
|
225
|
+
* (`error_code`, `expected_start_date`, `previous_reconciliation_info`)
|
|
226
|
+
* live at the top level of the response, next to `status`.
|
|
227
|
+
*/
|
|
228
|
+
export type StatementChainErrorCode = 'STATEMENT_RANGE_ALREADY_RECONCILED' | 'STATEMENT_RANGE_HAS_GAP';
|
|
229
|
+
export interface StatementDateAdjustmentPayload {
|
|
230
|
+
adjusted_start_date: string;
|
|
231
|
+
original_start_date: string;
|
|
232
|
+
previous_reconciliation_info: PreviousReconciliationInfoPayload;
|
|
233
|
+
reason: string;
|
|
234
|
+
}
|
|
235
|
+
export interface UpdateStatementInfoResponsePayload {
|
|
236
|
+
reconciliation: ReconciliationMetaPayload;
|
|
237
|
+
statement_upload: StatementUploadPayload;
|
|
238
|
+
date_adjustment?: StatementDateAdjustmentPayload | null;
|
|
239
|
+
}
|
|
240
|
+
export interface UpdateStatementInfoResponse extends ZeniAPIResponse<UpdateStatementInfoResponsePayload> {
|
|
241
|
+
error_code?: StatementChainErrorCode | string;
|
|
242
|
+
expected_start_date?: string | null;
|
|
243
|
+
previous_reconciliation_info?: PreviousReconciliationInfoPayload | null;
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Builds the date-conflict state from a 409 Confirm & Save response. Returns
|
|
247
|
+
* null unless the response is a 409 chain-validation conflict that carries an
|
|
248
|
+
* error code and a previous reconciliation period to render. Any other error
|
|
249
|
+
* status (4xx/5xx) is treated as a generic failure, not a date conflict.
|
|
250
|
+
*/
|
|
251
|
+
export declare function transformStatementDateConflictToState(response: UpdateStatementInfoResponse): StatementDateConflict | null;
|
|
252
|
+
export declare function transformParseStatementPayloadToState(payload: ParseStatementResponsePayload): ParsedStatementData;
|
|
253
|
+
export declare function transformUpdateStatementInfoPayloadToState(payload: UpdateStatementInfoResponsePayload): ParsedStatementData;
|
|
254
|
+
export declare function transformStatementUpdateStateToPayload(localData: StatementUpdateLocalData): StatementUpdateLocalDataPayload;
|
|
101
255
|
export {};
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createSaveReconciliationPayloadBasedOnActionAndMethod = createSaveReconciliationPayloadBasedOnActionAndMethod;
|
|
4
|
+
exports.transformStatementDateConflictToState = transformStatementDateConflictToState;
|
|
5
|
+
exports.transformParseStatementPayloadToState = transformParseStatementPayloadToState;
|
|
6
|
+
exports.transformUpdateStatementInfoPayloadToState = transformUpdateStatementInfoPayloadToState;
|
|
7
|
+
exports.transformStatementUpdateStateToPayload = transformStatementUpdateStateToPayload;
|
|
4
8
|
const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
|
|
5
9
|
const accountReconPayload_1 = require("../../../entity/accountRecon/accountReconPayload");
|
|
6
10
|
const reconciliationTransactionPayloads_1 = require("../../../entity/transaction/payloadTypes/reconciliationTransactionPayloads");
|
|
@@ -70,3 +74,145 @@ function createReviewTransactionPayload(accountReconciliationEntity) {
|
|
|
70
74
|
});
|
|
71
75
|
return reviewTransactionsPayload;
|
|
72
76
|
}
|
|
77
|
+
function transformStatementUploadPayloadToState(statementUploadPayload) {
|
|
78
|
+
return {
|
|
79
|
+
account: {
|
|
80
|
+
accountId: statementUploadPayload.account.account_id,
|
|
81
|
+
accountName: statementUploadPayload.account.account_name,
|
|
82
|
+
accountType: statementUploadPayload.account.account_type,
|
|
83
|
+
currencyCode: statementUploadPayload.account.currency_code,
|
|
84
|
+
last4Digits: statementUploadPayload.account.last_4_digits,
|
|
85
|
+
},
|
|
86
|
+
file: statementUploadPayload.file != null
|
|
87
|
+
? {
|
|
88
|
+
fileId: statementUploadPayload.file.file_id,
|
|
89
|
+
fileName: statementUploadPayload.file.file_name,
|
|
90
|
+
signedUrl: statementUploadPayload.file.signed_url,
|
|
91
|
+
}
|
|
92
|
+
: null,
|
|
93
|
+
statementMeta: {
|
|
94
|
+
closingBalance: statementUploadPayload.statement_meta.closing_balance,
|
|
95
|
+
openingBalance: statementUploadPayload.statement_meta.opening_balance,
|
|
96
|
+
statementDataStatus: statementUploadPayload.statement_meta.statement_data_status,
|
|
97
|
+
statementEndDate: statementUploadPayload.statement_meta.statement_end_date,
|
|
98
|
+
statementStartDate: statementUploadPayload.statement_meta.statement_start_date,
|
|
99
|
+
statementStatus: statementUploadPayload.statement_meta.statement_status,
|
|
100
|
+
statementUploadId: statementUploadPayload.statement_meta.statement_upload_id,
|
|
101
|
+
totalDeposits: statementUploadPayload.statement_meta.total_deposits,
|
|
102
|
+
totalPayments: statementUploadPayload.statement_meta.total_payments,
|
|
103
|
+
},
|
|
104
|
+
statementTransactions: (statementUploadPayload.statement_transactions ?? []).map((txn) => ({
|
|
105
|
+
amount: txn.amount,
|
|
106
|
+
citations: (txn.citation ?? []).map((c) => ({
|
|
107
|
+
page: c.page,
|
|
108
|
+
pageHeight: c.page_height,
|
|
109
|
+
pageWidth: c.page_width,
|
|
110
|
+
polygon: (c.polygon ?? []).map((point) => ({
|
|
111
|
+
x: point.x,
|
|
112
|
+
y: point.y,
|
|
113
|
+
})),
|
|
114
|
+
referenceText: c.reference_text,
|
|
115
|
+
})),
|
|
116
|
+
isUserAdded: txn.is_user_added,
|
|
117
|
+
isUserEdited: txn.is_user_edited,
|
|
118
|
+
statementTransactionId: txn.statement_transaction_id,
|
|
119
|
+
transactionDate: txn.transaction_date,
|
|
120
|
+
transactionDirection: txn.transaction_direction,
|
|
121
|
+
transactionMemo: txn.transaction_memo,
|
|
122
|
+
})),
|
|
123
|
+
aiSummary: transformAiSummaryPayloadToState(statementUploadPayload.ai_summary),
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
function transformPreviousReconciliationInfoToState(payload) {
|
|
127
|
+
if (payload == null) {
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
return {
|
|
131
|
+
endDate: payload.end_date,
|
|
132
|
+
reconciledAt: payload.reconciled_at,
|
|
133
|
+
reconciledByUserId: payload.reconciled_by_user_id,
|
|
134
|
+
reconciliationId: payload.reconciliation_id,
|
|
135
|
+
startDate: payload.start_date,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
function transformAiSummaryPayloadToState(aiSummaryPayload) {
|
|
139
|
+
if (aiSummaryPayload == null) {
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
const { chain_status: chainStatus } = aiSummaryPayload;
|
|
143
|
+
return {
|
|
144
|
+
accountIdentified: aiSummaryPayload.account_identified,
|
|
145
|
+
transactionsExtracted: aiSummaryPayload.transactions_extracted,
|
|
146
|
+
exceptionsDetected: aiSummaryPayload.exceptions_detected,
|
|
147
|
+
fieldsCaptured: (aiSummaryPayload.fields_captured ?? []).map((field) => ({
|
|
148
|
+
code: field.code,
|
|
149
|
+
label: field.label,
|
|
150
|
+
})),
|
|
151
|
+
chainStatus: {
|
|
152
|
+
code: chainStatus?.code ?? '',
|
|
153
|
+
label: chainStatus?.label ?? '',
|
|
154
|
+
expectedStartDate: chainStatus?.expected_start_date ?? null,
|
|
155
|
+
previousReconciliationInfo: transformPreviousReconciliationInfoToState(chainStatus?.previous_reconciliation_info),
|
|
156
|
+
},
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Builds the date-conflict state from a 409 Confirm & Save response. Returns
|
|
161
|
+
* null unless the response is a 409 chain-validation conflict that carries an
|
|
162
|
+
* error code and a previous reconciliation period to render. Any other error
|
|
163
|
+
* status (4xx/5xx) is treated as a generic failure, not a date conflict.
|
|
164
|
+
*/
|
|
165
|
+
function transformStatementDateConflictToState(response) {
|
|
166
|
+
const isConflictStatus = String(response.status?.code) === '409';
|
|
167
|
+
const previousReconciliationInfo = transformPreviousReconciliationInfoToState(response.previous_reconciliation_info);
|
|
168
|
+
if (isConflictStatus === false ||
|
|
169
|
+
response.error_code == null ||
|
|
170
|
+
previousReconciliationInfo == null) {
|
|
171
|
+
return null;
|
|
172
|
+
}
|
|
173
|
+
return {
|
|
174
|
+
errorCode: response.error_code,
|
|
175
|
+
expectedStartDate: response.expected_start_date ?? null,
|
|
176
|
+
previousReconciliationInfo,
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
function transformParseStatementPayloadToState(payload) {
|
|
180
|
+
return {
|
|
181
|
+
statementUpload: transformStatementUploadPayloadToState(payload.statement_upload),
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
function transformUpdateStatementInfoPayloadToState(payload) {
|
|
185
|
+
return {
|
|
186
|
+
statementUpload: transformStatementUploadPayloadToState(payload.statement_upload),
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
function transformStatementUpdateStateToPayload(localData) {
|
|
190
|
+
const { statementMeta, statementTransactions } = localData;
|
|
191
|
+
return {
|
|
192
|
+
statement_meta: {
|
|
193
|
+
opening_balance: statementMeta.openingBalance,
|
|
194
|
+
statement_end_date: statementMeta.statementEndDate,
|
|
195
|
+
statement_start_date: statementMeta.statementStartDate,
|
|
196
|
+
total_deposits: statementMeta.totalDeposits,
|
|
197
|
+
total_payments: statementMeta.totalPayments,
|
|
198
|
+
},
|
|
199
|
+
statement_transactions: {
|
|
200
|
+
added: statementTransactions.added.map((txn) => ({
|
|
201
|
+
amount: txn.amount,
|
|
202
|
+
transaction_date: txn.transactionDate,
|
|
203
|
+
transaction_direction: txn.transactionDirection,
|
|
204
|
+
transaction_memo: txn.transactionMemo,
|
|
205
|
+
})),
|
|
206
|
+
deleted_ids: statementTransactions.deletedIds,
|
|
207
|
+
updated: statementTransactions.updated
|
|
208
|
+
.filter((txn) => txn.statementTransactionId != null)
|
|
209
|
+
.map((txn) => ({
|
|
210
|
+
amount: txn.amount,
|
|
211
|
+
statement_transaction_id: txn.statementTransactionId,
|
|
212
|
+
transaction_date: txn.transactionDate,
|
|
213
|
+
transaction_direction: txn.transactionDirection,
|
|
214
|
+
transaction_memo: txn.transactionMemo,
|
|
215
|
+
})),
|
|
216
|
+
},
|
|
217
|
+
};
|
|
218
|
+
}
|
|
@@ -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, ReconReconcileSortKey, ReconReviewSortKey, ReconciliationReviewTabLocalData, ReconciliationTabsState, ReconciliationViewState, ReconciliationViewTabType, SaveReconcileDetailActionPayload, SaveReconciliationDetailFailurePayload, TransactionSummary } from '../types/reconciliationViewState';
|
|
8
|
+
import { AccountReconciliationLocalData, ActionFetchStates, ExcludeAccountFromReconciliationPayload, ParsedStatementData, ReconReconcileSortKey, ReconReviewSortKey, ReconciliationReviewTabLocalData, ReconciliationTabsState, ReconciliationViewState, ReconciliationViewTabType, SaveReconcileDetailActionPayload, SaveReconciliationDetailFailurePayload, 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;
|
|
@@ -52,7 +52,9 @@ export declare const fetchReconciliation: import("@reduxjs/toolkit").ActionCreat
|
|
|
52
52
|
variancePercentage?: number;
|
|
53
53
|
}, "expenseAutomationReconciliationView/updateBalancesLocalData">, initialiseLocalDataForSelectedAccountId: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationReconciliationView/initialiseLocalDataForSelectedAccountId">, clearExpenseAutomationReconciliationView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationReconciliationView/clearExpenseAutomationReconciliationView">, updateSelectedDrawerAccountId: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
54
54
|
selectedDrawerAccountId?: ID;
|
|
55
|
-
}, "expenseAutomationReconciliationView/updateSelectedDrawerAccountId">,
|
|
55
|
+
}, "expenseAutomationReconciliationView/updateSelectedDrawerAccountId">, updateStatementProcessingFailed: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
56
|
+
statementProcessingFailed: boolean;
|
|
57
|
+
}, "expenseAutomationReconciliationView/updateStatementProcessingFailed">, updateReviewTabSortState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
56
58
|
sortKey: ReconReviewSortKey;
|
|
57
59
|
sortOrder: SortOrder;
|
|
58
60
|
}, "expenseAutomationReconciliationView/updateReviewTabSortState">, initializeReconciliationReviewTabLocalData: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[localData: Record<string, ReconciliationReviewTabLocalData>], {
|
|
@@ -108,7 +110,55 @@ export declare const fetchReconciliation: import("@reduxjs/toolkit").ActionCreat
|
|
|
108
110
|
accountId: ID;
|
|
109
111
|
error: ZeniAPIStatus;
|
|
110
112
|
selectedPeriod: MonthYearPeriod;
|
|
111
|
-
}, "expenseAutomationReconciliationView/uploadAccountStatementFailure">,
|
|
113
|
+
}, "expenseAutomationReconciliationView/uploadAccountStatementFailure">, parseStatement: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
114
|
+
accountId: ID;
|
|
115
|
+
selectedPeriod: MonthYearPeriod;
|
|
116
|
+
statementUploadId: ID;
|
|
117
|
+
}, "expenseAutomationReconciliationView/parseStatement">, parseStatementSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
118
|
+
accountId: ID;
|
|
119
|
+
selectedPeriod: MonthYearPeriod;
|
|
120
|
+
}, "expenseAutomationReconciliationView/parseStatementSuccess">, parseStatementFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
121
|
+
accountId: ID;
|
|
122
|
+
error: ZeniAPIStatus;
|
|
123
|
+
selectedPeriod: MonthYearPeriod;
|
|
124
|
+
}, "expenseAutomationReconciliationView/parseStatementFailure">, reparseStatement: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
125
|
+
accountId: ID;
|
|
126
|
+
selectedPeriod: MonthYearPeriod;
|
|
127
|
+
statementUploadId: ID;
|
|
128
|
+
}, "expenseAutomationReconciliationView/reparseStatement">, reparseStatementSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
129
|
+
accountId: ID;
|
|
130
|
+
selectedPeriod: MonthYearPeriod;
|
|
131
|
+
}, "expenseAutomationReconciliationView/reparseStatementSuccess">, reparseStatementFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
132
|
+
accountId: ID;
|
|
133
|
+
error: ZeniAPIStatus;
|
|
134
|
+
selectedPeriod: MonthYearPeriod;
|
|
135
|
+
}, "expenseAutomationReconciliationView/reparseStatementFailure">, resetReparseStatementStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
136
|
+
accountId: ID;
|
|
137
|
+
selectedPeriod: MonthYearPeriod;
|
|
138
|
+
}, "expenseAutomationReconciliationView/resetReparseStatementStatus">, updateParsedStatementData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
139
|
+
accountId: ID;
|
|
140
|
+
parsedStatementData: ParsedStatementData;
|
|
141
|
+
selectedPeriod: MonthYearPeriod;
|
|
142
|
+
}, "expenseAutomationReconciliationView/updateParsedStatementData">, updateStatementUpdateLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
143
|
+
accountId: ID;
|
|
144
|
+
selectedPeriod: MonthYearPeriod;
|
|
145
|
+
statementUpdateLocalData: StatementUpdateLocalData;
|
|
146
|
+
}, "expenseAutomationReconciliationView/updateStatementUpdateLocalData">, submitStatementUpdate: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
147
|
+
accountId: ID;
|
|
148
|
+
selectedPeriod: MonthYearPeriod;
|
|
149
|
+
statementUploadId: ID;
|
|
150
|
+
}, "expenseAutomationReconciliationView/submitStatementUpdate">, submitStatementUpdateSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
151
|
+
accountId: ID;
|
|
152
|
+
selectedPeriod: MonthYearPeriod;
|
|
153
|
+
}, "expenseAutomationReconciliationView/submitStatementUpdateSuccess">, submitStatementUpdateFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
154
|
+
accountId: ID;
|
|
155
|
+
error: ZeniAPIStatus;
|
|
156
|
+
selectedPeriod: MonthYearPeriod;
|
|
157
|
+
dateConflict?: StatementDateConflict | null;
|
|
158
|
+
}, "expenseAutomationReconciliationView/submitStatementUpdateFailure">, clearStatementDateConflict: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
159
|
+
accountId: ID;
|
|
160
|
+
selectedPeriod: MonthYearPeriod;
|
|
161
|
+
}, "expenseAutomationReconciliationView/clearStatementDateConflict">, updateStatementUploadChosen: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
112
162
|
statementUploadChosen: boolean;
|
|
113
163
|
}, "expenseAutomationReconciliationView/updateStatementUploadChosen">, updateNodeCollapseState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
114
164
|
collapsed: boolean;
|