@zeniai/client-epic-state 5.0.80 → 5.0.81-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 (222) hide show
  1. package/lib/commonStateTypes/cacheOverrideFetchReducer.d.ts +17 -0
  2. package/lib/commonStateTypes/cacheOverrideFetchReducer.js +20 -0
  3. package/lib/commonStateTypes/filterPrimitives.d.ts +23 -0
  4. package/lib/commonStateTypes/filterPrimitives.js +21 -0
  5. package/lib/commonStateTypes/pusherActions.d.ts +11 -0
  6. package/lib/commonStateTypes/pusherActions.js +6 -0
  7. package/lib/coreEpics.js +1 -1
  8. package/lib/entity/account/accountSelector.d.ts +27 -1
  9. package/lib/entity/account/accountSelector.js +47 -1
  10. package/lib/entity/account/accountState.d.ts +6 -1
  11. package/lib/entity/account/accountState.js +11 -4
  12. package/lib/entity/account/subAccountSelector.d.ts +1 -1
  13. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerPayload.js +1 -3
  14. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerReducer.js +1 -2
  15. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerSelector.d.ts +1 -1
  16. package/lib/entity/chargeCard/chargeCardReducer.d.ts +19 -2
  17. package/lib/entity/chargeCard/chargeCardReducer.js +35 -2
  18. package/lib/entity/chargeCardTransaction/chargeCardTransactionReducer.d.ts +14 -1
  19. package/lib/entity/chargeCardTransaction/chargeCardTransactionReducer.js +36 -2
  20. package/lib/entity/class/classSelector.d.ts +35 -0
  21. package/lib/entity/class/classSelector.js +50 -0
  22. package/lib/entity/paymentAccount/paymentAccountSelector.d.ts +1 -0
  23. package/lib/entity/paymentAccount/paymentAccountSelector.js +4 -0
  24. package/lib/entity/sectionProjectView/sectionProjectViewReducer.d.ts +1 -1
  25. package/lib/entity/sectionProjectView/sectionProjectViewSelector.js +1 -1
  26. package/lib/entity/tenant/SessionManager.js +6 -3
  27. package/lib/entity/tenant/clearAllEpic.d.ts +2 -2
  28. package/lib/entity/tenant/clearAllEpic.js +2 -2
  29. package/lib/entity/tenant/epic/deleteConnectionEpic.d.ts +1 -1
  30. package/lib/entity/tenant/epic/initEmailConnectOAuthEpic.d.ts +21 -0
  31. package/lib/entity/tenant/epic/initEmailConnectOAuthEpic.js +54 -0
  32. package/lib/entity/tenant/epic/saveAPIKeyConnectionEpic.d.ts +1 -1
  33. package/lib/entity/tenant/epic/saveAPIKeyConnectionEpic.js +6 -2
  34. package/lib/entity/tenant/epic/saveConnectorCredentialsEpic.d.ts +3 -3
  35. package/lib/entity/tenant/epic/saveOAuthConnectionEpic.d.ts +1 -1
  36. package/lib/entity/tenant/epic/saveOAuthConnectionEpic.js +6 -2
  37. package/lib/entity/tenant/tenantPayload.d.ts +1 -0
  38. package/lib/entity/tenant/tenantReducer.d.ts +38 -25
  39. package/lib/entity/tenant/tenantReducer.js +71 -6
  40. package/lib/entity/tenant/tenantState.d.ts +1 -0
  41. package/lib/entity/transaction/payloadTypes/transactionLinePayload.js +3 -1
  42. package/lib/epic.d.ts +13 -11
  43. package/lib/epic.js +15 -12
  44. package/lib/esm/commonStateTypes/cacheOverrideFetchReducer.js +16 -0
  45. package/lib/esm/commonStateTypes/filterPrimitives.js +20 -0
  46. package/lib/esm/commonStateTypes/pusherActions.js +3 -0
  47. package/lib/esm/coreEpics.js +1 -1
  48. package/lib/esm/entity/account/accountSelector.js +46 -1
  49. package/lib/esm/entity/account/accountState.js +7 -1
  50. package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerPayload.js +1 -3
  51. package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerReducer.js +1 -2
  52. package/lib/esm/entity/chargeCard/chargeCardReducer.js +34 -1
  53. package/lib/esm/entity/chargeCardTransaction/chargeCardTransactionReducer.js +35 -1
  54. package/lib/esm/entity/class/classSelector.js +48 -0
  55. package/lib/esm/entity/paymentAccount/paymentAccountSelector.js +3 -0
  56. package/lib/esm/entity/sectionProjectView/sectionProjectViewSelector.js +1 -1
  57. package/lib/esm/entity/tenant/SessionManager.js +4 -1
  58. package/lib/esm/entity/tenant/clearAllEpic.js +2 -2
  59. package/lib/esm/entity/tenant/epic/initEmailConnectOAuthEpic.js +50 -0
  60. package/lib/esm/entity/tenant/epic/saveAPIKeyConnectionEpic.js +6 -2
  61. package/lib/esm/entity/tenant/epic/saveOAuthConnectionEpic.js +6 -2
  62. package/lib/esm/entity/tenant/tenantReducer.js +69 -4
  63. package/lib/esm/entity/transaction/payloadTypes/transactionLinePayload.js +3 -1
  64. package/lib/esm/epic.js +15 -12
  65. package/lib/esm/index.js +38 -25
  66. package/lib/esm/reducer.js +2 -2
  67. package/lib/esm/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.js +2 -5
  68. package/lib/esm/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.js +2 -5
  69. package/lib/esm/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +4 -1
  70. package/lib/esm/view/companyHealthMetricView/companyHealthMetricViewSelector.js +1 -1
  71. package/lib/esm/view/companyTaskManagerView/companyTaskManagerViewSelector.js +1 -1
  72. package/lib/esm/view/companyTaskManagerView/epics/fetchTaskManagerMetricsEpic.js +1 -1
  73. package/lib/esm/view/companyView/helpers/cockpitHelpers.js +1 -1
  74. package/lib/esm/view/companyView/selector/companyManagementViewSelector.js +1 -1
  75. package/lib/esm/view/companyView/selector/companyPortfolioViewSelector.js +1 -1
  76. package/lib/esm/view/creditAgentView/creditAgentViewReducer.js +1 -16
  77. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +2 -2
  78. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +2 -1
  79. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.js +8 -6
  80. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +7 -1
  81. package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +11 -1
  82. package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +21 -1
  83. package/lib/esm/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +2 -1
  84. package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +253 -14
  85. package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +147 -13
  86. package/lib/esm/view/expenseAutomationView/transactionFilterHelpers.js +258 -0
  87. package/lib/esm/view/expenseAutomationView/types/completedSubTab.js +17 -0
  88. package/lib/esm/view/expenseAutomationView/types/missingReceiptsViewState.js +0 -2
  89. package/lib/esm/view/financeStatement/financeStatementSelector.js +1 -1
  90. package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewReducer.js +61 -50
  91. package/lib/esm/view/recommendation/fetchEntityRecommendationsForLineUpdateEpic.js +87 -0
  92. package/lib/esm/view/recommendation/recommendationHelper.js +29 -0
  93. package/lib/esm/view/recommendation/recommendationReducer.js +26 -1
  94. package/lib/esm/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailReducer.js +3 -2
  95. package/lib/esm/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.js +3 -2
  96. package/lib/esm/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +55 -18
  97. package/lib/esm/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.js +16 -2
  98. package/lib/esm/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailPageEpic.js +5 -4
  99. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +26 -9
  100. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.js +9 -6
  101. package/lib/esm/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryReducer.js +3 -2
  102. package/lib/esm/view/spendManagement/chargeCards/chargeCardPaymentHistory/fetchChargeCardPaymentPageEpic.js +1 -1
  103. package/lib/esm/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailReducer.js +7 -3
  104. package/lib/esm/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.js +49 -0
  105. package/lib/esm/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.js +58 -0
  106. package/lib/esm/view/spendManagement/commonSetup/kycKybAutofillActions.js +12 -0
  107. package/lib/esm/view/spendManagement/commonSetup/kycKybParseMapper.js +205 -0
  108. package/lib/esm/view/spendManagement/commonSetup/setupViewReducer.js +71 -52
  109. package/lib/esm/view/spendManagement/commonSetup/setupViewSelector.js +2 -0
  110. package/lib/esm/view/spendManagement/commonSetup/types/kycKybAutofill.js +28 -0
  111. package/lib/esm/view/spendManagement/spendManagementFilterHelpers.js +4 -2
  112. package/lib/esm/view/subscriptionView/subscriptionViewSelector.js +1 -1
  113. package/lib/esm/view/taskManager/cannedResponsesView/epics/fetchCannedResponsesEpic.js +1 -1
  114. package/lib/esm/view/taskManager/cannedResponsesView/epics/saveCannedResponseEpic.js +1 -1
  115. package/lib/esm/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.js +1 -1
  116. package/lib/esm/view/taskManager/taskListView/taskListReducer.js +1 -1
  117. package/lib/esm/view/transactionDetail/transactionDetailReducer.js +121 -6
  118. package/lib/esm/view/transactionDetail/transactionDetailSelector.js +29 -1
  119. package/lib/index.d.ts +39 -28
  120. package/lib/index.js +97 -60
  121. package/lib/reducer.d.ts +2 -2
  122. package/lib/reducer.js +2 -2
  123. package/lib/view/aiAccountantView/aiAccountantViewPayload.d.ts +2 -2
  124. package/lib/view/aiAccountantView/aiAccountantViewReducer.d.ts +1 -1
  125. package/lib/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.js +2 -5
  126. package/lib/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.js +2 -5
  127. package/lib/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +4 -1
  128. package/lib/view/companyHealthMetricView/companyHealthMetricViewSelector.js +1 -1
  129. package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.d.ts +1 -1
  130. package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.js +1 -1
  131. package/lib/view/companyView/helpers/cockpitHelpers.js +1 -1
  132. package/lib/view/companyView/selector/companyManagementViewSelector.js +1 -1
  133. package/lib/view/companyView/selector/companyPortfolioViewSelector.js +1 -1
  134. package/lib/view/companyView/types/cockpitTypes.d.ts +1 -1
  135. package/lib/view/creditAgentView/creditAgentViewPayload.d.ts +0 -3
  136. package/lib/view/creditAgentView/creditAgentViewReducer.d.ts +1 -1
  137. package/lib/view/creditAgentView/creditAgentViewReducer.js +2 -17
  138. package/lib/view/creditAgentView/creditAgentViewState.d.ts +0 -5
  139. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +2 -2
  140. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +2 -1
  141. package/lib/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.js +8 -6
  142. package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +7 -1
  143. package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.d.ts +2 -2
  144. package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +10 -0
  145. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +2 -1
  146. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +23 -2
  147. package/lib/view/expenseAutomationView/payload/transactionCategorizationPayload.d.ts +21 -0
  148. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +2 -1
  149. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +2 -1
  150. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +28 -5
  151. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +253 -14
  152. package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +2 -1
  153. package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +16 -0
  154. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.d.ts +7 -1
  155. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +150 -13
  156. package/lib/view/expenseAutomationView/transactionFilterHelpers.d.ts +66 -0
  157. package/lib/view/expenseAutomationView/transactionFilterHelpers.js +262 -0
  158. package/lib/view/expenseAutomationView/types/completedSubTab.d.ts +10 -0
  159. package/lib/view/expenseAutomationView/types/completedSubTab.js +21 -0
  160. package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +1 -2
  161. package/lib/view/expenseAutomationView/types/missingReceiptsViewState.js +1 -4
  162. package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +44 -2
  163. package/lib/view/financeStatement/financeStatementSelector.js +1 -1
  164. package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.d.ts +25 -2
  165. package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.js +62 -51
  166. package/lib/view/onboardingView/customerView/onboardingCustomerViewState.d.ts +10 -0
  167. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelectorTypes.d.ts +1 -1
  168. package/lib/view/recommendation/fetchEntityRecommendationsForLineUpdateEpic.d.ts +9 -0
  169. package/lib/view/recommendation/fetchEntityRecommendationsForLineUpdateEpic.js +91 -0
  170. package/lib/view/recommendation/recommendationHelper.d.ts +9 -0
  171. package/lib/view/recommendation/recommendationHelper.js +31 -1
  172. package/lib/view/recommendation/recommendationReducer.d.ts +20 -1
  173. package/lib/view/recommendation/recommendationReducer.js +27 -2
  174. package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
  175. package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailReducer.d.ts +3 -1
  176. package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailReducer.js +3 -2
  177. package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.d.ts +3 -1
  178. package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.js +3 -2
  179. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +55 -18
  180. package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.js +16 -2
  181. package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailPageEpic.js +5 -4
  182. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.d.ts +18 -3
  183. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +27 -10
  184. package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.js +9 -6
  185. package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistory.d.ts +1 -1
  186. package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryReducer.d.ts +3 -1
  187. package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryReducer.js +3 -2
  188. package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/fetchChargeCardPaymentPageEpic.js +1 -1
  189. package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailReducer.d.ts +3 -1
  190. package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailReducer.js +7 -3
  191. package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.d.ts +8 -0
  192. package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.js +53 -0
  193. package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.d.ts +8 -0
  194. package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.js +62 -0
  195. package/lib/view/spendManagement/commonSetup/kycKybAutofillActions.d.ts +27 -0
  196. package/lib/view/spendManagement/commonSetup/kycKybAutofillActions.js +15 -0
  197. package/lib/view/spendManagement/commonSetup/kycKybParseMapper.d.ts +24 -0
  198. package/lib/view/spendManagement/commonSetup/kycKybParseMapper.js +213 -0
  199. package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +24 -2
  200. package/lib/view/spendManagement/commonSetup/setupViewReducer.js +72 -53
  201. package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +4 -0
  202. package/lib/view/spendManagement/commonSetup/setupViewSelector.js +2 -0
  203. package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +12 -0
  204. package/lib/view/spendManagement/commonSetup/types/kycKybAutofill.d.ts +125 -0
  205. package/lib/view/spendManagement/commonSetup/types/kycKybAutofill.js +32 -0
  206. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +1 -1
  207. package/lib/view/spendManagement/spendManagementFilterHelpers.d.ts +12 -3
  208. package/lib/view/spendManagement/spendManagementFilterHelpers.js +4 -2
  209. package/lib/view/subscriptionView/subscriptionViewSelector.js +1 -1
  210. package/lib/view/taskManager/taskListView/taskList.d.ts +1 -1
  211. package/lib/view/taskManager/taskListView/taskListReducer.js +1 -1
  212. package/lib/view/transactionDetail/transactionDetailReducer.d.ts +11 -1
  213. package/lib/view/transactionDetail/transactionDetailReducer.js +122 -7
  214. package/lib/view/transactionDetail/transactionDetailSelector.d.ts +2 -0
  215. package/lib/view/transactionDetail/transactionDetailSelector.js +31 -2
  216. package/lib/view/transactionDetail/transactionDetailTypes.d.ts +1 -0
  217. package/lib/view/zeniOAuthView/zeniOAuthSelector.d.ts +1 -1
  218. package/package.json +10 -4
  219. package/lib/esm/view/creditAgentView/epics/fetchCreditAgentAccessEpic.js +0 -13
  220. package/lib/tsconfig.typecheck.tsbuildinfo +0 -1
  221. package/lib/view/creditAgentView/epics/fetchCreditAgentAccessEpic.d.ts +0 -11
  222. package/lib/view/creditAgentView/epics/fetchCreditAgentAccessEpic.js +0 -17
@@ -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,18 @@ 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';
19
+ import { TransactionFilters } from '../transactionFilterHelpers';
18
20
  import { TransactionDetailKey } from '../../transactionDetail/transactionDetailState';
21
+ import { CompletedSubTab } from './completedSubTab';
19
22
  export declare const toTransactionsSortKey: (v: string) => "date" | "amount" | "vendor" | "project" | "category" | "class" | "payment_account" | "transaction_type" | "memo_and_receipt";
20
23
  export type TransactionsSortKey = ReturnType<typeof toTransactionsSortKey>;
21
24
  export declare const TRANSACTIONS_TABS: readonly ["review", "autoCategorized"];
@@ -46,6 +49,7 @@ export interface TransactionCategorizationLineItemData extends TransactionLineBa
46
49
  transactionId: ID;
47
50
  account?: AccountBase;
48
51
  categorizationStatus?: CategorizationStatusType;
52
+ categoryClassRecommendationsFetchState?: FetchStateAndError;
49
53
  class?: ClassBase;
50
54
  customer?: CustomerBase;
51
55
  item?: ProductOrService;
@@ -91,6 +95,7 @@ export interface SupportedTransactionCategorization {
91
95
  }
92
96
  export declare const initialSupportedTransactionCategorization: SupportedTransactionCategorization;
93
97
  export interface TransactionsTabViewState extends FetchedState {
98
+ filters: TransactionFilters;
94
99
  markAsNotMiscategorizedStatus: FetchStateAndError;
95
100
  refreshStatus: FetchStateAndError;
96
101
  saveStatus: FetchStateAndError;
@@ -103,7 +108,44 @@ export interface TransactionsTabViewState extends FetchedState {
103
108
  selectedTransactionId?: ID;
104
109
  selectedTransactionLineId?: ID;
105
110
  }
111
+ /**
112
+ * Snapshot of the autoCategorized tab's paginated dataset for a single
113
+ * Completed sub-tab. Stored in {@link TransactionsViewState.autoCategorizedSubTabCache}
114
+ * so revisiting an already-loaded sub-tab can short-circuit the fetch epic
115
+ * (mirrors parent-tab caching). The snapshot is period-spanning — both the
116
+ * `totalCount` map and `transactionIdsBySelectedPeriod` map preserve every
117
+ * period the user has paged through under that sub-tab.
118
+ *
119
+ * `scrollPosition` is captured per sub-tab so revisiting a sub-tab restores
120
+ * the user's last scroll offset; switching to a fresh / never-visited sub-tab
121
+ * starts at the top instead of inheriting the previous sub-tab's offset.
122
+ */
123
+ export interface AutoCategorizedSubTabSnapshot {
124
+ error: ZeniAPIStatus | undefined;
125
+ fetchState: FetchState;
126
+ pageToken: PageToken;
127
+ scrollPosition: TransactionsViewUIState['scrollPosition'];
128
+ totalCount: Record<MonthYearPeriodId, number>;
129
+ transactionIdsBySelectedPeriod: Record<MonthYearPeriodId, ID[]>;
130
+ }
106
131
  export type TransactionsViewState = {
132
+ /**
133
+ * Per-sub-tab snapshot cache for the Completed (autoCategorized) tab. Keyed
134
+ * by {@link CompletedSubTab}. Populated as the user navigates between
135
+ * sub-tabs and consulted on every switch — the active autoCategorized slot
136
+ * is restored from here when a snapshot exists, otherwise it is reset and
137
+ * the fetch epic loads page 1 fresh.
138
+ */
139
+ autoCategorizedSubTabCache: Partial<Record<CompletedSubTab, AutoCategorizedSubTabSnapshot>>;
140
+ /**
141
+ * Period-keyed parent tab counts, scoped per {@link TransactionsTab}.
142
+ * Sourced from the listing response's `parent_tab_total_count` and used
143
+ * exclusively to drive the parent tab badges on the UI — every other
144
+ * count consumer (pagination, sub-tab chips, in-tab "showing X of Y")
145
+ * keeps reading from {@link TransactionsViewUIState.totalCount}.
146
+ */
147
+ parentTotalCountByTab: Record<TransactionsTab, Record<MonthYearPeriodId, number>>;
148
+ selectedTransactionCategorizationCompletedSubTab: CompletedSubTab;
107
149
  selectedTransactionCategorizationTab: TransactionsTab;
108
150
  transactionCategorizationView: Record<TransactionsTab, TransactionsTabViewState>;
109
151
  };
@@ -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 {
@@ -0,0 +1,9 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { RootState } from '../../reducer';
4
+ import { ZeniAPI } from '../../zeniAPI';
5
+ import { markCategoryClassRecommendationsCompletedForCategorization, markCategoryClassRecommendationsFailureForCategorization, markCategoryClassRecommendationsInProgressForCategorization, setEntityRecommendationForLineIdsForCategorization } from '../expenseAutomationView/reducers/transactionsViewReducer';
6
+ import { markCategoryClassRecommendationsCompletedForTransactionDetail, markCategoryClassRecommendationsFailureForTransactionDetail, markCategoryClassRecommendationsInProgressForTransactionDetail, setEntityRecommendationForLineIdsForTransactionDetail } from '../transactionDetail/transactionDetailReducer';
7
+ import { fetchEntityRecommendationsForLineUpdate } from './recommendationReducer';
8
+ export type ActionType = ReturnType<typeof fetchEntityRecommendationsForLineUpdate> | ReturnType<typeof markCategoryClassRecommendationsInProgressForCategorization> | ReturnType<typeof markCategoryClassRecommendationsCompletedForCategorization> | ReturnType<typeof markCategoryClassRecommendationsFailureForCategorization> | ReturnType<typeof markCategoryClassRecommendationsInProgressForTransactionDetail> | ReturnType<typeof markCategoryClassRecommendationsCompletedForTransactionDetail> | ReturnType<typeof markCategoryClassRecommendationsFailureForTransactionDetail> | ReturnType<typeof setEntityRecommendationForLineIdsForCategorization> | ReturnType<typeof setEntityRecommendationForLineIdsForTransactionDetail>;
9
+ export declare const fetchEntityRecommendationsForLineUpdateEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fetchEntityRecommendationsForLineUpdateEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const tenantSelector_1 = require("../../entity/tenant/tenantSelector");
7
+ const transactionHelper_1 = require("../../entity/transaction/transactionHelper");
8
+ const responsePayload_1 = require("../../responsePayload");
9
+ const accountListSelector_1 = require("../accountList/accountListSelector");
10
+ const transactionsViewReducer_1 = require("../expenseAutomationView/reducers/transactionsViewReducer");
11
+ const transactionDetailReducer_1 = require("../transactionDetail/transactionDetailReducer");
12
+ const recommendationHelper_1 = require("./recommendationHelper");
13
+ const recommendationReducer_1 = require("./recommendationReducer");
14
+ // Close the per-target groupBy bucket after this much idle time so inactive
15
+ // groups don't accumulate forever (each group holds a Subject + a chain of
16
+ // active subscribers; without a duration selector groupBy retains them for
17
+ // the lifetime of the source observable, which is the lifetime of the app).
18
+ // Picked at 60s to leave a generous window for re-fetches on the same
19
+ // payee/transaction/line target while still bounding memory.
20
+ const GROUP_INACTIVITY_TIMEOUT_MS = 60000;
21
+ // Build the groupBy key. Same flow + same transaction + same line set
22
+ // share a target so switchMap can cancel an in-flight prior fetch. Use
23
+ // NUL (\u0000) as separator because it can never appear in transaction
24
+ // or line ids (vs the `|` used in an earlier WIP which collides with
25
+ // pipe-delimited synthetic ids).
26
+ const SEPARATOR = '\u0000';
27
+ const toGroupKey = (flowType, transactionId, lineIds) => `${flowType}${SEPARATOR}${transactionId}${SEPARATOR}${[...lineIds]
28
+ .sort((a, b) => a.localeCompare(b))
29
+ .join(SEPARATOR)}`;
30
+ // Targeted recommendations fetch that drives the per-line skeleton, the
31
+ // list-page row-checkbox uncheck/recheck, and the page-level Save
32
+ // disable.
33
+ //
34
+ // Concurrency model:
35
+ // - groupBy by (flowType, transactionId, sorted lineIds) so distinct
36
+ // targets run in parallel.
37
+ // - inside each group, switchMap so a re-fetch on the SAME target
38
+ // cancels any prior in-flight request for that target.
39
+ // - groupBy duration selector closes idle groups to bound memory.
40
+ const fetchEntityRecommendationsForLineUpdateEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(recommendationReducer_1.fetchEntityRecommendationsForLineUpdate.match), (0, operators_1.groupBy)((action) => toGroupKey(action.payload.flowType, action.payload.transactionDetails.transactionId.id, action.payload.transactionDetails.lineIds), undefined, (group$) => group$.pipe((0, operators_1.debounce)(() => (0, rxjs_1.timer)(GROUP_INACTIVITY_TIMEOUT_MS)))), (0, operators_1.mergeMap)((group$) => group$.pipe((0, operators_1.switchMap)((action) => {
41
+ const payload = action.payload;
42
+ const { transactionId, transaction, lineIds } = payload.transactionDetails;
43
+ const { entity, amount, isFetchCOT, isUncategorizedExpenseCategoryEnabled, } = payload;
44
+ // Synchronously emit the start arm so the per-line skeleton +
45
+ // row uncheck happen before the HTTP request begins. The
46
+ // discriminated-union payload narrows `payload.selectedTab` to
47
+ // a non-optional `TransactionsTab` inside the `'categorization'`
48
+ // branch, so no defensive fallthrough is needed.
49
+ const startAction = payload.flowType === 'categorization'
50
+ ? (0, transactionsViewReducer_1.markCategoryClassRecommendationsInProgressForCategorization)(payload.selectedTab, transactionId, lineIds)
51
+ : (0, transactionDetailReducer_1.markCategoryClassRecommendationsInProgressForTransactionDetail)(transactionId, lineIds);
52
+ const url = (0, recommendationHelper_1.buildRecommendationUrl)(zeniAPI.apiEndPoints.accountMicroServiceBaseUrl, entity, amount, payload.transactionDetails, isFetchCOT === true);
53
+ const httpStream$ = zeniAPI
54
+ .getJSON(url)
55
+ .pipe((0, operators_1.mergeMap)((response) => {
56
+ if (!(0, responsePayload_1.isSuccessResponse)(response) || response.data == null) {
57
+ return (0, rxjs_1.of)(payload.flowType === 'categorization'
58
+ ? (0, transactionsViewReducer_1.markCategoryClassRecommendationsFailureForCategorization)(payload.selectedTab, transactionId, lineIds, response.status)
59
+ : (0, transactionDetailReducer_1.markCategoryClassRecommendationsFailureForTransactionDetail)(transactionId, lineIds, response.status));
60
+ }
61
+ const recommendationWithCOTByLineId = (0, recommendationHelper_1.getRecommendationByLineIdWithCOTFromRecommendationPayloadWithCOT)(response.data.recommendations, lineIds);
62
+ // HTTP 200 with no per-line recommendations: NOT an error.
63
+ // Flip lines to Completed so the skeleton resolves and
64
+ // downstream UI can treat this as "we tried, nothing to
65
+ // apply".
66
+ if (recommendationWithCOTByLineId == null) {
67
+ return (0, rxjs_1.of)(payload.flowType === 'categorization'
68
+ ? (0, transactionsViewReducer_1.markCategoryClassRecommendationsCompletedForCategorization)(payload.selectedTab, transactionId, lineIds)
69
+ : (0, transactionDetailReducer_1.markCategoryClassRecommendationsCompletedForTransactionDetail)(transactionId, lineIds));
70
+ }
71
+ const transactionWithCOT = isFetchCOT === true
72
+ ? (0, transactionHelper_1.getTransactionWithCOTFromRecommendations)(transaction, recommendationWithCOTByLineId)
73
+ : (0, transactionHelper_1.getTransactionWithCOT)(transaction);
74
+ const uncategorizedIncomeExpense = (0, accountListSelector_1.getUncategorizedAccounts)(state$.value.accountState, state$.value.accountListState, 'accountList');
75
+ if (payload.flowType === 'categorization') {
76
+ return (0, rxjs_1.of)((0, transactionsViewReducer_1.setEntityRecommendationForLineIdsForCategorization)(payload.selectedTab, transactionId, transactionWithCOT, lineIds, entity, amount, recommendationWithCOTByLineId, uncategorizedIncomeExpense, isUncategorizedExpenseCategoryEnabled, (0, tenantSelector_1.getIsAccountingClassesEnabled)(state$.value)));
77
+ }
78
+ return (0, rxjs_1.of)((0, transactionDetailReducer_1.setEntityRecommendationForLineIdsForTransactionDetail)(transactionId, transactionWithCOT, lineIds, entity, amount, recommendationWithCOTByLineId, uncategorizedIncomeExpense));
79
+ }), (0, operators_1.catchError)((error) => {
80
+ const errorMessage = 'fetchEntityRecommendationsForLineUpdate failed: ' +
81
+ (error instanceof Error
82
+ ? error.message
83
+ : JSON.stringify(error));
84
+ const status = (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', errorMessage);
85
+ return (0, rxjs_1.of)(payload.flowType === 'categorization'
86
+ ? (0, transactionsViewReducer_1.markCategoryClassRecommendationsFailureForCategorization)(payload.selectedTab, transactionId, lineIds, status)
87
+ : (0, transactionDetailReducer_1.markCategoryClassRecommendationsFailureForTransactionDetail)(transactionId, lineIds, status));
88
+ }));
89
+ return (0, rxjs_1.concat)((0, rxjs_1.of)(startAction), httpStream$);
90
+ }))));
91
+ exports.fetchEntityRecommendationsForLineUpdateEpic = fetchEntityRecommendationsForLineUpdateEpic;
@@ -1,8 +1,17 @@
1
1
  import { RecommendationPayload, RecommendationPayloadWithCOT } from '../../commonPayloadTypes/recommendationPayload';
2
2
  import { ID } from '../../commonStateTypes/common';
3
3
  import { Recommendation, RecommendationWithCOT } from '../../commonStateTypes/recommendationBase';
4
+ import { Entity } from '../../entity/genericEntity/entity';
4
5
  import { RecommendationByLineId, RecommendationWithCOTByLineId } from '../../entity/transaction/stateTypes/transaction';
6
+ import { SupportedTransaction } from '../../entity/transaction/transactionState';
5
7
  export declare const getRecommendationFromRecommendationPayload: (payload: RecommendationPayload[]) => Recommendation[] | undefined;
6
8
  export declare const getRecommendationByLineIdFromRecommendationPayload: (recommendationPayload: RecommendationPayload[], lineIds: ID[]) => RecommendationByLineId | undefined;
7
9
  export declare const getRecommendationWithCOTFromRecommendationPayloadWithCOT: (payload: RecommendationPayloadWithCOT[]) => RecommendationWithCOT[] | undefined;
10
+ export declare const buildRecommendationUrl: (accountMicroServiceBaseUrl: string, entity: Entity, amount: number, transactionDetails: {
11
+ lineIds: ID[];
12
+ transaction: SupportedTransaction;
13
+ transactionId: {
14
+ id: string;
15
+ };
16
+ }, isFetchCOT: boolean) => string;
8
17
  export declare const getRecommendationByLineIdWithCOTFromRecommendationPayloadWithCOT: (recommendationPayload: RecommendationPayloadWithCOT[], lineIds: ID[]) => RecommendationWithCOTByLineId | undefined;
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getRecommendationByLineIdWithCOTFromRecommendationPayloadWithCOT = exports.getRecommendationWithCOTFromRecommendationPayloadWithCOT = exports.getRecommendationByLineIdFromRecommendationPayload = exports.getRecommendationFromRecommendationPayload = void 0;
3
+ exports.getRecommendationByLineIdWithCOTFromRecommendationPayloadWithCOT = exports.buildRecommendationUrl = exports.getRecommendationWithCOTFromRecommendationPayloadWithCOT = exports.getRecommendationByLineIdFromRecommendationPayload = exports.getRecommendationFromRecommendationPayload = void 0;
4
4
  const transactionPayload_1 = require("../../entity/transaction/payloadTypes/transactionPayload");
5
+ const transactionDetailState_1 = require("../transactionDetail/transactionDetailState");
5
6
  const getRecommendationFromRecommendationPayload = (payload) => {
6
7
  if (payload == null || payload.length === 0) {
7
8
  return undefined;
@@ -43,6 +44,35 @@ const getRecommendationWithCOTFromRecommendationPayloadWithCOT = (payload) => {
43
44
  return recommendations;
44
45
  };
45
46
  exports.getRecommendationWithCOTFromRecommendationPayloadWithCOT = getRecommendationWithCOTFromRecommendationPayloadWithCOT;
47
+ // Pluralized URL segment for entity types. Mirrors the legacy
48
+ // fetchEntityRecommendationsByTransactionIdEpic.toEntityTypeURL.
49
+ const toEntityTypeUrlSegment = (entityType) => `${entityType}s`;
50
+ // Build the recommendations URL for a single entity + transaction target.
51
+ // Centralizes the URL shape so the legacy
52
+ // fetchEntityRecommendationsByTransactionIdEpic and the new
53
+ // fetchEntityRecommendationsForLineUpdateEpic stay in lockstep.
54
+ const buildRecommendationUrl = (accountMicroServiceBaseUrl, entity, amount, transactionDetails, isFetchCOT) => {
55
+ const entityQuery = {
56
+ entity_name: entity.name,
57
+ entity_type: entity.type,
58
+ };
59
+ // Entity-id-null case: server expects entity_name / entity_type query
60
+ // instead of the {entityType}/{qboId}/recommendations path.
61
+ if (entity.qboId === entity.name) {
62
+ return `${accountMicroServiceBaseUrl}/1.0/recommendations?query=${encodeURIComponent(JSON.stringify(entityQuery))}`;
63
+ }
64
+ const query = {
65
+ amount,
66
+ transaction_id: (0, transactionDetailState_1.getActualTransactionID)(transactionDetails.transactionId.id),
67
+ transaction_type: transactionDetails.transaction.type,
68
+ line_ids: transactionDetails.lineIds,
69
+ };
70
+ if (isFetchCOT === true) {
71
+ query.include_cot = true;
72
+ }
73
+ return `${accountMicroServiceBaseUrl}/1.0/${toEntityTypeUrlSegment(entity.type)}/${entity.qboId}/recommendations?query=${encodeURIComponent(JSON.stringify(query))}`;
74
+ };
75
+ exports.buildRecommendationUrl = buildRecommendationUrl;
46
76
  const getRecommendationByLineIdWithCOTFromRecommendationPayloadWithCOT = (recommendationPayload, lineIds) => {
47
77
  if (recommendationPayload.length === 0) {
48
78
  return undefined;
@@ -4,7 +4,26 @@ import { Entity, EntityType } from '../../entity/genericEntity/entity';
4
4
  import { TransactionID } from '../../entity/transaction/stateTypes/transaction';
5
5
  import { SupportedTransaction } from '../../entity/transaction/transactionState';
6
6
  import { ZeniAPIStatus } from '../../responsePayload';
7
+ import { TransactionsTab } from '../expenseAutomationView/types/transactionsViewState';
7
8
  import { EntityRecommendationState } from './recommendationState';
9
+ export type RecommendationLineUpdateFlowType = 'categorization' | 'detail';
10
+ type FetchEntityRecommendationsForLineUpdateCommonPayload = {
11
+ amount: number;
12
+ entity: Entity;
13
+ transactionDetails: {
14
+ lineIds: ID[];
15
+ transaction: SupportedTransaction;
16
+ transactionId: TransactionID;
17
+ };
18
+ isFetchCOT?: boolean;
19
+ isUncategorizedExpenseCategoryEnabled?: boolean;
20
+ };
21
+ export type FetchEntityRecommendationsForLineUpdatePayload = (FetchEntityRecommendationsForLineUpdateCommonPayload & {
22
+ flowType: 'categorization';
23
+ selectedTab: TransactionsTab;
24
+ }) | (FetchEntityRecommendationsForLineUpdateCommonPayload & {
25
+ flowType: 'detail';
26
+ });
8
27
  export declare const initialState: EntityRecommendationState;
9
28
  export declare const fetchEntityRecommendationsByTransactionId: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[entity: Entity, amount: number, transactionDetails: {
10
29
  lineIds: ID[];
@@ -22,7 +41,7 @@ export declare const fetchEntityRecommendationsByTransactionId: import("@reduxjs
22
41
  isTransactionCategorizationFlow: any;
23
42
  isFetchCOT: any;
24
43
  isUncategorizedExpenseCategoryEnabled: boolean | undefined;
25
- }, "recommendation/fetchEntityRecommendationsByTransactionId", never, never>, fetchRecommendationByEntityName: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[entityName: string, entityType: EntityType], {
44
+ }, "recommendation/fetchEntityRecommendationsByTransactionId", never, never>, fetchEntityRecommendationsForLineUpdate: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[args: FetchEntityRecommendationsForLineUpdatePayload], FetchEntityRecommendationsForLineUpdatePayload, "recommendation/fetchEntityRecommendationsForLineUpdate", never, never>, fetchRecommendationByEntityName: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[entityName: string, entityType: EntityType], {
26
45
  entityName: string;
27
46
  entityType: EntityType;
28
47
  }, "recommendation/fetchRecommendationByEntityName", never, never>, fetchRecommendationByEntityId: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[entityId: string, entityType: EntityType], {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.clearRecommendation = exports.indicateReadyToInitializeRecommendation = exports.updateRecommendationForEntityFailure = exports.updateRecommendationForEntity = exports.fetchRecommendationByEntityId = exports.fetchRecommendationByEntityName = exports.fetchEntityRecommendationsByTransactionId = exports.initialState = void 0;
4
+ exports.clearRecommendation = exports.indicateReadyToInitializeRecommendation = exports.updateRecommendationForEntityFailure = exports.updateRecommendationForEntity = exports.fetchRecommendationByEntityId = exports.fetchRecommendationByEntityName = exports.fetchEntityRecommendationsForLineUpdate = exports.fetchEntityRecommendationsByTransactionId = exports.initialState = void 0;
5
5
  const toolkit_1 = require("@reduxjs/toolkit");
6
6
  const recommendationState_1 = require("./recommendationState");
7
7
  exports.initialState = {
@@ -37,6 +37,31 @@ const recommendation = (0, toolkit_1.createSlice)({
37
37
  };
38
38
  },
39
39
  },
40
+ // Targeted recommendations fetch fired when the user changes the
41
+ // payee/customer on a single transaction line (or the JE sibling set
42
+ // for that change). Routed by `fetchEntityRecommendationsForLineUpdateEpic`
43
+ // which uses groupBy + switchMap to keep fetches for distinct targets
44
+ // running in parallel while same-target re-fetches still cancel each
45
+ // other. The flowType discriminator selects the categorization vs
46
+ // detail slice for the per-line In-Progress / Completed / Error state.
47
+ fetchEntityRecommendationsForLineUpdate: {
48
+ reducer(draft, action) {
49
+ const { entity } = action.payload;
50
+ const key = (0, recommendationState_1.getEntityRecommendationKey)(entity.type, entity.id);
51
+ // Unconditional flip to In-Progress; the previous variant only
52
+ // seeded when missing, which left stale fetchStates when a prior
53
+ // fetch had already populated the entity entry.
54
+ draft.recommendationByEntity[key] = {
55
+ ...(draft.recommendationByEntity[key] ??
56
+ recommendationState_1.initialEntityRecommendationState),
57
+ fetchState: 'In-Progress',
58
+ error: undefined,
59
+ };
60
+ },
61
+ prepare(args) {
62
+ return { payload: args };
63
+ },
64
+ },
40
65
  fetchRecommendationByEntityName: {
41
66
  reducer(draft, action) {
42
67
  const { entityName, entityType } = action.payload;
@@ -115,7 +140,7 @@ const recommendation = (0, toolkit_1.createSlice)({
115
140
  },
116
141
  },
117
142
  });
118
- _a = recommendation.actions, exports.fetchEntityRecommendationsByTransactionId = _a.fetchEntityRecommendationsByTransactionId, exports.fetchRecommendationByEntityName = _a.fetchRecommendationByEntityName, exports.fetchRecommendationByEntityId = _a.fetchRecommendationByEntityId, exports.updateRecommendationForEntity = _a.updateRecommendationForEntity, exports.updateRecommendationForEntityFailure = _a.updateRecommendationForEntityFailure, exports.indicateReadyToInitializeRecommendation = _a.indicateReadyToInitializeRecommendation, exports.clearRecommendation = _a.clearRecommendation;
143
+ _a = recommendation.actions, exports.fetchEntityRecommendationsByTransactionId = _a.fetchEntityRecommendationsByTransactionId, exports.fetchEntityRecommendationsForLineUpdate = _a.fetchEntityRecommendationsForLineUpdate, exports.fetchRecommendationByEntityName = _a.fetchRecommendationByEntityName, exports.fetchRecommendationByEntityId = _a.fetchRecommendationByEntityId, exports.updateRecommendationForEntity = _a.updateRecommendationForEntity, exports.updateRecommendationForEntityFailure = _a.updateRecommendationForEntityFailure, exports.indicateReadyToInitializeRecommendation = _a.indicateReadyToInitializeRecommendation, exports.clearRecommendation = _a.clearRecommendation;
119
144
  exports.default = recommendation.reducer;
120
145
  const doUpdateRecommendationForEntity = (draft, entityId, entityType, payload) => {
121
146
  const key = (0, recommendationState_1.getEntityRecommendationKey)(entityType, entityId);
@@ -45,7 +45,7 @@ export interface BillPayFilters {
45
45
  }
46
46
  export interface BillPayFilterCategory {
47
47
  field: BillListViewFilterCategoryField;
48
- matchingOperator: 'equal' | 'not-equal';
48
+ matchingOperator: 'equal' | 'not_equal';
49
49
  values: (string | ZeniDate)[];
50
50
  valuesCombinationOperator: 'ANY';
51
51
  }