@zeniai/client-epic-state 5.0.76 → 5.0.77-betaAK1

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 (223) hide show
  1. package/lib/commonStateTypes/amount.d.ts +1 -0
  2. package/lib/commonStateTypes/amount.js +3 -1
  3. package/lib/commonStateTypes/cacheOverrideFetchReducer.d.ts +17 -0
  4. package/lib/commonStateTypes/cacheOverrideFetchReducer.js +20 -0
  5. package/lib/commonStateTypes/filterPrimitives.d.ts +23 -0
  6. package/lib/commonStateTypes/filterPrimitives.js +21 -0
  7. package/lib/commonStateTypes/pusherActions.d.ts +11 -0
  8. package/lib/commonStateTypes/pusherActions.js +6 -0
  9. package/lib/coreEpics.js +1 -1
  10. package/lib/entity/account/accountSelector.d.ts +27 -1
  11. package/lib/entity/account/accountSelector.js +47 -1
  12. package/lib/entity/account/accountState.d.ts +6 -1
  13. package/lib/entity/account/accountState.js +11 -4
  14. package/lib/entity/account/subAccountSelector.d.ts +1 -1
  15. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerPayload.js +1 -3
  16. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerReducer.js +1 -2
  17. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerSelector.d.ts +1 -1
  18. package/lib/entity/chargeCard/chargeCardReducer.d.ts +19 -2
  19. package/lib/entity/chargeCard/chargeCardReducer.js +35 -2
  20. package/lib/entity/chargeCardTransaction/chargeCardTransactionReducer.d.ts +14 -1
  21. package/lib/entity/chargeCardTransaction/chargeCardTransactionReducer.js +36 -2
  22. package/lib/entity/class/classSelector.d.ts +35 -0
  23. package/lib/entity/class/classSelector.js +50 -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/saveAPIKeyConnectionEpic.js +6 -2
  30. package/lib/entity/tenant/epic/saveOAuthConnectionEpic.js +6 -2
  31. package/lib/entity/tenant/tenantReducer.js +6 -1
  32. package/lib/entity/transaction/payloadTypes/transactionLinePayload.js +3 -1
  33. package/lib/entity/upcomingPaymentEvent/upcomingPaymentEventPayload.d.ts +11 -0
  34. package/lib/entity/upcomingPaymentEvent/upcomingPaymentEventPayload.js +23 -0
  35. package/lib/entity/upcomingPaymentEvent/upcomingPaymentEventReducer.d.ts +6 -0
  36. package/lib/entity/upcomingPaymentEvent/upcomingPaymentEventReducer.js +31 -0
  37. package/lib/entity/upcomingPaymentEvent/upcomingPaymentEventSelector.d.ts +4 -0
  38. package/lib/entity/upcomingPaymentEvent/upcomingPaymentEventSelector.js +16 -0
  39. package/lib/entity/upcomingPaymentEvent/upcomingPaymentEventState.d.ts +13 -0
  40. package/lib/entity/upcomingPaymentEvent/upcomingPaymentEventState.js +2 -0
  41. package/lib/epic.d.ts +16 -10
  42. package/lib/epic.js +17 -11
  43. package/lib/esm/commonStateTypes/amount.js +1 -0
  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/sectionProjectView/sectionProjectViewSelector.js +1 -1
  56. package/lib/esm/entity/tenant/SessionManager.js +4 -1
  57. package/lib/esm/entity/tenant/clearAllEpic.js +2 -2
  58. package/lib/esm/entity/tenant/epic/saveAPIKeyConnectionEpic.js +6 -2
  59. package/lib/esm/entity/tenant/epic/saveOAuthConnectionEpic.js +6 -2
  60. package/lib/esm/entity/tenant/tenantReducer.js +6 -1
  61. package/lib/esm/entity/transaction/payloadTypes/transactionLinePayload.js +3 -1
  62. package/lib/esm/entity/upcomingPaymentEvent/upcomingPaymentEventPayload.js +19 -0
  63. package/lib/esm/entity/upcomingPaymentEvent/upcomingPaymentEventReducer.js +27 -0
  64. package/lib/esm/entity/upcomingPaymentEvent/upcomingPaymentEventSelector.js +11 -0
  65. package/lib/esm/entity/upcomingPaymentEvent/upcomingPaymentEventState.js +1 -0
  66. package/lib/esm/epic.js +17 -11
  67. package/lib/esm/index.js +34 -22
  68. package/lib/esm/reducer.js +8 -2
  69. package/lib/esm/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.js +2 -5
  70. package/lib/esm/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.js +2 -5
  71. package/lib/esm/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +4 -1
  72. package/lib/esm/view/companyHealthMetricView/companyHealthMetricViewSelector.js +1 -1
  73. package/lib/esm/view/companyTaskManagerView/companyTaskManagerViewSelector.js +1 -1
  74. package/lib/esm/view/companyTaskManagerView/epics/fetchTaskManagerMetricsEpic.js +1 -1
  75. package/lib/esm/view/companyView/helpers/cockpitHelpers.js +1 -1
  76. package/lib/esm/view/companyView/selector/companyManagementViewSelector.js +1 -1
  77. package/lib/esm/view/companyView/selector/companyPortfolioViewSelector.js +1 -1
  78. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +2 -2
  79. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +2 -1
  80. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.js +21 -5
  81. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/refreshBatchDetailsForBatchIdEpic.js +52 -0
  82. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.js +8 -6
  83. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +7 -1
  84. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/syncTabsAfterAutomatchEpic.js +56 -0
  85. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +13 -9
  86. package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +11 -1
  87. package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +21 -1
  88. package/lib/esm/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +81 -2
  89. package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +253 -14
  90. package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +2 -0
  91. package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +147 -13
  92. package/lib/esm/view/expenseAutomationView/transactionFilterHelpers.js +258 -0
  93. package/lib/esm/view/expenseAutomationView/types/completedSubTab.js +17 -0
  94. package/lib/esm/view/expenseAutomationView/types/missingReceiptsViewState.js +0 -2
  95. package/lib/esm/view/financeStatement/financeStatementSelector.js +1 -1
  96. package/lib/esm/view/recommendation/fetchEntityRecommendationsForLineUpdateEpic.js +87 -0
  97. package/lib/esm/view/recommendation/recommendationHelper.js +29 -0
  98. package/lib/esm/view/recommendation/recommendationReducer.js +26 -1
  99. package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewPayload.js +1 -0
  100. package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewReducer.js +82 -0
  101. package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector.js +93 -0
  102. package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewState.js +14 -0
  103. package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementBannerEpic.js +6 -0
  104. package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementOverviewPageEpic.js +42 -0
  105. package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchUpcomingPaymentEventsEpic.js +22 -0
  106. package/lib/esm/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailReducer.js +3 -2
  107. package/lib/esm/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.js +3 -2
  108. package/lib/esm/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +55 -18
  109. package/lib/esm/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.js +16 -2
  110. package/lib/esm/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailPageEpic.js +5 -4
  111. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +26 -9
  112. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.js +9 -6
  113. package/lib/esm/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryReducer.js +3 -2
  114. package/lib/esm/view/spendManagement/chargeCards/chargeCardPaymentHistory/fetchChargeCardPaymentPageEpic.js +1 -1
  115. package/lib/esm/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailReducer.js +7 -3
  116. package/lib/esm/view/spendManagement/spendManagementFilterHelpers.js +4 -2
  117. package/lib/esm/view/subscriptionView/subscriptionViewSelector.js +1 -1
  118. package/lib/esm/view/taskManager/cannedResponsesView/epics/fetchCannedResponsesEpic.js +1 -1
  119. package/lib/esm/view/taskManager/cannedResponsesView/epics/saveCannedResponseEpic.js +1 -1
  120. package/lib/esm/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.js +1 -1
  121. package/lib/esm/view/taskManager/taskListView/taskListReducer.js +1 -1
  122. package/lib/esm/view/transactionDetail/transactionDetailReducer.js +121 -6
  123. package/lib/esm/view/transactionDetail/transactionDetailSelector.js +29 -1
  124. package/lib/index.d.ts +34 -24
  125. package/lib/index.js +92 -58
  126. package/lib/reducer.d.ts +8 -2
  127. package/lib/reducer.js +8 -2
  128. package/lib/view/aiAccountantView/aiAccountantViewPayload.d.ts +2 -2
  129. package/lib/view/aiAccountantView/aiAccountantViewReducer.d.ts +1 -1
  130. package/lib/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.js +2 -5
  131. package/lib/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.js +2 -5
  132. package/lib/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +4 -1
  133. package/lib/view/companyHealthMetricView/companyHealthMetricViewSelector.js +1 -1
  134. package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.d.ts +1 -1
  135. package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.js +1 -1
  136. package/lib/view/companyView/helpers/cockpitHelpers.js +1 -1
  137. package/lib/view/companyView/selector/companyManagementViewSelector.js +1 -1
  138. package/lib/view/companyView/selector/companyPortfolioViewSelector.js +1 -1
  139. package/lib/view/companyView/types/cockpitTypes.d.ts +1 -1
  140. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +2 -2
  141. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +2 -1
  142. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.js +21 -5
  143. package/lib/view/expenseAutomationView/epics/missingReceipts/refreshBatchDetailsForBatchIdEpic.d.ts +18 -0
  144. package/lib/view/expenseAutomationView/epics/missingReceipts/refreshBatchDetailsForBatchIdEpic.js +56 -0
  145. package/lib/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.js +8 -6
  146. package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +7 -1
  147. package/lib/view/expenseAutomationView/epics/missingReceipts/syncTabsAfterAutomatchEpic.d.ts +28 -0
  148. package/lib/view/expenseAutomationView/epics/missingReceipts/syncTabsAfterAutomatchEpic.js +60 -0
  149. package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.d.ts +11 -5
  150. package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +12 -8
  151. package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.d.ts +2 -2
  152. package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +10 -0
  153. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +2 -1
  154. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +23 -2
  155. package/lib/view/expenseAutomationView/payload/transactionCategorizationPayload.d.ts +21 -0
  156. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +15 -2
  157. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +83 -3
  158. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +28 -5
  159. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +253 -14
  160. package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +14 -1
  161. package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +16 -0
  162. package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +2 -0
  163. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.d.ts +7 -1
  164. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +150 -13
  165. package/lib/view/expenseAutomationView/transactionFilterHelpers.d.ts +66 -0
  166. package/lib/view/expenseAutomationView/transactionFilterHelpers.js +262 -0
  167. package/lib/view/expenseAutomationView/types/completedSubTab.d.ts +10 -0
  168. package/lib/view/expenseAutomationView/types/completedSubTab.js +21 -0
  169. package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +20 -2
  170. package/lib/view/expenseAutomationView/types/missingReceiptsViewState.js +1 -4
  171. package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +44 -2
  172. package/lib/view/financeStatement/financeStatementSelector.js +1 -1
  173. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelectorTypes.d.ts +1 -1
  174. package/lib/view/recommendation/fetchEntityRecommendationsForLineUpdateEpic.d.ts +9 -0
  175. package/lib/view/recommendation/fetchEntityRecommendationsForLineUpdateEpic.js +91 -0
  176. package/lib/view/recommendation/recommendationHelper.d.ts +9 -0
  177. package/lib/view/recommendation/recommendationHelper.js +31 -1
  178. package/lib/view/recommendation/recommendationReducer.d.ts +20 -1
  179. package/lib/view/recommendation/recommendationReducer.js +27 -2
  180. package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
  181. package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewPayload.d.ts +10 -0
  182. package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewPayload.js +2 -0
  183. package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewReducer.d.ts +20 -0
  184. package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewReducer.js +86 -0
  185. package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector.d.ts +20 -0
  186. package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector.js +98 -0
  187. package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewState.d.ts +21 -0
  188. package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewState.js +17 -0
  189. package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementBannerEpic.d.ts +5 -0
  190. package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementBannerEpic.js +10 -0
  191. package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementOverviewPageEpic.d.ts +9 -0
  192. package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementOverviewPageEpic.js +46 -0
  193. package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchUpcomingPaymentEventsEpic.d.ts +8 -0
  194. package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchUpcomingPaymentEventsEpic.js +26 -0
  195. package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailReducer.d.ts +3 -1
  196. package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailReducer.js +3 -2
  197. package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.d.ts +3 -1
  198. package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.js +3 -2
  199. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +55 -18
  200. package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.js +16 -2
  201. package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailPageEpic.js +5 -4
  202. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.d.ts +18 -3
  203. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +27 -10
  204. package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.js +9 -6
  205. package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistory.d.ts +1 -1
  206. package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryReducer.d.ts +3 -1
  207. package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryReducer.js +3 -2
  208. package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/fetchChargeCardPaymentPageEpic.js +1 -1
  209. package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailReducer.d.ts +3 -1
  210. package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailReducer.js +7 -3
  211. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +1 -1
  212. package/lib/view/spendManagement/spendManagementFilterHelpers.d.ts +12 -3
  213. package/lib/view/spendManagement/spendManagementFilterHelpers.js +4 -2
  214. package/lib/view/subscriptionView/subscriptionViewSelector.js +1 -1
  215. package/lib/view/taskManager/taskListView/taskList.d.ts +1 -1
  216. package/lib/view/taskManager/taskListView/taskListReducer.js +1 -1
  217. package/lib/view/transactionDetail/transactionDetailReducer.d.ts +11 -1
  218. package/lib/view/transactionDetail/transactionDetailReducer.js +122 -7
  219. package/lib/view/transactionDetail/transactionDetailSelector.d.ts +2 -0
  220. package/lib/view/transactionDetail/transactionDetailSelector.js +31 -2
  221. package/lib/view/transactionDetail/transactionDetailTypes.d.ts +1 -0
  222. package/lib/view/zeniOAuthView/zeniOAuthSelector.d.ts +1 -1
  223. package/package.json +9 -4
package/lib/reducer.d.ts CHANGED
@@ -3,7 +3,6 @@ import { AccountGroupState } from './entity/accountGroup/accountGroupState';
3
3
  import { AccountReconState } from './entity/accountRecon/accountReconState';
4
4
  import { AddressState } from './entity/address/addressState';
5
5
  import { AiAccountantCustomerState } from './entity/aiAccountantCustomer/aiAccountantCustomerState';
6
- import { CreditAgentEntityState } from './entity/creditAgent/creditAgentState';
7
6
  import { AiCfoState } from './entity/aiCfo/aiCfoState';
8
7
  import { ApprovalRuleState } from './entity/approvalRule/approvalRuleState';
9
8
  import { BankAccountState } from './entity/bankAccount/bankAccount';
@@ -19,6 +18,7 @@ import { CompanyState } from './entity/company/companyState';
19
18
  import { CompanyHealthState } from './entity/companyHealthMetric/companyHealthMetricState';
20
19
  import { ConnectedAccountState } from './entity/connectedAccount/connectedAccount';
21
20
  import { CountryListState } from './entity/countryList/countryListState';
21
+ import { CreditAgentEntityState } from './entity/creditAgent/creditAgentState';
22
22
  import { CurrencyState } from './entity/currency/currency';
23
23
  import { CustomerState } from './entity/customer/customerState';
24
24
  import { CustomerIncomeState } from './entity/customerIncome/customerIncomeTrendState';
@@ -60,6 +60,7 @@ import { TenantState } from './entity/tenant/tenantState';
60
60
  import { ToastNotificationState } from './entity/toastNotification/toastNotificationState';
61
61
  import { TransactionState } from './entity/transaction/transactionState';
62
62
  import { TransactionActivityLogState } from './entity/transactionActivityLog/transactionActivityLogState';
63
+ import { UpcomingPaymentEventState } from './entity/upcomingPaymentEvent/upcomingPaymentEventState';
63
64
  import { UserState } from './entity/user/userState';
64
65
  import { UserGroupsState } from './entity/userGroups/userGroupsState';
65
66
  import { UserRoleState } from './entity/userRole/userRoleState';
@@ -106,8 +107,8 @@ import { JESchedulesViewState as ExpenseAutomationJESchedulesViewState } from '.
106
107
  import { MissingReceiptsViewState as ExpenseAutomationMissingReceiptsViewState } from './view/expenseAutomationView/types/missingReceiptsViewState';
107
108
  import { ReconciliationViewState as ExpenseAutomationReconciliationViewState } from './view/expenseAutomationView/types/reconciliationViewState';
108
109
  import { TransactionsViewState as ExpenseAutomationTransactionsViewState } from './view/expenseAutomationView/types/transactionsViewState';
109
- import { FileViewState } from './view/fileView/fileViewState';
110
110
  import { FeatureNotificationViewState } from './view/featureNotificationView/featureNotificationViewState';
111
+ import { FileViewState } from './view/fileView/fileViewState';
111
112
  import { FinanceStatementState } from './view/financeStatement/financeStatementState';
112
113
  import { ForecastListState } from './view/forecastList/forecastListState';
113
114
  import { GlobalMerchantAutoCompleteState } from './view/globalMerchantView/globalMerchantAutoCompleteView/globalMerchantAutoCompleteViewState';
@@ -155,6 +156,7 @@ import { InternationalWireVerificationState } from './view/spendManagement/billP
155
156
  import { MagicLinkViewState } from './view/spendManagement/billPay/magicLinkView/magicLinkViewState';
156
157
  import { PreviousBillsState } from './view/spendManagement/billPay/previousBills/previousBillsState';
157
158
  import { WiseRedirectState } from './view/spendManagement/billPay/wiseRedirectView/wiseRedirectState';
159
+ import { CashManagementOverviewState } from './view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewState';
158
160
  import { CardUserOnboardingState } from './view/spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingState';
159
161
  import { CashbackDetailState } from './view/spendManagement/chargeCards/cashbackDetail/cashbackDetailState';
160
162
  import { ChargeCardConfigState } from './view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigState';
@@ -284,6 +286,7 @@ type EntitiesState = {
284
286
  toastNotificationState: ToastNotificationState;
285
287
  transactionActivityLogState: TransactionActivityLogState;
286
288
  transactionState: TransactionState;
289
+ upcomingPaymentEventState: UpcomingPaymentEventState;
287
290
  userGroupsState: UserGroupsState;
288
291
  userRoleState: UserRoleState;
289
292
  userState: UserState;
@@ -323,6 +326,7 @@ type ViewsState = {
323
326
  cashBalanceState: CashBalanceState;
324
327
  cashFlowState: CashFlowState;
325
328
  cashInCashOutState: CashInCashOutState;
329
+ cashManagementOverviewState: CashManagementOverviewState;
326
330
  cashPositionState: CashPositionState;
327
331
  chargeCardConfigState: ChargeCardConfigState;
328
332
  chargeCardDetailState: ChargeCardDetailState;
@@ -483,6 +487,7 @@ declare const reducers: import("redux").Reducer<import("redux").CombinedState<{
483
487
  cashBalanceState: CashBalanceState;
484
488
  cashFlowState: CashFlowState;
485
489
  cashInCashOutState: CashInCashOutState;
490
+ cashManagementOverviewState: CashManagementOverviewState;
486
491
  cashPositionState: CashPositionState;
487
492
  chargeCardConfigState: ChargeCardConfigState;
488
493
  chargeCardDetailState: ChargeCardDetailState;
@@ -672,6 +677,7 @@ declare const reducers: import("redux").Reducer<import("redux").CombinedState<{
672
677
  toastNotificationState: ToastNotificationState;
673
678
  transactionActivityLogState: TransactionActivityLogState;
674
679
  transactionState: TransactionState;
680
+ upcomingPaymentEventState: UpcomingPaymentEventState;
675
681
  userGroupsState: UserGroupsState;
676
682
  userRoleState: UserRoleState;
677
683
  userState: UserState;
package/lib/reducer.js CHANGED
@@ -43,7 +43,6 @@ const accountGroupReducer_1 = __importStar(require("./entity/accountGroup/accoun
43
43
  const accountReconReducer_1 = __importStar(require("./entity/accountRecon/accountReconReducer"));
44
44
  const addressReducer_1 = __importStar(require("./entity/address/addressReducer"));
45
45
  const aiAccountantCustomerReducer_1 = __importStar(require("./entity/aiAccountantCustomer/aiAccountantCustomerReducer"));
46
- const creditAgentReducer_1 = __importStar(require("./entity/creditAgent/creditAgentReducer"));
47
46
  const aiCfoReducer_1 = __importStar(require("./entity/aiCfo/aiCfoReducer"));
48
47
  const approvalRuleReducer_1 = __importStar(require("./entity/approvalRule/approvalRuleReducer"));
49
48
  const bankAccountReducer_1 = __importStar(require("./entity/bankAccount/bankAccountReducer"));
@@ -59,6 +58,7 @@ const companyReducer_1 = __importStar(require("./entity/company/companyReducer")
59
58
  const companyHealthMetricReducer_1 = __importStar(require("./entity/companyHealthMetric/companyHealthMetricReducer"));
60
59
  const connectedAccountReducer_1 = __importStar(require("./entity/connectedAccount/connectedAccountReducer"));
61
60
  const countryListReducer_1 = __importStar(require("./entity/countryList/countryListReducer"));
61
+ const creditAgentReducer_1 = __importStar(require("./entity/creditAgent/creditAgentReducer"));
62
62
  const currencyReducer_1 = __importStar(require("./entity/currency/currencyReducer"));
63
63
  const customerReducer_1 = __importStar(require("./entity/customer/customerReducer"));
64
64
  const customerIncomeTrendReducer_1 = __importStar(require("./entity/customerIncome/customerIncomeTrendReducer"));
@@ -100,6 +100,7 @@ const tenantReducer_1 = __importStar(require("./entity/tenant/tenantReducer"));
100
100
  const toastNotificationReducer_1 = __importStar(require("./entity/toastNotification/toastNotificationReducer"));
101
101
  const transactionReducer_1 = __importStar(require("./entity/transaction/transactionReducer"));
102
102
  const transactionActivityLogReducer_1 = __importStar(require("./entity/transactionActivityLog/transactionActivityLogReducer"));
103
+ const upcomingPaymentEventReducer_1 = __importStar(require("./entity/upcomingPaymentEvent/upcomingPaymentEventReducer"));
103
104
  const userReducer_1 = __importStar(require("./entity/user/userReducer"));
104
105
  const userGroupsReducer_1 = __importStar(require("./entity/userGroups/userGroupsReducer"));
105
106
  const userRoleReducer_1 = __importStar(require("./entity/userRole/userRoleReducer"));
@@ -146,9 +147,9 @@ const jeSchedulesViewReducer_1 = __importStar(require("./view/expenseAutomationV
146
147
  const missingReceiptsViewReducer_1 = __importStar(require("./view/expenseAutomationView/reducers/missingReceiptsViewReducer"));
147
148
  const reconciliationViewReducer_1 = __importStar(require("./view/expenseAutomationView/reducers/reconciliationViewReducer"));
148
149
  const transactionsViewReducer_1 = __importStar(require("./view/expenseAutomationView/reducers/transactionsViewReducer"));
150
+ const featureNotificationViewReducer_1 = __importStar(require("./view/featureNotificationView/featureNotificationViewReducer"));
149
151
  const fileViewReducer_1 = __importDefault(require("./view/fileView/fileViewReducer"));
150
152
  const fileViewState_1 = require("./view/fileView/fileViewState");
151
- const featureNotificationViewReducer_1 = __importStar(require("./view/featureNotificationView/featureNotificationViewReducer"));
152
153
  const financeStatementReducer_1 = __importStar(require("./view/financeStatement/financeStatementReducer"));
153
154
  const forecastListReducer_1 = __importStar(require("./view/forecastList/forecastListReducer"));
154
155
  const globalMerchantAutoCompleteViewReducer_1 = __importStar(require("./view/globalMerchantView/globalMerchantAutoCompleteView/globalMerchantAutoCompleteViewReducer"));
@@ -196,6 +197,7 @@ const internationalWireVerificationReducer_1 = __importStar(require("./view/spen
196
197
  const magicLinkViewReducer_1 = __importStar(require("./view/spendManagement/billPay/magicLinkView/magicLinkViewReducer"));
197
198
  const previousBillsReducer_1 = __importStar(require("./view/spendManagement/billPay/previousBills/previousBillsReducer"));
198
199
  const wiseRedirectReducer_1 = __importStar(require("./view/spendManagement/billPay/wiseRedirectView/wiseRedirectReducer"));
200
+ const cashManagementOverviewReducer_1 = __importStar(require("./view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewReducer"));
199
201
  const cardUserOnboardingReducer_1 = __importStar(require("./view/spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingReducer"));
200
202
  const cashbackDetailReducer_1 = __importStar(require("./view/spendManagement/chargeCards/cashbackDetail/cashbackDetailReducer"));
201
203
  const chargeCardConfigReducer_1 = __importStar(require("./view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer"));
@@ -326,6 +328,7 @@ const initialEntitiesState = {
326
328
  toastNotificationState: toastNotificationReducer_1.initialState,
327
329
  transactionActivityLogState: transactionActivityLogReducer_1.initialState,
328
330
  transactionState: transactionReducer_1.initialState,
331
+ upcomingPaymentEventState: upcomingPaymentEventReducer_1.initialState,
329
332
  userGroupsState: userGroupsReducer_1.initialState,
330
333
  userRoleState: userRoleReducer_1.initialState,
331
334
  userState: userReducer_1.initialState,
@@ -365,6 +368,7 @@ const initialViewsState = {
365
368
  cashBalanceState: cashBalanceReducer_1.initialState,
366
369
  cashFlowState: cashFlowReducer_1.initialState,
367
370
  cashInCashOutState: cashInCashOutReducer_1.initialState,
371
+ cashManagementOverviewState: cashManagementOverviewReducer_1.initialState,
368
372
  cashPositionState: cashPositionReducer_1.initialState,
369
373
  chargeCardConfigState: chargeCardConfigReducer_1.initialState,
370
374
  chargeCardDetailState: chargeCardDetailReducer_1.initialState,
@@ -562,6 +566,7 @@ const entityReducers = {
562
566
  toastNotificationState: toastNotificationReducer_1.default,
563
567
  transactionActivityLogState: transactionActivityLogReducer_1.default,
564
568
  transactionState: transactionReducer_1.default,
569
+ upcomingPaymentEventState: upcomingPaymentEventReducer_1.default,
565
570
  userGroupsState: userGroupsReducer_1.default,
566
571
  userRoleState: userRoleReducer_1.default,
567
572
  userState: userReducer_1.default,
@@ -600,6 +605,7 @@ const viewReducers = {
600
605
  cashBalanceState: cashBalanceReducer_1.default,
601
606
  cashFlowState: cashFlowReducer_1.default,
602
607
  cashInCashOutState: cashInCashOutReducer_1.default,
608
+ cashManagementOverviewState: cashManagementOverviewReducer_1.default,
603
609
  cashPositionState: cashPositionReducer_1.default,
604
610
  chargeCardConfigState: chargeCardConfigReducer_1.default,
605
611
  chargeCardDetailState: chargeCardDetailReducer_1.default,
@@ -1,7 +1,7 @@
1
- import { ZeniAPIResponse } from '../../responsePayload';
2
- export { AiAccountantCustomerPayload, AiAccountantEnrollmentPayload, AiAccountantJobPayload, toAiAccountantCustomer, toAiAccountantEnrollment, toAiAccountantJob, } from '../../entity/aiAccountantCustomer/aiAccountantCustomerPayload';
3
1
  import type { AiAccountantCustomerPayload, AiAccountantJobPayload } from '../../entity/aiAccountantCustomer/aiAccountantCustomerPayload';
4
2
  import { UserPayload } from '../../entity/user/userPayload';
3
+ import { ZeniAPIResponse } from '../../responsePayload';
4
+ export { AiAccountantCustomerPayload, AiAccountantEnrollmentPayload, AiAccountantJobPayload, toAiAccountantCustomer, toAiAccountantEnrollment, toAiAccountantJob, } from '../../entity/aiAccountantCustomer/aiAccountantCustomerPayload';
5
5
  export interface AiAccountantCustomersResponseData {
6
6
  customers: AiAccountantCustomerPayload[];
7
7
  users: UserPayload[];
@@ -1,5 +1,5 @@
1
- import { AiAccountantCustomerPayload } from '../../entity/aiAccountantCustomer/aiAccountantCustomerPayload';
2
1
  import { ID } from '../../commonStateTypes/common';
2
+ import { AiAccountantCustomerPayload } from '../../entity/aiAccountantCustomer/aiAccountantCustomerPayload';
3
3
  import { ZeniAPIStatus } from '../../responsePayload';
4
4
  import { AiAccountantUIState, AiAccountantViewState } from './aiAccountantViewState';
5
5
  export declare const initialAiAccountantViewState: AiAccountantViewState;
@@ -10,9 +10,7 @@ const aiAccountantViewReducer_1 = require("../aiAccountantViewReducer");
10
10
  const fetchAiAccountantCustomersEpic = (actions$, _, zeniAPI) => actions$.pipe((0, operators_1.filter)(aiAccountantViewReducer_1.fetchAiAccountantCustomers.match), (0, operators_1.switchMap)(() => {
11
11
  const base = `${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/cockpit-panels`;
12
12
  const url = `${base}/ai-accountant/customers`;
13
- return zeniAPI
14
- .getJSON(url)
15
- .pipe((0, operators_1.mergeMap)((response) => {
13
+ return zeniAPI.getJSON(url).pipe((0, operators_1.mergeMap)((response) => {
16
14
  if ((0, responsePayload_1.isSuccessResponse)(response)) {
17
15
  const customers = response.data?.customers ?? [];
18
16
  const users = response.data?.users ?? [];
@@ -25,7 +23,6 @@ const fetchAiAccountantCustomersEpic = (actions$, _, zeniAPI) => actions$.pipe((
25
23
  else {
26
24
  return (0, rxjs_1.of)((0, aiAccountantViewReducer_1.updateAiAccountantCustomersFailure)(response.status));
27
25
  }
28
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, aiAccountantViewReducer_1.updateAiAccountantCustomersFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'AI Accountant customers fetch failed: ' +
29
- JSON.stringify(error))))));
26
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, aiAccountantViewReducer_1.updateAiAccountantCustomersFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'AI Accountant customers fetch failed: ' + JSON.stringify(error))))));
30
27
  }));
31
28
  exports.fetchAiAccountantCustomersEpic = fetchAiAccountantCustomersEpic;
@@ -23,9 +23,7 @@ const fetchAiAccountantJobsEpic = (actions$, state$, zeniAPI) => actions$.pipe((
23
23
  }
24
24
  const base = `${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/cockpit-panels`;
25
25
  const url = `${base}/ai-accountant/jobs?${params.toString()}`;
26
- return zeniAPI
27
- .getJSON(url)
28
- .pipe((0, operators_1.mergeMap)((response) => {
26
+ return zeniAPI.getJSON(url).pipe((0, operators_1.mergeMap)((response) => {
29
27
  if ((0, responsePayload_1.isSuccessResponse)(response)) {
30
28
  const jobs = response.data?.jobs ?? [];
31
29
  const users = response.data?.users ?? [];
@@ -44,8 +42,7 @@ const fetchAiAccountantJobsEpic = (actions$, state$, zeniAPI) => actions$.pipe((
44
42
  }
45
43
  }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, aiAccountantViewReducer_1.updateAiAccountantJobsFailure)({
46
44
  tenantId,
47
- error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'AI Accountant jobs fetch failed: ' +
48
- JSON.stringify(error)),
45
+ error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'AI Accountant jobs fetch failed: ' + JSON.stringify(error)),
49
46
  }))));
50
47
  }));
51
48
  exports.fetchAiAccountantJobsEpic = fetchAiAccountantJobsEpic;
@@ -54,7 +54,10 @@ const triggerAiAccountantJobEpic = (actions$, state$, zeniAPI) => actions$.pipe(
54
54
  messageText: 'failed',
55
55
  type: 'error',
56
56
  variables: [
57
- { variableName: '__reason__', variableValue: 'Unexpected error' },
57
+ {
58
+ variableName: '__reason__',
59
+ variableValue: 'Unexpected error',
60
+ },
58
61
  ],
59
62
  }),
60
63
  ])));
@@ -299,7 +299,7 @@ const applyAdvancedFiltersOnCompaniesList = (allCompanies, filters, filteredComp
299
299
  const key = currentFilter.field;
300
300
  const categoryValue = getCategoryValueForCompany(key, company);
301
301
  if (categoryValue == null) {
302
- if (currentFilter.matchingOperator === 'not-equal') {
302
+ if (currentFilter.matchingOperator === 'not_equal') {
303
303
  return true;
304
304
  }
305
305
  return false;
@@ -1,3 +1,4 @@
1
+ import { FetchState } from '../../commonStateTypes/common';
1
2
  import { SelectorView } from '../../commonStateTypes/viewAndReport/viewAndReport';
2
3
  import { Company } from '../../entity/company/companyStateTypes';
3
4
  import { Tag } from '../../entity/tag/tagState';
@@ -5,7 +6,6 @@ import { Task } from '../../entity/task/taskState';
5
6
  import { User } from '../../entity/user/userState';
6
7
  import { RootState } from '../../reducer';
7
8
  import { CompanyTaskManagerViewUIState, TaskManagerMetrics } from './companyTaskManagerViewState';
8
- import { FetchState } from '../../commonStateTypes/common';
9
9
  export interface TaskWithCompanyDetail {
10
10
  assignees: User[];
11
11
  company: Company;
@@ -7,7 +7,7 @@ const tagSelector_1 = require("../../entity/tag/tagSelector");
7
7
  const taskSelector_1 = require("../../entity/task/taskSelector");
8
8
  const userSelector_1 = require("../../entity/user/userSelector");
9
9
  exports.getCompanyTaskManagerView = (0, toolkit_1.createSelector)((state) => state.companyTaskManagerViewState, (state) => state.companyState, (state) => state.userState, (state) => state.taskState, (state) => state.tagState, (companyTaskManagerViewState, companyState, userState, taskState, tagState) => {
10
- const { taskIds, uiState, fetchState, error, totalTaskCount, metrics, metricsFetchState } = companyTaskManagerViewState;
10
+ const { taskIds, uiState, fetchState, error, totalTaskCount, metrics, metricsFetchState, } = companyTaskManagerViewState;
11
11
  const tasksList = [];
12
12
  taskIds.forEach((taskId) => {
13
13
  const task = (0, taskSelector_1.getTaskById)(taskState, taskId);
@@ -51,7 +51,7 @@ const filterCompanyOnCategoriesWithSingleValue = (categoryValue, currentFilter,
51
51
  return filterCompanyOnRangeCategoryType(categoryValue, currentFilter);
52
52
  }
53
53
  // if filter category is not annualRecurringRevenue OR monthlyRecurringRevenue
54
- if (currentFilter.matchingOperator === 'not-equal') {
54
+ if (currentFilter.matchingOperator === 'not_equal') {
55
55
  return currentFilter.values.indexOf(categoryValue) === -1;
56
56
  }
57
57
  return currentFilter.values.indexOf(categoryValue) > -1;
@@ -159,7 +159,7 @@ const applyAdvancedFiltersOnCompaniesList = (allCompanies, filters, filteredComp
159
159
  const key = currentFilter.field;
160
160
  const categoryValue = getCategoryValueForCompany(key, company);
161
161
  if (categoryValue == null) {
162
- if (currentFilter.matchingOperator === 'not-equal') {
162
+ if (currentFilter.matchingOperator === 'not_equal') {
163
163
  return true;
164
164
  }
165
165
  return false;
@@ -122,7 +122,7 @@ const applyAdvancedFiltersOnCompaniesList = (allCompanies, filters, filteredComp
122
122
  const key = currentFilter.field;
123
123
  const categoryValue = getCategoryValueForCompany(key, company);
124
124
  if (categoryValue == null) {
125
- if (currentFilter.matchingOperator === 'not-equal') {
125
+ if (currentFilter.matchingOperator === 'not_equal') {
126
126
  return true;
127
127
  }
128
128
  return false;
@@ -19,7 +19,7 @@ export type SubscriptionViewFilterCategoryField = 'controllerUserIds' | 'statusC
19
19
  export type PortfolioViewFilterCategoryField = 'netBurnOrIncome' | 'cashPosition' | 'income' | 'expenses' | 'runway';
20
20
  export type HealthMonitorViewFilterCategoryField = 'verticalProductServices' | 'runway' | 'netPromoterScore' | 'customerSatisfactionScore' | 'churnProbabilityPercentage' | 'controller' | 'customerSuccessManager' | 'lastReportSent' | 'subscriptionStartDate' | 'subscriptionRenewalDate' | 'externalProductServiceExposure' | 'companyEngagementMetricsUpdatedAt' | 'companyGroupId' | 'monthlyRecurringRevenue';
21
21
  export interface CockpitFilterCategory {
22
- matchingOperator: 'equal' | 'not-equal';
22
+ matchingOperator: 'equal' | 'not_equal';
23
23
  values: FilterCategoryValueType[];
24
24
  valuesCombinationOperator: 'ANY' | 'ALL';
25
25
  field?: AiAccountantFilterCategoryField | ManagementViewFilterCategoryField | SubscriptionViewFilterCategoryField | PortfolioViewFilterCategoryField | HealthMonitorViewFilterCategoryField;
@@ -6,10 +6,10 @@ const operators_1 = require("rxjs/operators");
6
6
  const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
7
7
  const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
8
8
  const responsePayload_1 = require("../../../../responsePayload");
9
- const missingReceiptsPayload_1 = require("../../payload/missingReceiptsPayload");
10
- const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
11
9
  const bulkUploadTiming_1 = require("../../helpers/bulkUploadTiming");
12
10
  const rollingCalendarDateRangeInclusive_1 = require("../../helpers/rollingCalendarDateRangeInclusive");
11
+ const missingReceiptsPayload_1 = require("../../payload/missingReceiptsPayload");
12
+ const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
13
13
  const fetchBulkUploadBatchesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.fetchBulkUploadBatches.match), (0, operators_1.switchMap)((action) => {
14
14
  const { cacheOverride } = action.payload;
15
15
  const state = state$.value;
@@ -8,6 +8,7 @@ const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
8
8
  const transactionReducer_1 = require("../../../../entity/transaction/transactionReducer");
9
9
  const responsePayload_1 = require("../../../../responsePayload");
10
10
  const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
11
+ const completedSubTab_1 = require("../../types/completedSubTab");
11
12
  const fetchCompletedTransactionsEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.fetchCompletedTransactions.match), (0, operators_1.switchMap)((action) => {
12
13
  const state = state$.value;
13
14
  const { expenseAutomationViewState: { selectedPeriodByTenantId }, expenseAutomationMissingReceiptsViewState: { bulkUpload }, } = state;
@@ -42,7 +43,7 @@ const fetchCompletedTransactionsEpic = (actions$, state$, zeniAPI) => actions$.p
42
43
  if (sortOrder != null) {
43
44
  queryPayload.sort_order = sortOrder === 'ascending' ? 'asc' : 'desc';
44
45
  }
45
- if (completedSubTab !== 'all') {
46
+ if (completedSubTab !== completedSubTab_1.DEFAULT_COMPLETED_SUB_TAB) {
46
47
  queryPayload.match_type = completedSubTab;
47
48
  }
48
49
  const encodedQuery = encodeURIComponent(JSON.stringify(queryPayload));
@@ -35,10 +35,19 @@ function fetchBatchDetailsByIds(batchIds, zeniAPI) {
35
35
  }
36
36
  const fetchMultipleBatchDetailsEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.fetchBulkUploadBatchesSuccess.match), (0, operators_1.mergeMap)((action) => {
37
37
  const batchList = action.payload.batchList;
38
- const { batchDetailsById } = state$.value.expenseAutomationMissingReceiptsViewState.bulkUpload;
38
+ const bulkUpload = state$.value.expenseAutomationMissingReceiptsViewState.bulkUpload;
39
+ const { batchDetailsById, batchDetailsRevalidating } = bulkUpload;
39
40
  /** Only completed list rows may trigger batch-details API; preserve platform order. */
40
- const completedBatchesMissingDetails = (0, missingReceiptsPayload_1.filterBatchListItemsForBatchDetailsFetch)(batchList).filter((batch) => batchDetailsById[batch.batchId] == null);
41
- const completedBatchIds = completedBatchesMissingDetails.map((batch) => batch.batchId);
41
+ const completedRows = (0, missingReceiptsPayload_1.filterBatchListItemsForBatchDetailsFetch)(batchList);
42
+ /**
43
+ * Stale-while-revalidate: when a manual refresh has set `batchDetailsRevalidating`, refresh
44
+ * every completed list row (replacing entries via `storeBatchDetails` as they arrive). On a
45
+ * normal first fetch we still only request rows whose details are missing.
46
+ */
47
+ const candidateRows = batchDetailsRevalidating === true
48
+ ? completedRows
49
+ : completedRows.filter((batch) => batchDetailsById[batch.batchId] == null);
50
+ const completedBatchIds = candidateRows.map((batch) => batch.batchId);
42
51
  const batchIdsToFetch = completedBatchIds.slice(0, INITIAL_BATCH_PAGE_SIZE);
43
52
  if (batchIdsToFetch.length === 0) {
44
53
  /**
@@ -46,7 +55,6 @@ const fetchMultipleBatchDetailsEpic = (actions$, state$, zeniAPI) => actions$.pi
46
55
  * `currentBatchId` may not appear in the filtered list but still needs `GET /batches/:id`.
47
56
  * Fall back to the single-batch-details epic so `phase` and details can resolve.
48
57
  */
49
- const bulkUpload = state$.value.expenseAutomationMissingReceiptsViewState.bulkUpload;
50
58
  const currentId = bulkUpload.currentBatchId;
51
59
  if (currentId != null &&
52
60
  bulkUpload.phase === 'matching' &&
@@ -54,7 +62,15 @@ const fetchMultipleBatchDetailsEpic = (actions$, state$, zeniAPI) => actions$.pi
54
62
  (0, missingReceiptsPayload_1.shouldFetchBatchDetailsForBatchId)(bulkUpload.batchStatusById, bulkUpload.batchListByPeriod, currentId)) {
55
63
  return (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.fetchBulkUploadBatchDetails)());
56
64
  }
57
- return rxjs_1.EMPTY;
65
+ /**
66
+ * Close the pagination loop so the Unmatched-tab loading heuristic can settle.
67
+ * `fetchMoreBatchDetailsComplete` also clears `batchDetailsRevalidating` and flips
68
+ * `initialBatchDetailsLoaded` to true. Without this, `batchDetailsPaginationState` stays
69
+ * at `Not-Started` forever after a list refresh that finds zero completed rows (or all
70
+ * already cached) — the direct-open-Unmatched-without-upload path used to render an
71
+ * infinite skeleton.
72
+ */
73
+ return (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.fetchMoreBatchDetailsComplete)());
58
74
  }
59
75
  return (0, rxjs_1.concat)((0, rxjs_1.of)((0, missingReceiptsViewReducer_1.setInitialBatchDetailsLoading)()), fetchBatchDetailsByIds(batchIdsToFetch, zeniAPI), (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.fetchMoreBatchDetailsComplete)()));
60
76
  }));
@@ -0,0 +1,18 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { updateTransactions } from '../../../../entity/transaction/transactionReducer';
4
+ import { RootState } from '../../../../reducer';
5
+ import { ZeniAPI } from '../../../../zeniAPI';
6
+ import { batchDetailFetchFailed, markBatchDetailRefreshAttempted, refreshBatchDetailsForBatchId, storeBatchDetails } from '../../reducers/missingReceiptsViewReducer';
7
+ export type ActionType = ReturnType<typeof refreshBatchDetailsForBatchId> | ReturnType<typeof markBatchDetailRefreshAttempted> | ReturnType<typeof updateTransactions> | ReturnType<typeof storeBatchDetails> | ReturnType<typeof batchDetailFetchFailed>;
8
+ /**
9
+ * Single-batch stale-while-revalidate refresh. Triggered by `pusherBatchStatusCompletionEpic`
10
+ * (and any other path that wants to update one batch without wiping the cache). The response is
11
+ * stored via `storeBatchDetails`, which replaces the entry by `batchId` so the row updates in
12
+ * place — no skeleton, no list reflow.
13
+ *
14
+ * Throttle: `lastBatchDetailRefreshAtById[batchId]` is checked against `TARGETED_REFRESH_DEDUPE_MS`
15
+ * before issuing the call. The marker is emitted first so concurrent dispatches (e.g. Pusher
16
+ * resend during an in-flight request) see the dedupe timestamp and collapse to a single call.
17
+ */
18
+ export declare const refreshBatchDetailsForBatchIdEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.refreshBatchDetailsForBatchIdEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const transactionReducer_1 = require("../../../../entity/transaction/transactionReducer");
7
+ const responsePayload_1 = require("../../../../responsePayload");
8
+ const missingReceiptsPayload_1 = require("../../payload/missingReceiptsPayload");
9
+ const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
10
+ /**
11
+ * Pusher resends the same `completed` event in some cases (reconnect, server retry). Skip a
12
+ * targeted refresh if we issued one for the same batch within this window — the cached details
13
+ * are already fresh, so another `GET /1.0/batches/:id` is wasteful and visually flickers nothing.
14
+ */
15
+ const TARGETED_REFRESH_DEDUPE_MS = 5000;
16
+ /**
17
+ * Single-batch stale-while-revalidate refresh. Triggered by `pusherBatchStatusCompletionEpic`
18
+ * (and any other path that wants to update one batch without wiping the cache). The response is
19
+ * stored via `storeBatchDetails`, which replaces the entry by `batchId` so the row updates in
20
+ * place — no skeleton, no list reflow.
21
+ *
22
+ * Throttle: `lastBatchDetailRefreshAtById[batchId]` is checked against `TARGETED_REFRESH_DEDUPE_MS`
23
+ * before issuing the call. The marker is emitted first so concurrent dispatches (e.g. Pusher
24
+ * resend during an in-flight request) see the dedupe timestamp and collapse to a single call.
25
+ */
26
+ const refreshBatchDetailsForBatchIdEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.refreshBatchDetailsForBatchId.match), (0, operators_1.mergeMap)((action) => {
27
+ const { batchId } = action.payload;
28
+ const now = Date.now();
29
+ const lastAttempt = state$.value.expenseAutomationMissingReceiptsViewState.bulkUpload
30
+ .lastBatchDetailRefreshAtById[batchId];
31
+ if (lastAttempt != null &&
32
+ now - lastAttempt < TARGETED_REFRESH_DEDUPE_MS) {
33
+ return rxjs_1.EMPTY;
34
+ }
35
+ const apiCall = zeniAPI
36
+ .getJSON(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/batches/${batchId}`)
37
+ .pipe((0, operators_1.mergeMap)((response) => {
38
+ if (!(0, responsePayload_1.isSuccessResponse)(response) ||
39
+ response.data == null ||
40
+ !(0, missingReceiptsPayload_1.isBatchDetailsApiStatusCompleted)(response.data.status)) {
41
+ return rxjs_1.EMPTY;
42
+ }
43
+ const actions = [];
44
+ const transactionPayloads = (0, missingReceiptsPayload_1.extractTransactionPayloadsFromBatchFiles)(response.data.files);
45
+ if (transactionPayloads.length > 0) {
46
+ actions.push((0, transactionReducer_1.updateTransactions)(transactionPayloads, (value) => value.transaction_id));
47
+ }
48
+ actions.push((0, missingReceiptsViewReducer_1.storeBatchDetails)((0, missingReceiptsPayload_1.toBatchDetails)(response.data, zeniAPI.apiEndPoints.fileMicroServiceBaseUrl)));
49
+ return (0, rxjs_1.from)(actions);
50
+ }), (0, operators_1.catchError)((error) => {
51
+ console.error(`Failed to refresh batch details for ${batchId}:`, (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Refresh batch details errored out: ' + JSON.stringify(error)));
52
+ return (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.batchDetailFetchFailed)({ batchId }));
53
+ }));
54
+ return (0, rxjs_1.concat)((0, rxjs_1.of)((0, missingReceiptsViewReducer_1.markBatchDetailRefreshAttempted)({ batchId, timestamp: now })), apiCall);
55
+ }));
56
+ exports.refreshBatchDetailsForBatchIdEpic = refreshBatchDetailsForBatchIdEpic;
@@ -3,13 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.restoreBulkUploadAutomatchingOnMountEpic = void 0;
4
4
  const rxjs_1 = require("rxjs");
5
5
  const operators_1 = require("rxjs/operators");
6
+ const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
7
+ const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
6
8
  const responsePayload_1 = require("../../../../responsePayload");
7
- const missingReceiptsPayload_1 = require("../../payload/missingReceiptsPayload");
8
- const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
9
9
  const bulkUploadTiming_1 = require("../../helpers/bulkUploadTiming");
10
10
  const rollingCalendarDateRangeInclusive_1 = require("../../helpers/rollingCalendarDateRangeInclusive");
11
- const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
12
- const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
11
+ const missingReceiptsPayload_1 = require("../../payload/missingReceiptsPayload");
12
+ const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
13
13
  /**
14
14
  * On missing-receipts entry / period switch, hydrate the automatching banner for the logged-in
15
15
  * user without relying on UI-driven list fetches (the Missing tab does not fetch the batch list
@@ -52,10 +52,12 @@ const restoreBulkUploadAutomatchingOnMountEpic = (actions$, state$, zeniAPI) =>
52
52
  bulkUpload.batchListFetchState.fetchState === 'Completed';
53
53
  const listSource = alreadyCached
54
54
  ? (0, rxjs_1.of)(null)
55
- : zeniAPI.getJSON(listUrl).pipe((0, operators_1.catchError)(() => (0, rxjs_1.of)(null)));
55
+ : zeniAPI
56
+ .getJSON(listUrl)
57
+ .pipe((0, operators_1.catchError)(() => (0, rxjs_1.of)(null)));
56
58
  return listSource.pipe((0, operators_1.mergeMap)((listResponse) => {
57
59
  const batchList = alreadyCached
58
- ? bulkUpload.batchListByPeriod[periodId] ?? []
60
+ ? (bulkUpload.batchListByPeriod[periodId] ?? [])
59
61
  : listResponse != null &&
60
62
  (0, responsePayload_1.isSuccessResponse)(listResponse) &&
61
63
  listResponse.data != null
@@ -5,10 +5,11 @@ const rxjs_1 = require("rxjs");
5
5
  const operators_1 = require("rxjs/operators");
6
6
  const transactionReducer_1 = require("../../../../entity/transaction/transactionReducer");
7
7
  const responsePayload_1 = require("../../../../responsePayload");
8
+ const rollingCalendarDateRangeInclusive_1 = require("../../helpers/rollingCalendarDateRangeInclusive");
8
9
  const missingReceiptsPayload_1 = require("../../payload/missingReceiptsPayload");
9
10
  const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
11
+ const completedSubTab_1 = require("../../types/completedSubTab");
10
12
  const transactionsViewState_1 = require("../../types/transactionsViewState");
11
- const rollingCalendarDateRangeInclusive_1 = require("../../helpers/rollingCalendarDateRangeInclusive");
12
13
  /**
13
14
  * `auto_categorized` for manual transaction search (Unmatched).
14
15
  * Backend contract TBD — align with `fetchTransactionCategorizationEpic` (`selectedTab === 'autoCategorized'`)
@@ -49,6 +50,11 @@ const searchTransactionsForManualMatchEpic = (actions$, state$, zeniAPI) => {
49
50
  page_token: pageToken ?? null,
50
51
  page_size: manualSearch.pageSize,
51
52
  search_text: query,
53
+ // Manual search ignores the Completed sub-tab axis — always span the
54
+ // default sentinel so the receipt-matching UX returns results
55
+ // regardless of where the transaction would otherwise be bucketed on
56
+ // the Completed tab.
57
+ sub_tab: completedSubTab_1.DEFAULT_COMPLETED_SUB_TAB,
52
58
  };
53
59
  return zeniAPI
54
60
  .getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/expense-automation/transactions?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
@@ -0,0 +1,28 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { RootState } from '../../../../reducer';
4
+ import { bulkUploadReceiptsSuccess, clearBulkUpload, fetchBulkUploadBatchDetailsSuccess, fetchCompletedTransactions, fetchMissingReceipts, restoreBulkUploadMatchingState, storeBatchDetails } from '../../reducers/missingReceiptsViewReducer';
5
+ export type ActionType = ReturnType<typeof bulkUploadReceiptsSuccess> | ReturnType<typeof restoreBulkUploadMatchingState> | ReturnType<typeof fetchBulkUploadBatchDetailsSuccess> | ReturnType<typeof storeBatchDetails> | ReturnType<typeof clearBulkUpload> | ReturnType<typeof fetchMissingReceipts> | ReturnType<typeof fetchCompletedTransactions>;
6
+ /**
7
+ * After automatch completes for the active bulk-upload batch, refresh the two
8
+ * caches that are not invalidated by the existing batch-details refresh path:
9
+ * - Missing Receipts list (`transactionIdsBySelectedPeriod`)
10
+ * - Completed transactions cache (`bulkUpload.completedTransactionsByPeriod`)
11
+ *
12
+ * The Unmatched tab is already kept fresh via `pusherBatchStatusCompletionEpic`
13
+ * dispatching `fetchBulkUploadBatches({invalidateBatchDetailsCache: true})`,
14
+ * which feeds `fetchMultipleBatchDetailsEpic` and re-stores batch details.
15
+ *
16
+ * Lifecycle mirrors `bulkUploadMatchResultToastEpic`: trigger on
17
+ * `bulkUploadReceiptsSuccess` (fresh upload) or `restoreBulkUploadMatchingState`
18
+ * (restored session), then wait for the first batch-details action for that
19
+ * batchId — landing as either `fetchBulkUploadBatchDetailsSuccess` or
20
+ * `storeBatchDetails`. `clearBulkUpload` cancels the in-flight wait.
21
+ *
22
+ * Refetches use `cacheOverride: true` to bypass per-tab cache guards, and
23
+ * `fetchMissingReceipts` uses `refreshViewInBackground: true` to keep the
24
+ * existing rows visible while fresh data is in flight (the authoritative
25
+ * server filter `is_attachment_missing_only=true` removes matched rows once
26
+ * the response lands).
27
+ */
28
+ export declare const syncTabsAfterAutomatchEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.syncTabsAfterAutomatchEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
7
+ const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
8
+ const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
9
+ /**
10
+ * After automatch completes for the active bulk-upload batch, refresh the two
11
+ * caches that are not invalidated by the existing batch-details refresh path:
12
+ * - Missing Receipts list (`transactionIdsBySelectedPeriod`)
13
+ * - Completed transactions cache (`bulkUpload.completedTransactionsByPeriod`)
14
+ *
15
+ * The Unmatched tab is already kept fresh via `pusherBatchStatusCompletionEpic`
16
+ * dispatching `fetchBulkUploadBatches({invalidateBatchDetailsCache: true})`,
17
+ * which feeds `fetchMultipleBatchDetailsEpic` and re-stores batch details.
18
+ *
19
+ * Lifecycle mirrors `bulkUploadMatchResultToastEpic`: trigger on
20
+ * `bulkUploadReceiptsSuccess` (fresh upload) or `restoreBulkUploadMatchingState`
21
+ * (restored session), then wait for the first batch-details action for that
22
+ * batchId — landing as either `fetchBulkUploadBatchDetailsSuccess` or
23
+ * `storeBatchDetails`. `clearBulkUpload` cancels the in-flight wait.
24
+ *
25
+ * Refetches use `cacheOverride: true` to bypass per-tab cache guards, and
26
+ * `fetchMissingReceipts` uses `refreshViewInBackground: true` to keep the
27
+ * existing rows visible while fresh data is in flight (the authoritative
28
+ * server filter `is_attachment_missing_only=true` removes matched rows once
29
+ * the response lands).
30
+ */
31
+ const syncTabsAfterAutomatchEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)((action) => missingReceiptsViewReducer_1.bulkUploadReceiptsSuccess.match(action) ||
32
+ missingReceiptsViewReducer_1.restoreBulkUploadMatchingState.match(action)), (0, operators_1.switchMap)((uploadAction) => {
33
+ const { batchId } = uploadAction.payload;
34
+ return (0, rxjs_1.merge)(actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.fetchBulkUploadBatchDetailsSuccess.match)), actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.storeBatchDetails.match))).pipe((0, operators_1.filter)((a) => a.payload.batchId === batchId), (0, operators_1.take)(1), (0, operators_1.switchMap)((action) => {
35
+ const { summary } = action.payload;
36
+ if (summary.matched <= 0) {
37
+ return rxjs_1.EMPTY;
38
+ }
39
+ const state = state$.value;
40
+ const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
41
+ if (currentTenant == null) {
42
+ return rxjs_1.EMPTY;
43
+ }
44
+ const selectedPeriod = state.expenseAutomationViewState.selectedPeriodByTenantId[currentTenant.tenantId];
45
+ if (selectedPeriod == null) {
46
+ return (0, rxjs_1.from)([(0, missingReceiptsViewReducer_1.fetchCompletedTransactions)(undefined, true)]);
47
+ }
48
+ const period = (0, timePeriod_1.convertToPeriod)(selectedPeriod);
49
+ const timePeriodStart = (0, timePeriod_1.toAbsoluteDay)(period.start);
50
+ const timePeriodEnd = (0, timePeriod_1.toAbsoluteDay)(period.end);
51
+ if (timePeriodStart == null || timePeriodEnd == null) {
52
+ return (0, rxjs_1.from)([(0, missingReceiptsViewReducer_1.fetchCompletedTransactions)(undefined, true)]);
53
+ }
54
+ return (0, rxjs_1.from)([
55
+ (0, missingReceiptsViewReducer_1.fetchMissingReceipts)({ start: timePeriodStart, end: timePeriodEnd }, { amount: 75.0, currencyCode: 'USD', currencySymbol: '$' }, true, true),
56
+ (0, missingReceiptsViewReducer_1.fetchCompletedTransactions)(undefined, true),
57
+ ]);
58
+ }), (0, operators_1.takeUntil)(actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.clearBulkUpload.match))));
59
+ }));
60
+ exports.syncTabsAfterAutomatchEpic = syncTabsAfterAutomatchEpic;