@zeniai/client-epic-state 4.19.84-betaVR9 → 4.19.85
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/account/accountPayload.d.ts +0 -2
- package/lib/entity/account/accountPayload.js +0 -2
- package/lib/entity/account/accountState.d.ts +0 -2
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -1
- package/lib/epic.d.ts +1 -12
- package/lib/epic.js +1 -12
- package/lib/esm/entity/account/accountPayload.js +0 -2
- package/lib/esm/entity/snackbar/snackbarTypes.js +0 -1
- package/lib/esm/epic.js +1 -12
- package/lib/esm/index.js +3 -5
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/uploadMissingReceiptSuccessEpic.js +5 -7
- package/lib/esm/view/expenseAutomationView/payload/missingReceiptsPayload.js +1 -177
- package/lib/esm/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +1 -412
- package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +1 -20
- package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +1 -224
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +1 -2
- package/lib/esm/view/expenseAutomationView/types/missingReceiptsViewState.js +0 -6
- package/lib/esm/view/expenseAutomationView/types/transactionsViewState.js +1 -2
- package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +1 -1
- package/lib/esm/zeniAPI.js +2 -0
- package/lib/index.d.ts +4 -6
- package/lib/index.js +31 -66
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
- package/lib/view/expenseAutomationView/epics/missingReceipts/uploadMissingReceiptSuccessEpic.js +5 -7
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.d.ts +0 -118
- package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.js +0 -189
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +3 -70
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +2 -414
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +3 -11
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +2 -21
- package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +1 -69
- package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +0 -1
- package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.d.ts +1 -1
- package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +0 -223
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +1 -2
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +0 -129
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.js +1 -7
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +1 -2
- package/lib/view/expenseAutomationView/types/transactionsViewState.js +1 -2
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +1 -1
- package/lib/zeniAPI.js +2 -0
- package/package.json +1 -1
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +0 -28
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.js +0 -49
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.js +0 -40
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +0 -47
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +0 -61
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.js +0 -34
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.js +0 -57
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +0 -78
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +0 -59
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.js +0 -24
- package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.d.ts +0 -15
- package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +0 -32
- package/lib/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.d.ts +0 -7
- package/lib/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.js +0 -53
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.d.ts +0 -8
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.js +0 -44
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.d.ts +0 -7
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +0 -51
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.d.ts +0 -8
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +0 -65
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.d.ts +0 -8
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.js +0 -38
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.d.ts +0 -9
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.js +0 -62
- package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.d.ts +0 -14
- package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +0 -82
- package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.d.ts +0 -19
- package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +0 -64
- package/lib/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.d.ts +0 -7
- package/lib/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.js +0 -28
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import orderBy from 'lodash/orderBy';
|
|
2
2
|
import { toMonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
|
|
3
3
|
import { getCurrentTenant } from '../../../entity/tenant/tenantSelector';
|
|
4
|
-
import {
|
|
4
|
+
import { getSupportedTransactionsByIds } from '../../../entity/transaction/transactionSelector';
|
|
5
5
|
import { getAllSteps } from '../selectorTypes/expenseAutomationViewSelectorTypes';
|
|
6
|
-
import { isBatchListStatusCompleted } from '../payload/missingReceiptsPayload';
|
|
7
|
-
import { getCompletedTransactionsCacheKey } from '../reducers/missingReceiptsViewReducer';
|
|
8
6
|
export function getExpenseAutomationMissingReceiptsView(state) {
|
|
9
7
|
const { expenseAutomationMissingReceiptsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, } = state;
|
|
10
8
|
const currentTenant = getCurrentTenant(state);
|
|
@@ -49,110 +47,6 @@ export function getExpenseAutomationMissingReceiptsView(state) {
|
|
|
49
47
|
const completionStatus = missingReceiptsCompletionStatus != null
|
|
50
48
|
? missingReceiptsCompletionStatus
|
|
51
49
|
: 'incomplete';
|
|
52
|
-
const { bulkUpload, pendingMissingReceiptsTabNavigation, } = expenseAutomationMissingReceiptsViewState;
|
|
53
|
-
const currentBatchStatus = bulkUpload.currentBatchId != null
|
|
54
|
-
? bulkUpload.batchStatusById[bulkUpload.currentBatchId]
|
|
55
|
-
: undefined;
|
|
56
|
-
const batchList = monthYearPeriodId != null
|
|
57
|
-
? bulkUpload.batchListByPeriod[monthYearPeriodId] ?? []
|
|
58
|
-
: [];
|
|
59
|
-
/**
|
|
60
|
-
* Primary "Unmatched" batch = first completed batch in platform list order, preferring the
|
|
61
|
-
* first batch that still has un_matched/no_match work when any completed batch has such work.
|
|
62
|
-
* Batches without details yet: wait if the list row still reports unmatched work; otherwise skip
|
|
63
|
-
* so we do not block the whole tab while other rows are not fetched yet.
|
|
64
|
-
*/
|
|
65
|
-
const primaryBatchIdFromDetailsOrder = getPrimaryBatchIdFromBatchListOrder(batchList, bulkUpload.batchDetailsById, bulkUpload.failedBatchDetailIds);
|
|
66
|
-
/** During upload/matching, the in-flight batch may not appear in batchList yet — prefer currentBatchId. */
|
|
67
|
-
const unmatchedSectionBatchId = bulkUpload.phase === 'matching' || bulkUpload.phase === 'uploading'
|
|
68
|
-
? bulkUpload.currentBatchId ?? primaryBatchIdFromDetailsOrder
|
|
69
|
-
: primaryBatchIdFromDetailsOrder;
|
|
70
|
-
const completedBatchesInApiOrder = batchList.filter((b) => isBatchListStatusCompleted(b.status));
|
|
71
|
-
const currentBatchDetails = unmatchedSectionBatchId != null
|
|
72
|
-
? bulkUpload.batchDetailsById[unmatchedSectionBatchId]
|
|
73
|
-
: undefined;
|
|
74
|
-
const resolvedFiles = currentBatchDetails?.files.map((file) => resolveBatchFile(file, currentBatchDetails.batchId, transactionState));
|
|
75
|
-
const failedIds = new Set(bulkUpload.failedBatchDetailIds);
|
|
76
|
-
const hasMoreBatchDetails = completedBatchesInApiOrder.some((b) => bulkUpload.batchDetailsById[b.batchId] == null &&
|
|
77
|
-
!failedIds.has(b.batchId));
|
|
78
|
-
const getSortValue = (file) => {
|
|
79
|
-
const t = file.matchedTransaction;
|
|
80
|
-
if (t == null) {
|
|
81
|
-
return null;
|
|
82
|
-
}
|
|
83
|
-
switch (bulkUpload.sortKey) {
|
|
84
|
-
case 'vendor':
|
|
85
|
-
return (t.vendorName ?? t.description)?.toLowerCase() ?? null;
|
|
86
|
-
case 'category': {
|
|
87
|
-
const line = t.lines?.[0];
|
|
88
|
-
return line?.account?.accountName?.toLowerCase() ?? null;
|
|
89
|
-
}
|
|
90
|
-
case 'class': {
|
|
91
|
-
const line = t.lines?.[0];
|
|
92
|
-
return line?.class?.className?.toLowerCase() ?? null;
|
|
93
|
-
}
|
|
94
|
-
case 'date':
|
|
95
|
-
return t.date.valueOf();
|
|
96
|
-
case 'amount':
|
|
97
|
-
return t.amount.amount;
|
|
98
|
-
default:
|
|
99
|
-
return null;
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
const bulkUploadSortDirection = bulkUpload.sortOrder === 'ascending' ? 'asc' : 'desc';
|
|
103
|
-
const matchedFiles = orderBy(resolvedFiles?.filter((f) => f.status === 'matched') ?? [], getSortValue, bulkUploadSortDirection);
|
|
104
|
-
const unmatchedFiles = orderBy(resolvedFiles?.filter((f) => f.status === 'un_matched' || f.status === 'no_match') ?? [], getSortValue, bulkUploadSortDirection);
|
|
105
|
-
const progress = currentBatchStatus != null
|
|
106
|
-
? {
|
|
107
|
-
...currentBatchStatus.progress,
|
|
108
|
-
percentage: currentBatchStatus.progress.total > 0
|
|
109
|
-
? Math.round((currentBatchStatus.progress.processed /
|
|
110
|
-
currentBatchStatus.progress.total) *
|
|
111
|
-
100)
|
|
112
|
-
: 0,
|
|
113
|
-
}
|
|
114
|
-
: { total: 0, processed: 0, percentage: 0 };
|
|
115
|
-
const batchListFetchState = bulkUpload.batchListFetchState;
|
|
116
|
-
/**
|
|
117
|
-
* When primary batch is not resolved yet, still aggregate unmatched files from every batch
|
|
118
|
-
* that has details loaded (otherwise past is empty and receipts vanish from the UI).
|
|
119
|
-
*/
|
|
120
|
-
const pastBatches = unmatchedSectionBatchId != null
|
|
121
|
-
? batchList.filter((b) => b.batchId !== unmatchedSectionBatchId)
|
|
122
|
-
: batchList;
|
|
123
|
-
const pastUnmatchedFiles = pastBatches.flatMap((b) => {
|
|
124
|
-
const details = bulkUpload.batchDetailsById[b.batchId];
|
|
125
|
-
if (details == null) {
|
|
126
|
-
return [];
|
|
127
|
-
}
|
|
128
|
-
return details.files
|
|
129
|
-
.filter((f) => f.status === 'un_matched' || f.status === 'no_match')
|
|
130
|
-
.map((f) => resolveBatchFile(f, b.batchId, transactionState));
|
|
131
|
-
});
|
|
132
|
-
const completedTransactionsCacheKey = monthYearPeriodId != null
|
|
133
|
-
? getCompletedTransactionsCacheKey(monthYearPeriodId, bulkUpload.sortKey, bulkUpload.sortOrder, bulkUpload.completedSubTab)
|
|
134
|
-
: undefined;
|
|
135
|
-
const completedTransactionsForPeriod = completedTransactionsCacheKey != null
|
|
136
|
-
? bulkUpload.completedTransactionsByPeriod[completedTransactionsCacheKey]
|
|
137
|
-
: undefined;
|
|
138
|
-
const completedTransactionIds = completedTransactionsForPeriod?.transactionIds ?? [];
|
|
139
|
-
const resolvedCompletedTransactions = getSupportedTransactionsByIds(transactionState, completedTransactionIds);
|
|
140
|
-
const resolvedBatchDetails = currentBatchDetails != null && resolvedFiles != null
|
|
141
|
-
? {
|
|
142
|
-
batchId: currentBatchDetails.batchId,
|
|
143
|
-
createdAt: currentBatchDetails.createdAt,
|
|
144
|
-
files: resolvedFiles,
|
|
145
|
-
status: currentBatchDetails.status,
|
|
146
|
-
summary: currentBatchDetails.summary,
|
|
147
|
-
}
|
|
148
|
-
: undefined;
|
|
149
|
-
const manualSearchResults = bulkUpload.manualSearch.results.map((r) => {
|
|
150
|
-
const t = getSupportedTransactionById(transactionState, r.transactionId);
|
|
151
|
-
return {
|
|
152
|
-
...r,
|
|
153
|
-
vendorLogo: r.vendorLogo ?? t?.logo?.href,
|
|
154
|
-
};
|
|
155
|
-
});
|
|
156
50
|
return {
|
|
157
51
|
fetchState,
|
|
158
52
|
error,
|
|
@@ -161,122 +55,5 @@ export function getExpenseAutomationMissingReceiptsView(state) {
|
|
|
161
55
|
refreshStatus,
|
|
162
56
|
transactions: sortedTransactions,
|
|
163
57
|
completionStatus,
|
|
164
|
-
pendingMissingReceiptsTabNavigation: pendingMissingReceiptsTabNavigation ?? null,
|
|
165
|
-
bulkUpload: {
|
|
166
|
-
phase: bulkUpload.phase,
|
|
167
|
-
uploadStatus: bulkUpload.uploadStatus,
|
|
168
|
-
batchStatus: currentBatchStatus,
|
|
169
|
-
batchDetails: resolvedBatchDetails,
|
|
170
|
-
completedSubTab: bulkUpload.completedSubTab,
|
|
171
|
-
completedTransactions: {
|
|
172
|
-
fetchState: completedTransactionsForPeriod?.fetchState ?? {
|
|
173
|
-
fetchState: 'Not-Started',
|
|
174
|
-
error: undefined,
|
|
175
|
-
},
|
|
176
|
-
nextPageToken: completedTransactionsForPeriod?.nextPageToken ?? null,
|
|
177
|
-
totalCount: completedTransactionsForPeriod?.totalCount ?? 0,
|
|
178
|
-
transactions: resolvedCompletedTransactions,
|
|
179
|
-
},
|
|
180
|
-
matchedFiles,
|
|
181
|
-
unmatchedFiles,
|
|
182
|
-
progress,
|
|
183
|
-
currentResultsTab: bulkUpload.currentResultsTab,
|
|
184
|
-
sortKey: bulkUpload.sortKey,
|
|
185
|
-
sortOrder: bulkUpload.sortOrder,
|
|
186
|
-
batchList,
|
|
187
|
-
batchListFetchState,
|
|
188
|
-
pastBatches,
|
|
189
|
-
pastUnmatchedFiles,
|
|
190
|
-
confirmMatchStatus: bulkUpload.confirmMatchStatus,
|
|
191
|
-
manualSearchUiResetKey: bulkUpload.manualSearchUiResetKey,
|
|
192
|
-
hasMoreBatchDetails,
|
|
193
|
-
batchDetailsPaginationState: bulkUpload.batchDetailsPaginationState,
|
|
194
|
-
manualSearch: {
|
|
195
|
-
...bulkUpload.manualSearch,
|
|
196
|
-
results: manualSearchResults,
|
|
197
|
-
},
|
|
198
|
-
uploadProgress: bulkUpload.uploadProgress,
|
|
199
|
-
},
|
|
200
|
-
};
|
|
201
|
-
}
|
|
202
|
-
function batchDetailsHasUnmatchedWork(details) {
|
|
203
|
-
return details.files.some((f) => f.status === 'un_matched' || f.status === 'no_match');
|
|
204
|
-
}
|
|
205
|
-
/** List row summary before batch details load — aligns with unmatched / possible-match work. */
|
|
206
|
-
function batchListItemHasUnmatchedWork(batch) {
|
|
207
|
-
return batch.noMatchCount > 0 || batch.possibleMatchesCount > 0;
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* `batchList` must match platform order (same sequence as the bulk-upload batches API). Picks the
|
|
211
|
-
* primary batch for the top "Unmatched" section. Skips failed detail fetches.
|
|
212
|
-
*
|
|
213
|
-
* If details are not loaded for an earlier list row but that row reports no unmatched work, we
|
|
214
|
-
* skip it so later rows with loaded details can be primary (avoids an empty tab when the first
|
|
215
|
-
* fetch page only loaded later batches). If the list reports unmatched work but details are still
|
|
216
|
-
* loading, we wait (undefined) so primary order stays correct once details arrive.
|
|
217
|
-
*/
|
|
218
|
-
function getPrimaryBatchIdFromBatchListOrder(batchListInPlatformOrder, batchDetailsById, failedBatchDetailIds) {
|
|
219
|
-
const failedIds = new Set(failedBatchDetailIds);
|
|
220
|
-
const anyCompletedBatchHasUnmatchedWork = batchListInPlatformOrder.some((b) => {
|
|
221
|
-
if (failedIds.has(b.batchId)) {
|
|
222
|
-
return false;
|
|
223
|
-
}
|
|
224
|
-
const d = batchDetailsById[b.batchId];
|
|
225
|
-
if (d != null &&
|
|
226
|
-
d.status === 'completed' &&
|
|
227
|
-
batchDetailsHasUnmatchedWork(d)) {
|
|
228
|
-
return true;
|
|
229
|
-
}
|
|
230
|
-
return d == null && batchListItemHasUnmatchedWork(b);
|
|
231
|
-
});
|
|
232
|
-
for (const batch of batchListInPlatformOrder) {
|
|
233
|
-
if (failedIds.has(batch.batchId)) {
|
|
234
|
-
continue;
|
|
235
|
-
}
|
|
236
|
-
const details = batchDetailsById[batch.batchId];
|
|
237
|
-
if (details == null) {
|
|
238
|
-
if (batchListItemHasUnmatchedWork(batch)) {
|
|
239
|
-
return undefined;
|
|
240
|
-
}
|
|
241
|
-
continue;
|
|
242
|
-
}
|
|
243
|
-
if (details.status !== 'completed') {
|
|
244
|
-
continue;
|
|
245
|
-
}
|
|
246
|
-
if (anyCompletedBatchHasUnmatchedWork) {
|
|
247
|
-
if (batchDetailsHasUnmatchedWork(details)) {
|
|
248
|
-
return batch.batchId;
|
|
249
|
-
}
|
|
250
|
-
continue;
|
|
251
|
-
}
|
|
252
|
-
return batch.batchId;
|
|
253
|
-
}
|
|
254
|
-
return undefined;
|
|
255
|
-
}
|
|
256
|
-
function resolveBatchFile(file, batchId, transactionState) {
|
|
257
|
-
const matchedTransaction = file.matchedTransactionId != null
|
|
258
|
-
? getSupportedTransactionById(transactionState, file.matchedTransactionId)
|
|
259
|
-
: undefined;
|
|
260
|
-
const candidates = file.candidates
|
|
261
|
-
?.map((ref) => {
|
|
262
|
-
const transaction = getSupportedTransactionById(transactionState, ref.transactionId);
|
|
263
|
-
return transaction != null
|
|
264
|
-
? { transaction, matchScore: ref.matchScore }
|
|
265
|
-
: undefined;
|
|
266
|
-
})
|
|
267
|
-
.filter((c) => c != null);
|
|
268
|
-
return {
|
|
269
|
-
attachmentId: file.attachmentId,
|
|
270
|
-
batchId,
|
|
271
|
-
fileDownloadUrl: file.fileDownloadUrl,
|
|
272
|
-
fileId: file.fileId,
|
|
273
|
-
filename: file.filename,
|
|
274
|
-
filePreviewUrl: file.filePreviewUrl,
|
|
275
|
-
status: file.status,
|
|
276
|
-
matchedTransaction,
|
|
277
|
-
candidates: candidates != null && candidates.length > 0
|
|
278
|
-
? candidates
|
|
279
|
-
: undefined,
|
|
280
|
-
matchSource: file.matchSource,
|
|
281
58
|
};
|
|
282
59
|
}
|
|
@@ -10,7 +10,7 @@ import { getAllSteps } from '../selectorTypes/expenseAutomationViewSelectorTypes
|
|
|
10
10
|
export function getExpenseAutomationTransactionView(state) {
|
|
11
11
|
const { accountState, classState, classListState, accountListState, expenseAutomationTransactionsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, } = state;
|
|
12
12
|
const { selectedTransactionCategorizationTab } = expenseAutomationTransactionsViewState;
|
|
13
|
-
const { uiState, refreshStatus, saveStatus, markAsNotMiscategorizedStatus, transactionIdsBySelectedPeriod, transactionReviewLocalDataById, selectedCheckBoxTransactionIds, transactionIdsWithUnsavedData,
|
|
13
|
+
const { uiState, refreshStatus, saveStatus, markAsNotMiscategorizedStatus, transactionIdsBySelectedPeriod, transactionReviewLocalDataById, selectedCheckBoxTransactionIds, transactionIdsWithUnsavedData, selectedTransactionId, selectedTransactionLineId, } = expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab];
|
|
14
14
|
const uncategorizedIncomeExpense = getUncategorizedAccounts(accountState, accountListState, 'accountList');
|
|
15
15
|
const accountList = getAccountList(accountState, accountListState, 'accountList');
|
|
16
16
|
const classList = getClassList(classState, classListState);
|
|
@@ -94,7 +94,6 @@ export function getExpenseAutomationTransactionView(state) {
|
|
|
94
94
|
completionStatus,
|
|
95
95
|
totalCountByTab,
|
|
96
96
|
fetchStateByTransactionTabs: fetchStateByTab,
|
|
97
|
-
uploadReceiptStatusById,
|
|
98
97
|
selectedTransactionId,
|
|
99
98
|
selectedTransactionLineId,
|
|
100
99
|
};
|
|
@@ -7,9 +7,3 @@ const MISSING_RECEIPTS_SORT_KEYS = [
|
|
|
7
7
|
'amount',
|
|
8
8
|
];
|
|
9
9
|
export const toMissingReceiptsSortKey = (v) => stringToUnion(v, MISSING_RECEIPTS_SORT_KEYS);
|
|
10
|
-
// -- Bulk Receipt Upload Types --
|
|
11
|
-
/**
|
|
12
|
-
* Minimum trimmed query length before manual-match search calls the expense-automation API.
|
|
13
|
-
* Kept in sync with `ManualSearchInput` in web-components (fires search only when length ≥ this).
|
|
14
|
-
*/
|
|
15
|
-
export const MIN_MANUAL_TRANSACTION_SEARCH_LENGTH = 2;
|
|
@@ -4,11 +4,10 @@ const TRANSACTIONS_SORT_KEYS = [
|
|
|
4
4
|
'vendor',
|
|
5
5
|
'amount',
|
|
6
6
|
'transaction_type',
|
|
7
|
-
'payment_account',
|
|
8
7
|
'date',
|
|
9
8
|
'category',
|
|
10
9
|
'class',
|
|
11
|
-
'
|
|
10
|
+
'memo',
|
|
12
11
|
];
|
|
13
12
|
export const toTransactionsSortKey = (v) => stringToUnion(v, TRANSACTIONS_SORT_KEYS);
|
|
14
13
|
export const TRANSACTIONS_TABS = ['review', 'autoCategorized'];
|
package/lib/esm/zeniAPI.js
CHANGED
|
@@ -79,6 +79,8 @@ export class ZeniAPIClient {
|
|
|
79
79
|
return from(promise);
|
|
80
80
|
}
|
|
81
81
|
postFormData(restEndPoint, formData, signal) {
|
|
82
|
+
// Use apiHeaders for auth headers, then remove Content-Type
|
|
83
|
+
// so the browser sets multipart/form-data with the correct boundary
|
|
82
84
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
83
85
|
const { 'Content-Type': _contentType, ...headers } = this.apiHeaders();
|
|
84
86
|
const promise = fetch(restEndPoint, {
|
package/lib/index.d.ts
CHANGED
|
@@ -265,14 +265,14 @@ import { MAX_SELECTION_LIMIT, checkIfAllLineItemsAreCategoryClassFilled, getLine
|
|
|
265
265
|
import { UploadStatementDocumentAIPayload, UploadStatementDocumentAIResponse } from './view/expenseAutomationView/payload/reconciliationPayload';
|
|
266
266
|
import { clearExpenseAutomationFluxAnalysisView, fetchFluxAnalysisView, reviewFluxAnalysisView, updateFluxAnalysisViewPageMetaData, updateFluxAnalysisViewUIState, updateOperatingExpensesIdsForReview, updateSelectedSectionIdsForReview } from './view/expenseAutomationView/reducers/fluxAnalysisViewReducer';
|
|
267
267
|
import { clearJeScheduleLocalData as clearExpenseAutomationJEScheduleLocalData, clearExpenseAutomationJESchedulesView, fetchJeSchedulesPage as fetchExpenseAutomationJESchedulesPage, ignoreRecommendedJeSchedule as ignoreExpenseAutomationJESchedule, initializeAccountSettingsView as initializeJeAccountSettingsView, initializeJeScheduleLocalData, removeJeScheduleTransactionKey, retryJeSchedule as retryExpenseAutomationJESchedule, saveAccountSettings as saveJeAccountSettings, saveAccountSettingsLocalData as saveJeAccountSettingsLocalData, updateJeScheduleLocalDataById, updateJeScheduleTransactionKeys } from './view/expenseAutomationView/reducers/jeSchedulesViewReducer';
|
|
268
|
-
import {
|
|
268
|
+
import { fetchMissingReceipts as fetchExpenseAutomationMissingReceipts, markMissingReceiptAsDone as markExpenseAutomationMissingReceiptAsDone, updateMissingReceiptUploadState as updateExpenseAutomationMissingReceiptUploadState, updateMissingReceiptsUIState as updateExpenseAutomationMissingReceiptsUIState, uploadMissingReceiptSuccess as uploadExpenseAutomationMissingReceiptSuccess } from './view/expenseAutomationView/reducers/missingReceiptsViewReducer';
|
|
269
269
|
import { deleteAccountStatement, fetchReconciliation as fetchReconciliationView, saveReconciliationDetail as saveExpenseAutomationReconciliationDetail, saveReconciliationReview as saveExpenseAutomationReconciliationReview, setConnectionInProgressForAccount as setConnectionInProgressForAccountReconciliation, setStatementParseInProgress, updateAccountReconciliationLocalData as updateExpenseAutomationAccountReconciliationLocalData, updateSelectedAccountId as updateExpenseAutomationAccountReconciliationSelectedAccountId, updateSelectedTab as updateExpenseAutomationAccountReconciliationSelectedTab, updateReconListScrollPosition as updateExpenseAutomationReconListScrollPosition, updateReviewTabSortState as updateExpenseAutomationReconReviewTabListSortState, updateReviewTabLocalData as updateExpenseAutomationReconReviewTabLocalData, updateReconcileTabListScrollState as updateExpenseAutomationReconcileTabListScrollState, updateReconcileTabListSortState as updateExpenseAutomationReconcileTabListSortState, updateReconcileTabLocalData as updateExpenseAutomationReconcileTabLocalData, updateSelectedDrawerAccountId as updateExpenseAutomationSelectedDrawerAccountId, updateStatementUploadChosen, uploadAccountStatement } from './view/expenseAutomationView/reducers/reconciliationViewReducer';
|
|
270
|
-
import { backgroundRefetchReviewTab, clearExpenseAutomationTransactionsView, fetchTransactionCategorization, fetchTransactionCategorizationFailure, fetchTransactionCategorizationView, initializeTransactionCategorizationViewLocalData, markTransactionAsNotMiscategorized, saveTransactionCategorization, saveTransactionCategorizationLocalData, setAllItemsToCategoryClassInLocalDataForCategorization, setEntityRecommendationForLineIdsForCategorization, syncTransactionCategorizationFromDetailSave, updateCurrentSelectedTransactionCategorizationTab, updateSelectedCheckboxTransactionIds, updateSelectedCustomerForTransaction, updateSelectedTransactionId, updateSelectedVendorForTransaction, updateTransactionCategorization, updateTransactionCategorizationSaveStatus, updateTransactionCategorizationUIState
|
|
270
|
+
import { backgroundRefetchReviewTab, clearExpenseAutomationTransactionsView, fetchTransactionCategorization, fetchTransactionCategorizationFailure, fetchTransactionCategorizationView, initializeTransactionCategorizationViewLocalData, markTransactionAsNotMiscategorized, saveTransactionCategorization, saveTransactionCategorizationLocalData, setAllItemsToCategoryClassInLocalDataForCategorization, setEntityRecommendationForLineIdsForCategorization, syncTransactionCategorizationFromDetailSave, updateCurrentSelectedTransactionCategorizationTab, updateSelectedCheckboxTransactionIds, updateSelectedCustomerForTransaction, updateSelectedTransactionId, updateSelectedVendorForTransaction, updateTransactionCategorization, updateTransactionCategorizationSaveStatus, updateTransactionCategorizationUIState } from './view/expenseAutomationView/reducers/transactionsViewReducer';
|
|
271
271
|
import { ExpenseAutomationStepDetails, ExpenseAutomationViewSelector } from './view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes';
|
|
272
272
|
import { ExpenseAutomationFluxAnalysisViewSelector, FluxAnalysisOperatingExpenseView, FluxAnalysisSectionType, FluxAnalysisVendorView, FluxAnalysisViewSectionReport, FluxVendorAccountsAndClassesView } from './view/expenseAutomationView/selectorTypes/fluxAnalysisViewSelectorTypes';
|
|
273
273
|
import { JEAccountSettingsView } from './view/expenseAutomationView/selectorTypes/jeAccountSettingsViewSelectorTypes';
|
|
274
274
|
import { ExpenseAutomationJESchedulesViewSelector } from './view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes';
|
|
275
|
-
import {
|
|
275
|
+
import { ExpenseAutomationMissingReceiptsViewSelector } from './view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes';
|
|
276
276
|
import { AccountReconSectionID, AccountReconciliationByAccount, AccountReconciliationBySection, ExpenseAutomationReconciliationViewSelector } from './view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes';
|
|
277
277
|
import { ExpenseAutomationTransactionViewSelector, TransactionReviewLocalDataSelectorView } from './view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes';
|
|
278
278
|
import { getExpenseAutomationFluxAnalysisView } from './view/expenseAutomationView/selectors/fluxAnalysisViewSelector';
|
|
@@ -281,8 +281,6 @@ import { getExpenseAutomationReconciliationView, isAccountReconReport } from './
|
|
|
281
281
|
import { getExpenseAutomationTransactionView } from './view/expenseAutomationView/selectors/transactionCategorizationSelector';
|
|
282
282
|
import { FluxAnalysisActionType, FluxAnalysisReviewStatus, FluxAnalysisSortKey, FluxAnalysisViewUIState, FluxBalancesByMonth } from './view/expenseAutomationView/types/fluxAnalysisViewState';
|
|
283
283
|
import { AccountSettingsLocalData, JEScheduleLocalData } from './view/expenseAutomationView/types/jeSchedulesViewState';
|
|
284
|
-
import { BatchDetails, BatchFile, BatchFileStatus, BatchListItem, BatchStatus, BatchStatusValue, BatchSummary, BulkUploadPhase, BulkUploadResultsTab, BulkUploadSortKey, BulkUploadState, CandidateRef, CompletedSubTab, MatchCandidate, MatchSource, MissingReceiptsTab } from './view/expenseAutomationView/types/missingReceiptsViewState';
|
|
285
|
-
import { CompletedTransactionsSelectorData, ResolvedBatchFile, ResolvedCandidate, ResolvedBatchDetails } from './view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes';
|
|
286
284
|
import { MissingReceiptsSortKey as ExpenseAutomationMissingReceiptsSortKey, MissingReceiptsViewState as ExpenseAutomationMissingReceiptsViewState, MissingReceiptsViewUIState as ExpenseAutomationMissingReceiptsViewUIState, toMissingReceiptsSortKey as toExpenseAutomationMissingReceiptsSortKey } from './view/expenseAutomationView/types/missingReceiptsViewState';
|
|
287
285
|
import { AccountReconciliationLocalData, ReconciliationViewTabType as ExpenseAutomationReconciliationViewTab, ReconReconcileSortKey, ReconReviewSortKey, ReconciliationReconcileTabLocalData, ReconciliationReviewTabLocalData, SaveReconcileDetailActionPayload as SaveExpenseAutomationReconciliationActionType, toReconciliationTabsType } from './view/expenseAutomationView/types/reconciliationViewState';
|
|
288
286
|
import { TransactionsTab as ExpenseAutomationTransactionsTab, TransactionsViewState as ExpenseAutomationTransactionsViewState, TransactionsViewUIState as ExpenseAutomationTransactionsViewUIState, SupportedTransactionCategorization, TransactionCategorizationLineItemData, TransactionReviewLocalData, TransactionsSortKey, TransactionsTab, toTransactionsTabKey as toExpenseAutomationTransactionsTabKey, toTransactionsSortKey } from './view/expenseAutomationView/types/transactionsViewState';
|
|
@@ -623,7 +621,7 @@ export { TransactionsOrder, COABalancesSliceOrder, EntityOrder, Section, Section
|
|
|
623
621
|
export { ClassesViewSelectorReportV2 };
|
|
624
622
|
export { BalancesTimeseries, TrendTimeseries, BalanceKind };
|
|
625
623
|
export { fetchMonthEndCloseChecks, fetchMonthClosePerformanceTrend, MonthClosePerformanceTrend, MonthEndCloseCheck, getMonthEndCloseChecksViewByTenantId, MonthEndCloseChecksView, MonthEndCloseCheckFrequency, MonthCloseCheckMetrics, ALL_MONTH_END_CLOSE_CHECKS_FREQUENCY, MonthEndAuditSummary, };
|
|
626
|
-
export { ExpenseAutomationViewSelector, ExpenseAutomationStepDetails, ExpenseAutomationViewType, ExpenseAutomationMissingReceiptsViewSelector,
|
|
624
|
+
export { ExpenseAutomationViewSelector, ExpenseAutomationStepDetails, ExpenseAutomationViewType, ExpenseAutomationMissingReceiptsViewSelector, ExpenseAutomationFluxAnalysisViewSelector, FluxAnalysisVendorView, FluxAnalysisViewSectionReport, FluxVendorAccountsAndClassesView, ExpenseAutomationMissingReceiptsViewUIState, ExpenseAutomationMissingReceiptsViewState, ExpenseAutomationViewState, ExpenseAutomationTransactionsTab, ExpenseAutomationMissingReceiptsSortKey, getExpenseAutomationView, toExpenseAutomationMissingReceiptsSortKey, toExpenseAutomationTransactionsTabKey, toExpenseAutomationViewType, uploadExpenseAutomationMissingReceiptSuccess, markExpenseAutomationMissingReceiptAsDone, fetchAllExpenseAutomationTabs, refreshExpenseAutomationCurrentTab, updateCurrentSelectedTransactionCategorizationTab, fetchExpenseAutomationMissingReceipts, fetchFluxAnalysisView, clearExpenseAutomationFluxAnalysisView, updateOperatingExpensesIdsForReview as updateFluxOperatingExpensesIdsForReview, updateSelectedSectionIdsForReview as updateFluxAnalysisSelectedSectionIdsForReview, reviewFluxAnalysisView, updateExpenseAutomationMissingReceiptUploadState, updateExpenseAutomationMissingReceiptsUIState, FluxAnalysisOperatingExpenseView, FluxAnalysisSectionType, getExpenseAutomationFluxAnalysisView, FluxAnalysisSortKey, FluxAnalysisActionType, FluxBalancesByMonth, updateCurrentSelectedView, updateCurrentSelectedPeriod, getExpenseAutomationTransactionView, ReconReconcileSortKey, ReconciliationReconcileTabLocalData, FluxAnalysisReviewStatus, updateFluxAnalysisViewUIState, FluxAnalysisViewUIState, updateFluxAnalysisViewPageMetaData, MAX_SELECTION_LIMIT, checkIfAllLineItemsAreCategoryClassFilled, getLineItemsByTransactionIdsFromLocalData, isAnyItemWithUncategorizedExpenseAccount, SaveExpenseAutomationReconciliationActionType, saveExpenseAutomationReconciliationDetail, updateExpenseAutomationReconcileTabListScrollState, updateExpenseAutomationReconReviewTabListSortState, updateExpenseAutomationReconcileTabListSortState, updateExpenseAutomationReconcileTabLocalData, updateExpenseAutomationAccountReconciliationSelectedTab, updateExpenseAutomationAccountReconciliationSelectedAccountId, ExpenseAutomationReconciliationViewSelector, getExpenseAutomationReconciliationView, AccountReconciliationBySection, fetchReconciliationView, uploadAccountStatementIntoDocumentAI, UploadStatementDocumentAIResponse, updateExpenseAutomationReconListScrollPosition, setConnectionInProgressForAccountReconciliation, AccountReconciliationByAccount, AccountReconciliationEntity, getAccountReconByAccountIdAndSelectedPeriod, ExpenseAutomationReconciliationViewTab, toReconciliationTabsType, isAccountReconReport, ReconReviewSortKey, AccountReconSectionID, ReconciliationReviewTabLocalData, TransactionsToReview, RecommendedActionCodeType, ReconciliationStatusCodeType, BalanceDataStatusCodeType, updateExpenseAutomationReconReviewTabLocalData, updateExpenseAutomationSelectedDrawerAccountId, saveExpenseAutomationReconciliationReview, updateExpenseAutomationAccountReconciliationLocalData, BankStatusCodeType, ReconciliationAccountSourceType, toReconciliationAccountSource, StatementStatusCodeType, AccountReconciliationLocalData, StatementDataStatusCodeType, deleteAccountStatement, uploadAccountStatement, UploadStatementDocumentAIPayload, updateStatementUploadChosen, isReviewTransactionBankTransferType, isReviewTransactionBillPaymentType, isReviewTransactionCreditCardPaymentType, isReviewTransactionDepositType, isReviewTransactionExpenseType, isReviewTransactionCreditCardCreditType, setStatementParseInProgress, };
|
|
627
625
|
export { JEScheduleLocalData };
|
|
628
626
|
export { ExpenseAutomationJESchedulesViewSelector, JEAccountSettingsView, JEScheduledTransactionWithFailedEntries, };
|
|
629
627
|
export { fetchTransactionCategorization, fetchTransactionCategorizationView, updateTransactionCategorizationUIState, updateSelectedCheckboxTransactionIds, setEntityRecommendationForLineIdsForCategorization, initializeTransactionCategorizationViewLocalData, setAllItemsToCategoryClassInLocalDataForCategorization, saveTransactionCategorizationLocalData, fetchTransactionCategorizationFailure, saveTransactionCategorization, updateTransactionCategorization, updateTransactionCategorizationSaveStatus, markTransactionAsNotMiscategorized, updateSelectedVendorForTransaction, updateSelectedCustomerForTransaction, updateSelectedTransactionId, syncTransactionCategorizationFromDetailSave, backgroundRefetchReviewTab, clearExpenseAutomationTransactionsView, TransactionsSortKey, toTransactionsSortKey, TransactionsTab, TransactionCategorizationLineItemData, TransactionReviewLocalData, SupportedTransactionCategorization, ExpenseAutomationTransactionsViewState, ExpenseAutomationTransactionsViewUIState, ExpenseAutomationTransactionViewSelector, TransactionReviewLocalDataSelectorView, };
|