@zeniai/client-epic-state 5.0.67 → 5.0.69-beta0ND

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 (150) hide show
  1. package/lib/commonStateTypes/cacheOverrideFetchReducer.d.ts +17 -0
  2. package/lib/commonStateTypes/cacheOverrideFetchReducer.js +20 -0
  3. package/lib/commonStateTypes/pusherActions.d.ts +11 -0
  4. package/lib/commonStateTypes/pusherActions.js +6 -0
  5. package/lib/coreEpics.js +1 -1
  6. package/lib/entity/account/accountSelector.d.ts +1 -1
  7. package/lib/entity/account/accountState.d.ts +1 -1
  8. package/lib/entity/account/subAccountSelector.d.ts +1 -1
  9. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerPayload.js +1 -3
  10. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerReducer.js +1 -2
  11. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerSelector.d.ts +1 -1
  12. package/lib/entity/chargeCard/chargeCardReducer.d.ts +19 -2
  13. package/lib/entity/chargeCard/chargeCardReducer.js +35 -2
  14. package/lib/entity/chargeCardTransaction/chargeCardTransactionReducer.d.ts +14 -1
  15. package/lib/entity/chargeCardTransaction/chargeCardTransactionReducer.js +36 -2
  16. package/lib/entity/sectionProjectView/sectionProjectViewReducer.d.ts +1 -1
  17. package/lib/entity/sectionProjectView/sectionProjectViewSelector.js +1 -1
  18. package/lib/entity/tenant/SessionManager.js +6 -3
  19. package/lib/entity/tenant/clearAllEpic.d.ts +2 -2
  20. package/lib/entity/tenant/clearAllEpic.js +2 -2
  21. package/lib/entity/tenant/epic/saveAPIKeyConnectionEpic.js +6 -2
  22. package/lib/entity/tenant/epic/saveOAuthConnectionEpic.js +6 -2
  23. package/lib/entity/tenant/tenantReducer.js +6 -1
  24. package/lib/entity/transaction/payloadTypes/transactionLinePayload.js +3 -1
  25. package/lib/epic.d.ts +12 -10
  26. package/lib/epic.js +13 -11
  27. package/lib/esm/commonStateTypes/cacheOverrideFetchReducer.js +16 -0
  28. package/lib/esm/commonStateTypes/pusherActions.js +3 -0
  29. package/lib/esm/coreEpics.js +1 -1
  30. package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerPayload.js +1 -3
  31. package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerReducer.js +1 -2
  32. package/lib/esm/entity/chargeCard/chargeCardReducer.js +34 -1
  33. package/lib/esm/entity/chargeCardTransaction/chargeCardTransactionReducer.js +35 -1
  34. package/lib/esm/entity/sectionProjectView/sectionProjectViewSelector.js +1 -1
  35. package/lib/esm/entity/tenant/SessionManager.js +4 -1
  36. package/lib/esm/entity/tenant/clearAllEpic.js +2 -2
  37. package/lib/esm/entity/tenant/epic/saveAPIKeyConnectionEpic.js +6 -2
  38. package/lib/esm/entity/tenant/epic/saveOAuthConnectionEpic.js +6 -2
  39. package/lib/esm/entity/tenant/tenantReducer.js +6 -1
  40. package/lib/esm/entity/transaction/payloadTypes/transactionLinePayload.js +3 -1
  41. package/lib/esm/epic.js +13 -11
  42. package/lib/esm/index.js +23 -17
  43. package/lib/esm/reducer.js +2 -2
  44. package/lib/esm/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.js +2 -5
  45. package/lib/esm/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.js +2 -5
  46. package/lib/esm/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +4 -1
  47. package/lib/esm/view/companyTaskManagerView/companyTaskManagerViewSelector.js +1 -1
  48. package/lib/esm/view/companyTaskManagerView/epics/fetchTaskManagerMetricsEpic.js +1 -1
  49. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +2 -2
  50. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +2 -1
  51. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.js +8 -6
  52. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +7 -1
  53. package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +11 -1
  54. package/lib/esm/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +2 -1
  55. package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +127 -1
  56. package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +20 -1
  57. package/lib/esm/view/expenseAutomationView/types/completedSubTab.js +17 -0
  58. package/lib/esm/view/expenseAutomationView/types/missingReceiptsViewState.js +0 -2
  59. package/lib/esm/view/financeStatement/financeStatementSelector.js +1 -1
  60. package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewReducer.js +61 -50
  61. package/lib/esm/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailReducer.js +3 -2
  62. package/lib/esm/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.js +3 -2
  63. package/lib/esm/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +55 -18
  64. package/lib/esm/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.js +16 -2
  65. package/lib/esm/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailPageEpic.js +5 -4
  66. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +26 -9
  67. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.js +9 -6
  68. package/lib/esm/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryReducer.js +3 -2
  69. package/lib/esm/view/spendManagement/chargeCards/chargeCardPaymentHistory/fetchChargeCardPaymentPageEpic.js +1 -1
  70. package/lib/esm/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailReducer.js +7 -3
  71. package/lib/esm/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.js +49 -0
  72. package/lib/esm/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.js +58 -0
  73. package/lib/esm/view/spendManagement/commonSetup/kycKybAutofillActions.js +12 -0
  74. package/lib/esm/view/spendManagement/commonSetup/kycKybParseMapper.js +205 -0
  75. package/lib/esm/view/spendManagement/commonSetup/setupViewReducer.js +71 -52
  76. package/lib/esm/view/spendManagement/commonSetup/setupViewSelector.js +2 -0
  77. package/lib/esm/view/spendManagement/commonSetup/types/kycKybAutofill.js +28 -0
  78. package/lib/esm/view/taskManager/cannedResponsesView/epics/fetchCannedResponsesEpic.js +1 -1
  79. package/lib/esm/view/taskManager/cannedResponsesView/epics/saveCannedResponseEpic.js +1 -1
  80. package/lib/esm/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.js +1 -1
  81. package/lib/esm/view/transactionDetail/transactionDetailSelector.js +7 -1
  82. package/lib/index.d.ts +26 -19
  83. package/lib/index.js +83 -58
  84. package/lib/reducer.d.ts +2 -2
  85. package/lib/reducer.js +2 -2
  86. package/lib/view/aiAccountantView/aiAccountantViewPayload.d.ts +2 -2
  87. package/lib/view/aiAccountantView/aiAccountantViewReducer.d.ts +1 -1
  88. package/lib/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.js +2 -5
  89. package/lib/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.js +2 -5
  90. package/lib/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +4 -1
  91. package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.d.ts +1 -1
  92. package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.js +1 -1
  93. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +2 -2
  94. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +2 -1
  95. package/lib/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.js +8 -6
  96. package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +7 -1
  97. package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.d.ts +2 -2
  98. package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +10 -0
  99. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  100. package/lib/view/expenseAutomationView/payload/transactionCategorizationPayload.d.ts +21 -0
  101. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +2 -1
  102. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +2 -1
  103. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +9 -3
  104. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +128 -2
  105. package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +2 -1
  106. package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +14 -0
  107. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +20 -1
  108. package/lib/view/expenseAutomationView/types/completedSubTab.d.ts +10 -0
  109. package/lib/view/expenseAutomationView/types/completedSubTab.js +21 -0
  110. package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +1 -2
  111. package/lib/view/expenseAutomationView/types/missingReceiptsViewState.js +1 -4
  112. package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +41 -2
  113. package/lib/view/financeStatement/financeStatementSelector.js +1 -1
  114. package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.d.ts +25 -2
  115. package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.js +62 -51
  116. package/lib/view/onboardingView/customerView/onboardingCustomerViewState.d.ts +10 -0
  117. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelectorTypes.d.ts +1 -1
  118. package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailReducer.d.ts +3 -1
  119. package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailReducer.js +3 -2
  120. package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.d.ts +3 -1
  121. package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.js +3 -2
  122. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +55 -18
  123. package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.js +16 -2
  124. package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailPageEpic.js +5 -4
  125. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.d.ts +18 -3
  126. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +27 -10
  127. package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.js +9 -6
  128. package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryReducer.d.ts +3 -1
  129. package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryReducer.js +3 -2
  130. package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/fetchChargeCardPaymentPageEpic.js +1 -1
  131. package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailReducer.d.ts +3 -1
  132. package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailReducer.js +7 -3
  133. package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.d.ts +8 -0
  134. package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.js +53 -0
  135. package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.d.ts +8 -0
  136. package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.js +62 -0
  137. package/lib/view/spendManagement/commonSetup/kycKybAutofillActions.d.ts +27 -0
  138. package/lib/view/spendManagement/commonSetup/kycKybAutofillActions.js +15 -0
  139. package/lib/view/spendManagement/commonSetup/kycKybParseMapper.d.ts +24 -0
  140. package/lib/view/spendManagement/commonSetup/kycKybParseMapper.js +213 -0
  141. package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +24 -2
  142. package/lib/view/spendManagement/commonSetup/setupViewReducer.js +72 -53
  143. package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +4 -0
  144. package/lib/view/spendManagement/commonSetup/setupViewSelector.js +2 -0
  145. package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +12 -0
  146. package/lib/view/spendManagement/commonSetup/types/kycKybAutofill.d.ts +125 -0
  147. package/lib/view/spendManagement/commonSetup/types/kycKybAutofill.js +32 -0
  148. package/lib/view/transactionDetail/transactionDetailSelector.js +7 -1
  149. package/lib/view/zeniOAuthView/zeniOAuthSelector.d.ts +1 -1
  150. package/package.json +9 -4
@@ -2,7 +2,8 @@ import { CompletionStatusType, FetchStateAndError, ID } from '../../../commonSta
2
2
  import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
3
3
  import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
4
4
  import { SupportedTransaction } from '../../../entity/transaction/transactionState';
5
- import type { BatchFileStatus, BatchListItem, BatchStatus, BulkUploadPhase, BulkUploadResultsTab, BulkUploadSortKey, CompletedSubTab, ManualSearchState, MatchSource, MissingReceiptsViewUIState } from '../types/missingReceiptsViewState';
5
+ import type { CompletedSubTab } from '../types/completedSubTab';
6
+ import type { BatchFileStatus, BatchListItem, BatchStatus, BulkUploadPhase, BulkUploadResultsTab, BulkUploadSortKey, ManualSearchState, MatchSource, MissingReceiptsViewUIState } from '../types/missingReceiptsViewState';
6
7
  export interface CompletedTransactionsSelectorData {
7
8
  fetchState: FetchStateAndError;
8
9
  nextPageToken: string | null;
@@ -7,6 +7,7 @@ import { ClassBase } from '../../../entity/class/classState';
7
7
  import { SupportedTransactionWithCOT } from '../../../entity/transaction/transactionState';
8
8
  import { UncategorizedAccounts } from '../../accountList/accountListSelector';
9
9
  import { ProjectListSelectorView } from '../../projectList/projectListSelector';
10
+ import { CompletedSubTab } from '../types/completedSubTab';
10
11
  import { TransactionReviewLocalData, TransactionsTab, TransactionsViewUIState } from '../types/transactionsViewState';
11
12
  export interface TransactionReviewLocalDataSelectorView {
12
13
  transactionId: ID;
@@ -21,10 +22,23 @@ export interface ExpenseAutomationTransactionViewSelector extends SelectorView {
21
22
  fetchStateByTransactionTabs: Record<TransactionsTab, FetchStateAndError>;
22
23
  isAccountingProjectsEnabled: boolean;
23
24
  markAsNotMiscategorizedStatus: FetchStateAndError;
25
+ /**
26
+ * Parent tab badge counts, sourced from the listing response's
27
+ * `parent_tab_total_count`. Used exclusively to drive the navbar / tab
28
+ * strip badge labels — every other count consumer (pagination, in-list
29
+ * "showing X of Y", save flows) keeps reading {@link totalCountByTab}.
30
+ */
31
+ parentTabTotalCountByTab: Record<TransactionsTab, number>;
24
32
  projectList: ProjectListSelectorView;
25
33
  refreshStatus: FetchStateAndError;
26
34
  saveStatus: FetchStateAndError;
27
35
  selectedCheckBoxTransactionIds: ID[];
36
+ selectedTransactionCategorizationCompletedSubTab: CompletedSubTab;
37
+ /**
38
+ * Per-(sub-)tab counts mirroring `total_count` from the listing response.
39
+ * Powers pagination via `InfiniteLoader.itemCount`, in-list count copy,
40
+ * and the `resetTransactionCategorizationLocalData` round-trip.
41
+ */
28
42
  totalCountByTab: Record<TransactionsTab, number>;
29
43
  transactionIdsWithUnsavedData: ID[];
30
44
  transactionLocalData: TransactionReviewLocalDataSelectorView[];
@@ -16,7 +16,7 @@ const projectListSelector_1 = require("../../projectList/projectListSelector");
16
16
  const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
17
17
  function getExpenseAutomationTransactionView(state) {
18
18
  const { accountState, classState, classListState, accountListState, expenseAutomationTransactionsViewState, expenseAutomationViewState, projectState, projectListState, transactionState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
19
- const { selectedTransactionCategorizationTab } = expenseAutomationTransactionsViewState;
19
+ const { selectedTransactionCategorizationCompletedSubTab, selectedTransactionCategorizationTab, } = expenseAutomationTransactionsViewState;
20
20
  const { uiState, refreshStatus, saveStatus, markAsNotMiscategorizedStatus, transactionIdsBySelectedPeriod, transactionReviewLocalDataById, selectedCheckBoxTransactionIds, transactionIdsWithUnsavedData, uploadReceiptStatusById, selectedTransactionId, selectedTransactionLineId, } = expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab];
21
21
  const uncategorizedIncomeExpense = (0, accountListSelector_1.getUncategorizedAccounts)(accountState, accountListState, 'accountList');
22
22
  const accountList = (0, accountListSelector_1.getAccountList)(accountState, accountListState, 'accountList');
@@ -69,10 +69,27 @@ function getExpenseAutomationTransactionView(state) {
69
69
  .uiState.totalCount;
70
70
  const totalCountByAutoCat = expenseAutomationTransactionsViewState.transactionCategorizationView
71
71
  .autoCategorized.uiState.totalCount;
72
+ // Per-(sub-)tab counts powering pagination, in-list "showing X of Y", and
73
+ // any save/refresh round-trips. Sourced from `uiState.totalCount` which
74
+ // mirrors the response's `total_count` for whatever tab/sub-tab the user is
75
+ // viewing (e.g. only the Manual sub-tab rows for Completed → Manual).
72
76
  const totalCountByTab = {
73
77
  review: monthYearPeriodId != null ? totalCountByReview[monthYearPeriodId] : 0,
74
78
  autoCategorized: monthYearPeriodId != null ? totalCountByAutoCat[monthYearPeriodId] : 0,
75
79
  };
80
+ // Parent-tab badge counts. Sourced from `parent_tab_total_count` in the
81
+ // listing response and used exclusively by the navbar / tab strip badges.
82
+ // Independent of which Completed sub-tab is active so the badge stays
83
+ // stable across sub-tab switches.
84
+ const parentTotalCountByTab = expenseAutomationTransactionsViewState.parentTotalCountByTab;
85
+ const parentTabTotalCountByTab = {
86
+ review: monthYearPeriodId != null
87
+ ? (parentTotalCountByTab.review[monthYearPeriodId] ?? 0)
88
+ : 0,
89
+ autoCategorized: monthYearPeriodId != null
90
+ ? (parentTotalCountByTab.autoCategorized[monthYearPeriodId] ?? 0)
91
+ : 0,
92
+ };
76
93
  const fetchStateByTab = {
77
94
  review: {
78
95
  fetchState: expenseAutomationTransactionsViewState.transactionCategorizationView
@@ -114,9 +131,11 @@ function getExpenseAutomationTransactionView(state) {
114
131
  markAsNotMiscategorizedStatus,
115
132
  completionStatus,
116
133
  totalCountByTab,
134
+ parentTabTotalCountByTab,
117
135
  fetchStateByTransactionTabs: fetchStateByTab,
118
136
  uploadReceiptStatusById,
119
137
  selectedTransactionId,
120
138
  selectedTransactionLineId,
139
+ selectedTransactionCategorizationCompletedSubTab,
121
140
  };
122
141
  }
@@ -0,0 +1,10 @@
1
+ export declare const toCompletedSubTab: (v: string) => "all" | "manual" | "ai_accountant";
2
+ export type CompletedSubTab = ReturnType<typeof toCompletedSubTab>;
3
+ /**
4
+ * "No sub-tab filter" sentinel — single source of truth for the default
5
+ * value of {@link CompletedSubTab}. Use this constant in initial slice
6
+ * state and at any call site that needs to fall back to the parent-tab
7
+ * listing semantics (review tab requests, manual-search overrides, etc.)
8
+ * so a future rename of the union doesn't require chasing literals.
9
+ */
10
+ export declare const DEFAULT_COMPLETED_SUB_TAB: CompletedSubTab;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DEFAULT_COMPLETED_SUB_TAB = exports.toCompletedSubTab = void 0;
4
+ const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
5
+ /**
6
+ * Sub-tabs that can appear under any "Completed" tab in the Expense Automation
7
+ * surface (Transaction Categorization Completed and Missing Receipts Completed
8
+ * both use this exact union). Forwarded verbatim to listing APIs as `sub_tab`
9
+ * / `match_type`. `'all'` preserves parent-tab semantics on the backend.
10
+ */
11
+ const COMPLETED_SUB_TABS = ['all', 'ai_accountant', 'manual'];
12
+ const toCompletedSubTab = (v) => (0, stringToUnion_1.stringToUnion)(v.trim().toLowerCase(), COMPLETED_SUB_TABS);
13
+ exports.toCompletedSubTab = toCompletedSubTab;
14
+ /**
15
+ * "No sub-tab filter" sentinel — single source of truth for the default
16
+ * value of {@link CompletedSubTab}. Use this constant in initial slice
17
+ * state and at any call site that needs to fall back to the parent-tab
18
+ * listing semantics (review tab requests, manual-search overrides, etc.)
19
+ * so a future rename of the union doesn't require chasing literals.
20
+ */
21
+ exports.DEFAULT_COMPLETED_SUB_TAB = 'all';
@@ -1,6 +1,7 @@
1
1
  import { FetchStateAndError, FetchedState, ID } from '../../../commonStateTypes/common';
2
2
  import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
3
3
  import { MonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
4
+ import { CompletedSubTab } from './completedSubTab';
4
5
  export declare const toMissingReceiptsSortKey: (v: string) => "date" | "amount" | "vendor" | "category" | "class";
5
6
  export type MissingReceiptsSortKey = ReturnType<typeof toMissingReceiptsSortKey>;
6
7
  export interface MissingReceiptsViewUIState {
@@ -31,8 +32,6 @@ export declare const toBulkUploadResultsTab: (v: string) => "completed" | "unmat
31
32
  export type BulkUploadResultsTab = ReturnType<typeof toBulkUploadResultsTab>;
32
33
  export declare const toMissingReceiptsTab: (v: string) => "completed" | "unmatched" | "missing";
33
34
  export type MissingReceiptsTab = ReturnType<typeof toMissingReceiptsTab>;
34
- export declare const toCompletedSubTab: (v: string) => "all" | "manual" | "ai_accountant";
35
- export type CompletedSubTab = ReturnType<typeof toCompletedSubTab>;
36
35
  export declare const toMatchSource: (v: string) => "manual" | "ai";
37
36
  export type MatchSource = ReturnType<typeof toMatchSource>;
38
37
  export declare const toBulkUploadSortKey: (v: string) => "date" | "amount" | "vendor" | "category" | "class";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toBulkUploadSortKey = exports.toMatchSource = exports.toCompletedSubTab = exports.toMissingReceiptsTab = exports.toBulkUploadResultsTab = exports.toBulkUploadPhase = exports.toBatchFileStatus = exports.BATCH_FILE_STATUSES = exports.toBatchStatusValue = exports.MIN_MANUAL_TRANSACTION_SEARCH_LENGTH = exports.toMissingReceiptsSortKey = void 0;
3
+ exports.toBulkUploadSortKey = exports.toMatchSource = exports.toMissingReceiptsTab = exports.toBulkUploadResultsTab = exports.toBulkUploadPhase = exports.toBatchFileStatus = exports.BATCH_FILE_STATUSES = exports.toBatchStatusValue = exports.MIN_MANUAL_TRANSACTION_SEARCH_LENGTH = exports.toMissingReceiptsSortKey = void 0;
4
4
  exports.isUnmatchedTabFileStatus = isUnmatchedTabFileStatus;
5
5
  const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
6
6
  const MISSING_RECEIPTS_SORT_KEYS = [
@@ -49,9 +49,6 @@ exports.toBulkUploadResultsTab = toBulkUploadResultsTab;
49
49
  const MISSING_RECEIPTS_TABS = ['missing', 'completed', 'unmatched'];
50
50
  const toMissingReceiptsTab = (v) => (0, stringToUnion_1.stringToUnion)(v.trim().toLowerCase(), MISSING_RECEIPTS_TABS);
51
51
  exports.toMissingReceiptsTab = toMissingReceiptsTab;
52
- const COMPLETED_SUB_TABS = ['all', 'ai_accountant', 'manual'];
53
- const toCompletedSubTab = (v) => (0, stringToUnion_1.stringToUnion)(v.trim().toLowerCase(), COMPLETED_SUB_TABS);
54
- exports.toCompletedSubTab = toCompletedSubTab;
55
52
  const MATCH_SOURCES = ['ai', 'manual'];
56
53
  const toMatchSource = (v) => (0, stringToUnion_1.stringToUnion)(v.trim().toLowerCase(), MATCH_SOURCES);
57
54
  exports.toMatchSource = toMatchSource;
@@ -1,5 +1,5 @@
1
1
  import { Amount } from '../../../commonStateTypes/amount';
2
- import { FetchStateAndError, FetchedState, ID } from '../../../commonStateTypes/common';
2
+ import { FetchState, FetchStateAndError, FetchedState, ID } from '../../../commonStateTypes/common';
3
3
  import { Recommendation, RecommendationWithCOT } from '../../../commonStateTypes/recommendationBase';
4
4
  import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
5
5
  import { MonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
@@ -7,15 +7,17 @@ import { PageToken } from '../../../commonStateTypes/viewAndReport/viewAndReport
7
7
  import { AccountBase } from '../../../entity/account/accountState';
8
8
  import { ClassBase } from '../../../entity/class/classState';
9
9
  import { CustomerBase } from '../../../entity/customer/customerState';
10
- import { ProjectBase } from '../../../entity/project/projectState';
11
10
  import { Entity, EntityType } from '../../../entity/genericEntity/entity';
11
+ import { ProjectBase } from '../../../entity/project/projectState';
12
12
  import { TransactionID } from '../../../entity/transaction/stateTypes/transaction';
13
13
  import { BillableStatus, CategorizationStatusType, PlatformLineDetailType, ProductOrService, TransactionLineBase } from '../../../entity/transaction/stateTypes/transactionLine';
14
14
  import { TransactionCategory, TransactionType } from '../../../entity/transaction/stateTypes/transactionType';
15
15
  import { VendorBase } from '../../../entity/vendor/vendorState';
16
+ import { ZeniAPIStatus } from '../../../responsePayload';
16
17
  import { ZeniDate } from '../../../zeniDayJS';
17
18
  import { EntityRecommendationKey } from '../../recommendation/recommendationState';
18
19
  import { TransactionDetailKey } from '../../transactionDetail/transactionDetailState';
20
+ import { CompletedSubTab } from './completedSubTab';
19
21
  export declare const toTransactionsSortKey: (v: string) => "date" | "amount" | "vendor" | "project" | "category" | "class" | "payment_account" | "transaction_type" | "memo_and_receipt";
20
22
  export type TransactionsSortKey = ReturnType<typeof toTransactionsSortKey>;
21
23
  export declare const TRANSACTIONS_TABS: readonly ["review", "autoCategorized"];
@@ -103,7 +105,44 @@ export interface TransactionsTabViewState extends FetchedState {
103
105
  selectedTransactionId?: ID;
104
106
  selectedTransactionLineId?: ID;
105
107
  }
108
+ /**
109
+ * Snapshot of the autoCategorized tab's paginated dataset for a single
110
+ * Completed sub-tab. Stored in {@link TransactionsViewState.autoCategorizedSubTabCache}
111
+ * so revisiting an already-loaded sub-tab can short-circuit the fetch epic
112
+ * (mirrors parent-tab caching). The snapshot is period-spanning — both the
113
+ * `totalCount` map and `transactionIdsBySelectedPeriod` map preserve every
114
+ * period the user has paged through under that sub-tab.
115
+ *
116
+ * `scrollPosition` is captured per sub-tab so revisiting a sub-tab restores
117
+ * the user's last scroll offset; switching to a fresh / never-visited sub-tab
118
+ * starts at the top instead of inheriting the previous sub-tab's offset.
119
+ */
120
+ export interface AutoCategorizedSubTabSnapshot {
121
+ error: ZeniAPIStatus | undefined;
122
+ fetchState: FetchState;
123
+ pageToken: PageToken;
124
+ scrollPosition: TransactionsViewUIState['scrollPosition'];
125
+ totalCount: Record<MonthYearPeriodId, number>;
126
+ transactionIdsBySelectedPeriod: Record<MonthYearPeriodId, ID[]>;
127
+ }
106
128
  export type TransactionsViewState = {
129
+ /**
130
+ * Per-sub-tab snapshot cache for the Completed (autoCategorized) tab. Keyed
131
+ * by {@link CompletedSubTab}. Populated as the user navigates between
132
+ * sub-tabs and consulted on every switch — the active autoCategorized slot
133
+ * is restored from here when a snapshot exists, otherwise it is reset and
134
+ * the fetch epic loads page 1 fresh.
135
+ */
136
+ autoCategorizedSubTabCache: Partial<Record<CompletedSubTab, AutoCategorizedSubTabSnapshot>>;
137
+ /**
138
+ * Period-keyed parent tab counts, scoped per {@link TransactionsTab}.
139
+ * Sourced from the listing response's `parent_tab_total_count` and used
140
+ * exclusively to drive the parent tab badges on the UI — every other
141
+ * count consumer (pagination, sub-tab chips, in-tab "showing X of Y")
142
+ * keeps reading from {@link TransactionsViewUIState.totalCount}.
143
+ */
144
+ parentTotalCountByTab: Record<TransactionsTab, Record<MonthYearPeriodId, number>>;
145
+ selectedTransactionCategorizationCompletedSubTab: CompletedSubTab;
107
146
  selectedTransactionCategorizationTab: TransactionsTab;
108
147
  transactionCategorizationView: Record<TransactionsTab, TransactionsTabViewState>;
109
148
  };
@@ -5,6 +5,7 @@ const toolkit_1 = require("@reduxjs/toolkit");
5
5
  const coaBalanceType_1 = require("../../commonStateTypes/coaBalance/coaBalanceType");
6
6
  const coaBalancesFilter_1 = require("../../commonStateTypes/coaBalance/coaBalancesFilter");
7
7
  const coaBalancesFilterClassesView_1 = require("../../commonStateTypes/coaBalance/coaBalancesFilterClassesView");
8
+ const coaBalancesFilterProjectView_1 = require("../../commonStateTypes/coaBalance/coaBalancesFilterProjectView");
8
9
  const dataAvailable_1 = require("../../commonStateTypes/dataAvailable");
9
10
  const reduceFetchState_1 = require("../../commonStateTypes/reduceFetchState");
10
11
  const timeframeTick_1 = require("../../commonStateTypes/timeframeTick");
@@ -12,7 +13,6 @@ const thisPeriodHelpers_1 = require("../../commonStateTypes/viewAndReport/thisPe
12
13
  const balanceSheetSelector_1 = require("../balanceSheet/balanceSheetSelector");
13
14
  const cashFlowSelector_1 = require("../cashFlow/cashFlowSelector");
14
15
  const profitAndLossSelector_1 = require("../profitAndLoss/profitAndLossSelector");
15
- const coaBalancesFilterProjectView_1 = require("../../commonStateTypes/coaBalance/coaBalancesFilterProjectView");
16
16
  const profitAndLossClassesByClassHorizontalSelector_1 = require("../profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector");
17
17
  const profitAndLossClassesViewSelector_1 = require("../profitAndLossClassesView/profitAndLossClassesViewSelector");
18
18
  const profitAndLossProjectViewSelector_1 = require("../profitAndLossProjectView/profitAndLossProjectViewSelector");
@@ -1,6 +1,7 @@
1
1
  import { ID } from '../../../commonStateTypes/common';
2
2
  import { ZeniAPIStatus } from '../../../responsePayload';
3
3
  import { CompanyOfficerType } from '../../companyView/types/companyPassport/companyUsersLocalData';
4
+ import { CompanyDetailsLocalData, CompanyOfficerLocalData } from '../../spendManagement/commonSetup/setupViewState';
4
5
  import { PlaidLinkTokenType } from '../../spendManagement/plaidAccount/plaidAccountViewState';
5
6
  import { OnboardingCustomerViewState, OnboardingCustomerViewUIState, OnboardingStep } from './onboardingCustomerViewState';
6
7
  export declare const initialState: OnboardingCustomerViewState;
@@ -72,11 +73,33 @@ export declare const fetchOnboardingCustomerView: import("@reduxjs/toolkit").Act
72
73
  companyId: ID;
73
74
  currentStep?: OnboardingStep;
74
75
  reCalculateCurrentStep?: boolean;
75
- }, "onboardingCustomerView/updateOnboardingCustomerViewLocalStoreData">, saveOnboardingCustomerViewDataInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<import("../../..").SetupViewLocalData>, "onboardingCustomerView/saveOnboardingCustomerViewDataInLocalStore">, saveOnboardingCompnayOfficerPhoneInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
76
+ }, "onboardingCustomerView/updateOnboardingCustomerViewLocalStoreData">, saveOnboardingCustomerViewDataInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<import("../../spendManagement/commonSetup/setupViewState").SetupViewLocalData>, "onboardingCustomerView/saveOnboardingCustomerViewDataInLocalStore">, saveOnboardingCompnayOfficerPhoneInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
76
77
  officerType: CompanyOfficerType;
77
78
  phone: string | number;
78
79
  }, "onboardingCustomerView/saveOnboardingCompnayOfficerPhoneInLocalStore">, updateOnboardingCustomerViewUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<OnboardingCustomerViewUIState>, "onboardingCustomerView/updateOnboardingCustomerViewUIState">, sendOnboardingOfficerOtp: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/sendOnboardingOfficerOtp">, sendOnboardingOfficerOtpSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
79
80
  otpChallenge: string;
80
- }, "onboardingCustomerView/sendOnboardingOfficerOtpSuccess">, sendOnboardingOfficerOtpFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "onboardingCustomerView/sendOnboardingOfficerOtpFailure">, resendOnboardingOfficerOtp: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/resendOnboardingOfficerOtp">, verifyOnboardingOfficerOtp: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/verifyOnboardingOfficerOtp">, verifyOnboardingOfficerOtpSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/verifyOnboardingOfficerOtpSuccess">, verifyOnboardingOfficerOtpFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "onboardingCustomerView/verifyOnboardingOfficerOtpFailure">, clearOnboardingCustomerViewDataInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/clearOnboardingCustomerViewDataInLocalStore">, clearOnboardingCustomerView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/clearOnboardingCustomerView">;
81
+ }, "onboardingCustomerView/sendOnboardingOfficerOtpSuccess">, sendOnboardingOfficerOtpFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "onboardingCustomerView/sendOnboardingOfficerOtpFailure">, resendOnboardingOfficerOtp: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/resendOnboardingOfficerOtp">, verifyOnboardingOfficerOtp: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/verifyOnboardingOfficerOtp">, verifyOnboardingOfficerOtpSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/verifyOnboardingOfficerOtpSuccess">, verifyOnboardingOfficerOtpFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "onboardingCustomerView/verifyOnboardingOfficerOtpFailure">, clearOnboardingCustomerViewDataInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/clearOnboardingCustomerViewDataInLocalStore">, clearOnboardingCustomerView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/clearOnboardingCustomerView">, applyKycDocumentAutofillForOnboarding: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: {
82
+ autoFilledFieldNames: string[];
83
+ companyId: ID;
84
+ officerType: CompanyOfficerType;
85
+ values: Partial<CompanyOfficerLocalData>;
86
+ }], {
87
+ autoFilledFieldNames: string[];
88
+ companyId: ID;
89
+ officerType: CompanyOfficerType;
90
+ values: Partial<CompanyOfficerLocalData>;
91
+ }, "onboardingCustomerView/applyKycDocumentAutofillForOnboarding", never, never>, applyKybDocumentAutofillForOnboarding: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: {
92
+ autoFilledFieldNames: string[];
93
+ companyId: ID;
94
+ values: Partial<CompanyDetailsLocalData>;
95
+ }], {
96
+ autoFilledFieldNames: string[];
97
+ companyId: ID;
98
+ values: Partial<CompanyDetailsLocalData>;
99
+ }, "onboardingCustomerView/applyKybDocumentAutofillForOnboarding", never, never>, clearKycKybAutofillForOnboarding: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload?: {
100
+ officerType?: CompanyOfficerType;
101
+ } | undefined], {
102
+ officerType?: CompanyOfficerType;
103
+ }, "onboardingCustomerView/clearKycKybAutofillForOnboarding", never, never>;
81
104
  declare const _default: import("redux").Reducer<OnboardingCustomerViewState>;
82
105
  export default _default;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.clearOnboardingCustomerView = exports.clearOnboardingCustomerViewDataInLocalStore = exports.verifyOnboardingOfficerOtpFailure = exports.verifyOnboardingOfficerOtpSuccess = exports.verifyOnboardingOfficerOtp = exports.resendOnboardingOfficerOtp = exports.sendOnboardingOfficerOtpFailure = exports.sendOnboardingOfficerOtpSuccess = exports.sendOnboardingOfficerOtp = exports.updateOnboardingCustomerViewUIState = exports.saveOnboardingCompnayOfficerPhoneInLocalStore = exports.saveOnboardingCustomerViewDataInLocalStore = exports.updateOnboardingCustomerViewLocalStoreData = exports.updateOnboardingCustomerViewAccountDetails = exports.updateCurrentStep = exports.getOnboardingPlaidLinkTokenFailure = exports.getOnboardingPlaidLinkTokenSuccess = exports.getOnboardingPlaidLinkToken = exports.establishOnboardingPlaidConnectionFailure = exports.establishOnboardingPlaidConnectionSuccess = exports.establishOnboardingPlaidConnection = exports.updateOnboardingPaymentAccountLoginStatusFailure = exports.updateOnboardingPaymentAccountLoginStatusSuccess = exports.updateOnboardingPaymentAccountLoginStatus = exports.updateOnboardingPaymentAccountStatusFailure = exports.updateOnboardingPaymentAccountStatusSuccess = exports.updateOnboardingPaymentAccountStatus = exports.updateOnboardingCustomerViewFailure = exports.updateOnboardingCustomerViewSuccess = exports.updateOnboardingCustomerView = exports.updateOnboardingCustomerViewDashboardLoadedFailure = exports.updateOnboardingCustomerViewDashboardLoadedSuccess = exports.updateOnboardingCustomerViewDashboardLoaded = exports.updateOnboardingCustomerViewCompleteStatusFailure = exports.updateOnboardingCustomerViewCompleteStatusSuccess = exports.updateOnboardingCustomerViewCompleteStatus = exports.fetchOnboardingCustomerSetupViewFailure = exports.fetchOnboardingCustomerSetupViewSuccess = exports.fetchOnboardingCustomerSetupView = exports.fetchOnboardingCustomerView = exports.initialState = void 0;
4
+ exports.clearKycKybAutofillForOnboarding = exports.applyKybDocumentAutofillForOnboarding = exports.applyKycDocumentAutofillForOnboarding = exports.clearOnboardingCustomerView = exports.clearOnboardingCustomerViewDataInLocalStore = exports.verifyOnboardingOfficerOtpFailure = exports.verifyOnboardingOfficerOtpSuccess = exports.verifyOnboardingOfficerOtp = exports.resendOnboardingOfficerOtp = exports.sendOnboardingOfficerOtpFailure = exports.sendOnboardingOfficerOtpSuccess = exports.sendOnboardingOfficerOtp = exports.updateOnboardingCustomerViewUIState = exports.saveOnboardingCompnayOfficerPhoneInLocalStore = exports.saveOnboardingCustomerViewDataInLocalStore = exports.updateOnboardingCustomerViewLocalStoreData = exports.updateOnboardingCustomerViewAccountDetails = exports.updateCurrentStep = exports.getOnboardingPlaidLinkTokenFailure = exports.getOnboardingPlaidLinkTokenSuccess = exports.getOnboardingPlaidLinkToken = exports.establishOnboardingPlaidConnectionFailure = exports.establishOnboardingPlaidConnectionSuccess = exports.establishOnboardingPlaidConnection = exports.updateOnboardingPaymentAccountLoginStatusFailure = exports.updateOnboardingPaymentAccountLoginStatusSuccess = exports.updateOnboardingPaymentAccountLoginStatus = exports.updateOnboardingPaymentAccountStatusFailure = exports.updateOnboardingPaymentAccountStatusSuccess = exports.updateOnboardingPaymentAccountStatus = exports.updateOnboardingCustomerViewFailure = exports.updateOnboardingCustomerViewSuccess = exports.updateOnboardingCustomerView = exports.updateOnboardingCustomerViewDashboardLoadedFailure = exports.updateOnboardingCustomerViewDashboardLoadedSuccess = exports.updateOnboardingCustomerViewDashboardLoaded = exports.updateOnboardingCustomerViewCompleteStatusFailure = exports.updateOnboardingCustomerViewCompleteStatusSuccess = exports.updateOnboardingCustomerViewCompleteStatus = exports.fetchOnboardingCustomerSetupViewFailure = exports.fetchOnboardingCustomerSetupViewSuccess = exports.fetchOnboardingCustomerSetupView = exports.fetchOnboardingCustomerView = exports.initialState = void 0;
5
5
  const toolkit_1 = require("@reduxjs/toolkit");
6
6
  const zeniDayJS_1 = require("../../../zeniDayJS");
7
7
  const initialStatus = {
@@ -14,60 +14,29 @@ exports.initialState = {
14
14
  dashboardLoadedStatus: initialStatus,
15
15
  currentStep: 'link_payment_account',
16
16
  companyDetails: {
17
+ autoFilledFields: [],
17
18
  localData: undefined,
18
19
  },
19
- companyOfficerUpdateStatus: {
20
- Officer_1: {
20
+ companyOfficerUpdateStatus: (() => {
21
+ const emptyOfficerSlot = {
22
+ autoFilledFields: [],
21
23
  localData: undefined,
22
24
  sendOtpStatus: initialStatus,
23
25
  otpverificationStatus: initialStatus,
24
- },
25
- Officer_2: {
26
- localData: undefined,
27
- sendOtpStatus: initialStatus,
28
- otpverificationStatus: initialStatus,
29
- },
30
- Officer_3: {
31
- localData: undefined,
32
- sendOtpStatus: initialStatus,
33
- otpverificationStatus: initialStatus,
34
- },
35
- Officer_4: {
36
- localData: undefined,
37
- sendOtpStatus: initialStatus,
38
- otpverificationStatus: initialStatus,
39
- },
40
- Officer_5: {
41
- localData: undefined,
42
- sendOtpStatus: initialStatus,
43
- otpverificationStatus: initialStatus,
44
- },
45
- Officer_6: {
46
- localData: undefined,
47
- sendOtpStatus: initialStatus,
48
- otpverificationStatus: initialStatus,
49
- },
50
- Officer_7: {
51
- localData: undefined,
52
- sendOtpStatus: initialStatus,
53
- otpverificationStatus: initialStatus,
54
- },
55
- Officer_8: {
56
- localData: undefined,
57
- sendOtpStatus: initialStatus,
58
- otpverificationStatus: initialStatus,
59
- },
60
- Officer_9: {
61
- localData: undefined,
62
- sendOtpStatus: initialStatus,
63
- otpverificationStatus: initialStatus,
64
- },
65
- Officer_10: {
66
- localData: undefined,
67
- sendOtpStatus: initialStatus,
68
- otpverificationStatus: initialStatus,
69
- },
70
- },
26
+ };
27
+ return {
28
+ Officer_1: { ...emptyOfficerSlot },
29
+ Officer_2: { ...emptyOfficerSlot },
30
+ Officer_3: { ...emptyOfficerSlot },
31
+ Officer_4: { ...emptyOfficerSlot },
32
+ Officer_5: { ...emptyOfficerSlot },
33
+ Officer_6: { ...emptyOfficerSlot },
34
+ Officer_7: { ...emptyOfficerSlot },
35
+ Officer_8: { ...emptyOfficerSlot },
36
+ Officer_9: { ...emptyOfficerSlot },
37
+ Officer_10: { ...emptyOfficerSlot },
38
+ };
39
+ })(),
71
40
  primaryContactDetails: {},
72
41
  paymentAccountDetails: {
73
42
  fetchStatus: initialStatus,
@@ -596,7 +565,49 @@ const onboardingCustomerView = (0, toolkit_1.createSlice)({
596
565
  clearOnboardingCustomerView(draft) {
597
566
  Object.assign(draft, exports.initialState);
598
567
  },
568
+ /** Merge AI-parsed officer fields into the officer's onboarding localData. */
569
+ applyKycDocumentAutofillForOnboarding: {
570
+ reducer(draft, action) {
571
+ const { officerType, values, autoFilledFieldNames } = action.payload;
572
+ const slot = draft.companyOfficerUpdateStatus[officerType];
573
+ slot.localData = Object.assign({}, slot.localData, values);
574
+ slot.autoFilledFields = Array.from(new Set([...slot.autoFilledFields, ...autoFilledFieldNames]));
575
+ },
576
+ prepare(payload) {
577
+ return { payload };
578
+ },
579
+ },
580
+ /** Merge AI-parsed company fields into companyDetails onboarding localData. */
581
+ applyKybDocumentAutofillForOnboarding: {
582
+ reducer(draft, action) {
583
+ const { values, autoFilledFieldNames } = action.payload;
584
+ draft.companyDetails.localData = Object.assign({}, draft.companyDetails.localData, values);
585
+ const prev = draft.companyDetails.autoFilledFields ?? [];
586
+ draft.companyDetails.autoFilledFields = Array.from(new Set([...prev, ...autoFilledFieldNames]));
587
+ },
588
+ prepare(payload) {
589
+ return { payload };
590
+ },
591
+ },
592
+ /** Wipe AI-autofill badges during onboarding. */
593
+ clearKycKybAutofillForOnboarding: {
594
+ reducer(draft, action) {
595
+ const { officerType } = action.payload;
596
+ if (officerType != null) {
597
+ draft.companyOfficerUpdateStatus[officerType].autoFilledFields = [];
598
+ }
599
+ else {
600
+ draft.companyDetails.autoFilledFields = [];
601
+ Object.keys(draft.companyOfficerUpdateStatus).forEach((key) => {
602
+ draft.companyOfficerUpdateStatus[key].autoFilledFields = [];
603
+ });
604
+ }
605
+ },
606
+ prepare(payload = {}) {
607
+ return { payload };
608
+ },
609
+ },
599
610
  },
600
611
  });
601
- _a = onboardingCustomerView.actions, exports.fetchOnboardingCustomerView = _a.fetchOnboardingCustomerView, exports.fetchOnboardingCustomerSetupView = _a.fetchOnboardingCustomerSetupView, exports.fetchOnboardingCustomerSetupViewSuccess = _a.fetchOnboardingCustomerSetupViewSuccess, exports.fetchOnboardingCustomerSetupViewFailure = _a.fetchOnboardingCustomerSetupViewFailure, exports.updateOnboardingCustomerViewCompleteStatus = _a.updateOnboardingCustomerViewCompleteStatus, exports.updateOnboardingCustomerViewCompleteStatusSuccess = _a.updateOnboardingCustomerViewCompleteStatusSuccess, exports.updateOnboardingCustomerViewCompleteStatusFailure = _a.updateOnboardingCustomerViewCompleteStatusFailure, exports.updateOnboardingCustomerViewDashboardLoaded = _a.updateOnboardingCustomerViewDashboardLoaded, exports.updateOnboardingCustomerViewDashboardLoadedSuccess = _a.updateOnboardingCustomerViewDashboardLoadedSuccess, exports.updateOnboardingCustomerViewDashboardLoadedFailure = _a.updateOnboardingCustomerViewDashboardLoadedFailure, exports.updateOnboardingCustomerView = _a.updateOnboardingCustomerView, exports.updateOnboardingCustomerViewSuccess = _a.updateOnboardingCustomerViewSuccess, exports.updateOnboardingCustomerViewFailure = _a.updateOnboardingCustomerViewFailure, exports.updateOnboardingPaymentAccountStatus = _a.updateOnboardingPaymentAccountStatus, exports.updateOnboardingPaymentAccountStatusSuccess = _a.updateOnboardingPaymentAccountStatusSuccess, exports.updateOnboardingPaymentAccountStatusFailure = _a.updateOnboardingPaymentAccountStatusFailure, exports.updateOnboardingPaymentAccountLoginStatus = _a.updateOnboardingPaymentAccountLoginStatus, exports.updateOnboardingPaymentAccountLoginStatusSuccess = _a.updateOnboardingPaymentAccountLoginStatusSuccess, exports.updateOnboardingPaymentAccountLoginStatusFailure = _a.updateOnboardingPaymentAccountLoginStatusFailure, exports.establishOnboardingPlaidConnection = _a.establishOnboardingPlaidConnection, exports.establishOnboardingPlaidConnectionSuccess = _a.establishOnboardingPlaidConnectionSuccess, exports.establishOnboardingPlaidConnectionFailure = _a.establishOnboardingPlaidConnectionFailure, exports.getOnboardingPlaidLinkToken = _a.getOnboardingPlaidLinkToken, exports.getOnboardingPlaidLinkTokenSuccess = _a.getOnboardingPlaidLinkTokenSuccess, exports.getOnboardingPlaidLinkTokenFailure = _a.getOnboardingPlaidLinkTokenFailure, exports.updateCurrentStep = _a.updateCurrentStep, exports.updateOnboardingCustomerViewAccountDetails = _a.updateOnboardingCustomerViewAccountDetails, exports.updateOnboardingCustomerViewLocalStoreData = _a.updateOnboardingCustomerViewLocalStoreData, exports.saveOnboardingCustomerViewDataInLocalStore = _a.saveOnboardingCustomerViewDataInLocalStore, exports.saveOnboardingCompnayOfficerPhoneInLocalStore = _a.saveOnboardingCompnayOfficerPhoneInLocalStore, exports.updateOnboardingCustomerViewUIState = _a.updateOnboardingCustomerViewUIState, exports.sendOnboardingOfficerOtp = _a.sendOnboardingOfficerOtp, exports.sendOnboardingOfficerOtpSuccess = _a.sendOnboardingOfficerOtpSuccess, exports.sendOnboardingOfficerOtpFailure = _a.sendOnboardingOfficerOtpFailure, exports.resendOnboardingOfficerOtp = _a.resendOnboardingOfficerOtp, exports.verifyOnboardingOfficerOtp = _a.verifyOnboardingOfficerOtp, exports.verifyOnboardingOfficerOtpSuccess = _a.verifyOnboardingOfficerOtpSuccess, exports.verifyOnboardingOfficerOtpFailure = _a.verifyOnboardingOfficerOtpFailure, exports.clearOnboardingCustomerViewDataInLocalStore = _a.clearOnboardingCustomerViewDataInLocalStore, exports.clearOnboardingCustomerView = _a.clearOnboardingCustomerView;
612
+ _a = onboardingCustomerView.actions, exports.fetchOnboardingCustomerView = _a.fetchOnboardingCustomerView, exports.fetchOnboardingCustomerSetupView = _a.fetchOnboardingCustomerSetupView, exports.fetchOnboardingCustomerSetupViewSuccess = _a.fetchOnboardingCustomerSetupViewSuccess, exports.fetchOnboardingCustomerSetupViewFailure = _a.fetchOnboardingCustomerSetupViewFailure, exports.updateOnboardingCustomerViewCompleteStatus = _a.updateOnboardingCustomerViewCompleteStatus, exports.updateOnboardingCustomerViewCompleteStatusSuccess = _a.updateOnboardingCustomerViewCompleteStatusSuccess, exports.updateOnboardingCustomerViewCompleteStatusFailure = _a.updateOnboardingCustomerViewCompleteStatusFailure, exports.updateOnboardingCustomerViewDashboardLoaded = _a.updateOnboardingCustomerViewDashboardLoaded, exports.updateOnboardingCustomerViewDashboardLoadedSuccess = _a.updateOnboardingCustomerViewDashboardLoadedSuccess, exports.updateOnboardingCustomerViewDashboardLoadedFailure = _a.updateOnboardingCustomerViewDashboardLoadedFailure, exports.updateOnboardingCustomerView = _a.updateOnboardingCustomerView, exports.updateOnboardingCustomerViewSuccess = _a.updateOnboardingCustomerViewSuccess, exports.updateOnboardingCustomerViewFailure = _a.updateOnboardingCustomerViewFailure, exports.updateOnboardingPaymentAccountStatus = _a.updateOnboardingPaymentAccountStatus, exports.updateOnboardingPaymentAccountStatusSuccess = _a.updateOnboardingPaymentAccountStatusSuccess, exports.updateOnboardingPaymentAccountStatusFailure = _a.updateOnboardingPaymentAccountStatusFailure, exports.updateOnboardingPaymentAccountLoginStatus = _a.updateOnboardingPaymentAccountLoginStatus, exports.updateOnboardingPaymentAccountLoginStatusSuccess = _a.updateOnboardingPaymentAccountLoginStatusSuccess, exports.updateOnboardingPaymentAccountLoginStatusFailure = _a.updateOnboardingPaymentAccountLoginStatusFailure, exports.establishOnboardingPlaidConnection = _a.establishOnboardingPlaidConnection, exports.establishOnboardingPlaidConnectionSuccess = _a.establishOnboardingPlaidConnectionSuccess, exports.establishOnboardingPlaidConnectionFailure = _a.establishOnboardingPlaidConnectionFailure, exports.getOnboardingPlaidLinkToken = _a.getOnboardingPlaidLinkToken, exports.getOnboardingPlaidLinkTokenSuccess = _a.getOnboardingPlaidLinkTokenSuccess, exports.getOnboardingPlaidLinkTokenFailure = _a.getOnboardingPlaidLinkTokenFailure, exports.updateCurrentStep = _a.updateCurrentStep, exports.updateOnboardingCustomerViewAccountDetails = _a.updateOnboardingCustomerViewAccountDetails, exports.updateOnboardingCustomerViewLocalStoreData = _a.updateOnboardingCustomerViewLocalStoreData, exports.saveOnboardingCustomerViewDataInLocalStore = _a.saveOnboardingCustomerViewDataInLocalStore, exports.saveOnboardingCompnayOfficerPhoneInLocalStore = _a.saveOnboardingCompnayOfficerPhoneInLocalStore, exports.updateOnboardingCustomerViewUIState = _a.updateOnboardingCustomerViewUIState, exports.sendOnboardingOfficerOtp = _a.sendOnboardingOfficerOtp, exports.sendOnboardingOfficerOtpSuccess = _a.sendOnboardingOfficerOtpSuccess, exports.sendOnboardingOfficerOtpFailure = _a.sendOnboardingOfficerOtpFailure, exports.resendOnboardingOfficerOtp = _a.resendOnboardingOfficerOtp, exports.verifyOnboardingOfficerOtp = _a.verifyOnboardingOfficerOtp, exports.verifyOnboardingOfficerOtpSuccess = _a.verifyOnboardingOfficerOtpSuccess, exports.verifyOnboardingOfficerOtpFailure = _a.verifyOnboardingOfficerOtpFailure, exports.clearOnboardingCustomerViewDataInLocalStore = _a.clearOnboardingCustomerViewDataInLocalStore, exports.clearOnboardingCustomerView = _a.clearOnboardingCustomerView, exports.applyKycDocumentAutofillForOnboarding = _a.applyKycDocumentAutofillForOnboarding, exports.applyKybDocumentAutofillForOnboarding = _a.applyKybDocumentAutofillForOnboarding, exports.clearKycKybAutofillForOnboarding = _a.clearKycKybAutofillForOnboarding;
602
613
  exports.default = onboardingCustomerView.reducer;
@@ -22,9 +22,19 @@ export interface OnboardingCustomerViewUIState {
22
22
  }
23
23
  export interface OnboardingCustomerViewState extends FetchedState {
24
24
  companyDetails: {
25
+ /**
26
+ * Field names from {@link CompanyDetailsLocalData} populated by AI autofill
27
+ * from an uploaded KYB document during onboarding. Drives the ✦ sparkle.
28
+ */
29
+ autoFilledFields: string[];
25
30
  localData?: CompanyDetailsLocalData;
26
31
  };
27
32
  companyOfficerUpdateStatus: Record<CompanyOfficerType, {
33
+ /**
34
+ * Field names from {@link CompanyOfficerLocalData} populated by AI autofill
35
+ * from an uploaded KYC identity document during onboarding.
36
+ */
37
+ autoFilledFields: string[];
28
38
  otpverificationStatus: FetchStateAndError;
29
39
  sendOtpStatus: FetchStateAndError;
30
40
  localData?: CompanyOfficerLocalData;
@@ -1,10 +1,10 @@
1
- import { SectionProjectViewReport } from '../../entity/sectionProjectView/sectionProjectViewSelectorTypes';
2
1
  import { COABalancesFilterProjectView } from '../../commonStateTypes/coaBalance/coaBalancesFilterProjectView';
3
2
  import { ID } from '../../commonStateTypes/common';
4
3
  import { DataAvailable } from '../../commonStateTypes/dataAvailable';
5
4
  import { CalculatedSection } from '../../commonStateTypes/selectorTypes/selectorTypes';
6
5
  import { SelectorReport } from '../../commonStateTypes/viewAndReport/viewAndReport';
7
6
  import { Project } from '../../entity/project/projectState';
7
+ import { SectionProjectViewReport } from '../../entity/sectionProjectView/sectionProjectViewSelectorTypes';
8
8
  import { PandLReportViewCalculatedSectionID, PandLReportViewSectionID } from '../profitAndLossClassesView/profitAndLossClassesViewSelectorTypes';
9
9
  import { ProfitAndLossProjectViewUIState } from './profitAndLossProjectViewState';
10
10
  export interface ProfitAndLossProjectViewReport extends SelectorReport {
@@ -2,7 +2,9 @@ import { ZeniAPIStatus } from '../../../../responsePayload';
2
2
  import { ChargeCardCashbackPayload } from './cashbackDetailPayload';
3
3
  import { CashbackDetailState, CashbackDetailUIState } from './cashbackDetailState';
4
4
  export declare const initialState: CashbackDetailState;
5
- export declare const fetchCashbackDetail: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"cashbackDetail/fetchCashbackDetail">, updateCashbackDetail: import("@reduxjs/toolkit").ActionCreatorWithPayload<ChargeCardCashbackPayload, "cashbackDetail/updateCashbackDetail">, updateCashbackDetailFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "cashbackDetail/updateCashbackDetailFailure">, updateCashbackDetailUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
5
+ export declare const fetchCashbackDetail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: boolean | undefined], {
6
+ cacheOverride: boolean;
7
+ }, "cashbackDetail/fetchCashbackDetail", never, never>, updateCashbackDetail: import("@reduxjs/toolkit").ActionCreatorWithPayload<ChargeCardCashbackPayload, "cashbackDetail/updateCashbackDetail">, updateCashbackDetailFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "cashbackDetail/updateCashbackDetailFailure">, updateCashbackDetailUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
6
8
  uiState: Partial<CashbackDetailUIState>;
7
9
  }, "cashbackDetail/updateCashbackDetailUIState">, clearCashbackDetail: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"cashbackDetail/clearCashbackDetail">;
8
10
  declare const _default: import("redux").Reducer<CashbackDetailState>;
@@ -5,6 +5,7 @@ exports.clearCashbackDetail = exports.updateCashbackDetailUIState = exports.upda
5
5
  const toolkit_1 = require("@reduxjs/toolkit");
6
6
  const viewAndReportPayloadv2_1 = require("../../../../commonPayloadTypes/v2/viewAndReportPayloadv2");
7
7
  const amount_1 = require("../../../../commonStateTypes/amount");
8
+ const cacheOverrideFetchReducer_1 = require("../../../../commonStateTypes/cacheOverrideFetchReducer");
8
9
  const cashbackDetailState_1 = require("./cashbackDetailState");
9
10
  exports.initialState = {
10
11
  fetchState: 'Not-Started',
@@ -31,10 +32,10 @@ const cashbackDetail = (0, toolkit_1.createSlice)({
31
32
  name: 'cashbackDetail',
32
33
  initialState: exports.initialState,
33
34
  reducers: {
34
- fetchCashbackDetail(draft) {
35
+ fetchCashbackDetail: (0, cacheOverrideFetchReducer_1.createCacheOverrideFetchReducer)((draft) => {
35
36
  draft.fetchState = 'In-Progress';
36
37
  draft.error = undefined;
37
- },
38
+ }),
38
39
  updateCashbackDetail(draft, action) {
39
40
  draft.cashbackByPeriod = toCashbackByPeriod(action.payload);
40
41
  draft.cashbackSummary = toCashbackSummary(action.payload);
@@ -2,6 +2,8 @@ import { ZeniAPIStatus } from '../../../../responsePayload';
2
2
  import { ChargeCardConfigPayload } from './chargeCardConfigPayload';
3
3
  import { ChargeCardConfigState } from './chargeCardConfigState';
4
4
  export declare const initialState: ChargeCardConfigState;
5
- export declare const fetchChargeCardConfig: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardConfig/fetchChargeCardConfig">, updateChargeCardConfig: import("@reduxjs/toolkit").ActionCreatorWithPayload<ChargeCardConfigPayload, "chargeCardConfig/updateChargeCardConfig">, updateChargeCardConfigFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardConfig/updateChargeCardConfigFailure">, clearChargeCardConfig: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardConfig/clearChargeCardConfig">;
5
+ export declare const fetchChargeCardConfig: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: boolean | undefined], {
6
+ cacheOverride: boolean;
7
+ }, "chargeCardConfig/fetchChargeCardConfig", never, never>, updateChargeCardConfig: import("@reduxjs/toolkit").ActionCreatorWithPayload<ChargeCardConfigPayload, "chargeCardConfig/updateChargeCardConfig">, updateChargeCardConfigFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardConfig/updateChargeCardConfigFailure">, clearChargeCardConfig: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardConfig/clearChargeCardConfig">;
6
8
  declare const _default: import("redux").Reducer<ChargeCardConfigState>;
7
9
  export default _default;
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.clearChargeCardConfig = exports.updateChargeCardConfigFailure = exports.updateChargeCardConfig = exports.fetchChargeCardConfig = exports.initialState = void 0;
5
5
  const toolkit_1 = require("@reduxjs/toolkit");
6
6
  const amount_1 = require("../../../../commonStateTypes/amount");
7
+ const cacheOverrideFetchReducer_1 = require("../../../../commonStateTypes/cacheOverrideFetchReducer");
7
8
  const chargeCard_1 = require("../../../../entity/chargeCard/chargeCard");
8
9
  const chargeCardConfigPayload_1 = require("./chargeCardConfigPayload");
9
10
  exports.initialState = {
@@ -34,10 +35,10 @@ const chargeCardConfig = (0, toolkit_1.createSlice)({
34
35
  name: 'chargeCardConfig',
35
36
  initialState: exports.initialState,
36
37
  reducers: {
37
- fetchChargeCardConfig(draft) {
38
+ fetchChargeCardConfig: (0, cacheOverrideFetchReducer_1.createCacheOverrideFetchReducer)((draft) => {
38
39
  draft.fetchState = 'In-Progress';
39
40
  draft.error = undefined;
40
- },
41
+ }),
41
42
  updateChargeCardConfig(draft, action) {
42
43
  const { payload } = action;
43
44
  draft.creditLimitFrequency =