@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.
Files changed (116) hide show
  1. package/lib/entity/account/accountPayload.d.ts +2 -0
  2. package/lib/entity/account/accountPayload.js +2 -0
  3. package/lib/entity/account/accountState.d.ts +2 -0
  4. package/lib/entity/company/companyPayload.d.ts +13 -0
  5. package/lib/entity/company/companyPayload.js +21 -0
  6. package/lib/entity/company/companyStateTypes.d.ts +13 -0
  7. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  8. package/lib/entity/snackbar/snackbarTypes.js +1 -0
  9. package/lib/epic.d.ts +12 -1
  10. package/lib/epic.js +12 -1
  11. package/lib/esm/entity/account/accountPayload.js +2 -0
  12. package/lib/esm/entity/chargeCardTransaction/chargeCardTransactionPayload.js +2 -2
  13. package/lib/esm/entity/company/companyPayload.js +21 -0
  14. package/lib/esm/entity/snackbar/snackbarTypes.js +1 -0
  15. package/lib/esm/epic.js +12 -1
  16. package/lib/esm/index.js +13 -8
  17. package/lib/esm/view/companyView/epic/companyPassport/updateCompanyDetailsEpic.js +6 -0
  18. package/lib/esm/view/companyView/types/companyPassport/companyPassportLocalData.js +13 -0
  19. package/lib/esm/view/companyView/types/companyPassportViewPayload.js +55 -12
  20. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +28 -0
  21. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.js +49 -0
  22. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.js +40 -0
  23. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +47 -0
  24. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +61 -0
  25. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.js +34 -0
  26. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.js +57 -0
  27. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +78 -0
  28. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/uploadMissingReceiptSuccessEpic.js +7 -5
  29. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +59 -0
  30. package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/triggerReviewTabRefetchEpic.js +2 -3
  31. package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.js +24 -0
  32. package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
  33. package/lib/esm/view/expenseAutomationView/payload/missingReceiptsPayload.js +173 -1
  34. package/lib/esm/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +412 -1
  35. package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +20 -1
  36. package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +225 -1
  37. package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +2 -1
  38. package/lib/esm/view/expenseAutomationView/types/missingReceiptsViewState.js +10 -0
  39. package/lib/esm/view/expenseAutomationView/types/transactionsViewState.js +2 -1
  40. package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewSelector.js +22 -4
  41. package/lib/esm/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryDownloadSelector.js +2 -2
  42. package/lib/esm/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistorySelector.js +2 -2
  43. package/lib/esm/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailSelector.js +4 -1
  44. package/lib/esm/view/spendManagement/chargeCards/chargeCardRepaymentDetail/fetchChargeCardRepaymentDetailEpic.js +2 -1
  45. package/lib/esm/view/spendManagement/chargeCards/chargeCardRepaymentDetail/initiateChargeCardRepaymentEpic.js +1 -1
  46. package/lib/esm/view/spendManagement/commonSetup/epic/setup/updateBusinessVerificationDetailsEpic.js +67 -1
  47. package/lib/esm/view/spendManagement/commonSetup/epic/setup/updateSetupViewLocalStoreDataEpic.js +16 -2
  48. package/lib/esm/view/spendManagement/commonSetup/setupViewSelector.js +15 -1
  49. package/lib/esm/view/spendManagement/commonSetup/types/businessVerification.js +148 -1
  50. package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +1 -1
  51. package/lib/esm/zeniAPI.js +0 -2
  52. package/lib/index.d.ts +14 -9
  53. package/lib/index.js +90 -45
  54. package/lib/tsconfig.typecheck.tsbuildinfo +1 -0
  55. package/lib/view/companyView/epic/companyPassport/updateCompanyDetailsEpic.js +6 -0
  56. package/lib/view/companyView/types/companyPassport/companyDetailsLocalData.d.ts +13 -0
  57. package/lib/view/companyView/types/companyPassport/companyPassportLocalData.js +13 -0
  58. package/lib/view/companyView/types/companyPassportViewPayload.d.ts +1 -1
  59. package/lib/view/companyView/types/companyPassportViewPayload.js +55 -12
  60. package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.d.ts +15 -0
  61. package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +32 -0
  62. package/lib/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.d.ts +7 -0
  63. package/lib/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.js +53 -0
  64. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.d.ts +8 -0
  65. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.js +44 -0
  66. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.d.ts +7 -0
  67. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +51 -0
  68. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.d.ts +8 -0
  69. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +65 -0
  70. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.d.ts +8 -0
  71. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.js +38 -0
  72. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.d.ts +9 -0
  73. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.js +62 -0
  74. package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.d.ts +14 -0
  75. package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +82 -0
  76. package/lib/view/expenseAutomationView/epics/missingReceipts/uploadMissingReceiptSuccessEpic.js +7 -5
  77. package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.d.ts +19 -0
  78. package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +64 -0
  79. package/lib/view/expenseAutomationView/epics/transactionCategorization/triggerReviewTabRefetchEpic.js +2 -3
  80. package/lib/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.d.ts +7 -0
  81. package/lib/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.js +28 -0
  82. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  83. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
  84. package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.d.ts +118 -0
  85. package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.js +185 -0
  86. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +70 -3
  87. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +414 -2
  88. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +11 -3
  89. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +21 -2
  90. package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +69 -1
  91. package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +1 -0
  92. package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.d.ts +1 -1
  93. package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +224 -0
  94. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +2 -1
  95. package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +131 -0
  96. package/lib/view/expenseAutomationView/types/missingReceiptsViewState.js +12 -1
  97. package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +2 -1
  98. package/lib/view/expenseAutomationView/types/transactionsViewState.js +2 -1
  99. package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.d.ts +1 -0
  100. package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.js +22 -3
  101. package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryDownloadSelector.js +2 -2
  102. package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistorySelector.js +2 -2
  103. package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailSelector.js +4 -1
  104. package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/fetchChargeCardRepaymentDetailEpic.js +2 -1
  105. package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/initiateChargeCardRepaymentEpic.d.ts +1 -1
  106. package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/initiateChargeCardRepaymentEpic.js +1 -1
  107. package/lib/view/spendManagement/commonSetup/epic/setup/updateBusinessVerificationDetailsEpic.js +67 -1
  108. package/lib/view/spendManagement/commonSetup/epic/setup/updateSetupViewLocalStoreDataEpic.js +16 -2
  109. package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +14 -0
  110. package/lib/view/spendManagement/commonSetup/setupViewSelector.js +15 -1
  111. package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +14 -0
  112. package/lib/view/spendManagement/commonSetup/types/businessVerification.d.ts +43 -0
  113. package/lib/view/spendManagement/commonSetup/types/businessVerification.js +150 -0
  114. package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +1 -1
  115. package/lib/zeniAPI.js +0 -2
  116. package/package.json +1 -1
@@ -1,9 +1,77 @@
1
1
  import { CompletionStatusType, FetchStateAndError, ID } from '../../../commonStateTypes/common';
2
2
  import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
3
3
  import { SupportedTransaction } from '../../../entity/transaction/transactionState';
4
- import { MissingReceiptsViewUIState } from '../types/missingReceiptsViewState';
4
+ import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
5
+ import type { BatchFileStatus, BatchListItem, BatchStatus, BulkUploadPhase, BulkUploadResultsTab, BulkUploadSortKey, CompletedSubTab, ManualSearchState, MatchSource, MissingReceiptsViewUIState } from '../types/missingReceiptsViewState';
6
+ export interface CompletedTransactionsSelectorData {
7
+ fetchState: FetchStateAndError;
8
+ nextPageToken: string | null;
9
+ totalCount: number;
10
+ transactions: SupportedTransaction[];
11
+ }
12
+ export interface ResolvedCandidate {
13
+ matchScore: number;
14
+ transaction: SupportedTransaction;
15
+ }
16
+ export interface ResolvedBatchFile {
17
+ attachmentId: ID;
18
+ batchId: ID;
19
+ fileDownloadUrl: string | null;
20
+ fileId: ID;
21
+ filename: string;
22
+ filePreviewUrl: string | null;
23
+ status: BatchFileStatus;
24
+ candidates?: ResolvedCandidate[];
25
+ matchedTransaction?: SupportedTransaction;
26
+ matchSource?: MatchSource;
27
+ }
28
+ export interface BulkUploadSelectorData {
29
+ batchDetails: ResolvedBatchDetails | undefined;
30
+ batchDetailsPaginationState: FetchStateAndError;
31
+ batchList: BatchListItem[];
32
+ batchListFetchState: FetchStateAndError;
33
+ batchStatus: BatchStatus | undefined;
34
+ completedSubTab: CompletedSubTab;
35
+ completedTransactions: CompletedTransactionsSelectorData;
36
+ confirmMatchStatus: FetchStateAndError;
37
+ currentResultsTab: BulkUploadResultsTab;
38
+ hasMoreBatchDetails: boolean;
39
+ manualSearch: ManualSearchState;
40
+ /** Bumps when manual search state is cleared — remount manual search inputs. */
41
+ manualSearchUiResetKey: number;
42
+ matchedFiles: ResolvedBatchFile[];
43
+ pastBatches: BatchListItem[];
44
+ pastUnmatchedFiles: ResolvedBatchFile[];
45
+ phase: BulkUploadPhase;
46
+ progress: {
47
+ percentage: number;
48
+ processed: number;
49
+ total: number;
50
+ };
51
+ sortKey: BulkUploadSortKey;
52
+ sortOrder: SortOrder;
53
+ unmatchedFiles: ResolvedBatchFile[];
54
+ uploadProgress: number;
55
+ uploadStatus: FetchStateAndError;
56
+ }
57
+ export interface ResolvedBatchDetails {
58
+ batchId: ID;
59
+ createdAt: string;
60
+ files: ResolvedBatchFile[];
61
+ status: string;
62
+ summary: {
63
+ failed: number;
64
+ matched: number;
65
+ noMatch: number;
66
+ possibleMatches: number;
67
+ total: number;
68
+ };
69
+ }
5
70
  export interface ExpenseAutomationMissingReceiptsViewSelector extends SelectorView {
71
+ bulkUpload: BulkUploadSelectorData;
6
72
  completionStatus: CompletionStatusType;
73
+ /** When set, UI should switch bulk-upload sub-tab once (e.g. Unmatched on batch completion). */
74
+ pendingMissingReceiptsTabNavigation: BulkUploadResultsTab | null;
7
75
  refreshStatus: FetchStateAndError;
8
76
  transactions: SupportedTransaction[];
9
77
  uiState: MissingReceiptsViewUIState;
@@ -28,6 +28,7 @@ export interface ExpenseAutomationTransactionViewSelector extends SelectorView {
28
28
  transactions: SupportedTransactionWithCOT[];
29
29
  uiState: TransactionsViewUIState;
30
30
  uncategorizedAccounts: UncategorizedAccounts;
31
+ uploadReceiptStatusById: Record<ID, FetchStateAndError>;
31
32
  selectedTransactionId?: ID;
32
33
  selectedTransactionLineId?: ID;
33
34
  }
@@ -1,3 +1,3 @@
1
1
  import { RootState } from '../../../reducer';
2
- import { ExpenseAutomationMissingReceiptsViewSelector } from '../selectorTypes/missingReceiptsSelectorTypes';
2
+ import type { ExpenseAutomationMissingReceiptsViewSelector } from '../selectorTypes/missingReceiptsSelectorTypes';
3
3
  export declare function getExpenseAutomationMissingReceiptsView(state: RootState): ExpenseAutomationMissingReceiptsViewSelector;
@@ -9,6 +9,9 @@ const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
9
9
  const tenantSelector_1 = require("../../../entity/tenant/tenantSelector");
10
10
  const transactionSelector_1 = require("../../../entity/transaction/transactionSelector");
11
11
  const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
12
+ const missingReceiptsPayload_1 = require("../payload/missingReceiptsPayload");
13
+ const missingReceiptsViewReducer_1 = require("../reducers/missingReceiptsViewReducer");
14
+ const missingReceiptsViewState_1 = require("../types/missingReceiptsViewState");
12
15
  function getExpenseAutomationMissingReceiptsView(state) {
13
16
  const { expenseAutomationMissingReceiptsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, } = state;
14
17
  const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
@@ -53,6 +56,110 @@ function getExpenseAutomationMissingReceiptsView(state) {
53
56
  const completionStatus = missingReceiptsCompletionStatus != null
54
57
  ? missingReceiptsCompletionStatus
55
58
  : 'incomplete';
59
+ const { bulkUpload, pendingMissingReceiptsTabNavigation, } = expenseAutomationMissingReceiptsViewState;
60
+ const currentBatchStatus = bulkUpload.currentBatchId != null
61
+ ? bulkUpload.batchStatusById[bulkUpload.currentBatchId]
62
+ : undefined;
63
+ const batchList = monthYearPeriodId != null
64
+ ? bulkUpload.batchListByPeriod[monthYearPeriodId] ?? []
65
+ : [];
66
+ /**
67
+ * Primary "Unmatched" batch = first completed batch in platform list order, preferring the
68
+ * first batch that still has possible_matches/no_match work when any completed batch has such work.
69
+ * Batches without details yet: wait if the list row still reports unmatched work; otherwise skip
70
+ * so we do not block the whole tab while other rows are not fetched yet.
71
+ */
72
+ const primaryBatchIdFromDetailsOrder = getPrimaryBatchIdFromBatchListOrder(batchList, bulkUpload.batchDetailsById, bulkUpload.failedBatchDetailIds);
73
+ /** During upload/matching, the in-flight batch may not appear in batchList yet — prefer currentBatchId. */
74
+ const unmatchedSectionBatchId = bulkUpload.phase === 'matching' || bulkUpload.phase === 'uploading'
75
+ ? bulkUpload.currentBatchId ?? primaryBatchIdFromDetailsOrder
76
+ : primaryBatchIdFromDetailsOrder;
77
+ const completedBatchesInApiOrder = batchList.filter((b) => (0, missingReceiptsPayload_1.isBatchListStatusCompleted)(b.status));
78
+ const currentBatchDetails = unmatchedSectionBatchId != null
79
+ ? bulkUpload.batchDetailsById[unmatchedSectionBatchId]
80
+ : undefined;
81
+ const resolvedFiles = currentBatchDetails?.files.map((file) => resolveBatchFile(file, currentBatchDetails.batchId, transactionState));
82
+ const failedIds = new Set(bulkUpload.failedBatchDetailIds);
83
+ const hasMoreBatchDetails = completedBatchesInApiOrder.some((b) => bulkUpload.batchDetailsById[b.batchId] == null &&
84
+ !failedIds.has(b.batchId));
85
+ const getSortValue = (file) => {
86
+ const t = file.matchedTransaction;
87
+ if (t == null) {
88
+ return null;
89
+ }
90
+ switch (bulkUpload.sortKey) {
91
+ case 'vendor':
92
+ return (t.vendorName ?? t.description)?.toLowerCase() ?? null;
93
+ case 'category': {
94
+ const line = t.lines?.[0];
95
+ return line?.account?.accountName?.toLowerCase() ?? null;
96
+ }
97
+ case 'class': {
98
+ const line = t.lines?.[0];
99
+ return line?.class?.className?.toLowerCase() ?? null;
100
+ }
101
+ case 'date':
102
+ return t.date.valueOf();
103
+ case 'amount':
104
+ return t.amount.amount;
105
+ default:
106
+ return null;
107
+ }
108
+ };
109
+ const bulkUploadSortDirection = bulkUpload.sortOrder === 'ascending' ? 'asc' : 'desc';
110
+ const matchedFiles = (0, orderBy_1.default)(resolvedFiles?.filter((f) => f.status === 'exact_match') ?? [], getSortValue, bulkUploadSortDirection);
111
+ const unmatchedFiles = (0, orderBy_1.default)(resolvedFiles?.filter((f) => (0, missingReceiptsViewState_1.isUnmatchedTabFileStatus)(f.status)) ?? [], getSortValue, bulkUploadSortDirection);
112
+ const progress = currentBatchStatus != null
113
+ ? {
114
+ ...currentBatchStatus.progress,
115
+ percentage: currentBatchStatus.progress.total > 0
116
+ ? Math.round((currentBatchStatus.progress.processed /
117
+ currentBatchStatus.progress.total) *
118
+ 100)
119
+ : 0,
120
+ }
121
+ : { total: 0, processed: 0, percentage: 0 };
122
+ const batchListFetchState = bulkUpload.batchListFetchState;
123
+ /**
124
+ * When primary batch is not resolved yet, still aggregate unmatched files from every batch
125
+ * that has details loaded (otherwise past is empty and receipts vanish from the UI).
126
+ */
127
+ const pastBatches = unmatchedSectionBatchId != null
128
+ ? batchList.filter((b) => b.batchId !== unmatchedSectionBatchId)
129
+ : batchList;
130
+ const pastUnmatchedFiles = pastBatches.flatMap((b) => {
131
+ const details = bulkUpload.batchDetailsById[b.batchId];
132
+ if (details == null) {
133
+ return [];
134
+ }
135
+ return details.files
136
+ .filter((f) => (0, missingReceiptsViewState_1.isUnmatchedTabFileStatus)(f.status))
137
+ .map((f) => resolveBatchFile(f, b.batchId, transactionState));
138
+ });
139
+ const completedTransactionsCacheKey = monthYearPeriodId != null
140
+ ? (0, missingReceiptsViewReducer_1.getCompletedTransactionsCacheKey)(monthYearPeriodId, bulkUpload.sortKey, bulkUpload.sortOrder, bulkUpload.completedSubTab)
141
+ : undefined;
142
+ const completedTransactionsForPeriod = completedTransactionsCacheKey != null
143
+ ? bulkUpload.completedTransactionsByPeriod[completedTransactionsCacheKey]
144
+ : undefined;
145
+ const completedTransactionIds = completedTransactionsForPeriod?.transactionIds ?? [];
146
+ const resolvedCompletedTransactions = (0, transactionSelector_1.getSupportedTransactionsByIds)(transactionState, completedTransactionIds);
147
+ const resolvedBatchDetails = currentBatchDetails != null && resolvedFiles != null
148
+ ? {
149
+ batchId: currentBatchDetails.batchId,
150
+ createdAt: currentBatchDetails.createdAt,
151
+ files: resolvedFiles,
152
+ status: currentBatchDetails.status,
153
+ summary: currentBatchDetails.summary,
154
+ }
155
+ : undefined;
156
+ const manualSearchResults = bulkUpload.manualSearch.results.map((r) => {
157
+ const t = (0, transactionSelector_1.getSupportedTransactionById)(transactionState, r.transactionId);
158
+ return {
159
+ ...r,
160
+ vendorLogo: r.vendorLogo ?? t?.logo?.href,
161
+ };
162
+ });
56
163
  return {
57
164
  fetchState,
58
165
  error,
@@ -61,5 +168,122 @@ function getExpenseAutomationMissingReceiptsView(state) {
61
168
  refreshStatus,
62
169
  transactions: sortedTransactions,
63
170
  completionStatus,
171
+ pendingMissingReceiptsTabNavigation: pendingMissingReceiptsTabNavigation ?? null,
172
+ bulkUpload: {
173
+ phase: bulkUpload.phase,
174
+ uploadStatus: bulkUpload.uploadStatus,
175
+ batchStatus: currentBatchStatus,
176
+ batchDetails: resolvedBatchDetails,
177
+ completedSubTab: bulkUpload.completedSubTab,
178
+ completedTransactions: {
179
+ fetchState: completedTransactionsForPeriod?.fetchState ?? {
180
+ fetchState: 'Not-Started',
181
+ error: undefined,
182
+ },
183
+ nextPageToken: completedTransactionsForPeriod?.nextPageToken ?? null,
184
+ totalCount: completedTransactionsForPeriod?.totalCount ?? 0,
185
+ transactions: resolvedCompletedTransactions,
186
+ },
187
+ matchedFiles,
188
+ unmatchedFiles,
189
+ progress,
190
+ currentResultsTab: bulkUpload.currentResultsTab,
191
+ sortKey: bulkUpload.sortKey,
192
+ sortOrder: bulkUpload.sortOrder,
193
+ batchList,
194
+ batchListFetchState,
195
+ pastBatches,
196
+ pastUnmatchedFiles,
197
+ confirmMatchStatus: bulkUpload.confirmMatchStatus,
198
+ manualSearchUiResetKey: bulkUpload.manualSearchUiResetKey,
199
+ hasMoreBatchDetails,
200
+ batchDetailsPaginationState: bulkUpload.batchDetailsPaginationState,
201
+ manualSearch: {
202
+ ...bulkUpload.manualSearch,
203
+ results: manualSearchResults,
204
+ },
205
+ uploadProgress: bulkUpload.uploadProgress,
206
+ },
207
+ };
208
+ }
209
+ function batchDetailsHasUnmatchedWork(details) {
210
+ return details.files.some((f) => (0, missingReceiptsViewState_1.isUnmatchedTabFileStatus)(f.status));
211
+ }
212
+ /** List row summary before batch details load — aligns with unmatched / possible-match work. */
213
+ function batchListItemHasUnmatchedWork(batch) {
214
+ return batch.noMatchCount > 0 || batch.possibleMatchesCount > 0;
215
+ }
216
+ /**
217
+ * `batchList` must match platform order (same sequence as the bulk-upload batches API). Picks the
218
+ * primary batch for the top "Unmatched" section. Skips failed detail fetches.
219
+ *
220
+ * If details are not loaded for an earlier list row but that row reports no unmatched work, we
221
+ * skip it so later rows with loaded details can be primary (avoids an empty tab when the first
222
+ * fetch page only loaded later batches). If the list reports unmatched work but details are still
223
+ * loading, we wait (undefined) so primary order stays correct once details arrive.
224
+ */
225
+ function getPrimaryBatchIdFromBatchListOrder(batchListInPlatformOrder, batchDetailsById, failedBatchDetailIds) {
226
+ const failedIds = new Set(failedBatchDetailIds);
227
+ const anyCompletedBatchHasUnmatchedWork = batchListInPlatformOrder.some((b) => {
228
+ if (failedIds.has(b.batchId)) {
229
+ return false;
230
+ }
231
+ const d = batchDetailsById[b.batchId];
232
+ if (d != null &&
233
+ d.status === 'completed' &&
234
+ batchDetailsHasUnmatchedWork(d)) {
235
+ return true;
236
+ }
237
+ return d == null && batchListItemHasUnmatchedWork(b);
238
+ });
239
+ for (const batch of batchListInPlatformOrder) {
240
+ if (failedIds.has(batch.batchId)) {
241
+ continue;
242
+ }
243
+ const details = batchDetailsById[batch.batchId];
244
+ if (details == null) {
245
+ if (batchListItemHasUnmatchedWork(batch)) {
246
+ return undefined;
247
+ }
248
+ continue;
249
+ }
250
+ if (details.status !== 'completed') {
251
+ continue;
252
+ }
253
+ if (anyCompletedBatchHasUnmatchedWork) {
254
+ if (batchDetailsHasUnmatchedWork(details)) {
255
+ return batch.batchId;
256
+ }
257
+ continue;
258
+ }
259
+ return batch.batchId;
260
+ }
261
+ return undefined;
262
+ }
263
+ function resolveBatchFile(file, batchId, transactionState) {
264
+ const matchedTransaction = file.matchedTransactionId != null
265
+ ? (0, transactionSelector_1.getSupportedTransactionById)(transactionState, file.matchedTransactionId)
266
+ : undefined;
267
+ const candidates = file.candidates
268
+ ?.map((ref) => {
269
+ const transaction = (0, transactionSelector_1.getSupportedTransactionById)(transactionState, ref.transactionId);
270
+ return transaction != null
271
+ ? { transaction, matchScore: ref.matchScore }
272
+ : undefined;
273
+ })
274
+ .filter((c) => c != null);
275
+ return {
276
+ attachmentId: file.attachmentId,
277
+ batchId,
278
+ fileDownloadUrl: file.fileDownloadUrl,
279
+ fileId: file.fileId,
280
+ filename: file.filename,
281
+ filePreviewUrl: file.filePreviewUrl,
282
+ status: file.status,
283
+ matchedTransaction,
284
+ candidates: candidates != null && candidates.length > 0
285
+ ? candidates
286
+ : undefined,
287
+ matchSource: file.matchSource,
64
288
  };
65
289
  }
@@ -16,7 +16,7 @@ const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAu
16
16
  function getExpenseAutomationTransactionView(state) {
17
17
  const { accountState, classState, classListState, accountListState, expenseAutomationTransactionsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, } = state;
18
18
  const { selectedTransactionCategorizationTab } = expenseAutomationTransactionsViewState;
19
- const { uiState, refreshStatus, saveStatus, markAsNotMiscategorizedStatus, transactionIdsBySelectedPeriod, transactionReviewLocalDataById, selectedCheckBoxTransactionIds, transactionIdsWithUnsavedData, selectedTransactionId, selectedTransactionLineId, } = expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab];
19
+ const { uiState, refreshStatus, saveStatus, markAsNotMiscategorizedStatus, transactionIdsBySelectedPeriod, transactionReviewLocalDataById, selectedCheckBoxTransactionIds, transactionIdsWithUnsavedData, uploadReceiptStatusById, selectedTransactionId, selectedTransactionLineId, } = expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab];
20
20
  const uncategorizedIncomeExpense = (0, accountListSelector_1.getUncategorizedAccounts)(accountState, accountListState, 'accountList');
21
21
  const accountList = (0, accountListSelector_1.getAccountList)(accountState, accountListState, 'accountList');
22
22
  const classList = (0, classListSelector_1.getClassList)(classState, classListState);
@@ -100,6 +100,7 @@ function getExpenseAutomationTransactionView(state) {
100
100
  completionStatus,
101
101
  totalCountByTab,
102
102
  fetchStateByTransactionTabs: fetchStateByTab,
103
+ uploadReceiptStatusById,
103
104
  selectedTransactionId,
104
105
  selectedTransactionLineId,
105
106
  };
@@ -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,7 +13,137 @@ export interface MissingReceiptsViewUIState {
12
13
  sortKey: MissingReceiptsSortKey;
13
14
  sortOrder: SortOrder;
14
15
  }
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
+ export declare const MIN_MANUAL_TRANSACTION_SEARCH_LENGTH = 2;
21
+ export type BatchStatusValue = 'pending' | 'processing' | 'completed';
22
+ export type BatchFileStatus = 'exact_match' | 'possible_matches' | 'no_match' | 'failed';
23
+ /** True for files that belong in the Unmatched tab (possible matches or no match). */
24
+ export declare function isUnmatchedTabFileStatus(status: BatchFileStatus): boolean;
25
+ export type BulkUploadPhase = 'idle' | 'uploading' | 'matching' | 'completed';
26
+ export type BulkUploadResultsTab = 'completed' | 'unmatched';
27
+ export type MissingReceiptsTab = 'missing' | BulkUploadResultsTab;
28
+ export type CompletedSubTab = 'all' | 'ai_accountant' | 'manual';
29
+ export type MatchSource = 'ai' | 'manual';
30
+ export interface CandidateRef {
31
+ matchScore: number;
32
+ transactionId: ID;
33
+ }
34
+ export interface MatchCandidate {
35
+ amount: number;
36
+ currencyCode: string;
37
+ matchScore: number;
38
+ transactionDate: string;
39
+ transactionId: ID;
40
+ transactionType: string;
41
+ vendorName: string;
42
+ vendorLogo?: string;
43
+ }
44
+ export interface BatchFile {
45
+ attachmentId: ID;
46
+ fileDownloadUrl: string | null;
47
+ fileId: ID;
48
+ filename: string;
49
+ filePreviewUrl: string | null;
50
+ status: BatchFileStatus;
51
+ candidates?: CandidateRef[];
52
+ matchedTransactionId?: ID;
53
+ matchSource?: MatchSource;
54
+ }
55
+ export interface BatchSummary {
56
+ failed: number;
57
+ matched: number;
58
+ noMatch: number;
59
+ possibleMatches: number;
60
+ total: number;
61
+ }
62
+ export interface BatchStatus {
63
+ batchId: ID;
64
+ progress: {
65
+ processed: number;
66
+ total: number;
67
+ };
68
+ status: BatchStatusValue;
69
+ }
70
+ export interface BatchDetails {
71
+ batchId: ID;
72
+ createdAt: string;
73
+ files: BatchFile[];
74
+ status: BatchStatusValue;
75
+ summary: BatchSummary;
76
+ }
77
+ export interface BatchListItem {
78
+ batchId: ID;
79
+ createdAt: string;
80
+ failedCount: number;
81
+ matchedCount: number;
82
+ noMatchCount: number;
83
+ possibleMatchesCount: number;
84
+ status: string;
85
+ totalFiles: number;
86
+ }
87
+ export interface ManualSearchResult {
88
+ amount: number;
89
+ currencyCode: string;
90
+ entityId: string;
91
+ memo: string;
92
+ transactionDate: string;
93
+ transactionId: ID;
94
+ transactionType: string;
95
+ vendorName: string;
96
+ /** Present when API/merged transaction state supplies a logo URL. */
97
+ vendorLogo?: string;
98
+ }
99
+ export interface ManualSearchState {
100
+ fetchState: FetchStateAndError;
101
+ /** True while appending the next page (initial search uses fetchState only). */
102
+ isLoadingMore: boolean;
103
+ nextPageToken: string | null;
104
+ pageSize: number;
105
+ results: ManualSearchResult[];
106
+ searchQuery: string;
107
+ totalCount: number;
108
+ }
109
+ export type CompletedTransactionsMatchType = 'all' | 'ai_accountant' | 'manual';
110
+ export interface CompletedTransactionsState {
111
+ fetchState: FetchStateAndError;
112
+ nextPageToken: string | null;
113
+ totalCount: number;
114
+ transactionIds: ID[];
115
+ }
116
+ export interface BulkUploadState {
117
+ batchDetailsById: Record<ID, BatchDetails>;
118
+ batchDetailsPaginationState: FetchStateAndError;
119
+ batchListByPeriod: Record<MonthYearPeriodId, BatchListItem[]>;
120
+ batchListFetchState: FetchStateAndError;
121
+ batchStatusById: Record<ID, BatchStatus>;
122
+ completedSubTab: CompletedSubTab;
123
+ completedTransactionsByPeriod: Record<string, CompletedTransactionsState>;
124
+ confirmMatchStatus: FetchStateAndError;
125
+ currentResultsTab: BulkUploadResultsTab;
126
+ failedBatchDetailIds: ID[];
127
+ /**
128
+ * Incremented when manual search Redux state is cleared so Unmatched `ManualSearchInput`
129
+ * instances remount and drop local query text.
130
+ */
131
+ manualSearch: ManualSearchState;
132
+ manualSearchUiResetKey: number;
133
+ phase: BulkUploadPhase;
134
+ sortKey: BulkUploadSortKey;
135
+ sortOrder: SortOrder;
136
+ uploadProgress: number;
137
+ uploadStatus: FetchStateAndError;
138
+ currentBatchId?: ID;
139
+ }
15
140
  export interface MissingReceiptsViewState extends FetchedState {
141
+ bulkUpload: BulkUploadState;
142
+ /**
143
+ * When set, the app shell should switch the Missing Receipts sub-tab (e.g. to Unmatched)
144
+ * once, then clear via `clearMissingReceiptsTabNavigation`.
145
+ */
146
+ pendingMissingReceiptsTabNavigation: BulkUploadResultsTab | null;
16
147
  refreshStatus: FetchStateAndError;
17
148
  transactionIdsBySelectedPeriod: Record<MonthYearPeriodId, ID[]>;
18
149
  uiState: MissingReceiptsViewUIState;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toMissingReceiptsSortKey = void 0;
3
+ 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,13 @@ 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
+ /** True for files that belong in the Unmatched tab (possible matches or no match). */
22
+ function isUnmatchedTabFileStatus(status) {
23
+ return status === 'possible_matches' || status === 'no_match';
24
+ }
@@ -15,7 +15,7 @@ import { VendorBase } from '../../../entity/vendor/vendorState';
15
15
  import { ZeniDate } from '../../../zeniDayJS';
16
16
  import { EntityRecommendationKey } from '../../recommendation/recommendationState';
17
17
  import { TransactionDetailKey } from '../../transactionDetail/transactionDetailState';
18
- export declare const toTransactionsSortKey: (v: string) => "date" | "amount" | "vendor" | "category" | "class" | "memo" | "transaction_type";
18
+ export declare const toTransactionsSortKey: (v: string) => "date" | "amount" | "vendor" | "category" | "class" | "payment_account" | "transaction_type" | "memo_and_receipt";
19
19
  export type TransactionsSortKey = ReturnType<typeof toTransactionsSortKey>;
20
20
  export declare const TRANSACTIONS_TABS: readonly ["review", "autoCategorized"];
21
21
  export declare const toTransactionsTabKey: (v: string) => "review" | "autoCategorized";
@@ -97,6 +97,7 @@ export interface TransactionsTabViewState extends FetchedState {
97
97
  transactionIdsWithUnsavedData: ID[];
98
98
  transactionReviewLocalDataById: Record<ID | TransactionDetailKey, SupportedTransactionCategorization>;
99
99
  uiState: TransactionsViewUIState;
100
+ uploadReceiptStatusById: Record<ID, FetchStateAndError>;
100
101
  selectedTransactionId?: ID;
101
102
  selectedTransactionLineId?: ID;
102
103
  }
@@ -7,10 +7,11 @@ const TRANSACTIONS_SORT_KEYS = [
7
7
  'vendor',
8
8
  'amount',
9
9
  'transaction_type',
10
+ 'payment_account',
10
11
  'date',
11
12
  'category',
12
13
  'class',
13
- 'memo',
14
+ 'memo_and_receipt',
14
15
  ];
15
16
  const toTransactionsSortKey = (v) => (0, stringToUnion_1.stringToUnion)(v, TRANSACTIONS_SORT_KEYS);
16
17
  exports.toTransactionsSortKey = toTransactionsSortKey;
@@ -53,4 +53,5 @@ export declare const onboardingStepsData: (isValidConnection: boolean, productSe
53
53
  allStepsData: OnboardingStep[];
54
54
  requiredStepsData: OnboardingStep[];
55
55
  };
56
+ export declare function isCompanyDetailsSavePending(fileState: FileState, company?: CompanyView, primaryContact?: User, companyDetailsLocalData?: CompanyDetails): boolean;
56
57
  export declare const getProductSettingsString: (productSettings: TenantProductSettings | undefined) => string;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getProductSettingsString = exports.onboardingStepsData = void 0;
4
4
  exports.getOnboardingCustomerView = getOnboardingCustomerView;
5
5
  exports.isOfficerDetailsCompleted = isOfficerDetailsCompleted;
6
+ exports.isCompanyDetailsSavePending = isCompanyDetailsSavePending;
6
7
  const reduceFetchState_1 = require("../../../commonStateTypes/reduceFetchState");
7
8
  const fileSelector_1 = require("../../../entity/file/fileSelector");
8
9
  const paymentAccountSelector_1 = require("../../../entity/paymentAccount/paymentAccountSelector");
@@ -229,12 +230,12 @@ function isCompanyDetailsSavePending(fileState, company, primaryContact, company
229
230
  return false;
230
231
  }
231
232
  const { companyInfo, incInfo, taxInfo, questionaire } = company.company.company;
232
- const { companyDescription, companyLegalName, companyUrl, phone } = companyInfo;
233
- const { fileIds, companyIncDate: incDate, companyIncType } = incInfo;
233
+ const { companyDescription, companyLegalName, companyUrl, phone, companySourceOfFunds, companySourceOfFundsDescription, countriesOfOperations, transactionVolume, transactionVolumeDescription, purposeOfAccount, purposeOfAccountDescription, regulatedStatus, regulatedStatusDescription, usNexus, usNexusTypes, } = companyInfo;
234
+ const { fileIds, companyIncDate: incDate, companyIncState, companyIncType, companySubIndustry, } = incInfo;
234
235
  const { companyIndustry } = questionaire;
235
236
  const { taxId } = taxInfo;
236
237
  const companyFileIds = (0, fileSelector_1.getFilesByFileIds)(fileState, fileIds).map((file) => file.fileId);
237
- const { companyDescription: companyDescriptionLocalData, companyIndustry: companyIndustryLocalData, companyLegalName: companyLegalNameLocalData, taxIdOrEIN: taxIdLocalData, incDate: incDateLocalData, phone: companyPhoneLocalData, website: companyUrlLocalData, companyFiles: companyFilesLocalData, typeOfIncorporation: companyIncTypeLocalData, primaryContactLocalData, } = companyDetailsLocalData;
238
+ const { companyDescription: companyDescriptionLocalData, companyIndustry: companyIndustryLocalData, companyLegalName: companyLegalNameLocalData, taxIdOrEIN: taxIdLocalData, incDate: incDateLocalData, phone: companyPhoneLocalData, website: companyUrlLocalData, companyFiles: companyFilesLocalData, stateOfIncorporation: stateOfIncorporationLocalData, typeOfIncorporation: companyIncTypeLocalData, companySourceOfFunds: companySourceOfFundsLocalData, companySourceOfFundsDescription: companySourceOfFundsDescriptionLocalData, countriesOfOperations: countriesOfOperationsLocalData, companySubIndustry: companySubIndustryLocalData, transactionVolume: transactionVolumeLocalData, transactionVolumeDescription: transactionVolumeDescriptionLocalData, purposeOfAccount: purposeOfAccountLocalData, purposeOfAccountDescription: purposeOfAccountDescriptionLocalData, regulatedStatus: regulatedStatusLocalData, regulatedStatusDescription: regulatedStatusDescriptionLocalData, usNexus: usNexusLocalData, usNexusTypes: usNexusTypesLocalData, primaryContactLocalData, } = companyDetailsLocalData;
238
239
  const fileIdsLocalData = companyFilesLocalData.map((file) => file.fileId);
239
240
  if (primaryContact != null) {
240
241
  const { firstName, lastName, email } = primaryContact;
@@ -244,6 +245,10 @@ function isCompanyDetailsSavePending(fileState, company, primaryContact, company
244
245
  return true;
245
246
  }
246
247
  }
248
+ const countriesOfOperationsMatch = JSON.stringify(countriesOfOperations ?? []) ===
249
+ JSON.stringify(countriesOfOperationsLocalData ?? []);
250
+ const usNexusTypesMatch = JSON.stringify(usNexusTypes ?? []) ===
251
+ JSON.stringify(usNexusTypesLocalData ?? []);
247
252
  return (companyDescription != companyDescriptionLocalData ||
248
253
  companyIndustry != companyIndustryLocalData ||
249
254
  companyLegalName != companyLegalNameLocalData ||
@@ -251,7 +256,21 @@ function isCompanyDetailsSavePending(fileState, company, primaryContact, company
251
256
  incDate?.toString() != incDateLocalData?.toString() ||
252
257
  phone != companyPhoneLocalData ||
253
258
  companyUrl?.toString() != companyUrlLocalData?.toString() ||
259
+ companyIncState != stateOfIncorporationLocalData ||
260
+ companySourceOfFunds != companySourceOfFundsLocalData ||
261
+ companySourceOfFundsDescription !=
262
+ companySourceOfFundsDescriptionLocalData ||
263
+ !countriesOfOperationsMatch ||
254
264
  companyIncType != companyIncTypeLocalData ||
265
+ transactionVolume != transactionVolumeLocalData ||
266
+ transactionVolumeDescription != transactionVolumeDescriptionLocalData ||
267
+ purposeOfAccount != purposeOfAccountLocalData ||
268
+ purposeOfAccountDescription != purposeOfAccountDescriptionLocalData ||
269
+ regulatedStatus != regulatedStatusLocalData ||
270
+ regulatedStatusDescription != regulatedStatusDescriptionLocalData ||
271
+ usNexus != usNexusLocalData ||
272
+ !usNexusTypesMatch ||
273
+ companySubIndustry != companySubIndustryLocalData ||
255
274
  !(fileIdsLocalData.length === companyFileIds.length &&
256
275
  companyFileIds.every((fileId) => fileIdsLocalData.includes(fileId))));
257
276
  }
@@ -5,8 +5,8 @@ const chargeCardRepaymentSelector_1 = require("../../../../entity/chargeCardRepa
5
5
  const userSelector_1 = require("../../../../entity/user/userSelector");
6
6
  const chargeCardPaymentHistoryHelpers_1 = require("./chargeCardPaymentHistoryHelpers");
7
7
  const getChargeCardPaymentHistoryDownloadReport = (state) => {
8
- const { chargeCardPaymentHistoryState, chargeCardRepaymentState, userState, } = state;
9
- const { filters, repaymentHistoryIds, searchText, uiState, fetchState, error, } = chargeCardPaymentHistoryState;
8
+ const { chargeCardPaymentHistoryState, chargeCardRepaymentState, userState } = state;
9
+ const { filters, repaymentHistoryIds, searchText, uiState, fetchState, error } = chargeCardPaymentHistoryState;
10
10
  const repaymentHistory = (0, chargeCardRepaymentSelector_1.getChargeCardRepaymentByIds)(chargeCardRepaymentState, repaymentHistoryIds);
11
11
  const repaymentHistoryUserIds = Array.from(new Set(repaymentHistory.map((r) => r.paidById)));
12
12
  const repaymentHistoryUsers = (0, userSelector_1.getUsersByUserIds)(userState, repaymentHistoryUserIds);
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getChargeCardPaymentHistoryView = void 0;
4
4
  const reduceFetchState_1 = require("../../../../commonStateTypes/reduceFetchState");
5
5
  const chargeCardRepaymentSelector_1 = require("../../../../entity/chargeCardRepayment/chargeCardRepaymentSelector");
6
- const userSelector_1 = require("../../../../entity/user/userSelector");
7
- const setupViewSelector_1 = require("../../commonSetup/setupViewSelector");
8
6
  const depositAccountSelector_1 = require("../../../../entity/depositAccount/depositAccountSelector");
9
7
  const paymentAccountSelector_1 = require("../../../../entity/paymentAccount/paymentAccountSelector");
8
+ const userSelector_1 = require("../../../../entity/user/userSelector");
9
+ const setupViewSelector_1 = require("../../commonSetup/setupViewSelector");
10
10
  const depositAccountListSelector_1 = require("../../zeniAccounts/depositAccountList/depositAccountListSelector");
11
11
  const paymentAccountListSelector_1 = require("../../zeniAccounts/paymentAccountList/paymentAccountListSelector");
12
12
  const chargeCardPaymentHistoryHelpers_1 = require("./chargeCardPaymentHistoryHelpers");
@@ -18,7 +18,10 @@ const getChargeCardRepaymentDetail = (state) => {
18
18
  else {
19
19
  const depositFundingFromLimit = Object.values(depositAccountState.depositAccountLimitForChargeCardByID ?? {}).map(setupViewSelector_1.mapDepositAccountWithLimitToFundingAccount);
20
20
  const paymentFundingAccounts = (0, setupViewSelector_1.getAllFundingAccounts)([], paymentAccountsView.paymentAccounts, paymentAccountListState.paymentAccountBalanceFetchStatus);
21
- transferFromAccounts = [...depositFundingFromLimit, ...paymentFundingAccounts];
21
+ transferFromAccounts = [
22
+ ...depositFundingFromLimit,
23
+ ...paymentFundingAccounts,
24
+ ];
22
25
  }
23
26
  }
24
27
  const reducedFetchState = (0, reduceFetchState_1.reduceAnyCompletedFetchState)([