@zeniai/client-epic-state 4.19.84-betaVR15 → 4.19.84-betaVR2
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/epic.js +1 -1
- package/lib/esm/epic.js +2 -2
- package/lib/esm/index.js +3 -7
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +5 -10
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.js +1 -1
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.js +1 -1
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +4 -14
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +3 -43
- package/lib/esm/view/expenseAutomationView/payload/missingReceiptsPayload.js +9 -38
- package/lib/esm/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +22 -54
- package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +35 -57
- package/lib/esm/view/expenseAutomationView/types/missingReceiptsViewState.js +0 -39
- package/lib/index.d.ts +3 -4
- package/lib/index.js +33 -48
- package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.d.ts +0 -3
- package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +3 -8
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.js +1 -1
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.js +1 -1
- package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +3 -13
- package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.d.ts +2 -14
- package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +3 -44
- package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.d.ts +1 -12
- package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.js +9 -39
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +5 -11
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +22 -54
- package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +35 -57
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +9 -27
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.js +1 -49
- package/package.json +1 -1
- package/lib/esm/view/expenseAutomationView/bulkUploadTiming.js +0 -10
- package/lib/view/expenseAutomationView/bulkUploadTiming.d.ts +0 -10
- package/lib/view/expenseAutomationView/bulkUploadTiming.js +0 -13
|
@@ -3,6 +3,7 @@ import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderType
|
|
|
3
3
|
import { MonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
|
|
4
4
|
export declare const toMissingReceiptsSortKey: (v: string) => "date" | "amount" | "vendor" | "category" | "class";
|
|
5
5
|
export type MissingReceiptsSortKey = ReturnType<typeof toMissingReceiptsSortKey>;
|
|
6
|
+
export type BulkUploadSortKey = 'amount' | 'category' | 'class' | 'date' | 'vendor';
|
|
6
7
|
export interface MissingReceiptsViewUIState {
|
|
7
8
|
scrollPosition: {
|
|
8
9
|
scrollTop: number;
|
|
@@ -12,31 +13,13 @@ export interface MissingReceiptsViewUIState {
|
|
|
12
13
|
sortKey: MissingReceiptsSortKey;
|
|
13
14
|
sortOrder: SortOrder;
|
|
14
15
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
export
|
|
20
|
-
export
|
|
21
|
-
export type
|
|
22
|
-
/** Canonical batch file statuses (API ingress may use aliases; see `parseBatchFileStatus`). */
|
|
23
|
-
export declare const BATCH_FILE_STATUSES: readonly ["exact_match", "possible_matches", "no_match", "failed"];
|
|
24
|
-
export declare const toBatchFileStatus: (v: string) => "failed" | "exact_match" | "possible_matches" | "no_match";
|
|
25
|
-
export type BatchFileStatus = ReturnType<typeof toBatchFileStatus>;
|
|
26
|
-
/** True for files that belong in the Unmatched tab (possible matches or no match). */
|
|
27
|
-
export declare function isUnmatchedTabFileStatus(status: BatchFileStatus): boolean;
|
|
28
|
-
export declare const toBulkUploadPhase: (v: string) => "completed" | "idle" | "uploading" | "matching";
|
|
29
|
-
export type BulkUploadPhase = ReturnType<typeof toBulkUploadPhase>;
|
|
30
|
-
export declare const toBulkUploadResultsTab: (v: string) => "completed" | "unmatched";
|
|
31
|
-
export type BulkUploadResultsTab = ReturnType<typeof toBulkUploadResultsTab>;
|
|
32
|
-
export declare const toMissingReceiptsTab: (v: string) => "completed" | "unmatched" | "missing";
|
|
33
|
-
export type MissingReceiptsTab = ReturnType<typeof toMissingReceiptsTab>;
|
|
34
|
-
export declare const toCompletedSubTab: (v: string) => "all" | "manual" | "ai_accountant";
|
|
35
|
-
export type CompletedSubTab = ReturnType<typeof toCompletedSubTab>;
|
|
36
|
-
export declare const toMatchSource: (v: string) => "manual" | "ai";
|
|
37
|
-
export type MatchSource = ReturnType<typeof toMatchSource>;
|
|
38
|
-
export declare const toBulkUploadSortKey: (v: string) => "date" | "amount" | "vendor" | "category" | "class";
|
|
39
|
-
export type BulkUploadSortKey = ReturnType<typeof toBulkUploadSortKey>;
|
|
16
|
+
export type BatchStatusValue = 'pending' | 'processing' | 'completed';
|
|
17
|
+
export type BatchFileStatus = 'matched' | 'un_matched' | 'no_match' | 'failed';
|
|
18
|
+
export type BulkUploadPhase = 'idle' | 'uploading' | 'matching' | 'completed';
|
|
19
|
+
export type BulkUploadResultsTab = 'completed' | 'unmatched';
|
|
20
|
+
export type MissingReceiptsTab = 'missing' | BulkUploadResultsTab;
|
|
21
|
+
export type CompletedSubTab = 'all' | 'ai_accountant' | 'manual';
|
|
22
|
+
export type MatchSource = 'ai' | 'manual';
|
|
40
23
|
export interface CandidateRef {
|
|
41
24
|
matchScore: number;
|
|
42
25
|
transactionId: ID;
|
|
@@ -116,8 +99,7 @@ export interface ManualSearchState {
|
|
|
116
99
|
searchQuery: string;
|
|
117
100
|
totalCount: number;
|
|
118
101
|
}
|
|
119
|
-
|
|
120
|
-
export type CompletedTransactionsMatchType = CompletedSubTab;
|
|
102
|
+
export type CompletedTransactionsMatchType = 'all' | 'ai_accountant' | 'manual';
|
|
121
103
|
export interface CompletedTransactionsState {
|
|
122
104
|
fetchState: FetchStateAndError;
|
|
123
105
|
nextPageToken: string | null;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.isUnmatchedTabFileStatus = isUnmatchedTabFileStatus;
|
|
3
|
+
exports.toMissingReceiptsSortKey = void 0;
|
|
5
4
|
const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
|
|
6
5
|
const MISSING_RECEIPTS_SORT_KEYS = [
|
|
7
6
|
'vendor',
|
|
@@ -12,50 +11,3 @@ const MISSING_RECEIPTS_SORT_KEYS = [
|
|
|
12
11
|
];
|
|
13
12
|
const toMissingReceiptsSortKey = (v) => (0, stringToUnion_1.stringToUnion)(v, MISSING_RECEIPTS_SORT_KEYS);
|
|
14
13
|
exports.toMissingReceiptsSortKey = toMissingReceiptsSortKey;
|
|
15
|
-
// -- Bulk Receipt Upload Types --
|
|
16
|
-
/**
|
|
17
|
-
* Minimum trimmed query length before manual-match search calls the expense-automation API.
|
|
18
|
-
* Kept in sync with `ManualSearchInput` in web-components (fires search only when length ≥ this).
|
|
19
|
-
*/
|
|
20
|
-
exports.MIN_MANUAL_TRANSACTION_SEARCH_LENGTH = 2;
|
|
21
|
-
const BATCH_STATUS_VALUES = ['pending', 'processing', 'completed'];
|
|
22
|
-
const toBatchStatusValue = (v) => (0, stringToUnion_1.stringToUnion)(v.trim().toLowerCase(), BATCH_STATUS_VALUES);
|
|
23
|
-
exports.toBatchStatusValue = toBatchStatusValue;
|
|
24
|
-
/** Canonical batch file statuses (API ingress may use aliases; see `parseBatchFileStatus`). */
|
|
25
|
-
exports.BATCH_FILE_STATUSES = [
|
|
26
|
-
'exact_match',
|
|
27
|
-
'possible_matches',
|
|
28
|
-
'no_match',
|
|
29
|
-
'failed',
|
|
30
|
-
];
|
|
31
|
-
const toBatchFileStatus = (v) => (0, stringToUnion_1.stringToUnion)(v.trim().toLowerCase().replace(/-/g, '_'), exports.BATCH_FILE_STATUSES);
|
|
32
|
-
exports.toBatchFileStatus = toBatchFileStatus;
|
|
33
|
-
const UNMATCHED_TAB_FILE_STATUSES = ['possible_matches', 'no_match'];
|
|
34
|
-
/** True for files that belong in the Unmatched tab (possible matches or no match). */
|
|
35
|
-
function isUnmatchedTabFileStatus(status) {
|
|
36
|
-
return UNMATCHED_TAB_FILE_STATUSES.includes(status);
|
|
37
|
-
}
|
|
38
|
-
const BULK_UPLOAD_PHASES = ['idle', 'uploading', 'matching', 'completed'];
|
|
39
|
-
const toBulkUploadPhase = (v) => (0, stringToUnion_1.stringToUnion)(v.trim().toLowerCase(), BULK_UPLOAD_PHASES);
|
|
40
|
-
exports.toBulkUploadPhase = toBulkUploadPhase;
|
|
41
|
-
const BULK_UPLOAD_RESULTS_TABS = ['completed', 'unmatched'];
|
|
42
|
-
const toBulkUploadResultsTab = (v) => (0, stringToUnion_1.stringToUnion)(v.trim().toLowerCase(), BULK_UPLOAD_RESULTS_TABS);
|
|
43
|
-
exports.toBulkUploadResultsTab = toBulkUploadResultsTab;
|
|
44
|
-
const MISSING_RECEIPTS_TABS = ['missing', 'completed', 'unmatched'];
|
|
45
|
-
const toMissingReceiptsTab = (v) => (0, stringToUnion_1.stringToUnion)(v.trim().toLowerCase(), MISSING_RECEIPTS_TABS);
|
|
46
|
-
exports.toMissingReceiptsTab = toMissingReceiptsTab;
|
|
47
|
-
const COMPLETED_SUB_TABS = ['all', 'ai_accountant', 'manual'];
|
|
48
|
-
const toCompletedSubTab = (v) => (0, stringToUnion_1.stringToUnion)(v.trim().toLowerCase(), COMPLETED_SUB_TABS);
|
|
49
|
-
exports.toCompletedSubTab = toCompletedSubTab;
|
|
50
|
-
const MATCH_SOURCES = ['ai', 'manual'];
|
|
51
|
-
const toMatchSource = (v) => (0, stringToUnion_1.stringToUnion)(v.trim().toLowerCase(), MATCH_SOURCES);
|
|
52
|
-
exports.toMatchSource = toMatchSource;
|
|
53
|
-
const BULK_UPLOAD_SORT_KEYS = [
|
|
54
|
-
'amount',
|
|
55
|
-
'category',
|
|
56
|
-
'class',
|
|
57
|
-
'date',
|
|
58
|
-
'vendor',
|
|
59
|
-
];
|
|
60
|
-
const toBulkUploadSortKey = (v) => (0, stringToUnion_1.stringToUnion)(v.trim().toLowerCase(), BULK_UPLOAD_SORT_KEYS);
|
|
61
|
-
exports.toBulkUploadSortKey = toBulkUploadSortKey;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.19.84-
|
|
3
|
+
"version": "4.19.84-betaVR2",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* After upload API success, hold the bar at 100% this long before transitioning to matching,
|
|
3
|
-
* so the fill animation can complete without an abrupt swap to the auto-matching banner.
|
|
4
|
-
*/
|
|
5
|
-
export const BULK_UPLOAD_BAR_COMPLETE_HOLD_MS = 400;
|
|
6
|
-
/**
|
|
7
|
-
* Max wall-clock wait for Pusher + batch-details resolution after upload. If exceeded, we stop
|
|
8
|
-
* fallback polling, clear the automatching banner (`phase` → completed), and refresh batch list.
|
|
9
|
-
*/
|
|
10
|
-
export const BULK_UPLOAD_AUTOMATCHING_TIMEOUT_MS = 300000;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* After upload API success, hold the bar at 100% this long before transitioning to matching,
|
|
3
|
-
* so the fill animation can complete without an abrupt swap to the auto-matching banner.
|
|
4
|
-
*/
|
|
5
|
-
export declare const BULK_UPLOAD_BAR_COMPLETE_HOLD_MS = 400;
|
|
6
|
-
/**
|
|
7
|
-
* Max wall-clock wait for Pusher + batch-details resolution after upload. If exceeded, we stop
|
|
8
|
-
* fallback polling, clear the automatching banner (`phase` → completed), and refresh batch list.
|
|
9
|
-
*/
|
|
10
|
-
export declare const BULK_UPLOAD_AUTOMATCHING_TIMEOUT_MS = 300000;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BULK_UPLOAD_AUTOMATCHING_TIMEOUT_MS = exports.BULK_UPLOAD_BAR_COMPLETE_HOLD_MS = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* After upload API success, hold the bar at 100% this long before transitioning to matching,
|
|
6
|
-
* so the fill animation can complete without an abrupt swap to the auto-matching banner.
|
|
7
|
-
*/
|
|
8
|
-
exports.BULK_UPLOAD_BAR_COMPLETE_HOLD_MS = 400;
|
|
9
|
-
/**
|
|
10
|
-
* Max wall-clock wait for Pusher + batch-details resolution after upload. If exceeded, we stop
|
|
11
|
-
* fallback polling, clear the automatching banner (`phase` → completed), and refresh batch list.
|
|
12
|
-
*/
|
|
13
|
-
exports.BULK_UPLOAD_AUTOMATCHING_TIMEOUT_MS = 300000;
|