@zeniai/client-epic-state 4.19.84-betaVR1 → 4.19.84-betaVR11
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/esm/index.js +4 -1
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +7 -3
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.js +1 -1
- 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 +14 -4
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +20 -3
- package/lib/esm/view/expenseAutomationView/payload/missingReceiptsPayload.js +38 -9
- package/lib/esm/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +25 -14
- package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +32 -31
- package/lib/esm/view/expenseAutomationView/types/missingReceiptsViewState.js +39 -0
- package/lib/index.d.ts +2 -2
- package/lib/index.js +44 -33
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +7 -3
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.js +1 -1
- 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 +13 -3
- package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.d.ts +7 -1
- package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +20 -3
- package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.d.ts +12 -1
- package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.js +39 -9
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +3 -3
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +25 -14
- package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +32 -31
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +27 -9
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.js +49 -1
- package/package.json +2 -2
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toMissingReceiptsSortKey = void 0;
|
|
3
|
+
exports.toBulkUploadSortKey = exports.toMatchSource = exports.toCompletedSubTab = exports.toMissingReceiptsTab = exports.toBulkUploadResultsTab = exports.toBulkUploadPhase = exports.toBatchFileStatus = exports.BATCH_FILE_STATUSES = exports.toBatchStatusValue = exports.MIN_MANUAL_TRANSACTION_SEARCH_LENGTH = exports.toMissingReceiptsSortKey = void 0;
|
|
4
|
+
exports.isUnmatchedTabFileStatus = isUnmatchedTabFileStatus;
|
|
4
5
|
const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
|
|
5
6
|
const MISSING_RECEIPTS_SORT_KEYS = [
|
|
6
7
|
'vendor',
|
|
@@ -11,3 +12,50 @@ const MISSING_RECEIPTS_SORT_KEYS = [
|
|
|
11
12
|
];
|
|
12
13
|
const toMissingReceiptsSortKey = (v) => (0, stringToUnion_1.stringToUnion)(v, MISSING_RECEIPTS_SORT_KEYS);
|
|
13
14
|
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-betaVR11",
|
|
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",
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"find-dead-code": "ts-prune | grep -v '(used in module)'",
|
|
112
112
|
"find-unused-exports": "ts-unused-exports ./tsconfig.json",
|
|
113
113
|
"circular-dependency": "npx madge --circular --extensions ts ./src",
|
|
114
|
-
"build": "concurrently --kill-others-on-fail --handle-input \"echo 'Running ESLint...' && eslint . --ext .js,.jsx,.ts,.tsx\" \"echo 'TypeScript build in progress...' && time tsc && echo 'ESM build...' && tsc -p tsconfig.esm.json\"",
|
|
114
|
+
"build": "concurrently --kill-others-on-fail --handle-input \"echo 'Running ESLint...' && eslint . --ext .js,.jsx,.ts,.tsx\" \"echo 'TypeScript build in progress...' && time tsc && echo 'ESM build...' && tsc -p tsconfig.esm.json\" \"echo 'Running tests and typecheck...' && pnpm test\" && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
|
|
115
115
|
"only-build": "eslint . --ext .js,.jsx,.ts,.tsx && time tsc && tsc -p tsconfig.esm.json && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
|
|
116
116
|
"only-build-dev": "eslint . --ext .js,.jsx,.ts,.tsx && time tsc -p tsconfig.dev.json && tsc -p tsconfig.esm.dev.json && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
|
|
117
117
|
"format": "prettier --write --ignore-unknown \"src/**/*\" && pnpm lint",
|