@zeniai/client-epic-state 4.19.83 → 4.19.84-betaVR10
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/company/companyPayload.d.ts +13 -0
- package/lib/entity/company/companyPayload.js +21 -0
- package/lib/entity/company/companyStateTypes.d.ts +13 -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/chargeCardTransaction/chargeCardTransactionPayload.js +2 -2
- package/lib/esm/entity/company/companyPayload.js +21 -0
- package/lib/esm/entity/snackbar/snackbarTypes.js +1 -0
- package/lib/esm/epic.js +12 -1
- package/lib/esm/index.js +13 -8
- package/lib/esm/view/companyView/epic/companyPassport/updateCompanyDetailsEpic.js +6 -0
- package/lib/esm/view/companyView/types/companyPassport/companyPassportLocalData.js +13 -0
- package/lib/esm/view/companyView/types/companyPassportViewPayload.js +55 -12
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +28 -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 +78 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/uploadMissingReceiptSuccessEpic.js +7 -5
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +59 -0
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/triggerReviewTabRefetchEpic.js +2 -3
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.js +24 -0
- package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
- package/lib/esm/view/expenseAutomationView/payload/missingReceiptsPayload.js +173 -1
- package/lib/esm/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +412 -1
- package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +20 -1
- package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +225 -1
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +2 -1
- package/lib/esm/view/expenseAutomationView/types/missingReceiptsViewState.js +10 -0
- package/lib/esm/view/expenseAutomationView/types/transactionsViewState.js +2 -1
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewSelector.js +22 -4
- package/lib/esm/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryDownloadSelector.js +2 -2
- package/lib/esm/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistorySelector.js +2 -2
- package/lib/esm/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailSelector.js +4 -1
- package/lib/esm/view/spendManagement/chargeCards/chargeCardRepaymentDetail/fetchChargeCardRepaymentDetailEpic.js +2 -1
- package/lib/esm/view/spendManagement/chargeCards/chargeCardRepaymentDetail/initiateChargeCardRepaymentEpic.js +1 -1
- package/lib/esm/view/spendManagement/commonSetup/epic/setup/updateBusinessVerificationDetailsEpic.js +67 -1
- package/lib/esm/view/spendManagement/commonSetup/epic/setup/updateSetupViewLocalStoreDataEpic.js +16 -2
- package/lib/esm/view/spendManagement/commonSetup/setupViewSelector.js +15 -1
- package/lib/esm/view/spendManagement/commonSetup/types/businessVerification.js +148 -1
- package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +1 -1
- package/lib/esm/zeniAPI.js +0 -2
- package/lib/index.d.ts +14 -9
- package/lib/index.js +90 -45
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -0
- package/lib/view/companyView/epic/companyPassport/updateCompanyDetailsEpic.js +6 -0
- package/lib/view/companyView/types/companyPassport/companyDetailsLocalData.d.ts +13 -0
- package/lib/view/companyView/types/companyPassport/companyPassportLocalData.js +13 -0
- package/lib/view/companyView/types/companyPassportViewPayload.d.ts +1 -1
- package/lib/view/companyView/types/companyPassportViewPayload.js +55 -12
- package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.d.ts +15 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +32 -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 +82 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/uploadMissingReceiptSuccessEpic.js +7 -5
- package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.d.ts +19 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +64 -0
- package/lib/view/expenseAutomationView/epics/transactionCategorization/triggerReviewTabRefetchEpic.js +2 -3
- 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/helpers/transactionCategorizationLocalDataHelper.js +2 -2
- package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.d.ts +118 -0
- package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.js +185 -0
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +70 -3
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +414 -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 +224 -0
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +2 -1
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +131 -0
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.js +12 -1
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +2 -1
- package/lib/view/expenseAutomationView/types/transactionsViewState.js +2 -1
- package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.d.ts +1 -0
- package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.js +22 -3
- package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryDownloadSelector.js +2 -2
- package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistorySelector.js +2 -2
- package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailSelector.js +4 -1
- package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/fetchChargeCardRepaymentDetailEpic.js +2 -1
- package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/initiateChargeCardRepaymentEpic.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/initiateChargeCardRepaymentEpic.js +1 -1
- package/lib/view/spendManagement/commonSetup/epic/setup/updateBusinessVerificationDetailsEpic.js +67 -1
- package/lib/view/spendManagement/commonSetup/epic/setup/updateSetupViewLocalStoreDataEpic.js +16 -2
- package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +14 -0
- package/lib/view/spendManagement/commonSetup/setupViewSelector.js +15 -1
- package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +14 -0
- package/lib/view/spendManagement/commonSetup/types/businessVerification.d.ts +43 -0
- package/lib/view/spendManagement/commonSetup/types/businessVerification.js +150 -0
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +1 -1
- package/lib/zeniAPI.js +0 -2
- package/package.json +1 -1
|
@@ -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, type BatchListItem, type BatchStatus, type BulkUploadResultsTab, type BulkUploadSortKey, type BulkUploadState, type CompletedSubTab, type ManualSearchResult, type MissingReceiptsViewState, type 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?: {
|
|
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;
|
|
@@ -1,10 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.clearExpenseAutomationMissingReceiptsView = exports.markMissingReceiptAsDone = exports.updateMissingReceiptsUIState = exports.updateMissingReceiptUploadState = exports.uploadMissingReceiptSuccess = exports.fetchMissingReceiptsFailure = exports.fetchMissingReceiptsSuccess = exports.fetchMissingReceipts = exports.initialState = void 0;
|
|
4
|
+
exports.fetchCompletedTransactionsFailure = exports.fetchCompletedTransactionsSuccess = exports.fetchCompletedTransactions = exports.acknowledgeBulkUploadConfirmMatchComplete = exports.clearManualSearchResults = exports.searchTransactionsForManualMatchFailure = exports.searchTransactionsForManualMatchSuccess = exports.searchTransactionsForManualMatch = exports.clearBulkUpload = exports.setBulkUploadSortConfig = exports.setBulkUploadCompletedSubTab = exports.setBulkUploadResultsTab = exports.confirmBulkUploadMatchFailure = exports.confirmBulkUploadMatchSuccess = exports.confirmBulkUploadMatch = exports.fetchBulkUploadBatchesFailure = exports.fetchBulkUploadBatchesSuccess = exports.fetchBulkUploadBatches = exports.fetchMoreBatchDetailsFailure = exports.fetchMoreBatchDetailsComplete = exports.fetchMoreBatchDetails = exports.setInitialBatchDetailsLoading = exports.batchDetailFetchFailed = exports.storeBatchDetails = exports.fetchBulkUploadBatchDetailsFailure = exports.fetchBulkUploadBatchDetailsSuccess = exports.fetchBulkUploadBatchDetails = exports.clearMissingReceiptsTabNavigation = exports.requestMissingReceiptsTabNavigation = exports.pusherBatchStatusUpdate = exports.bulkUploadReceiptsFailure = exports.bulkUploadReceiptsSuccess = exports.updateBulkUploadProgress = exports.bulkUploadReceipts = exports.clearExpenseAutomationMissingReceiptsView = exports.markMissingReceiptAsDone = exports.updateMissingReceiptsUIState = exports.updateMissingReceiptUploadState = exports.uploadMissingReceiptSuccess = exports.fetchMissingReceiptsFailure = exports.fetchMissingReceiptsSuccess = exports.fetchMissingReceipts = exports.initialState = exports.initialBulkUploadState = exports.getCompletedTransactionsCacheKey = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
|
|
7
|
+
const missingReceiptsViewState_1 = require("../types/missingReceiptsViewState");
|
|
8
|
+
const getCompletedTransactionsCacheKey = (periodId, sortKey, sortOrder, subTab) => `completed-${subTab}-${sortKey}-${sortOrder === 'ascending' ? 'asc' : 'desc'}-${periodId}`;
|
|
9
|
+
exports.getCompletedTransactionsCacheKey = getCompletedTransactionsCacheKey;
|
|
10
|
+
exports.initialBulkUploadState = {
|
|
11
|
+
batchDetailsById: {},
|
|
12
|
+
batchDetailsPaginationState: { fetchState: 'Not-Started', error: undefined },
|
|
13
|
+
batchListByPeriod: {},
|
|
14
|
+
batchListFetchState: { fetchState: 'Not-Started', error: undefined },
|
|
15
|
+
batchStatusById: {},
|
|
16
|
+
completedSubTab: 'all',
|
|
17
|
+
completedTransactionsByPeriod: {},
|
|
18
|
+
confirmMatchStatus: { fetchState: 'Not-Started', error: undefined },
|
|
19
|
+
currentBatchId: undefined,
|
|
20
|
+
currentResultsTab: 'unmatched',
|
|
21
|
+
failedBatchDetailIds: [],
|
|
22
|
+
manualSearchUiResetKey: 0,
|
|
23
|
+
manualSearch: {
|
|
24
|
+
fetchState: { fetchState: 'Not-Started', error: undefined },
|
|
25
|
+
isLoadingMore: false,
|
|
26
|
+
nextPageToken: null,
|
|
27
|
+
pageSize: 25,
|
|
28
|
+
results: [],
|
|
29
|
+
searchQuery: '',
|
|
30
|
+
totalCount: 0,
|
|
31
|
+
},
|
|
32
|
+
phase: 'idle',
|
|
33
|
+
sortKey: 'date',
|
|
34
|
+
sortOrder: 'descending',
|
|
35
|
+
uploadProgress: 0,
|
|
36
|
+
uploadStatus: { fetchState: 'Not-Started', error: undefined },
|
|
37
|
+
};
|
|
7
38
|
exports.initialState = {
|
|
39
|
+
bulkUpload: exports.initialBulkUploadState,
|
|
40
|
+
pendingMissingReceiptsTabNavigation: null,
|
|
8
41
|
uploadReceiptStatusById: {},
|
|
9
42
|
refreshStatus: {
|
|
10
43
|
fetchState: 'Not-Started',
|
|
@@ -124,7 +157,386 @@ const expenseAutomationMissingReceiptsView = (0, toolkit_1.createSlice)({
|
|
|
124
157
|
clearExpenseAutomationMissingReceiptsView(draft) {
|
|
125
158
|
Object.assign(draft, exports.initialState);
|
|
126
159
|
},
|
|
160
|
+
// -- Bulk Upload Actions --
|
|
161
|
+
bulkUploadReceipts: {
|
|
162
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
163
|
+
reducer(draft, _action) {
|
|
164
|
+
draft.bulkUpload.phase = 'uploading';
|
|
165
|
+
draft.bulkUpload.uploadProgress = 0;
|
|
166
|
+
draft.bulkUpload.uploadStatus = {
|
|
167
|
+
fetchState: 'In-Progress',
|
|
168
|
+
error: undefined,
|
|
169
|
+
};
|
|
170
|
+
},
|
|
171
|
+
prepare(files) {
|
|
172
|
+
return { payload: { files } };
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
updateBulkUploadProgress(draft, action) {
|
|
176
|
+
draft.bulkUpload.uploadProgress = action.payload;
|
|
177
|
+
},
|
|
178
|
+
bulkUploadReceiptsSuccess(draft, action) {
|
|
179
|
+
draft.bulkUpload.currentBatchId = action.payload.batchId;
|
|
180
|
+
draft.bulkUpload.uploadStatus = {
|
|
181
|
+
fetchState: 'Completed',
|
|
182
|
+
error: undefined,
|
|
183
|
+
};
|
|
184
|
+
draft.bulkUpload.phase = 'matching';
|
|
185
|
+
},
|
|
186
|
+
bulkUploadReceiptsFailure(draft, action) {
|
|
187
|
+
draft.bulkUpload.uploadStatus = {
|
|
188
|
+
fetchState: 'Error',
|
|
189
|
+
error: action.payload.error,
|
|
190
|
+
};
|
|
191
|
+
draft.bulkUpload.phase = 'idle';
|
|
192
|
+
},
|
|
193
|
+
pusherBatchStatusUpdate(draft, action) {
|
|
194
|
+
const batchStatus = action.payload;
|
|
195
|
+
draft.bulkUpload.batchStatusById[batchStatus.batchId] = batchStatus;
|
|
196
|
+
/**
|
|
197
|
+
* Auto-matching banner (`phase === 'matching'`) must clear when the server reports this
|
|
198
|
+
* upload batch is done — otherwise the Missing tab keeps MatchingProgressBanner until
|
|
199
|
+
* batch-details APIs run; EmailUploadBanner should show again for the next upload.
|
|
200
|
+
*/
|
|
201
|
+
if (batchStatus.status === 'completed' &&
|
|
202
|
+
draft.bulkUpload.phase === 'matching' &&
|
|
203
|
+
draft.bulkUpload.currentBatchId === batchStatus.batchId) {
|
|
204
|
+
draft.bulkUpload.phase = 'completed';
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
requestMissingReceiptsTabNavigation(draft, action) {
|
|
208
|
+
draft.pendingMissingReceiptsTabNavigation = action.payload.tab;
|
|
209
|
+
},
|
|
210
|
+
clearMissingReceiptsTabNavigation(draft) {
|
|
211
|
+
draft.pendingMissingReceiptsTabNavigation = null;
|
|
212
|
+
},
|
|
213
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
214
|
+
fetchBulkUploadBatchDetails(_draft) {
|
|
215
|
+
// trigger epic, no state change needed
|
|
216
|
+
},
|
|
217
|
+
fetchBulkUploadBatchDetailsSuccess(draft, action) {
|
|
218
|
+
const details = action.payload;
|
|
219
|
+
draft.bulkUpload.batchDetailsById[details.batchId] = details;
|
|
220
|
+
draft.bulkUpload.phase = 'completed';
|
|
221
|
+
},
|
|
222
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
223
|
+
fetchBulkUploadBatchDetailsFailure(draft, _action) {
|
|
224
|
+
draft.bulkUpload.phase = 'completed';
|
|
225
|
+
},
|
|
226
|
+
storeBatchDetails(draft, action) {
|
|
227
|
+
const details = action.payload;
|
|
228
|
+
draft.bulkUpload.batchDetailsById[details.batchId] = details;
|
|
229
|
+
/**
|
|
230
|
+
* Multi-batch fetch paths use `storeBatchDetails` (not `fetchBulkUploadBatchDetailsSuccess`).
|
|
231
|
+
* Without this, `phase` stays `matching` after upload forever and the Unmatched tab keeps
|
|
232
|
+
* showing the skeleton (`bulkUploadPhase === 'matching'` in web-components).
|
|
233
|
+
*/
|
|
234
|
+
if (draft.bulkUpload.phase === 'matching' &&
|
|
235
|
+
draft.bulkUpload.currentBatchId === details.batchId) {
|
|
236
|
+
draft.bulkUpload.phase = 'completed';
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
batchDetailFetchFailed(draft, action) {
|
|
240
|
+
const { batchId } = action.payload;
|
|
241
|
+
if (!draft.bulkUpload.failedBatchDetailIds.includes(batchId)) {
|
|
242
|
+
draft.bulkUpload.failedBatchDetailIds.push(batchId);
|
|
243
|
+
}
|
|
244
|
+
if (draft.bulkUpload.phase === 'matching' &&
|
|
245
|
+
draft.bulkUpload.currentBatchId === batchId) {
|
|
246
|
+
draft.bulkUpload.phase = 'completed';
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
setInitialBatchDetailsLoading(draft) {
|
|
250
|
+
draft.bulkUpload.batchDetailsPaginationState = {
|
|
251
|
+
fetchState: 'In-Progress',
|
|
252
|
+
error: undefined,
|
|
253
|
+
};
|
|
254
|
+
},
|
|
255
|
+
fetchMoreBatchDetails(_draft) {
|
|
256
|
+
_draft.bulkUpload.batchDetailsPaginationState = {
|
|
257
|
+
fetchState: 'In-Progress',
|
|
258
|
+
error: undefined,
|
|
259
|
+
};
|
|
260
|
+
},
|
|
261
|
+
fetchMoreBatchDetailsComplete(draft) {
|
|
262
|
+
draft.bulkUpload.batchDetailsPaginationState = {
|
|
263
|
+
fetchState: 'Completed',
|
|
264
|
+
error: undefined,
|
|
265
|
+
};
|
|
266
|
+
const currentId = draft.bulkUpload.currentBatchId;
|
|
267
|
+
const currentDetails = currentId != null
|
|
268
|
+
? draft.bulkUpload.batchDetailsById[currentId]
|
|
269
|
+
: undefined;
|
|
270
|
+
if (draft.bulkUpload.phase === 'matching' &&
|
|
271
|
+
currentId != null &&
|
|
272
|
+
currentDetails?.status === 'completed') {
|
|
273
|
+
draft.bulkUpload.phase = 'completed';
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
fetchMoreBatchDetailsFailure(draft, action) {
|
|
277
|
+
draft.bulkUpload.batchDetailsPaginationState = {
|
|
278
|
+
fetchState: 'Error',
|
|
279
|
+
error: action.payload.error,
|
|
280
|
+
};
|
|
281
|
+
},
|
|
282
|
+
fetchBulkUploadBatches: {
|
|
283
|
+
reducer(draft, action) {
|
|
284
|
+
if (action.payload.invalidateBatchDetailsCache === true) {
|
|
285
|
+
draft.bulkUpload.batchDetailsById = {};
|
|
286
|
+
draft.bulkUpload.failedBatchDetailIds = [];
|
|
287
|
+
}
|
|
288
|
+
draft.bulkUpload.batchListFetchState = {
|
|
289
|
+
fetchState: 'In-Progress',
|
|
290
|
+
error: undefined,
|
|
291
|
+
};
|
|
292
|
+
},
|
|
293
|
+
prepare(input) {
|
|
294
|
+
const o = input ?? {};
|
|
295
|
+
return {
|
|
296
|
+
payload: {
|
|
297
|
+
cacheOverride: o.cacheOverride === true,
|
|
298
|
+
invalidateBatchDetailsCache: o.invalidateBatchDetailsCache === true,
|
|
299
|
+
},
|
|
300
|
+
};
|
|
301
|
+
},
|
|
302
|
+
},
|
|
303
|
+
fetchBulkUploadBatchesSuccess(draft, action) {
|
|
304
|
+
const periodId = (0, timePeriod_1.toMonthYearPeriodId)(action.payload.selectedPeriod);
|
|
305
|
+
draft.bulkUpload.batchListByPeriod[periodId] = action.payload.batchList;
|
|
306
|
+
draft.bulkUpload.batchListFetchState = {
|
|
307
|
+
fetchState: 'Completed',
|
|
308
|
+
error: undefined,
|
|
309
|
+
};
|
|
310
|
+
/**
|
|
311
|
+
* When the multi-batch-details epic has nothing to fetch (e.g. list rows not `completed`
|
|
312
|
+
* yet, or details already present), `phase` can stay `matching` even though we already
|
|
313
|
+
* have completed details for `currentBatchId` (from polling / Pusher). Sync so the UI can
|
|
314
|
+
* dismiss the Unmatched skeleton.
|
|
315
|
+
*/
|
|
316
|
+
const currentId = draft.bulkUpload.currentBatchId;
|
|
317
|
+
if (draft.bulkUpload.phase === 'matching' &&
|
|
318
|
+
currentId != null) {
|
|
319
|
+
const existing = draft.bulkUpload.batchDetailsById[currentId];
|
|
320
|
+
if (existing?.status === 'completed') {
|
|
321
|
+
draft.bulkUpload.phase = 'completed';
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
fetchBulkUploadBatchesFailure(draft, action) {
|
|
326
|
+
draft.bulkUpload.batchListFetchState = {
|
|
327
|
+
fetchState: 'Error',
|
|
328
|
+
error: action.payload.error,
|
|
329
|
+
};
|
|
330
|
+
},
|
|
331
|
+
confirmBulkUploadMatch: {
|
|
332
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
333
|
+
reducer(draft, _action) {
|
|
334
|
+
draft.bulkUpload.confirmMatchStatus = {
|
|
335
|
+
fetchState: 'In-Progress',
|
|
336
|
+
error: undefined,
|
|
337
|
+
};
|
|
338
|
+
},
|
|
339
|
+
prepare(batchId, attachmentId, transactionId, transactionType, fileName) {
|
|
340
|
+
return { payload: { batchId, attachmentId, transactionId, transactionType, fileName } };
|
|
341
|
+
},
|
|
342
|
+
},
|
|
343
|
+
confirmBulkUploadMatchSuccess(draft, action) {
|
|
344
|
+
const { batchId, attachmentId, transactionId } = action.payload;
|
|
345
|
+
draft.bulkUpload.confirmMatchStatus = {
|
|
346
|
+
fetchState: 'Completed',
|
|
347
|
+
error: undefined,
|
|
348
|
+
};
|
|
349
|
+
const details = draft.bulkUpload.batchDetailsById[batchId];
|
|
350
|
+
if (details != null) {
|
|
351
|
+
const file = details.files.find((f) => f.attachmentId === attachmentId);
|
|
352
|
+
if (file != null) {
|
|
353
|
+
const originalStatus = file.status;
|
|
354
|
+
file.status = 'exact_match';
|
|
355
|
+
file.matchedTransactionId = transactionId;
|
|
356
|
+
file.candidates = undefined;
|
|
357
|
+
details.summary.matched += 1;
|
|
358
|
+
if (originalStatus === 'no_match') {
|
|
359
|
+
details.summary.noMatch = Math.max(0, details.summary.noMatch - 1);
|
|
360
|
+
}
|
|
361
|
+
else if (originalStatus === 'possible_matches') {
|
|
362
|
+
details.summary.possibleMatches = Math.max(0, details.summary.possibleMatches - 1);
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
draft.bulkUpload.manualSearch = exports.initialBulkUploadState.manualSearch;
|
|
367
|
+
draft.bulkUpload.manualSearchUiResetKey += 1;
|
|
368
|
+
},
|
|
369
|
+
confirmBulkUploadMatchFailure(draft, action) {
|
|
370
|
+
draft.bulkUpload.confirmMatchStatus = {
|
|
371
|
+
fetchState: 'Error',
|
|
372
|
+
error: action.payload.error,
|
|
373
|
+
};
|
|
374
|
+
},
|
|
375
|
+
setBulkUploadResultsTab(draft, action) {
|
|
376
|
+
draft.bulkUpload.currentResultsTab = action.payload;
|
|
377
|
+
},
|
|
378
|
+
setBulkUploadCompletedSubTab(draft, action) {
|
|
379
|
+
draft.bulkUpload.completedSubTab = action.payload;
|
|
380
|
+
},
|
|
381
|
+
setBulkUploadSortConfig(draft, action) {
|
|
382
|
+
draft.bulkUpload.sortKey = action.payload.sortKey;
|
|
383
|
+
draft.bulkUpload.sortOrder = action.payload.sortOrder;
|
|
384
|
+
},
|
|
385
|
+
clearBulkUpload(draft) {
|
|
386
|
+
Object.assign(draft.bulkUpload, exports.initialBulkUploadState);
|
|
387
|
+
draft.pendingMissingReceiptsTabNavigation = null;
|
|
388
|
+
},
|
|
389
|
+
searchTransactionsForManualMatch: {
|
|
390
|
+
reducer(draft, action) {
|
|
391
|
+
const { query, pageToken } = action.payload;
|
|
392
|
+
const isLoadMore = pageToken != null;
|
|
393
|
+
const trimmed = query.trim();
|
|
394
|
+
/**
|
|
395
|
+
* Cleared or too-short query: no API (see epic). Reset fully (no In-Progress).
|
|
396
|
+
* Only bump `manualSearchUiResetKey` when clearing a real search — not when the UI
|
|
397
|
+
* dispatches `""` on every keystroke while length is below MIN (web-components always sends
|
|
398
|
+
* `onSearch("")` in that case), or ReceiptCard remounts and the input loses focus.
|
|
399
|
+
*/
|
|
400
|
+
if (!isLoadMore &&
|
|
401
|
+
trimmed.length < missingReceiptsViewState_1.MIN_MANUAL_TRANSACTION_SEARCH_LENGTH) {
|
|
402
|
+
const hadActiveSearch = draft.bulkUpload.manualSearch.searchQuery.trim().length >=
|
|
403
|
+
missingReceiptsViewState_1.MIN_MANUAL_TRANSACTION_SEARCH_LENGTH ||
|
|
404
|
+
draft.bulkUpload.manualSearch.results.length > 0;
|
|
405
|
+
draft.bulkUpload.manualSearch = exports.initialBulkUploadState.manualSearch;
|
|
406
|
+
if (hadActiveSearch) {
|
|
407
|
+
draft.bulkUpload.manualSearchUiResetKey += 1;
|
|
408
|
+
}
|
|
409
|
+
return;
|
|
410
|
+
}
|
|
411
|
+
draft.bulkUpload.manualSearch.searchQuery = query;
|
|
412
|
+
if (isLoadMore) {
|
|
413
|
+
draft.bulkUpload.manualSearch.isLoadingMore = true;
|
|
414
|
+
}
|
|
415
|
+
else {
|
|
416
|
+
draft.bulkUpload.manualSearch.isLoadingMore = false;
|
|
417
|
+
draft.bulkUpload.manualSearch.results = [];
|
|
418
|
+
draft.bulkUpload.manualSearch.nextPageToken = null;
|
|
419
|
+
draft.bulkUpload.manualSearch.totalCount = 0;
|
|
420
|
+
draft.bulkUpload.manualSearch.fetchState = {
|
|
421
|
+
fetchState: 'In-Progress',
|
|
422
|
+
error: undefined,
|
|
423
|
+
};
|
|
424
|
+
}
|
|
425
|
+
},
|
|
426
|
+
prepare(query, pageToken) {
|
|
427
|
+
return { payload: { query, pageToken: pageToken ?? undefined } };
|
|
428
|
+
},
|
|
429
|
+
},
|
|
430
|
+
searchTransactionsForManualMatchSuccess(draft, action) {
|
|
431
|
+
const { append, nextPageToken, results, totalCount } = action.payload;
|
|
432
|
+
if (append) {
|
|
433
|
+
const merged = [...draft.bulkUpload.manualSearch.results, ...results];
|
|
434
|
+
const byId = new Map(merged.map((r) => [r.transactionId, r]));
|
|
435
|
+
draft.bulkUpload.manualSearch.results = Array.from(byId.values());
|
|
436
|
+
}
|
|
437
|
+
else {
|
|
438
|
+
draft.bulkUpload.manualSearch.results = results;
|
|
439
|
+
}
|
|
440
|
+
draft.bulkUpload.manualSearch.nextPageToken = nextPageToken;
|
|
441
|
+
draft.bulkUpload.manualSearch.totalCount = totalCount;
|
|
442
|
+
draft.bulkUpload.manualSearch.isLoadingMore = false;
|
|
443
|
+
draft.bulkUpload.manualSearch.fetchState = {
|
|
444
|
+
fetchState: 'Completed',
|
|
445
|
+
error: undefined,
|
|
446
|
+
};
|
|
447
|
+
},
|
|
448
|
+
searchTransactionsForManualMatchFailure(draft, action) {
|
|
449
|
+
draft.bulkUpload.manualSearch.isLoadingMore = false;
|
|
450
|
+
draft.bulkUpload.manualSearch.fetchState = {
|
|
451
|
+
fetchState: 'Error',
|
|
452
|
+
error: action.payload.error,
|
|
453
|
+
};
|
|
454
|
+
},
|
|
455
|
+
clearManualSearchResults(draft) {
|
|
456
|
+
draft.bulkUpload.manualSearch = exports.initialBulkUploadState.manualSearch;
|
|
457
|
+
draft.bulkUpload.manualSearchUiResetKey += 1;
|
|
458
|
+
},
|
|
459
|
+
acknowledgeBulkUploadConfirmMatchComplete(draft) {
|
|
460
|
+
draft.bulkUpload.confirmMatchStatus = {
|
|
461
|
+
fetchState: 'Not-Started',
|
|
462
|
+
error: undefined,
|
|
463
|
+
};
|
|
464
|
+
},
|
|
465
|
+
// -- Completed Transactions Actions --
|
|
466
|
+
fetchCompletedTransactions: {
|
|
467
|
+
reducer(draft, action) {
|
|
468
|
+
const { pageToken } = action.payload;
|
|
469
|
+
if (pageToken != null) {
|
|
470
|
+
const periods = draft.bulkUpload.completedTransactionsByPeriod;
|
|
471
|
+
for (const entry of Object.values(periods)) {
|
|
472
|
+
if (entry.nextPageToken === pageToken) {
|
|
473
|
+
entry.fetchState = {
|
|
474
|
+
fetchState: 'In-Progress',
|
|
475
|
+
error: undefined,
|
|
476
|
+
};
|
|
477
|
+
break;
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
},
|
|
482
|
+
prepare(pageToken, cacheOverride) {
|
|
483
|
+
return { payload: { pageToken, cacheOverride } };
|
|
484
|
+
},
|
|
485
|
+
},
|
|
486
|
+
fetchCompletedTransactionsSuccess(draft, action) {
|
|
487
|
+
const { transactionIds, nextPageToken, totalCount, selectedPeriod, isInitialLoad } = action.payload;
|
|
488
|
+
const periodId = (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod);
|
|
489
|
+
const cacheKey = (0, exports.getCompletedTransactionsCacheKey)(periodId, draft.bulkUpload.sortKey, draft.bulkUpload.sortOrder, draft.bulkUpload.completedSubTab);
|
|
490
|
+
if (isInitialLoad) {
|
|
491
|
+
draft.bulkUpload.completedTransactionsByPeriod[cacheKey] = {
|
|
492
|
+
transactionIds,
|
|
493
|
+
nextPageToken,
|
|
494
|
+
totalCount,
|
|
495
|
+
fetchState: { fetchState: 'Completed', error: undefined },
|
|
496
|
+
};
|
|
497
|
+
}
|
|
498
|
+
else {
|
|
499
|
+
const existing = draft.bulkUpload.completedTransactionsByPeriod[cacheKey];
|
|
500
|
+
if (existing != null) {
|
|
501
|
+
existing.transactionIds.push(...transactionIds);
|
|
502
|
+
existing.nextPageToken = nextPageToken;
|
|
503
|
+
existing.totalCount = totalCount;
|
|
504
|
+
existing.fetchState = { fetchState: 'Completed', error: undefined };
|
|
505
|
+
}
|
|
506
|
+
else {
|
|
507
|
+
draft.bulkUpload.completedTransactionsByPeriod[cacheKey] = {
|
|
508
|
+
transactionIds,
|
|
509
|
+
nextPageToken,
|
|
510
|
+
totalCount,
|
|
511
|
+
fetchState: { fetchState: 'Completed', error: undefined },
|
|
512
|
+
};
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
},
|
|
516
|
+
fetchCompletedTransactionsFailure(draft, action) {
|
|
517
|
+
const periodId = (0, timePeriod_1.toMonthYearPeriodId)(action.payload.selectedPeriod);
|
|
518
|
+
const cacheKey = (0, exports.getCompletedTransactionsCacheKey)(periodId, draft.bulkUpload.sortKey, draft.bulkUpload.sortOrder, draft.bulkUpload.completedSubTab);
|
|
519
|
+
const existing = draft.bulkUpload.completedTransactionsByPeriod[cacheKey];
|
|
520
|
+
if (existing != null) {
|
|
521
|
+
existing.fetchState = {
|
|
522
|
+
fetchState: 'Error',
|
|
523
|
+
error: action.payload.error,
|
|
524
|
+
};
|
|
525
|
+
}
|
|
526
|
+
else {
|
|
527
|
+
draft.bulkUpload.completedTransactionsByPeriod[cacheKey] = {
|
|
528
|
+
fetchState: { fetchState: 'Error', error: action.payload.error },
|
|
529
|
+
nextPageToken: null,
|
|
530
|
+
totalCount: 0,
|
|
531
|
+
transactionIds: [],
|
|
532
|
+
};
|
|
533
|
+
}
|
|
534
|
+
},
|
|
127
535
|
},
|
|
128
536
|
});
|
|
129
|
-
_a = expenseAutomationMissingReceiptsView.actions, exports.fetchMissingReceipts = _a.fetchMissingReceipts, exports.fetchMissingReceiptsSuccess = _a.fetchMissingReceiptsSuccess, exports.fetchMissingReceiptsFailure = _a.fetchMissingReceiptsFailure, exports.uploadMissingReceiptSuccess = _a.uploadMissingReceiptSuccess, exports.updateMissingReceiptUploadState = _a.updateMissingReceiptUploadState, exports.updateMissingReceiptsUIState = _a.updateMissingReceiptsUIState, exports.markMissingReceiptAsDone = _a.markMissingReceiptAsDone, exports.clearExpenseAutomationMissingReceiptsView = _a.clearExpenseAutomationMissingReceiptsView
|
|
537
|
+
_a = expenseAutomationMissingReceiptsView.actions, exports.fetchMissingReceipts = _a.fetchMissingReceipts, exports.fetchMissingReceiptsSuccess = _a.fetchMissingReceiptsSuccess, exports.fetchMissingReceiptsFailure = _a.fetchMissingReceiptsFailure, exports.uploadMissingReceiptSuccess = _a.uploadMissingReceiptSuccess, exports.updateMissingReceiptUploadState = _a.updateMissingReceiptUploadState, exports.updateMissingReceiptsUIState = _a.updateMissingReceiptsUIState, exports.markMissingReceiptAsDone = _a.markMissingReceiptAsDone, exports.clearExpenseAutomationMissingReceiptsView = _a.clearExpenseAutomationMissingReceiptsView,
|
|
538
|
+
// Bulk Upload
|
|
539
|
+
exports.bulkUploadReceipts = _a.bulkUploadReceipts, exports.updateBulkUploadProgress = _a.updateBulkUploadProgress, exports.bulkUploadReceiptsSuccess = _a.bulkUploadReceiptsSuccess, exports.bulkUploadReceiptsFailure = _a.bulkUploadReceiptsFailure, exports.pusherBatchStatusUpdate = _a.pusherBatchStatusUpdate, exports.requestMissingReceiptsTabNavigation = _a.requestMissingReceiptsTabNavigation, exports.clearMissingReceiptsTabNavigation = _a.clearMissingReceiptsTabNavigation, exports.fetchBulkUploadBatchDetails = _a.fetchBulkUploadBatchDetails, exports.fetchBulkUploadBatchDetailsSuccess = _a.fetchBulkUploadBatchDetailsSuccess, exports.fetchBulkUploadBatchDetailsFailure = _a.fetchBulkUploadBatchDetailsFailure, exports.storeBatchDetails = _a.storeBatchDetails, exports.batchDetailFetchFailed = _a.batchDetailFetchFailed, exports.setInitialBatchDetailsLoading = _a.setInitialBatchDetailsLoading, exports.fetchMoreBatchDetails = _a.fetchMoreBatchDetails, exports.fetchMoreBatchDetailsComplete = _a.fetchMoreBatchDetailsComplete, exports.fetchMoreBatchDetailsFailure = _a.fetchMoreBatchDetailsFailure, exports.fetchBulkUploadBatches = _a.fetchBulkUploadBatches, exports.fetchBulkUploadBatchesSuccess = _a.fetchBulkUploadBatchesSuccess, exports.fetchBulkUploadBatchesFailure = _a.fetchBulkUploadBatchesFailure, exports.confirmBulkUploadMatch = _a.confirmBulkUploadMatch, exports.confirmBulkUploadMatchSuccess = _a.confirmBulkUploadMatchSuccess, exports.confirmBulkUploadMatchFailure = _a.confirmBulkUploadMatchFailure, exports.setBulkUploadResultsTab = _a.setBulkUploadResultsTab, exports.setBulkUploadCompletedSubTab = _a.setBulkUploadCompletedSubTab, exports.setBulkUploadSortConfig = _a.setBulkUploadSortConfig, exports.clearBulkUpload = _a.clearBulkUpload, exports.searchTransactionsForManualMatch = _a.searchTransactionsForManualMatch, exports.searchTransactionsForManualMatchSuccess = _a.searchTransactionsForManualMatchSuccess, exports.searchTransactionsForManualMatchFailure = _a.searchTransactionsForManualMatchFailure, exports.clearManualSearchResults = _a.clearManualSearchResults, exports.acknowledgeBulkUploadConfirmMatchComplete = _a.acknowledgeBulkUploadConfirmMatchComplete,
|
|
540
|
+
// Completed Transactions
|
|
541
|
+
exports.fetchCompletedTransactions = _a.fetchCompletedTransactions, exports.fetchCompletedTransactionsSuccess = _a.fetchCompletedTransactionsSuccess, exports.fetchCompletedTransactionsFailure = _a.fetchCompletedTransactionsFailure;
|
|
130
542
|
exports.default = expenseAutomationMissingReceiptsView.reducer;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FetchState, ID } from '../../../commonStateTypes/common';
|
|
1
|
+
import { FetchState, FetchStateAndError, ID, UpdateType } from '../../../commonStateTypes/common';
|
|
2
2
|
import { COTTransactionTrackingByTransactionId, RecommendationWithCOT } from '../../../commonStateTypes/recommendationBase';
|
|
3
3
|
import { MonthYearPeriod, TimePeriod } from '../../../commonStateTypes/timePeriod';
|
|
4
4
|
import { PageToken } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
@@ -7,7 +7,7 @@ import { ClassBase } from '../../../entity/class/classState';
|
|
|
7
7
|
import { CustomerBase } from '../../../entity/customer/customerState';
|
|
8
8
|
import { Entity } from '../../../entity/genericEntity/entity';
|
|
9
9
|
import { RecommendationWithCOTByLineId, TransactionID } from '../../../entity/transaction/stateTypes/transaction';
|
|
10
|
-
import { SupportedTransaction, SupportedTransactionWithCOT } from '../../../entity/transaction/transactionState';
|
|
10
|
+
import { SupportedTransaction, SupportedTransactionPayload, SupportedTransactionWithCOT } from '../../../entity/transaction/transactionState';
|
|
11
11
|
import { VendorBase } from '../../../entity/vendor/vendorState';
|
|
12
12
|
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
13
13
|
import { UncategorizedAccounts } from '../../accountList/accountListSelector';
|
|
@@ -158,6 +158,14 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
|
|
|
158
158
|
}, "expenseAutomationTransactionsView/syncTransactionCategorizationFromDetailSave", never, never>, backgroundRefetchReviewTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, isUncategorizedExpenseCategoryEnabled?: boolean | undefined], {
|
|
159
159
|
period: TimePeriod;
|
|
160
160
|
isUncategorizedExpenseCategoryEnabled: boolean | undefined;
|
|
161
|
-
}, "expenseAutomationTransactionsView/backgroundRefetchReviewTab", never, never
|
|
161
|
+
}, "expenseAutomationTransactionsView/backgroundRefetchReviewTab", never, never>, updateTransactionCategorizationUploadReceiptState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", transactionId: string, fetchStatus: FetchStateAndError], {
|
|
162
|
+
selectedTab: "review" | "autoCategorized";
|
|
163
|
+
transactionId: string;
|
|
164
|
+
fetchStatus: FetchStateAndError;
|
|
165
|
+
}, "expenseAutomationTransactionsView/updateTransactionCategorizationUploadReceiptState", never, never>, uploadTransactionCategorizationReceiptSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", transactionPayload: SupportedTransactionPayload, updateType?: UpdateType | undefined], {
|
|
166
|
+
selectedTab: "review" | "autoCategorized";
|
|
167
|
+
transactionPayload: SupportedTransactionPayload;
|
|
168
|
+
updateType: UpdateType;
|
|
169
|
+
}, "expenseAutomationTransactionsView/uploadTransactionCategorizationReceiptSuccess", never, never>;
|
|
162
170
|
declare const _default: import("redux").Reducer<TransactionsViewState>;
|
|
163
171
|
export default _default;
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
var _a;
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.backgroundRefetchReviewTab = exports.syncTransactionCategorizationFromDetailSave = exports.updateSelectedTransactionId = exports.setEntityRecommendationForLineIdsForCategorization = exports.clearExpenseAutomationTransactionsView = exports.clearExpenseAutomationTransactionsViewPerTabView = exports.updateSelectedCheckboxTransactionIds = exports.fetchTransactionCategorizationView = exports.resetOtherTabsFetchState = exports.fetchTransactionCategorizationSuccess = exports.updateTotalCountForTransactionCategorization = exports.setAllItemsToCategoryClassInLocalDataForCategorization = exports.updateSelectedCustomerForTransaction = exports.updateSelectedVendorForTransaction = exports.updateStatusForTransactionNotMiscategorizedUpdateForCategorization = exports.markTransactionAsNotMiscategorized = exports.updateTransactionCategorizationSaveStatus = exports.updateCurrentSelectedTransactionCategorizationTab = exports.updateTransactionCategorization = exports.saveTransactionCategorization = exports.fetchTransactionCategorizationFailure = exports.saveTransactionCategorizationLocalData = exports.initializeTransactionCategorizationViewLocalData = exports.updateTransactionCategorizationUIState = exports.fetchTransactionCategorization = exports.initialState = exports.initialTransactionTabViewState = void 0;
|
|
7
|
+
exports.uploadTransactionCategorizationReceiptSuccess = exports.updateTransactionCategorizationUploadReceiptState = exports.backgroundRefetchReviewTab = exports.syncTransactionCategorizationFromDetailSave = exports.updateSelectedTransactionId = exports.setEntityRecommendationForLineIdsForCategorization = exports.clearExpenseAutomationTransactionsView = exports.clearExpenseAutomationTransactionsViewPerTabView = exports.updateSelectedCheckboxTransactionIds = exports.fetchTransactionCategorizationView = exports.resetOtherTabsFetchState = exports.fetchTransactionCategorizationSuccess = exports.updateTotalCountForTransactionCategorization = exports.setAllItemsToCategoryClassInLocalDataForCategorization = exports.updateSelectedCustomerForTransaction = exports.updateSelectedVendorForTransaction = exports.updateStatusForTransactionNotMiscategorizedUpdateForCategorization = exports.markTransactionAsNotMiscategorized = exports.updateTransactionCategorizationSaveStatus = exports.updateCurrentSelectedTransactionCategorizationTab = exports.updateTransactionCategorization = exports.saveTransactionCategorization = exports.fetchTransactionCategorizationFailure = exports.saveTransactionCategorizationLocalData = exports.initializeTransactionCategorizationViewLocalData = exports.updateTransactionCategorizationUIState = exports.fetchTransactionCategorization = exports.initialState = exports.initialTransactionTabViewState = void 0;
|
|
8
8
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
9
9
|
const get_1 = __importDefault(require("lodash/get"));
|
|
10
10
|
const uniq_1 = __importDefault(require("lodash/uniq"));
|
|
@@ -43,6 +43,7 @@ exports.initialTransactionTabViewState = {
|
|
|
43
43
|
transactionIdsBySelectedPeriod: {},
|
|
44
44
|
selectedCheckBoxTransactionIds: [],
|
|
45
45
|
transactionIdsWithUnsavedData: [],
|
|
46
|
+
uploadReceiptStatusById: {},
|
|
46
47
|
selectedTransactionId: undefined,
|
|
47
48
|
selectedTransactionLineId: undefined,
|
|
48
49
|
};
|
|
@@ -706,6 +707,24 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
706
707
|
clearExpenseAutomationTransactionsView(draft) {
|
|
707
708
|
Object.assign(draft, exports.initialState);
|
|
708
709
|
},
|
|
710
|
+
updateTransactionCategorizationUploadReceiptState: {
|
|
711
|
+
reducer(draft, action) {
|
|
712
|
+
const { transactionId, fetchStatus, selectedTab } = action.payload;
|
|
713
|
+
draft.transactionCategorizationView[selectedTab].uploadReceiptStatusById[transactionId] = fetchStatus;
|
|
714
|
+
},
|
|
715
|
+
prepare(selectedTab, transactionId, fetchStatus) {
|
|
716
|
+
return { payload: { selectedTab, transactionId, fetchStatus } };
|
|
717
|
+
},
|
|
718
|
+
},
|
|
719
|
+
uploadTransactionCategorizationReceiptSuccess: {
|
|
720
|
+
reducer(draft, action) {
|
|
721
|
+
const { transactionPayload, selectedTab } = action.payload;
|
|
722
|
+
draft.transactionCategorizationView[selectedTab].uploadReceiptStatusById[transactionPayload.transaction_id] = { fetchState: 'Completed', error: undefined };
|
|
723
|
+
},
|
|
724
|
+
prepare(selectedTab, transactionPayload, updateType = 'merge') {
|
|
725
|
+
return { payload: { selectedTab, transactionPayload, updateType } };
|
|
726
|
+
},
|
|
727
|
+
},
|
|
709
728
|
syncTransactionCategorizationFromDetailSave: {
|
|
710
729
|
prepare(transactionId, updatedTransaction, pendingReviewLineIds, uncategorizedIncomeExpense, isUncategorizedExpenseCategoryEnabled) {
|
|
711
730
|
return {
|
|
@@ -777,5 +796,5 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
777
796
|
},
|
|
778
797
|
},
|
|
779
798
|
});
|
|
780
|
-
_a = expenseAutomationTransactionsView.actions, exports.fetchTransactionCategorization = _a.fetchTransactionCategorization, exports.updateTransactionCategorizationUIState = _a.updateTransactionCategorizationUIState, exports.initializeTransactionCategorizationViewLocalData = _a.initializeTransactionCategorizationViewLocalData, exports.saveTransactionCategorizationLocalData = _a.saveTransactionCategorizationLocalData, exports.fetchTransactionCategorizationFailure = _a.fetchTransactionCategorizationFailure, exports.saveTransactionCategorization = _a.saveTransactionCategorization, exports.updateTransactionCategorization = _a.updateTransactionCategorization, exports.updateCurrentSelectedTransactionCategorizationTab = _a.updateCurrentSelectedTransactionCategorizationTab, exports.updateTransactionCategorizationSaveStatus = _a.updateTransactionCategorizationSaveStatus, exports.markTransactionAsNotMiscategorized = _a.markTransactionAsNotMiscategorized, exports.updateStatusForTransactionNotMiscategorizedUpdateForCategorization = _a.updateStatusForTransactionNotMiscategorizedUpdateForCategorization, exports.updateSelectedVendorForTransaction = _a.updateSelectedVendorForTransaction, exports.updateSelectedCustomerForTransaction = _a.updateSelectedCustomerForTransaction, exports.setAllItemsToCategoryClassInLocalDataForCategorization = _a.setAllItemsToCategoryClassInLocalDataForCategorization, exports.updateTotalCountForTransactionCategorization = _a.updateTotalCountForTransactionCategorization, exports.fetchTransactionCategorizationSuccess = _a.fetchTransactionCategorizationSuccess, exports.resetOtherTabsFetchState = _a.resetOtherTabsFetchState, exports.fetchTransactionCategorizationView = _a.fetchTransactionCategorizationView, exports.updateSelectedCheckboxTransactionIds = _a.updateSelectedCheckboxTransactionIds, exports.clearExpenseAutomationTransactionsViewPerTabView = _a.clearExpenseAutomationTransactionsViewPerTabView, exports.clearExpenseAutomationTransactionsView = _a.clearExpenseAutomationTransactionsView, exports.setEntityRecommendationForLineIdsForCategorization = _a.setEntityRecommendationForLineIdsForCategorization, exports.updateSelectedTransactionId = _a.updateSelectedTransactionId, exports.syncTransactionCategorizationFromDetailSave = _a.syncTransactionCategorizationFromDetailSave, exports.backgroundRefetchReviewTab = _a.backgroundRefetchReviewTab;
|
|
799
|
+
_a = expenseAutomationTransactionsView.actions, exports.fetchTransactionCategorization = _a.fetchTransactionCategorization, exports.updateTransactionCategorizationUIState = _a.updateTransactionCategorizationUIState, exports.initializeTransactionCategorizationViewLocalData = _a.initializeTransactionCategorizationViewLocalData, exports.saveTransactionCategorizationLocalData = _a.saveTransactionCategorizationLocalData, exports.fetchTransactionCategorizationFailure = _a.fetchTransactionCategorizationFailure, exports.saveTransactionCategorization = _a.saveTransactionCategorization, exports.updateTransactionCategorization = _a.updateTransactionCategorization, exports.updateCurrentSelectedTransactionCategorizationTab = _a.updateCurrentSelectedTransactionCategorizationTab, exports.updateTransactionCategorizationSaveStatus = _a.updateTransactionCategorizationSaveStatus, exports.markTransactionAsNotMiscategorized = _a.markTransactionAsNotMiscategorized, exports.updateStatusForTransactionNotMiscategorizedUpdateForCategorization = _a.updateStatusForTransactionNotMiscategorizedUpdateForCategorization, exports.updateSelectedVendorForTransaction = _a.updateSelectedVendorForTransaction, exports.updateSelectedCustomerForTransaction = _a.updateSelectedCustomerForTransaction, exports.setAllItemsToCategoryClassInLocalDataForCategorization = _a.setAllItemsToCategoryClassInLocalDataForCategorization, exports.updateTotalCountForTransactionCategorization = _a.updateTotalCountForTransactionCategorization, exports.fetchTransactionCategorizationSuccess = _a.fetchTransactionCategorizationSuccess, exports.resetOtherTabsFetchState = _a.resetOtherTabsFetchState, exports.fetchTransactionCategorizationView = _a.fetchTransactionCategorizationView, exports.updateSelectedCheckboxTransactionIds = _a.updateSelectedCheckboxTransactionIds, exports.clearExpenseAutomationTransactionsViewPerTabView = _a.clearExpenseAutomationTransactionsViewPerTabView, exports.clearExpenseAutomationTransactionsView = _a.clearExpenseAutomationTransactionsView, exports.setEntityRecommendationForLineIdsForCategorization = _a.setEntityRecommendationForLineIdsForCategorization, exports.updateSelectedTransactionId = _a.updateSelectedTransactionId, exports.syncTransactionCategorizationFromDetailSave = _a.syncTransactionCategorizationFromDetailSave, exports.backgroundRefetchReviewTab = _a.backgroundRefetchReviewTab, exports.updateTransactionCategorizationUploadReceiptState = _a.updateTransactionCategorizationUploadReceiptState, exports.uploadTransactionCategorizationReceiptSuccess = _a.uploadTransactionCategorizationReceiptSuccess;
|
|
781
800
|
exports.default = expenseAutomationTransactionsView.reducer;
|