@zeniai/client-epic-state 4.19.82 → 4.19.84-betaVR1
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 +2 -0
- package/lib/entity/account/accountPayload.js +2 -0
- package/lib/entity/account/accountState.d.ts +2 -0
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +1 -0
- package/lib/epic.d.ts +12 -1
- package/lib/epic.js +12 -1
- package/lib/esm/entity/account/accountPayload.js +2 -0
- package/lib/esm/entity/snackbar/snackbarTypes.js +1 -0
- package/lib/esm/epic.js +12 -1
- package/lib/esm/index.js +5 -3
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +24 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.js +49 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.js +40 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +47 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +61 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.js +34 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.js +57 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +68 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/uploadMissingReceiptSuccessEpic.js +7 -5
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +42 -0
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.js +24 -0
- package/lib/esm/view/expenseAutomationView/payload/missingReceiptsPayload.js +147 -1
- package/lib/esm/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +401 -1
- package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +20 -1
- package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +224 -1
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +2 -1
- package/lib/esm/view/expenseAutomationView/types/transactionsViewState.js +2 -1
- package/lib/esm/zeniAPI.js +0 -2
- package/lib/index.d.ts +6 -4
- package/lib/index.js +66 -31
- package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.d.ts +15 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +28 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.d.ts +7 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.js +53 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.d.ts +8 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.js +44 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.d.ts +7 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +51 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.d.ts +8 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +65 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.d.ts +8 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.js +38 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.d.ts +9 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.js +62 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.d.ts +14 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +72 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/uploadMissingReceiptSuccessEpic.js +7 -5
- package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.d.ts +13 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +47 -0
- package/lib/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.d.ts +7 -0
- package/lib/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.js +28 -0
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.d.ts +107 -0
- package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.js +158 -0
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +70 -3
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +403 -2
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +11 -3
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +21 -2
- package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +69 -1
- package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +1 -0
- package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.d.ts +1 -1
- package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +223 -0
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +2 -1
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +124 -0
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +2 -1
- package/lib/view/expenseAutomationView/types/transactionsViewState.js +2 -1
- package/lib/zeniAPI.js +0 -2
- package/package.json +2 -2
- package/lib/tsconfig.typecheck.tsbuildinfo +0 -1
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import { URLPayload } from '../../../commonPayloadTypes/urlPayload';
|
|
1
2
|
import { TransactionPayload } from '../../../entity/transaction/payloadTypes/transactionPayload';
|
|
3
|
+
import { SupportedTransactionPayload } from '../../../entity/transaction/transactionState';
|
|
2
4
|
import { ZeniAPIResponse } from '../../../responsePayload';
|
|
5
|
+
import type { MonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
|
|
6
|
+
import type { BatchDetails, BatchFile, BatchListItem, BatchStatus, BatchSummary, ManualSearchResult } from '../types/missingReceiptsViewState';
|
|
3
7
|
export interface MissingReceiptsQueryPayload {
|
|
4
8
|
end_date: string;
|
|
5
9
|
is_attachment_missing_only: boolean;
|
|
@@ -13,4 +17,107 @@ interface MissingReceiptsPayload {
|
|
|
13
17
|
transactions: TransactionPayload[];
|
|
14
18
|
}
|
|
15
19
|
export type MissingReceiptsResponse = ZeniAPIResponse<MissingReceiptsPayload>;
|
|
20
|
+
export interface BatchListQueryPayload {
|
|
21
|
+
end_date: string;
|
|
22
|
+
sort_order: string;
|
|
23
|
+
start_date: string;
|
|
24
|
+
}
|
|
25
|
+
export interface BulkUploadResponsePayload {
|
|
26
|
+
batch_id: string;
|
|
27
|
+
status: string;
|
|
28
|
+
total_files: number;
|
|
29
|
+
}
|
|
30
|
+
export type BulkUploadResponse = ZeniAPIResponse<BulkUploadResponsePayload>;
|
|
31
|
+
export interface BatchListResponsePayload {
|
|
32
|
+
batches: BatchListItemPayload[];
|
|
33
|
+
}
|
|
34
|
+
export interface BatchListItemPayload {
|
|
35
|
+
batch_id: string;
|
|
36
|
+
created_at: string;
|
|
37
|
+
failed_count: number;
|
|
38
|
+
matched_count: number;
|
|
39
|
+
no_match_count: number;
|
|
40
|
+
possible_matches_count: number;
|
|
41
|
+
status: string;
|
|
42
|
+
total_files: number;
|
|
43
|
+
}
|
|
44
|
+
export type BatchListResponse = ZeniAPIResponse<BatchListResponsePayload>;
|
|
45
|
+
export interface MatchedTransactionPayload {
|
|
46
|
+
amount: number;
|
|
47
|
+
currency_code: string;
|
|
48
|
+
transaction_date: string | null;
|
|
49
|
+
transaction_id: string;
|
|
50
|
+
vendor_name: string;
|
|
51
|
+
transaction_type?: string;
|
|
52
|
+
vendor_logo?: URLPayload | null;
|
|
53
|
+
}
|
|
54
|
+
export interface MatchCandidatePayload extends MatchedTransactionPayload {
|
|
55
|
+
match_score: number;
|
|
56
|
+
}
|
|
57
|
+
export interface BatchFilePayload {
|
|
58
|
+
attachment_id: string;
|
|
59
|
+
file_id: string;
|
|
60
|
+
file_preview_url: string | null;
|
|
61
|
+
filename: string;
|
|
62
|
+
status: string;
|
|
63
|
+
candidates?: MatchCandidatePayload[];
|
|
64
|
+
match_source?: string;
|
|
65
|
+
matched_transaction?: MatchedTransactionPayload;
|
|
66
|
+
}
|
|
67
|
+
export interface BatchDetailsResponsePayload {
|
|
68
|
+
batch_id: string;
|
|
69
|
+
created_at: string;
|
|
70
|
+
files: BatchFilePayload[];
|
|
71
|
+
status: string;
|
|
72
|
+
summary: {
|
|
73
|
+
failed: number;
|
|
74
|
+
matched: number;
|
|
75
|
+
no_match: number;
|
|
76
|
+
possible_matches: number;
|
|
77
|
+
total: number;
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
export type BatchDetailsResponse = ZeniAPIResponse<BatchDetailsResponsePayload>;
|
|
81
|
+
export declare function toBatchFile(payload: BatchFilePayload, filesEndPoint?: string): BatchFile;
|
|
82
|
+
export declare function extractTransactionPayloadsFromBatchFiles(files: BatchFilePayload[]): SupportedTransactionPayload[];
|
|
83
|
+
export declare function toBatchSummary(payload: BatchDetailsResponsePayload['summary']): BatchSummary;
|
|
84
|
+
export declare function toBatchDetails(payload: BatchDetailsResponsePayload, filesEndPoint?: string): BatchDetails;
|
|
85
|
+
/** Batch list `status` is a string from the API — compare case-insensitively. */
|
|
86
|
+
export declare function isBatchListStatusCompleted(status: string): boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Subset of the get-all-batches (`/batches?query=...`) list that is eligible for
|
|
89
|
+
* `GET /batches/:batchId` details fetches. The stored list may include pending, failed, or other
|
|
90
|
+
* statuses for UI; only `completed` rows should trigger batch-details requests.
|
|
91
|
+
*/
|
|
92
|
+
export declare function filterBatchListItemsForBatchDetailsFetch(batches: BatchListItem[]): BatchListItem[];
|
|
93
|
+
/**
|
|
94
|
+
* Batch details API response `status` field — only completed payloads should be stored from
|
|
95
|
+
* multi-batch fetch paths (list can be briefly stale vs. live processing state).
|
|
96
|
+
*/
|
|
97
|
+
export declare function isBatchDetailsApiStatusCompleted(status: string): boolean;
|
|
98
|
+
export declare function findBatchListItemForBatchId(batchListByPeriod: Record<MonthYearPeriodId, BatchListItem[]>, batchId: string): BatchListItem | undefined;
|
|
99
|
+
/**
|
|
100
|
+
* Whether it is appropriate to call `GET .../batches/:id` for details.
|
|
101
|
+
* Skips when live batch status or batch list row indicates the batch is not completed yet.
|
|
102
|
+
* When status is unknown in both sources, allows the request (e.g. dispatch before list refresh).
|
|
103
|
+
*/
|
|
104
|
+
export declare function shouldFetchBatchDetailsForBatchId(batchStatusById: Record<string, BatchStatus>, batchListByPeriod: Record<MonthYearPeriodId, BatchListItem[]>, batchId: string): boolean;
|
|
105
|
+
export declare function toBatchListItem(payload: BatchListItemPayload): BatchListItem;
|
|
106
|
+
/** Maps expense-automation transaction rows to manual-search list rows (Unmatched tab). */
|
|
107
|
+
export declare function supportedTransactionPayloadToManualSearchResult(payload: SupportedTransactionPayload): ManualSearchResult;
|
|
108
|
+
export interface CompletedTransactionsQueryPayload {
|
|
109
|
+
end_date?: string;
|
|
110
|
+
match_type?: string;
|
|
111
|
+
page_size?: number;
|
|
112
|
+
page_token?: string | null;
|
|
113
|
+
sort_by?: string;
|
|
114
|
+
sort_order?: string;
|
|
115
|
+
start_date?: string;
|
|
116
|
+
}
|
|
117
|
+
export interface CompletedTransactionsResponsePayload {
|
|
118
|
+
next_page_token: string | null;
|
|
119
|
+
total_count: number;
|
|
120
|
+
transactions: SupportedTransactionPayload[];
|
|
121
|
+
}
|
|
122
|
+
export type CompletedTransactionsResponse = ZeniAPIResponse<CompletedTransactionsResponsePayload>;
|
|
16
123
|
export {};
|
|
@@ -1,2 +1,160 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toBatchFile = toBatchFile;
|
|
4
|
+
exports.extractTransactionPayloadsFromBatchFiles = extractTransactionPayloadsFromBatchFiles;
|
|
5
|
+
exports.toBatchSummary = toBatchSummary;
|
|
6
|
+
exports.toBatchDetails = toBatchDetails;
|
|
7
|
+
exports.isBatchListStatusCompleted = isBatchListStatusCompleted;
|
|
8
|
+
exports.filterBatchListItemsForBatchDetailsFetch = filterBatchListItemsForBatchDetailsFetch;
|
|
9
|
+
exports.isBatchDetailsApiStatusCompleted = isBatchDetailsApiStatusCompleted;
|
|
10
|
+
exports.findBatchListItemForBatchId = findBatchListItemForBatchId;
|
|
11
|
+
exports.shouldFetchBatchDetailsForBatchId = shouldFetchBatchDetailsForBatchId;
|
|
12
|
+
exports.toBatchListItem = toBatchListItem;
|
|
13
|
+
exports.supportedTransactionPayloadToManualSearchResult = supportedTransactionPayloadToManualSearchResult;
|
|
14
|
+
const urlPayload_1 = require("../../../commonPayloadTypes/urlPayload");
|
|
15
|
+
const transactionPayload_1 = require("../../../entity/transaction/payloadTypes/transactionPayload");
|
|
16
|
+
// -- Converter functions --
|
|
17
|
+
function toBatchFile(payload, filesEndPoint) {
|
|
18
|
+
return {
|
|
19
|
+
attachmentId: payload.attachment_id,
|
|
20
|
+
candidates: payload.candidates?.map((c) => ({
|
|
21
|
+
transactionId: c.transaction_id,
|
|
22
|
+
matchScore: c.match_score,
|
|
23
|
+
})),
|
|
24
|
+
fileDownloadUrl: payload.file_id != null && filesEndPoint != null
|
|
25
|
+
? `${filesEndPoint}/1.0/files/${payload.file_id}?query=${encodeURIComponent(JSON.stringify({ download_file: true }))}`
|
|
26
|
+
: null,
|
|
27
|
+
fileId: payload.file_id,
|
|
28
|
+
filePreviewUrl: payload.file_preview_url,
|
|
29
|
+
filename: payload.filename,
|
|
30
|
+
matchSource: payload.match_source,
|
|
31
|
+
matchedTransactionId: payload.matched_transaction?.transaction_id,
|
|
32
|
+
status: payload.status,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function extractTransactionPayloadsFromBatchFiles(files) {
|
|
36
|
+
const seen = new Set();
|
|
37
|
+
const payloads = [];
|
|
38
|
+
for (const file of files) {
|
|
39
|
+
if (file.matched_transaction != null) {
|
|
40
|
+
const id = file.matched_transaction.transaction_id;
|
|
41
|
+
if (!seen.has(id)) {
|
|
42
|
+
seen.add(id);
|
|
43
|
+
payloads.push(matchedTransactionPayloadToSupportedTransactionPayload(file.matched_transaction));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (file.candidates != null) {
|
|
47
|
+
for (const candidate of file.candidates) {
|
|
48
|
+
const id = candidate.transaction_id;
|
|
49
|
+
if (!seen.has(id)) {
|
|
50
|
+
seen.add(id);
|
|
51
|
+
payloads.push(matchedTransactionPayloadToSupportedTransactionPayload(candidate));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return payloads;
|
|
57
|
+
}
|
|
58
|
+
function matchedTransactionPayloadToSupportedTransactionPayload(payload) {
|
|
59
|
+
return {
|
|
60
|
+
transaction_id: payload.transaction_id,
|
|
61
|
+
transaction_type: payload.transaction_type ?? 'expense',
|
|
62
|
+
transaction_date: payload.transaction_date ?? '',
|
|
63
|
+
currency_code: payload.currency_code,
|
|
64
|
+
total_amount: payload.amount,
|
|
65
|
+
vendor_name: payload.vendor_name,
|
|
66
|
+
logo: payload.vendor_logo == null ? undefined : (0, urlPayload_1.toURL)(payload.vendor_logo),
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
function toBatchSummary(payload) {
|
|
70
|
+
return {
|
|
71
|
+
failed: payload.failed,
|
|
72
|
+
matched: payload.matched,
|
|
73
|
+
noMatch: payload.no_match,
|
|
74
|
+
possibleMatches: payload.possible_matches,
|
|
75
|
+
total: payload.total,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
function toBatchDetails(payload, filesEndPoint) {
|
|
79
|
+
return {
|
|
80
|
+
batchId: payload.batch_id,
|
|
81
|
+
createdAt: payload.created_at,
|
|
82
|
+
files: payload.files.map((f) => toBatchFile(f, filesEndPoint)),
|
|
83
|
+
status: payload.status,
|
|
84
|
+
summary: toBatchSummary(payload.summary),
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
/** Batch list `status` is a string from the API — compare case-insensitively. */
|
|
88
|
+
function isBatchListStatusCompleted(status) {
|
|
89
|
+
return status.toLowerCase() === 'completed';
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Subset of the get-all-batches (`/batches?query=...`) list that is eligible for
|
|
93
|
+
* `GET /batches/:batchId` details fetches. The stored list may include pending, failed, or other
|
|
94
|
+
* statuses for UI; only `completed` rows should trigger batch-details requests.
|
|
95
|
+
*/
|
|
96
|
+
function filterBatchListItemsForBatchDetailsFetch(batches) {
|
|
97
|
+
return batches.filter((b) => isBatchListStatusCompleted(b.status));
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Batch details API response `status` field — only completed payloads should be stored from
|
|
101
|
+
* multi-batch fetch paths (list can be briefly stale vs. live processing state).
|
|
102
|
+
*/
|
|
103
|
+
function isBatchDetailsApiStatusCompleted(status) {
|
|
104
|
+
return status.toLowerCase() === 'completed';
|
|
105
|
+
}
|
|
106
|
+
function findBatchListItemForBatchId(batchListByPeriod, batchId) {
|
|
107
|
+
for (const list of Object.values(batchListByPeriod)) {
|
|
108
|
+
const found = list.find((b) => b.batchId === batchId);
|
|
109
|
+
if (found != null) {
|
|
110
|
+
return found;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return undefined;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Whether it is appropriate to call `GET .../batches/:id` for details.
|
|
117
|
+
* Skips when live batch status or batch list row indicates the batch is not completed yet.
|
|
118
|
+
* When status is unknown in both sources, allows the request (e.g. dispatch before list refresh).
|
|
119
|
+
*/
|
|
120
|
+
function shouldFetchBatchDetailsForBatchId(batchStatusById, batchListByPeriod, batchId) {
|
|
121
|
+
const live = batchStatusById[batchId]?.status;
|
|
122
|
+
if (live === 'completed') {
|
|
123
|
+
return true;
|
|
124
|
+
}
|
|
125
|
+
if (live === 'pending' || live === 'processing') {
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
const listItem = findBatchListItemForBatchId(batchListByPeriod, batchId);
|
|
129
|
+
if (listItem != null && !isBatchListStatusCompleted(listItem.status)) {
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
function toBatchListItem(payload) {
|
|
135
|
+
return {
|
|
136
|
+
batchId: payload.batch_id,
|
|
137
|
+
createdAt: payload.created_at,
|
|
138
|
+
failedCount: payload.failed_count,
|
|
139
|
+
matchedCount: payload.matched_count,
|
|
140
|
+
noMatchCount: payload.no_match_count,
|
|
141
|
+
possibleMatchesCount: payload.possible_matches_count,
|
|
142
|
+
status: payload.status,
|
|
143
|
+
totalFiles: payload.total_files,
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
/** Maps expense-automation transaction rows to manual-search list rows (Unmatched tab). */
|
|
147
|
+
function supportedTransactionPayloadToManualSearchResult(payload) {
|
|
148
|
+
const amountPayload = (0, transactionPayload_1.getTransactionPayloadAmount)(payload);
|
|
149
|
+
return {
|
|
150
|
+
amount: amountPayload.amount,
|
|
151
|
+
currencyCode: amountPayload.currencyCode,
|
|
152
|
+
entityId: payload.vendor_id ?? payload.customer_id ?? '',
|
|
153
|
+
memo: payload.transaction_memo ?? '',
|
|
154
|
+
transactionDate: payload.transaction_date,
|
|
155
|
+
transactionId: payload.transaction_id,
|
|
156
|
+
transactionType: payload.transaction_type,
|
|
157
|
+
vendorName: payload.vendor_name ?? '',
|
|
158
|
+
vendorLogo: (0, urlPayload_1.toURL)(payload.logo)?.href,
|
|
159
|
+
};
|
|
160
|
+
}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { Amount } from '../../../commonStateTypes/amount';
|
|
2
|
-
import { FetchStateAndError, UpdateType } from '../../../commonStateTypes/common';
|
|
2
|
+
import { FetchStateAndError, ID, UpdateType } from '../../../commonStateTypes/common';
|
|
3
|
+
import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
|
|
3
4
|
import { MonthYearPeriod, TimePeriod } from '../../../commonStateTypes/timePeriod';
|
|
4
5
|
import { TransactionPayload } from '../../../entity/transaction/payloadTypes/transactionPayload';
|
|
5
6
|
import { SupportedTransactionPayload } from '../../../entity/transaction/transactionState';
|
|
6
7
|
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
7
|
-
import { MissingReceiptsViewState, MissingReceiptsViewUIState } from '../types/missingReceiptsViewState';
|
|
8
|
+
import type { BatchDetails, BatchListItem, BatchStatus, BulkUploadResultsTab, BulkUploadSortKey, BulkUploadState, CompletedSubTab, ManualSearchResult, MissingReceiptsViewState, MissingReceiptsViewUIState } from '../types/missingReceiptsViewState';
|
|
9
|
+
import type { MonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
|
|
10
|
+
export declare const getCompletedTransactionsCacheKey: (periodId: MonthYearPeriodId, sortKey: BulkUploadSortKey, sortOrder: SortOrder, subTab: CompletedSubTab) => string;
|
|
11
|
+
export declare const initialBulkUploadState: BulkUploadState;
|
|
8
12
|
export declare const initialState: MissingReceiptsViewState;
|
|
9
13
|
export declare const fetchMissingReceipts: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, minimumTransactionAmount: Amount, cacheOverride?: any, refreshViewInBackground?: any], {
|
|
10
14
|
period: TimePeriod;
|
|
@@ -26,6 +30,69 @@ export declare const fetchMissingReceipts: import("@reduxjs/toolkit").ActionCrea
|
|
|
26
30
|
}, "expenseAutomationMissingReceiptsView/updateMissingReceiptUploadState", never, never>, updateMissingReceiptsUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<MissingReceiptsViewUIState>, "expenseAutomationMissingReceiptsView/updateMissingReceiptsUIState">, markMissingReceiptAsDone: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[transactionPayload: SupportedTransactionPayload, selectedPeriod: MonthYearPeriod], {
|
|
27
31
|
transactionPayload: SupportedTransactionPayload;
|
|
28
32
|
selectedPeriod: MonthYearPeriod;
|
|
29
|
-
}, "expenseAutomationMissingReceiptsView/markMissingReceiptAsDone", never, never>, clearExpenseAutomationMissingReceiptsView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationMissingReceiptsView/clearExpenseAutomationMissingReceiptsView"
|
|
33
|
+
}, "expenseAutomationMissingReceiptsView/markMissingReceiptAsDone", never, never>, clearExpenseAutomationMissingReceiptsView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationMissingReceiptsView/clearExpenseAutomationMissingReceiptsView">, bulkUploadReceipts: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[files: File[]], {
|
|
34
|
+
files: File[];
|
|
35
|
+
}, "expenseAutomationMissingReceiptsView/bulkUploadReceipts", never, never>, updateBulkUploadProgress: import("@reduxjs/toolkit").ActionCreatorWithPayload<number, "expenseAutomationMissingReceiptsView/updateBulkUploadProgress">, bulkUploadReceiptsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
36
|
+
batchId: ID;
|
|
37
|
+
}, "expenseAutomationMissingReceiptsView/bulkUploadReceiptsSuccess">, bulkUploadReceiptsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
38
|
+
error: ZeniAPIStatus;
|
|
39
|
+
}, "expenseAutomationMissingReceiptsView/bulkUploadReceiptsFailure">, pusherBatchStatusUpdate: import("@reduxjs/toolkit").ActionCreatorWithPayload<BatchStatus, "expenseAutomationMissingReceiptsView/pusherBatchStatusUpdate">, requestMissingReceiptsTabNavigation: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
40
|
+
tab: BulkUploadResultsTab;
|
|
41
|
+
}, "expenseAutomationMissingReceiptsView/requestMissingReceiptsTabNavigation">, clearMissingReceiptsTabNavigation: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationMissingReceiptsView/clearMissingReceiptsTabNavigation">, fetchBulkUploadBatchDetails: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationMissingReceiptsView/fetchBulkUploadBatchDetails">, fetchBulkUploadBatchDetailsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<BatchDetails, "expenseAutomationMissingReceiptsView/fetchBulkUploadBatchDetailsSuccess">, fetchBulkUploadBatchDetailsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
42
|
+
error: ZeniAPIStatus;
|
|
43
|
+
}, "expenseAutomationMissingReceiptsView/fetchBulkUploadBatchDetailsFailure">, storeBatchDetails: import("@reduxjs/toolkit").ActionCreatorWithPayload<BatchDetails, "expenseAutomationMissingReceiptsView/storeBatchDetails">, batchDetailFetchFailed: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
44
|
+
batchId: ID;
|
|
45
|
+
}, "expenseAutomationMissingReceiptsView/batchDetailFetchFailed">, setInitialBatchDetailsLoading: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationMissingReceiptsView/setInitialBatchDetailsLoading">, fetchMoreBatchDetails: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationMissingReceiptsView/fetchMoreBatchDetails">, fetchMoreBatchDetailsComplete: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationMissingReceiptsView/fetchMoreBatchDetailsComplete">, fetchMoreBatchDetailsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
46
|
+
error: ZeniAPIStatus;
|
|
47
|
+
}, "expenseAutomationMissingReceiptsView/fetchMoreBatchDetailsFailure">, fetchBulkUploadBatches: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[input?: boolean | {
|
|
48
|
+
cacheOverride?: boolean;
|
|
49
|
+
invalidateBatchDetailsCache?: boolean;
|
|
50
|
+
} | undefined], {
|
|
51
|
+
cacheOverride: boolean;
|
|
52
|
+
invalidateBatchDetailsCache: boolean;
|
|
53
|
+
}, "expenseAutomationMissingReceiptsView/fetchBulkUploadBatches", never, never>, fetchBulkUploadBatchesSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
54
|
+
batchList: BatchListItem[];
|
|
55
|
+
selectedPeriod: MonthYearPeriod;
|
|
56
|
+
}, "expenseAutomationMissingReceiptsView/fetchBulkUploadBatchesSuccess">, fetchBulkUploadBatchesFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
57
|
+
error: ZeniAPIStatus;
|
|
58
|
+
selectedPeriod: MonthYearPeriod;
|
|
59
|
+
}, "expenseAutomationMissingReceiptsView/fetchBulkUploadBatchesFailure">, confirmBulkUploadMatch: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[batchId: string, attachmentId: string, transactionId: string, transactionType: string, fileName: string], {
|
|
60
|
+
batchId: string;
|
|
61
|
+
attachmentId: string;
|
|
62
|
+
transactionId: string;
|
|
63
|
+
transactionType: string;
|
|
64
|
+
fileName: string;
|
|
65
|
+
}, "expenseAutomationMissingReceiptsView/confirmBulkUploadMatch", never, never>, confirmBulkUploadMatchSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
66
|
+
attachmentId: ID;
|
|
67
|
+
batchId: ID;
|
|
68
|
+
transactionId: ID;
|
|
69
|
+
}, "expenseAutomationMissingReceiptsView/confirmBulkUploadMatchSuccess">, confirmBulkUploadMatchFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
70
|
+
error: ZeniAPIStatus;
|
|
71
|
+
}, "expenseAutomationMissingReceiptsView/confirmBulkUploadMatchFailure">, setBulkUploadResultsTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<BulkUploadResultsTab, "expenseAutomationMissingReceiptsView/setBulkUploadResultsTab">, setBulkUploadCompletedSubTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<CompletedSubTab, "expenseAutomationMissingReceiptsView/setBulkUploadCompletedSubTab">, setBulkUploadSortConfig: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
72
|
+
sortKey: BulkUploadSortKey;
|
|
73
|
+
sortOrder: SortOrder;
|
|
74
|
+
}, "expenseAutomationMissingReceiptsView/setBulkUploadSortConfig">, clearBulkUpload: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationMissingReceiptsView/clearBulkUpload">, searchTransactionsForManualMatch: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[query: string, pageToken?: string | null | undefined], {
|
|
75
|
+
query: string;
|
|
76
|
+
pageToken: string | undefined;
|
|
77
|
+
}, "expenseAutomationMissingReceiptsView/searchTransactionsForManualMatch", never, never>, searchTransactionsForManualMatchSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
78
|
+
append: boolean;
|
|
79
|
+
nextPageToken: string | null;
|
|
80
|
+
results: ManualSearchResult[];
|
|
81
|
+
totalCount: number;
|
|
82
|
+
}, "expenseAutomationMissingReceiptsView/searchTransactionsForManualMatchSuccess">, searchTransactionsForManualMatchFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
83
|
+
error: ZeniAPIStatus;
|
|
84
|
+
}, "expenseAutomationMissingReceiptsView/searchTransactionsForManualMatchFailure">, clearManualSearchResults: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationMissingReceiptsView/clearManualSearchResults">, acknowledgeBulkUploadConfirmMatchComplete: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationMissingReceiptsView/acknowledgeBulkUploadConfirmMatchComplete">, fetchCompletedTransactions: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[pageToken?: string | undefined, cacheOverride?: boolean | undefined], {
|
|
85
|
+
pageToken: string | undefined;
|
|
86
|
+
cacheOverride: boolean | undefined;
|
|
87
|
+
}, "expenseAutomationMissingReceiptsView/fetchCompletedTransactions", never, never>, fetchCompletedTransactionsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
88
|
+
isInitialLoad: boolean;
|
|
89
|
+
nextPageToken: string | null;
|
|
90
|
+
selectedPeriod: MonthYearPeriod;
|
|
91
|
+
totalCount: number;
|
|
92
|
+
transactionIds: ID[];
|
|
93
|
+
}, "expenseAutomationMissingReceiptsView/fetchCompletedTransactionsSuccess">, fetchCompletedTransactionsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
94
|
+
error: ZeniAPIStatus;
|
|
95
|
+
selectedPeriod: MonthYearPeriod;
|
|
96
|
+
}, "expenseAutomationMissingReceiptsView/fetchCompletedTransactionsFailure">;
|
|
30
97
|
declare const _default: import("redux").Reducer<MissingReceiptsViewState>;
|
|
31
98
|
export default _default;
|