@zeniai/client-epic-state 5.1.0-betaSS2 → 5.1.0

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 (450) hide show
  1. package/lib/common/aiCfo/aiCfoSuggestedQuestionsPageContext.d.ts +1 -1
  2. package/lib/commonStateTypes/amount.d.ts +1 -0
  3. package/lib/commonStateTypes/amount.js +9 -1
  4. package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
  5. package/lib/commonStateTypes/viewAndReport/viewAndReport.js +2 -0
  6. package/lib/commonStateTypes/workingDayHelper.d.ts +9 -0
  7. package/lib/commonStateTypes/workingDayHelper.js +28 -1
  8. package/lib/entity/account/accountSelector.d.ts +9 -0
  9. package/lib/entity/account/accountSelector.js +14 -1
  10. package/lib/entity/account/accountState.d.ts +1 -1
  11. package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
  12. package/lib/entity/aiCfo/aiCfoPayload.d.ts +64 -5
  13. package/lib/entity/aiCfo/aiCfoReducer.d.ts +23 -2
  14. package/lib/entity/aiCfo/aiCfoReducer.js +252 -10
  15. package/lib/entity/aiCfo/aiCfoSelector.d.ts +4 -1
  16. package/lib/entity/aiCfo/aiCfoSelector.js +19 -1
  17. package/lib/entity/aiCfo/aiCfoState.d.ts +98 -4
  18. package/lib/entity/aiCfo/aiCfoState.js +20 -1
  19. package/lib/entity/approvalRule/approvalRuleConflict.d.ts +56 -0
  20. package/lib/entity/approvalRule/approvalRuleConflict.js +77 -0
  21. package/lib/entity/approvalRule/approvalRulePayload.d.ts +34 -5
  22. package/lib/entity/approvalRule/approvalRulePayload.js +145 -10
  23. package/lib/entity/approvalRule/approvalRuleSelector.d.ts +25 -1
  24. package/lib/entity/approvalRule/approvalRuleSelector.js +40 -0
  25. package/lib/entity/approvalRule/approvalRuleState.d.ts +59 -7
  26. package/lib/entity/cardPolicy/cardPolicyPayload.d.ts +277 -0
  27. package/lib/entity/cardPolicy/cardPolicyPayload.js +143 -0
  28. package/lib/entity/cardPolicy/cardPolicyReducer.d.ts +19 -0
  29. package/lib/entity/cardPolicy/cardPolicyReducer.js +175 -0
  30. package/lib/entity/cardPolicy/cardPolicySelector.d.ts +32 -0
  31. package/lib/entity/cardPolicy/cardPolicySelector.js +99 -0
  32. package/lib/entity/cardPolicy/cardPolicyState.d.ts +205 -0
  33. package/lib/entity/cardPolicy/cardPolicyState.js +14 -0
  34. package/lib/entity/cardPolicy/extractPolicyDocumentEpic.d.ts +18 -0
  35. package/lib/entity/cardPolicy/extractPolicyDocumentEpic.js +68 -0
  36. package/lib/entity/cardPolicy/fetchCardPolicyVendorOptionsEpic.d.ts +26 -0
  37. package/lib/entity/cardPolicy/fetchCardPolicyVendorOptionsEpic.js +47 -0
  38. package/lib/entity/cardPolicy/policyDocumentExtractionToRecommendationBridgeEpic.d.ts +25 -0
  39. package/lib/entity/cardPolicy/policyDocumentExtractionToRecommendationBridgeEpic.js +39 -0
  40. package/lib/entity/cardPolicy/policyRecommendationFromUploadEpic.d.ts +24 -0
  41. package/lib/entity/cardPolicy/policyRecommendationFromUploadEpic.js +105 -0
  42. package/lib/entity/class/classReducer.d.ts +4 -4
  43. package/lib/entity/class/classState.d.ts +1 -1
  44. package/lib/entity/forecast/forecastState.d.ts +1 -1
  45. package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +1 -0
  46. package/lib/entity/jeSchedules/jeSchedulesPayload.js +7 -0
  47. package/lib/entity/jeSchedules/jeSchedulesState.d.ts +2 -0
  48. package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +1 -1
  49. package/lib/entity/monthEndCloseChecks/monthEndCloseChecksState.d.ts +1 -1
  50. package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
  51. package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
  52. package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
  53. package/lib/entity/sectionProjectView/sectionProjectView.d.ts +1 -1
  54. package/lib/entity/sectionProjectView/sectionProjectViewReducer.d.ts +2 -2
  55. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  56. package/lib/entity/snackbar/snackbarTypes.js +7 -0
  57. package/lib/entity/task/taskPayload.d.ts +3 -1
  58. package/lib/entity/task/taskPayload.js +2 -0
  59. package/lib/entity/task/taskState.d.ts +2 -0
  60. package/lib/entity/tenant/clearAllEpic.d.ts +9 -2
  61. package/lib/entity/tenant/clearAllEpic.js +14 -0
  62. package/lib/entity/tenant/tenantPayload.d.ts +21 -0
  63. package/lib/entity/tenant/tenantReducer.d.ts +14 -5
  64. package/lib/entity/tenant/tenantReducer.js +132 -8
  65. package/lib/entity/tenant/tenantState.d.ts +24 -1
  66. package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +4 -0
  67. package/lib/entity/transaction/payloadTypes/transactionPayload.js +18 -10
  68. package/lib/entity/transaction/stateTypes/transaction.d.ts +3 -0
  69. package/lib/entity/transaction/stateTypes/transactionLine.d.ts +2 -1
  70. package/lib/entity/transaction/stateTypes/transactionLine.js +2 -1
  71. package/lib/epic.d.ts +31 -2
  72. package/lib/epic.js +31 -2
  73. package/lib/esm/commonStateTypes/amount.js +7 -0
  74. package/lib/esm/commonStateTypes/viewAndReport/viewAndReport.js +2 -0
  75. package/lib/esm/commonStateTypes/workingDayHelper.js +26 -0
  76. package/lib/esm/entity/account/accountSelector.js +11 -0
  77. package/lib/esm/entity/aiCfo/aiCfoReducer.js +252 -10
  78. package/lib/esm/entity/aiCfo/aiCfoSelector.js +17 -1
  79. package/lib/esm/entity/aiCfo/aiCfoState.js +17 -0
  80. package/lib/esm/entity/approvalRule/approvalRuleConflict.js +74 -0
  81. package/lib/esm/entity/approvalRule/approvalRulePayload.js +145 -10
  82. package/lib/esm/entity/approvalRule/approvalRuleSelector.js +35 -0
  83. package/lib/esm/entity/cardPolicy/cardPolicyPayload.js +130 -0
  84. package/lib/esm/entity/cardPolicy/cardPolicyReducer.js +171 -0
  85. package/lib/esm/entity/cardPolicy/cardPolicySelector.js +75 -0
  86. package/lib/esm/entity/cardPolicy/cardPolicyState.js +9 -0
  87. package/lib/esm/entity/cardPolicy/extractPolicyDocumentEpic.js +64 -0
  88. package/lib/esm/entity/cardPolicy/fetchCardPolicyVendorOptionsEpic.js +43 -0
  89. package/lib/esm/entity/cardPolicy/policyDocumentExtractionToRecommendationBridgeEpic.js +35 -0
  90. package/lib/esm/entity/cardPolicy/policyRecommendationFromUploadEpic.js +101 -0
  91. package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +7 -0
  92. package/lib/esm/entity/snackbar/snackbarTypes.js +7 -0
  93. package/lib/esm/entity/task/taskPayload.js +2 -0
  94. package/lib/esm/entity/tenant/clearAllEpic.js +14 -0
  95. package/lib/esm/entity/tenant/tenantReducer.js +130 -7
  96. package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +18 -10
  97. package/lib/esm/entity/transaction/stateTypes/transactionLine.js +1 -0
  98. package/lib/esm/epic.js +31 -2
  99. package/lib/esm/index.js +68 -28
  100. package/lib/esm/reducer.js +21 -0
  101. package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +6 -3
  102. package/lib/esm/view/aiCfoView/epics/createSessionAndSubmitEpic.js +5 -2
  103. package/lib/esm/view/aiCfoView/epics/createSessionEpic.js +2 -1
  104. package/lib/esm/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +12 -2
  105. package/lib/esm/view/companyTaskManagerView/companyTaskManagerViewReducer.js +39 -11
  106. package/lib/esm/view/companyTaskManagerView/companyTaskManagerViewSelector.js +14 -4
  107. package/lib/esm/view/companyTaskManagerView/epics/fetchCockpitContextEpic.js +38 -0
  108. package/lib/esm/view/companyTaskManagerView/epics/fetchCompanyTaskManagerViewEpic.js +37 -28
  109. package/lib/esm/view/companyTaskManagerView/epics/updateCompanyTaskManagerViewFiltersEpic.js +16 -0
  110. package/lib/esm/view/companyView/companyViewReducer.js +46 -1
  111. package/lib/esm/view/companyView/epic/companyPassport/dismissCapitalizationOnboardingEpic.js +25 -0
  112. package/lib/esm/view/companyView/epic/companyPassport/updateCapitalizationAccountThresholdEpic.js +98 -0
  113. package/lib/esm/view/companyView/epic/fetchAllCockpitViewsEpic.js +2 -2
  114. package/lib/esm/view/companyView/types/companyPassport/companyPassportViewState.js +4 -0
  115. package/lib/esm/view/createTransferEntry/createTransferEntryReducer.js +82 -0
  116. package/lib/esm/view/createTransferEntry/createTransferEntrySelector.js +64 -0
  117. package/lib/esm/view/createTransferEntry/createTransferEntryState.js +17 -0
  118. package/lib/esm/view/createTransferEntry/epics/createTransferEntryEpic.js +136 -0
  119. package/lib/esm/view/createTransferEntry/epics/fetchTransferAccountsEpic.js +36 -0
  120. package/lib/esm/view/dashboard/dashboardReducer.js +11 -1
  121. package/lib/esm/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +3 -3
  122. package/lib/esm/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +3 -4
  123. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +13 -9
  124. package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/backgroundRefetchReviewTabEpic.js +3 -16
  125. package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +9 -16
  126. package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.js +2 -2
  127. package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/markTransactionAsNotMiscategorizedEpic.js +2 -13
  128. package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/saveTransactionCategorizationEpic.js +2 -6
  129. package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/triggerReviewTabRefetchEpic.js +2 -2
  130. package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/updateTransactionCategorizationEpic.js +2 -6
  131. package/lib/esm/view/expenseAutomationView/expenseAutomationViewReducer.js +3 -20
  132. package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +20 -44
  133. package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +13 -6
  134. package/lib/esm/view/expenseAutomationView/transactionFilterHelpers.js +106 -18
  135. package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesSelector.js +22 -2
  136. package/lib/esm/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +14 -0
  137. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewReducer.js +109 -12
  138. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/deleteBillPayApprovalRuleEpic.js +10 -2
  139. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPaySetupApproverViewEpic.js +8 -4
  140. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/initializeBillPaySetupApproverViewUpdateDataEpic.js +11 -7
  141. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/reorderBillPayApprovalRulesEpic.js +54 -0
  142. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/saveBillPaySetupApproverViewUpdatesEpic.js +13 -4
  143. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js +140 -16
  144. package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +60 -4
  145. package/lib/esm/view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic.js +8 -2
  146. package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowPayload.js +29 -0
  147. package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowReducer.js +78 -0
  148. package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowSelector.js +47 -0
  149. package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowState.js +47 -0
  150. package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/epics/fetchCashManagementSettingsEpic.js +34 -0
  151. package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/epics/saveAutoSweepSettingsEpic.js +32 -0
  152. package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewPayload.js +54 -0
  153. package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewReducer.js +92 -0
  154. package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector.js +225 -0
  155. package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewState.js +10 -0
  156. package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementBannerEpic.js +23 -0
  157. package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementOverviewPageEpic.js +36 -0
  158. package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementRecommendationEpic.js +27 -0
  159. package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchRecentTransferEpic.js +28 -0
  160. package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailReducer.js +52 -0
  161. package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailSelector.js +22 -0
  162. package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailState.js +1 -0
  163. package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/fetchCardPolicyDetailEpic.js +36 -0
  164. package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/updateCardPolicyEpic.js +39 -0
  165. package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/archiveCardPolicyEpic.js +34 -0
  166. package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer.js +71 -0
  167. package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListSelector.js +21 -0
  168. package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListState.js +1 -0
  169. package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/fetchCardPolicyListEpic.js +38 -0
  170. package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyAiCardPolicyFormDraftUpdate.js +289 -0
  171. package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToAiCardPolicyDraft.js +109 -0
  172. package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToDraftEpic.js +44 -0
  173. package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToManualCardPolicyDraft.js +111 -0
  174. package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyUploadPlanToAiCardPolicyDraft.js +25 -0
  175. package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/buildAiCardPolicyFormDraftSeed.js +363 -0
  176. package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/buildManualCardPolicyFormDraftSeed.js +36 -0
  177. package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyChipIds.js +19 -0
  178. package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyFormDraftTypes.js +6 -0
  179. package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyRequestParts.js +119 -0
  180. package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyReducer.js +154 -0
  181. package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicySelector.js +22 -0
  182. package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyState.js +1 -0
  183. package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyTemplateEpic.js +49 -0
  184. package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/deriveAiPolicyReviewRowsFromInputs.js +140 -0
  185. package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/fetchCardPolicyMccCategoriesEpic.js +20 -0
  186. package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/seedAiCardPolicyFormDraftEpic.js +100 -0
  187. package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toBulkCardPolicyTemplateRequestsFromDraft.js +96 -0
  188. package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toCardPolicyTemplateRequestFromDraft.js +59 -0
  189. package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toManualCardPolicyTemplateRequestFromDraft.js +24 -0
  190. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +25 -0
  191. package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/aiCardCreationFormDraftTypes.js +1 -0
  192. package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/applyAiCardCreationFormDraftUpdate.js +34 -0
  193. package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/buildAiCardCreationFormDraftSeed.js +57 -0
  194. package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/deriveAiCardRowsFromTeams.js +35 -0
  195. package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardEpic.js +2 -2
  196. package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.js +42 -4
  197. package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.js +35 -0
  198. package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/seedAiCardCreationFormDraftEpic.js +62 -0
  199. package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/toIssueChargeCardLocalDataFromDraft.js +44 -0
  200. package/lib/esm/view/spendManagement/reimbursement/editRemiView/epics/fetchEditRemiDetailPageEpic.js +5 -1
  201. package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/deleteRemiApprovalRuleEpic.js +10 -2
  202. package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/fetchRemiSetupApproverViewEpic.js +8 -2
  203. package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/initializeRemiSetupApproverViewUpdateDataEpic.js +11 -7
  204. package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/reorderRemiApprovalRulesEpic.js +61 -0
  205. package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/saveRemiSetupApproverViewUpdatesEpic.js +13 -4
  206. package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewReducer.js +80 -11
  207. package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.js +18 -0
  208. package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.js +18 -0
  209. package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.js +1 -1
  210. package/lib/esm/view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer.js +45 -1
  211. package/lib/esm/view/transactionDetail/journalEntryLinesViewModel.js +149 -0
  212. package/lib/esm/view/transactionDetail/transactionDetailSelector.js +6 -1
  213. package/lib/index.d.ts +84 -34
  214. package/lib/index.js +261 -37
  215. package/lib/reducer.d.ts +21 -0
  216. package/lib/reducer.js +21 -0
  217. package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +11 -2
  218. package/lib/view/aiCfoView/aiCfoViewReducer.js +6 -3
  219. package/lib/view/aiCfoView/epics/createSessionAndSubmitEpic.js +5 -2
  220. package/lib/view/aiCfoView/epics/createSessionEpic.js +2 -1
  221. package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.d.ts +8 -1
  222. package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +12 -2
  223. package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
  224. package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
  225. package/lib/view/cardBalance/cardBalanceSelector.d.ts +1 -1
  226. package/lib/view/cashBalance/cashBalanceSelector.d.ts +1 -1
  227. package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
  228. package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
  229. package/lib/view/companyTaskManagerView/companyTaskManagerViewPayload.d.ts +19 -11
  230. package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.d.ts +11 -5
  231. package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.js +40 -12
  232. package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.d.ts +2 -0
  233. package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.js +13 -3
  234. package/lib/view/companyTaskManagerView/companyTaskManagerViewState.d.ts +11 -3
  235. package/lib/view/companyTaskManagerView/epics/fetchCockpitContextEpic.d.ts +10 -0
  236. package/lib/view/companyTaskManagerView/epics/fetchCockpitContextEpic.js +42 -0
  237. package/lib/view/companyTaskManagerView/epics/fetchCompanyTaskManagerViewEpic.d.ts +1 -3
  238. package/lib/view/companyTaskManagerView/epics/fetchCompanyTaskManagerViewEpic.js +37 -28
  239. package/lib/view/companyTaskManagerView/epics/updateCompanyTaskManagerViewFiltersEpic.d.ts +6 -0
  240. package/lib/view/companyTaskManagerView/epics/updateCompanyTaskManagerViewFiltersEpic.js +20 -0
  241. package/lib/view/companyView/companyViewReducer.d.ts +12 -1
  242. package/lib/view/companyView/companyViewReducer.js +48 -3
  243. package/lib/view/companyView/epic/companyPassport/dismissCapitalizationOnboardingEpic.d.ts +9 -0
  244. package/lib/view/companyView/epic/companyPassport/dismissCapitalizationOnboardingEpic.js +29 -0
  245. package/lib/view/companyView/epic/companyPassport/updateCapitalizationAccountThresholdEpic.d.ts +10 -0
  246. package/lib/view/companyView/epic/companyPassport/updateCapitalizationAccountThresholdEpic.js +102 -0
  247. package/lib/view/companyView/epic/fetchAllCockpitViewsEpic.js +2 -2
  248. package/lib/view/companyView/types/cockpitTypes.d.ts +3 -2
  249. package/lib/view/companyView/types/companyPassport/companyPassportViewState.d.ts +1 -0
  250. package/lib/view/companyView/types/companyPassport/companyPassportViewState.js +4 -0
  251. package/lib/view/createTransferEntry/createTransferEntryReducer.d.ts +32 -0
  252. package/lib/view/createTransferEntry/createTransferEntryReducer.js +86 -0
  253. package/lib/view/createTransferEntry/createTransferEntrySelector.d.ts +39 -0
  254. package/lib/view/createTransferEntry/createTransferEntrySelector.js +69 -0
  255. package/lib/view/createTransferEntry/createTransferEntryState.d.ts +30 -0
  256. package/lib/view/createTransferEntry/createTransferEntryState.js +20 -0
  257. package/lib/view/createTransferEntry/epics/createTransferEntryEpic.d.ts +11 -0
  258. package/lib/view/createTransferEntry/epics/createTransferEntryEpic.js +140 -0
  259. package/lib/view/createTransferEntry/epics/fetchTransferAccountsEpic.d.ts +14 -0
  260. package/lib/view/createTransferEntry/epics/fetchTransferAccountsEpic.js +40 -0
  261. package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
  262. package/lib/view/dashboard/dashboardReducer.js +11 -1
  263. package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +3 -3
  264. package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +3 -4
  265. package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.d.ts +6 -0
  266. package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +14 -10
  267. package/lib/view/expenseAutomationView/epics/transactionCategorization/backgroundRefetchReviewTabEpic.js +3 -16
  268. package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +9 -16
  269. package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.js +2 -2
  270. package/lib/view/expenseAutomationView/epics/transactionCategorization/markTransactionAsNotMiscategorizedEpic.js +2 -13
  271. package/lib/view/expenseAutomationView/epics/transactionCategorization/saveTransactionCategorizationEpic.js +2 -6
  272. package/lib/view/expenseAutomationView/epics/transactionCategorization/triggerReviewTabRefetchEpic.js +2 -2
  273. package/lib/view/expenseAutomationView/epics/transactionCategorization/updateTransactionCategorizationEpic.js +2 -6
  274. package/lib/view/expenseAutomationView/expenseAutomationViewReducer.d.ts +2 -6
  275. package/lib/view/expenseAutomationView/expenseAutomationViewReducer.js +3 -20
  276. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  277. package/lib/view/expenseAutomationView/payload/transactionCategorizationPayload.d.ts +20 -9
  278. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +12 -19
  279. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +21 -45
  280. package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +8 -6
  281. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.d.ts +1 -0
  282. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +15 -7
  283. package/lib/view/expenseAutomationView/transactionFilterHelpers.js +106 -18
  284. package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +1 -1
  285. package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +1 -2
  286. package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
  287. package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
  288. package/lib/view/people/peopleTypes.d.ts +1 -1
  289. package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
  290. package/lib/view/reportsResync/reportsResyncReducer.d.ts +2 -2
  291. package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
  292. package/lib/view/spendManagement/autotransferRules/autoTransferRulesSelector.d.ts +8 -1
  293. package/lib/view/spendManagement/autotransferRules/autoTransferRulesSelector.js +21 -1
  294. package/lib/view/spendManagement/autotransferRules/autoTransferRulesState.d.ts +22 -0
  295. package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.d.ts +7 -0
  296. package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +14 -0
  297. package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewReducer.d.ts +14 -3
  298. package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewReducer.js +110 -13
  299. package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewState.d.ts +16 -0
  300. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/deleteBillPayApprovalRuleEpic.js +10 -2
  301. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPaySetupApproverViewEpic.js +8 -4
  302. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/initializeBillPaySetupApproverViewUpdateDataEpic.js +10 -6
  303. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/reorderBillPayApprovalRulesEpic.d.ts +23 -0
  304. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/reorderBillPayApprovalRulesEpic.js +58 -0
  305. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/saveBillPaySetupApproverViewUpdatesEpic.js +12 -3
  306. package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.d.ts +59 -1
  307. package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js +142 -17
  308. package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonState.d.ts +31 -5
  309. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +8 -1
  310. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +60 -4
  311. package/lib/view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic.js +8 -2
  312. package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowPayload.d.ts +47 -0
  313. package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowPayload.js +34 -0
  314. package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowReducer.d.ts +23 -0
  315. package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowReducer.js +82 -0
  316. package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowSelector.d.ts +40 -0
  317. package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowSelector.js +51 -0
  318. package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowState.d.ts +37 -0
  319. package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowState.js +53 -0
  320. package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/fetchCashManagementSettingsEpic.d.ts +14 -0
  321. package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/fetchCashManagementSettingsEpic.js +38 -0
  322. package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/saveAutoSweepSettingsEpic.d.ts +7 -0
  323. package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/saveAutoSweepSettingsEpic.js +36 -0
  324. package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewPayload.d.ts +56 -0
  325. package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewPayload.js +60 -0
  326. package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewReducer.d.ts +22 -0
  327. package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewReducer.js +96 -0
  328. package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector.d.ts +59 -0
  329. package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector.js +230 -0
  330. package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewState.d.ts +122 -0
  331. package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewState.js +13 -0
  332. package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementBannerEpic.d.ts +7 -0
  333. package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementBannerEpic.js +27 -0
  334. package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementOverviewPageEpic.d.ts +9 -0
  335. package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementOverviewPageEpic.js +40 -0
  336. package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementRecommendationEpic.d.ts +7 -0
  337. package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementRecommendationEpic.js +31 -0
  338. package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchRecentTransferEpic.d.ts +15 -0
  339. package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchRecentTransferEpic.js +32 -0
  340. package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailReducer.d.ts +14 -0
  341. package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailReducer.js +56 -0
  342. package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailSelector.d.ts +15 -0
  343. package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailSelector.js +28 -0
  344. package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailState.d.ts +8 -0
  345. package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailState.js +2 -0
  346. package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/fetchCardPolicyDetailEpic.d.ts +8 -0
  347. package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/fetchCardPolicyDetailEpic.js +40 -0
  348. package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/updateCardPolicyEpic.d.ts +8 -0
  349. package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/updateCardPolicyEpic.js +43 -0
  350. package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/archiveCardPolicyEpic.d.ts +8 -0
  351. package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/archiveCardPolicyEpic.js +38 -0
  352. package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer.d.ts +15 -0
  353. package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer.js +75 -0
  354. package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListSelector.d.ts +15 -0
  355. package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListSelector.js +27 -0
  356. package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListState.d.ts +7 -0
  357. package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListState.js +2 -0
  358. package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/fetchCardPolicyListEpic.d.ts +8 -0
  359. package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/fetchCardPolicyListEpic.js +42 -0
  360. package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyAiCardPolicyFormDraftUpdate.d.ts +8 -0
  361. package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyAiCardPolicyFormDraftUpdate.js +294 -0
  362. package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToAiCardPolicyDraft.d.ts +8 -0
  363. package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToAiCardPolicyDraft.js +113 -0
  364. package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToDraftEpic.d.ts +9 -0
  365. package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToDraftEpic.js +48 -0
  366. package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToManualCardPolicyDraft.d.ts +8 -0
  367. package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyExtractedPolicyToManualCardPolicyDraft.js +115 -0
  368. package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyUploadPlanToAiCardPolicyDraft.d.ts +13 -0
  369. package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/applyUploadPlanToAiCardPolicyDraft.js +29 -0
  370. package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/buildAiCardPolicyFormDraftSeed.d.ts +14 -0
  371. package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/buildAiCardPolicyFormDraftSeed.js +369 -0
  372. package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/buildManualCardPolicyFormDraftSeed.d.ts +6 -0
  373. package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/buildManualCardPolicyFormDraftSeed.js +40 -0
  374. package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyChipIds.d.ts +7 -0
  375. package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyChipIds.js +26 -0
  376. package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyFormDraftTypes.d.ts +116 -0
  377. package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyFormDraftTypes.js +10 -0
  378. package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyRequestParts.d.ts +33 -0
  379. package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/cardPolicyRequestParts.js +126 -0
  380. package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyReducer.d.ts +52 -0
  381. package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyReducer.js +158 -0
  382. package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicySelector.d.ts +11 -0
  383. package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicySelector.js +31 -0
  384. package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyState.d.ts +12 -0
  385. package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyState.js +2 -0
  386. package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyTemplateEpic.d.ts +9 -0
  387. package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyTemplateEpic.js +53 -0
  388. package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/deriveAiPolicyReviewRowsFromInputs.d.ts +10 -0
  389. package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/deriveAiPolicyReviewRowsFromInputs.js +144 -0
  390. package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/fetchCardPolicyMccCategoriesEpic.d.ts +7 -0
  391. package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/fetchCardPolicyMccCategoriesEpic.js +24 -0
  392. package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/seedAiCardPolicyFormDraftEpic.d.ts +11 -0
  393. package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/seedAiCardPolicyFormDraftEpic.js +104 -0
  394. package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toBulkCardPolicyTemplateRequestsFromDraft.d.ts +22 -0
  395. package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toBulkCardPolicyTemplateRequestsFromDraft.js +100 -0
  396. package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toCardPolicyTemplateRequestFromDraft.d.ts +8 -0
  397. package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toCardPolicyTemplateRequestFromDraft.js +63 -0
  398. package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toManualCardPolicyTemplateRequestFromDraft.d.ts +3 -0
  399. package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/toManualCardPolicyTemplateRequestFromDraft.js +28 -0
  400. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
  401. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.d.ts +14 -0
  402. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +27 -1
  403. package/lib/view/spendManagement/chargeCards/issueChargeCard/aiCardCreationFormDraftTypes.d.ts +34 -0
  404. package/lib/view/spendManagement/chargeCards/issueChargeCard/aiCardCreationFormDraftTypes.js +2 -0
  405. package/lib/view/spendManagement/chargeCards/issueChargeCard/applyAiCardCreationFormDraftUpdate.d.ts +7 -0
  406. package/lib/view/spendManagement/chargeCards/issueChargeCard/applyAiCardCreationFormDraftUpdate.js +38 -0
  407. package/lib/view/spendManagement/chargeCards/issueChargeCard/buildAiCardCreationFormDraftSeed.d.ts +12 -0
  408. package/lib/view/spendManagement/chargeCards/issueChargeCard/buildAiCardCreationFormDraftSeed.js +61 -0
  409. package/lib/view/spendManagement/chargeCards/issueChargeCard/deriveAiCardRowsFromTeams.d.ts +9 -0
  410. package/lib/view/spendManagement/chargeCards/issueChargeCard/deriveAiCardRowsFromTeams.js +39 -0
  411. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardEpic.d.ts +2 -2
  412. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardEpic.js +1 -1
  413. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.d.ts +12 -2
  414. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.js +43 -5
  415. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.d.ts +7 -0
  416. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.js +42 -1
  417. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardState.d.ts +5 -0
  418. package/lib/view/spendManagement/chargeCards/issueChargeCard/seedAiCardCreationFormDraftEpic.d.ts +11 -0
  419. package/lib/view/spendManagement/chargeCards/issueChargeCard/seedAiCardCreationFormDraftEpic.js +66 -0
  420. package/lib/view/spendManagement/chargeCards/issueChargeCard/toIssueChargeCardLocalDataFromDraft.d.ts +3 -0
  421. package/lib/view/spendManagement/chargeCards/issueChargeCard/toIssueChargeCardLocalDataFromDraft.js +48 -0
  422. package/lib/view/spendManagement/reimbursement/editRemiView/epics/fetchEditRemiDetailPageEpic.js +5 -1
  423. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/deleteRemiApprovalRuleEpic.js +10 -2
  424. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/fetchRemiSetupApproverViewEpic.js +8 -2
  425. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/initializeRemiSetupApproverViewUpdateDataEpic.js +10 -6
  426. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/reorderRemiApprovalRulesEpic.d.ts +14 -0
  427. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/reorderRemiApprovalRulesEpic.js +65 -0
  428. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/saveRemiSetupApproverViewUpdatesEpic.js +12 -3
  429. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewReducer.d.ts +14 -3
  430. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewReducer.js +81 -12
  431. package/lib/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewState.d.ts +12 -0
  432. package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.d.ts +8 -0
  433. package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.js +22 -0
  434. package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.d.ts +8 -0
  435. package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.js +22 -0
  436. package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.js +1 -1
  437. package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer.d.ts +1 -1
  438. package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer.js +46 -2
  439. package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewState.d.ts +2 -0
  440. package/lib/view/taskManager/taskListView/taskList.d.ts +3 -3
  441. package/lib/view/taskManager/taskListView/taskListReducer.d.ts +1 -1
  442. package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
  443. package/lib/view/topEx/topExSelector.d.ts +1 -1
  444. package/lib/view/transactionDetail/journalEntryLinesViewModel.d.ts +102 -0
  445. package/lib/view/transactionDetail/journalEntryLinesViewModel.js +160 -0
  446. package/lib/view/transactionDetail/transactionDetailPayload.d.ts +1 -1
  447. package/lib/view/transactionDetail/transactionDetailSelector.d.ts +6 -1
  448. package/lib/view/transactionDetail/transactionDetailSelector.js +6 -1
  449. package/lib/zeniAPI.d.ts +1 -0
  450. package/package.json +1 -1
@@ -1,19 +1,45 @@
1
1
  import { FetchStateAndError, ID } from '../../../../../commonStateTypes/common';
2
- import { Criteria, Step } from '../../../../../entity/approvalRule/approvalRuleState';
2
+ import { AmountCriteria, DepartmentCriteria, Step, VendorCriteria } from '../../../../../entity/approvalRule/approvalRuleState';
3
3
  export type ApprovalUpdateActionType = 'approval_create' | 'approval_update';
4
4
  export interface ApproverViewUpdateData {
5
5
  type: ApprovalUpdateActionType;
6
6
  updateStatus: FetchStateAndError;
7
7
  data?: ApprovalRuleUpdateData | ApprovalRuleCreateData;
8
8
  }
9
- export interface ApprovalRuleUpdateData {
9
+ /**
10
+ * Form-side criteria shape used by the rule create/edit form.
11
+ *
12
+ * Each condition kind gets its own optional slot, mirroring how the UI
13
+ * edits them as distinct rows. At most one of each kind is present; this
14
+ * matches the design constraint that each condition type can be added once.
15
+ */
16
+ export interface ApprovalRuleFormCriteria {
17
+ amount?: AmountCriteria;
18
+ department?: DepartmentCriteria;
19
+ vendor?: VendorCriteria;
20
+ }
21
+ /**
22
+ * Rule-level fields shared by both create and update flows.
23
+ *
24
+ * These come from the 3.0 design: the form now owns a name, an optional
25
+ * description, an optional Separation-of-Duties toggle, and a flag that
26
+ * marks the rule as the org-wide fallback rule. They live alongside
27
+ * criteria/steps but are not part of either.
28
+ */
29
+ export interface ApprovalRuleFormBase {
30
+ description?: string;
31
+ isFallback?: boolean;
32
+ name?: string;
33
+ separationOfDuties?: boolean;
34
+ }
35
+ export interface ApprovalRuleUpdateData extends ApprovalRuleFormBase {
10
36
  approvalRuleId: ID;
11
- criteria: Criteria;
37
+ criteria: ApprovalRuleFormCriteria;
12
38
  steps: Step[];
13
39
  isApplicableOnPendingApprovalEntity?: boolean;
14
40
  }
15
- export interface ApprovalRuleCreateData {
16
- criteria: Criteria;
41
+ export interface ApprovalRuleCreateData extends ApprovalRuleFormBase {
42
+ criteria: ApprovalRuleFormCriteria;
17
43
  steps: Step[];
18
44
  isApplicableOnPendingApprovalEntity?: boolean;
19
45
  }
@@ -100,6 +100,13 @@ export interface EditBillDetailSelectorView extends SelectorView {
100
100
  withdrawFromList: FundingAccount[];
101
101
  billPayInfo?: BillPayInfo;
102
102
  bookCloseDate?: ZeniDate;
103
+ /**
104
+ * Bill-level accounting class id. Approval Rules 3.0 'department'
105
+ * criteria match against this — selectors needing to evaluate a
106
+ * department-narrowed rule against the current bill should read
107
+ * this rather than digging through 'state.billTransactionState'.
108
+ */
109
+ classId?: ID;
103
110
  createTime?: ZeniDate;
104
111
  editBillInitialDetails?: EditBillInitialDetails;
105
112
  internationalWireOnboardingStatus?: AllowedValueWithCode;
@@ -157,4 +164,4 @@ export declare const getDefaultWithdrawFromAccount: (state: RootState, depositAc
157
164
  accountId: ID;
158
165
  accountType: AccountTypeSubConfigCodeKeyType;
159
166
  }) => FundingAccount | undefined;
160
- export declare const checkIfCreatorIsApprover: (billAmount: number, approvalRules: ApprovalRuleWithUser[], signedInUser?: LoggedInUser) => boolean;
167
+ export declare const checkIfCreatorIsApprover: (billAmount: number, approvalRules: ApprovalRuleWithUser[], signedInUser?: LoggedInUser, billVendorId?: ID, billDepartmentId?: ID) => boolean;
@@ -9,6 +9,7 @@ exports.getPaymentSection = getPaymentSection;
9
9
  exports.toPaymentToOption = toPaymentToOption;
10
10
  const get_1 = __importDefault(require("lodash/get"));
11
11
  const has_1 = __importDefault(require("lodash/has"));
12
+ const approvalRuleSelector_1 = require("../../../../entity/approvalRule/approvalRuleSelector");
12
13
  const reduceFetchState_1 = require("../../../../commonStateTypes/reduceFetchState");
13
14
  const bankAccountSelector_1 = require("../../../../entity/bankAccount/bankAccountSelector");
14
15
  const contactSelector_1 = require("../../../../entity/billPay/contact/contactSelector");
@@ -365,6 +366,14 @@ const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAc
365
366
  isDeleted,
366
367
  showAutofill,
367
368
  addBillAutoFields,
369
+ // Bill-level accounting class. Approval Rules 3.0 'department'
370
+ // criteria match against this. Lives on BillTransaction; not on
371
+ // any sub-section. Empty-string is normalised to 'undefined'
372
+ // so downstream readers treat "no class" uniformly regardless
373
+ // of whether the wire used '' or omitted the field.
374
+ classId: transaction?.classId != null && transaction.classId !== ''
375
+ ? transaction.classId
376
+ : undefined,
368
377
  billStage,
369
378
  deleteStatus,
370
379
  billActivities,
@@ -695,12 +704,59 @@ const getDefaultWithdrawFromAccount = (state, depositAccounts, companyId, lastSe
695
704
  return undefined;
696
705
  };
697
706
  exports.getDefaultWithdrawFromAccount = getDefaultWithdrawFromAccount;
698
- const checkIfCreatorIsApprover = (billAmount, approvalRules, signedInUser) => {
707
+ const checkIfCreatorIsApprover = (billAmount, approvalRules, signedInUser, billVendorId, billDepartmentId) => {
699
708
  let isCreatorAlsoApprover = false;
709
+ // Approval Rules 3.0 — a rule applies to a bill only when all of
710
+ // its present criteria are satisfied. Criteria not declared on
711
+ // the rule are treated as "no narrowing on this axis".
712
+ //
713
+ // Strict-match semantics for vendor / department: if the rule
714
+ // narrows by an axis but the bill has no value on that axis, the
715
+ // rule does NOT apply (an absent bill-side value can't satisfy
716
+ // either 'is' or 'is_not'). Amount is always present on a rule
717
+ // (the form enforces this), but bounds may be one-sided.
700
718
  const approvalRule = approvalRules.find((rule) => {
701
- const { max, min } = rule.criteria[0].range;
702
- return (billAmount > min.amount &&
703
- (max?.amount != null ? billAmount <= max?.amount : true));
719
+ const vendorCriteria = (0, approvalRuleSelector_1.getVendorCriteria)(rule.criteria);
720
+ if (vendorCriteria != null) {
721
+ if (billVendorId == null) {
722
+ return false;
723
+ }
724
+ const includesVendor = vendorCriteria.vendorIds.includes(billVendorId);
725
+ if (vendorCriteria.operator === 'is' && !includesVendor) {
726
+ return false;
727
+ }
728
+ if (vendorCriteria.operator === 'is_not' && includesVendor) {
729
+ return false;
730
+ }
731
+ }
732
+ const departmentCriteria = (0, approvalRuleSelector_1.getDepartmentCriteria)(rule.criteria);
733
+ if (departmentCriteria != null) {
734
+ if (billDepartmentId == null) {
735
+ return false;
736
+ }
737
+ const includesDepartment = departmentCriteria.departmentIds.includes(billDepartmentId);
738
+ if (departmentCriteria.operator === 'is' && !includesDepartment) {
739
+ return false;
740
+ }
741
+ if (departmentCriteria.operator === 'is_not' && includesDepartment) {
742
+ return false;
743
+ }
744
+ }
745
+ const amountCriteria = (0, approvalRuleSelector_1.getAmountCriteria)(rule.criteria);
746
+ if (amountCriteria == null) {
747
+ // The form guarantees an amount criterion on every rule, so
748
+ // this branch is defensive against backend drift. Keep
749
+ // pre-3.0 behaviour: a rule that doesn't declare amount
750
+ // doesn't participate here.
751
+ return false;
752
+ }
753
+ // Bounds use the wire's inclusive 'gte' / 'lte' semantics, and
754
+ // either side may be absent for a one-sided 'greater_than' /
755
+ // 'less_than' rule.
756
+ const { min, max } = amountCriteria;
757
+ const matchesMin = min == null || billAmount >= min.amount;
758
+ const matchesMax = max == null || billAmount <= max.amount;
759
+ return matchesMin && matchesMax;
704
760
  });
705
761
  if (approvalRule != null) {
706
762
  const requireApprovalSteps = approvalRule.steps.filter((step) => step.action === 'require_approval');
@@ -41,7 +41,10 @@ const fetchEditBillDetailPageEpic = (actions$, state$) => actions$.pipe((0, oper
41
41
  else {
42
42
  billDetailActions.push((0, editBillViewReducer_1.updateShowAutofill)(true));
43
43
  }
44
- billDetailActions.push((0, billPaySetupApproverViewReducer_1.fetchBillPaySetupApproverView)(true));
44
+ // Side-fetch from the edit-bill page bootstrap. The triggering
45
+ // action doesn't carry the V3 flag, so we explicitly target v1
46
+ // here; tenants on v3 re-fetch through their own screen connector.
47
+ billDetailActions.push((0, billPaySetupApproverViewReducer_1.fetchBillPaySetupApproverView)(true, true, false));
45
48
  }
46
49
  else {
47
50
  if (state.ownerListState.fetchState !== 'In-Progress' &&
@@ -84,7 +87,10 @@ const fetchEditBillDetailPageEpic = (actions$, state$) => actions$.pipe((0, oper
84
87
  // While opening New Bill Refresh Approval Rules and Payment Accounts
85
88
  if (approvalViewFetchState !== 'In-Progress' &&
86
89
  approvalViewFetchState !== 'Completed') {
87
- billDetailActions.push((0, billPaySetupApproverViewReducer_1.fetchBillPaySetupApproverView)(true));
90
+ // Side-fetch from the edit-bill page bootstrap. The triggering
91
+ // action doesn't carry the V3 flag, so we explicitly target v1
92
+ // here; tenants on v3 re-fetch through their own screen connector.
93
+ billDetailActions.push((0, billPaySetupApproverViewReducer_1.fetchBillPaySetupApproverView)(true, true, false));
88
94
  }
89
95
  }
90
96
  return (0, rxjs_1.concat)((0, rxjs_1.from)(billDetailActions));
@@ -0,0 +1,47 @@
1
+ import { Amount } from '../../../../commonStateTypes/amount';
2
+ import { ID } from '../../../../commonStateTypes/common';
3
+ import { DepositAccountPayload } from '../../../../entity/depositAccount/depositAccountPayload';
4
+ import { ZeniAPIResponse } from '../../../../responsePayload';
5
+ import { ZeniDate } from '../../../../zeniDayJS';
6
+ import { AutoSweepFlowState, AutoSweepFrequency } from './autoSweepFlowState';
7
+ /**
8
+ * Body sent to `PUT /cash-management/settings`. Field names match the
9
+ * cash-management-agent contract; `minimum_buffer_usd` is a plain number
10
+ * (the slice tracks the canonical `Amount` value).
11
+ */
12
+ export type SaveAutoSweepSettingsBody = {
13
+ frequency: string;
14
+ memo: string;
15
+ minimum_buffer_usd: number;
16
+ };
17
+ export type SaveAutoSweepSettingsResponse = ZeniAPIResponse<unknown>;
18
+ export declare const toSaveAutoSweepSettingsBody: (state: Pick<AutoSweepFlowState, "bufferAmount" | "frequency" | "memo">) => SaveAutoSweepSettingsBody;
19
+ /**
20
+ * `source_bank_account` on the cash-management settings response matches the
21
+ * shared `DepositAccountPayload` shape, so the fetch epic dispatches it into
22
+ * the deposit-account entity bucket and the auto-sweep slice only keeps the
23
+ * id. The selector hydrates the full `FundingAccount` on read.
24
+ */
25
+ export interface CashManagementSettingsPayload {
26
+ cash_management_settings_id: string | null;
27
+ frequency: string;
28
+ minimum_buffer_usd: number;
29
+ next_transfer_date: string;
30
+ source_bank_account: DepositAccountPayload;
31
+ }
32
+ export type CashManagementSettingsResponse = ZeniAPIResponse<CashManagementSettingsPayload>;
33
+ /**
34
+ * Map a `GET /cash-management/settings` payload into the slice's writable
35
+ * fields. Defensive on the frequency (string-from-the-wire → union via
36
+ * `toAutoSweepFrequency`, falling back to `'weekly'` if the server returns
37
+ * something we don't model yet). Only the source account *id* is stored
38
+ * here — the full deposit-account payload is published to the entity bucket
39
+ * by the fetch epic.
40
+ */
41
+ export declare const toAutoSweepFlowStatePatch: (payload: CashManagementSettingsPayload) => {
42
+ bufferAmount: Amount;
43
+ frequency: AutoSweepFrequency;
44
+ nextTransferDate?: ZeniDate;
45
+ primaryFundingAccountId?: ID;
46
+ settingsId?: ID;
47
+ };
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toAutoSweepFlowStatePatch = exports.toSaveAutoSweepSettingsBody = void 0;
4
+ const amount_1 = require("../../../../commonStateTypes/amount");
5
+ const zeniDayJS_1 = require("../../../../zeniDayJS");
6
+ const autoSweepFlowState_1 = require("./autoSweepFlowState");
7
+ const toSaveAutoSweepSettingsBody = (state) => ({
8
+ frequency: state.frequency,
9
+ memo: state.memo,
10
+ minimum_buffer_usd: state.bufferAmount.amount,
11
+ });
12
+ exports.toSaveAutoSweepSettingsBody = toSaveAutoSweepSettingsBody;
13
+ /**
14
+ * Map a `GET /cash-management/settings` payload into the slice's writable
15
+ * fields. Defensive on the frequency (string-from-the-wire → union via
16
+ * `toAutoSweepFrequency`, falling back to `'weekly'` if the server returns
17
+ * something we don't model yet). Only the source account *id* is stored
18
+ * here — the full deposit-account payload is published to the entity bucket
19
+ * by the fetch epic.
20
+ */
21
+ const toAutoSweepFlowStatePatch = (payload) => {
22
+ const currencyCode = payload.source_bank_account.balances?.currency_code;
23
+ const currencySymbol = payload.source_bank_account.balances?.currency_symbol;
24
+ return {
25
+ bufferAmount: (0, amount_1.toAmount)(payload.minimum_buffer_usd, currencyCode ?? 'USD', currencySymbol ?? '$'),
26
+ frequency: (0, autoSweepFlowState_1.toAutoSweepFrequency)(payload.frequency) ?? 'weekly',
27
+ nextTransferDate: payload.next_transfer_date != null && payload.next_transfer_date !== ''
28
+ ? (0, zeniDayJS_1.date)(payload.next_transfer_date)
29
+ : undefined,
30
+ primaryFundingAccountId: payload.source_bank_account.deposit_account_id ?? undefined,
31
+ settingsId: payload.cash_management_settings_id ?? undefined,
32
+ };
33
+ };
34
+ exports.toAutoSweepFlowStatePatch = toAutoSweepFlowStatePatch;
@@ -0,0 +1,23 @@
1
+ import { Amount } from '../../../../commonStateTypes/amount';
2
+ import { FetchState } from '../../../../commonStateTypes/common';
3
+ import { ZeniAPIStatus } from '../../../../responsePayload';
4
+ import { CashManagementSettingsPayload } from './autoSweepFlowPayload';
5
+ import { AutoSweepFlowState, AutoSweepFrequency } from './autoSweepFlowState';
6
+ export declare const initialState: AutoSweepFlowState;
7
+ export declare const fetchCashManagementSettings: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"autoSweepFlow/fetchCashManagementSettings">, updateCashManagementSettings: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
8
+ data: CashManagementSettingsPayload;
9
+ }, "autoSweepFlow/updateCashManagementSettings">, updateCashManagementSettingsFetchStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
10
+ fetchState: FetchState;
11
+ error?: ZeniAPIStatus;
12
+ }, "autoSweepFlow/updateCashManagementSettingsFetchStatus">, updateAutoSweepRisk: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
13
+ bufferAmount: Amount;
14
+ }, "autoSweepFlow/updateAutoSweepRisk">, updateAutoSweepDraft: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
15
+ bufferAmount: Amount;
16
+ frequency: AutoSweepFrequency;
17
+ memo: string;
18
+ }, "autoSweepFlow/updateAutoSweepDraft">, saveAutoSweepSettings: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"autoSweepFlow/saveAutoSweepSettings">, updateAutoSweepSettingsFetchStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
19
+ fetchState: FetchState;
20
+ error?: ZeniAPIStatus;
21
+ }, "autoSweepFlow/updateAutoSweepSettingsFetchStatus">, clearAutoSweepFlow: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"autoSweepFlow/clearAutoSweepFlow">;
22
+ declare const _default: import("redux").Reducer<AutoSweepFlowState>;
23
+ export default _default;
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ var _a;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.clearAutoSweepFlow = exports.updateAutoSweepSettingsFetchStatus = exports.saveAutoSweepSettings = exports.updateAutoSweepDraft = exports.updateAutoSweepRisk = exports.updateCashManagementSettingsFetchStatus = exports.updateCashManagementSettings = exports.fetchCashManagementSettings = exports.initialState = void 0;
5
+ const toolkit_1 = require("@reduxjs/toolkit");
6
+ const autoSweepFlowPayload_1 = require("./autoSweepFlowPayload");
7
+ const autoSweepFlowState_1 = require("./autoSweepFlowState");
8
+ exports.initialState = autoSweepFlowState_1.initialAutoSweepFlowState;
9
+ const autoSweepFlow = (0, toolkit_1.createSlice)({
10
+ name: 'autoSweepFlow',
11
+ initialState: exports.initialState,
12
+ reducers: {
13
+ /**
14
+ * Kicks off `GET /cash-management/settings`. Flips the top-level
15
+ * fetchState to `In-Progress`; the fetch epic picks this up.
16
+ */
17
+ fetchCashManagementSettings(draft) {
18
+ draft.fetchState = 'In-Progress';
19
+ draft.error = undefined;
20
+ },
21
+ /**
22
+ * Hydrates the form fields with the server-side settings (and stashes
23
+ * the settings id for subsequent saves). Marks the GET as `Completed`.
24
+ */
25
+ updateCashManagementSettings(draft, action) {
26
+ const patch = (0, autoSweepFlowPayload_1.toAutoSweepFlowStatePatch)(action.payload.data);
27
+ draft.bufferAmount = patch.bufferAmount;
28
+ draft.frequency = patch.frequency;
29
+ draft.nextTransferDate = patch.nextTransferDate;
30
+ draft.primaryFundingAccountId = patch.primaryFundingAccountId;
31
+ draft.settingsId = patch.settingsId;
32
+ draft.fetchState = 'Completed';
33
+ draft.error = undefined;
34
+ },
35
+ updateCashManagementSettingsFetchStatus(draft, action) {
36
+ draft.fetchState = action.payload.fetchState;
37
+ draft.error = action.payload.error;
38
+ },
39
+ /**
40
+ * Live-update the buffer (risk band) as the user toggles the risk picker
41
+ * on the setup page, without staging frequency/memo. The selector derives
42
+ * the risk-adjusted sweep amount off `bufferAmount`, so dispatching this on
43
+ * every risk change keeps the setup and review screens in sync.
44
+ */
45
+ updateAutoSweepRisk(draft, action) {
46
+ draft.bufferAmount = action.payload.bufferAmount;
47
+ },
48
+ /**
49
+ * Stage the in-flight form values without submitting them — fired from
50
+ * the setup→review transition so other selectors (and devtools) can see
51
+ * what the user is about to confirm. Leaves `saveStatus` untouched; the
52
+ * actual PUT only kicks off when the user clicks "Confirm Sweep" via
53
+ * `saveAutoSweepSettings`.
54
+ */
55
+ updateAutoSweepDraft(draft, action) {
56
+ draft.bufferAmount = action.payload.bufferAmount;
57
+ draft.frequency = action.payload.frequency;
58
+ draft.memo = action.payload.memo;
59
+ },
60
+ /**
61
+ * Trigger the PUT for the auto-sweep settings already staged via
62
+ * `updateAutoSweepDraft`. Carries no payload — flips `saveStatus` to
63
+ * `In-Progress` and the save epic reads `bufferAmount` / `frequency` /
64
+ * `memo` straight from the slice. Callers must ensure those fields
65
+ * reflect the user's latest input before dispatching.
66
+ */
67
+ saveAutoSweepSettings(draft) {
68
+ draft.saveStatus = { fetchState: 'In-Progress', error: undefined };
69
+ },
70
+ updateAutoSweepSettingsFetchStatus(draft, action) {
71
+ draft.saveStatus = {
72
+ fetchState: action.payload.fetchState,
73
+ error: action.payload.error,
74
+ };
75
+ },
76
+ clearAutoSweepFlow() {
77
+ return autoSweepFlowState_1.initialAutoSweepFlowState;
78
+ },
79
+ },
80
+ });
81
+ _a = autoSweepFlow.actions, exports.fetchCashManagementSettings = _a.fetchCashManagementSettings, exports.updateCashManagementSettings = _a.updateCashManagementSettings, exports.updateCashManagementSettingsFetchStatus = _a.updateCashManagementSettingsFetchStatus, exports.updateAutoSweepRisk = _a.updateAutoSweepRisk, exports.updateAutoSweepDraft = _a.updateAutoSweepDraft, exports.saveAutoSweepSettings = _a.saveAutoSweepSettings, exports.updateAutoSweepSettingsFetchStatus = _a.updateAutoSweepSettingsFetchStatus, exports.clearAutoSweepFlow = _a.clearAutoSweepFlow;
82
+ exports.default = autoSweepFlow.reducer;
@@ -0,0 +1,40 @@
1
+ import { Amount } from '../../../../commonStateTypes/amount';
2
+ import { FetchStateAndError, ID } from '../../../../commonStateTypes/common';
3
+ import { SelectorView } from '../../../../commonStateTypes/viewAndReport/viewAndReport';
4
+ import { RootState } from '../../../../reducer';
5
+ import { FundingAccount } from '../../commonSetup/setupViewSelector';
6
+ import { TreasurySummaryWithBalance } from '../../treasury/treasuryList/treasuryDetailState';
7
+ import { AutoSweepFrequency, RiskLevel } from './autoSweepFlowState';
8
+ /**
9
+ * The editable form state behind `<AutoSweepSetupPage>`. Kept as a nested
10
+ * object on the selector view so the screen can pass it through as a single
11
+ * unit and the rest of the view (server-derived data + statuses) stays
12
+ * separate from "what the user is currently editing".
13
+ */
14
+ export interface AutoSweepFlowFormData {
15
+ bufferAmount: Amount;
16
+ frequency: AutoSweepFrequency;
17
+ memo: string;
18
+ /** Derived from `bufferAmount` — the matching preset risk level, falling
19
+ * back to `'moderate'` for custom server-side values. */
20
+ risk: RiskLevel;
21
+ }
22
+ export interface AutoSweepFlowSelectorView extends SelectorView {
23
+ formData: AutoSweepFlowFormData;
24
+ saveStatus: FetchStateAndError;
25
+ /**
26
+ * Recommended sweep amount. Sourced from the cash management banner
27
+ * (the first money_movements[0].movements[0].amount returned by the
28
+ * agent's `/recommend` endpoint). Defaults to zero when the agent
29
+ * hasn't returned a movement yet.
30
+ */
31
+ sweepAmount: Amount;
32
+ /** Resolved from `primaryFundingAccountId` against the deposit-account
33
+ * entity bucket. `undefined` until the GET fetch publishes the account. */
34
+ primaryFundingAccount?: FundingAccount;
35
+ settingsId?: ID;
36
+ /** Treasury account summary used by the setup / review flow to render the
37
+ * destination column. Mirrors `getTreasuryDetail().accountSummary`. */
38
+ treasurySummary?: TreasurySummaryWithBalance;
39
+ }
40
+ export declare const getAutoSweepFlow: (state: RootState) => AutoSweepFlowSelectorView;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getAutoSweepFlow = void 0;
4
+ const depositAccountSelector_1 = require("../../../../entity/depositAccount/depositAccountSelector");
5
+ const setupViewSelector_1 = require("../../commonSetup/setupViewSelector");
6
+ const treasuryDetailSelector_1 = require("../../treasury/treasuryList/treasuryDetailSelector");
7
+ const cashManagementOverviewSelector_1 = require("../cashManagementOverview/cashManagementOverviewSelector");
8
+ const autoSweepFlowState_1 = require("./autoSweepFlowState");
9
+ /**
10
+ * Risk band the agent's recommended sweep amount is computed against. The
11
+ * `sweepAmount` returned by the banner assumes this buffer, so the selector
12
+ * adjusts the displayed sweep by the delta between the user's selected band
13
+ * and this default.
14
+ */
15
+ const DEFAULT_RISK_LEVEL = 'moderate';
16
+ const getAutoSweepFlow = (state) => {
17
+ const { bufferAmount, frequency, memo, saveStatus, settingsId, primaryFundingAccountId, fetchState, error, } = state.autoSweepFlowState;
18
+ const depositAccount = primaryFundingAccountId != null
19
+ ? (0, depositAccountSelector_1.getDepositAccountByDepositAccountId)(state.depositAccountState, primaryFundingAccountId)
20
+ : undefined;
21
+ const risk = (0, autoSweepFlowState_1.bufferAmountToRisk)(bufferAmount.amount);
22
+ // The banner's recommended sweep assumes the default buffer band; shift it
23
+ // by the delta between the user's selected band and that default so a
24
+ // tighter buffer sweeps more and a looser buffer sweeps less.
25
+ const baseSweepAmount = (0, cashManagementOverviewSelector_1.getCashManagementOverviewBanner)(state).amount;
26
+ const sweepAmount = {
27
+ ...baseSweepAmount,
28
+ amount: baseSweepAmount.amount +
29
+ autoSweepFlowState_1.RISK_BUFFER_AMOUNT[risk] -
30
+ autoSweepFlowState_1.RISK_BUFFER_AMOUNT[DEFAULT_RISK_LEVEL],
31
+ };
32
+ return {
33
+ fetchState,
34
+ error,
35
+ formData: {
36
+ bufferAmount,
37
+ frequency,
38
+ memo,
39
+ risk,
40
+ },
41
+ primaryFundingAccount: depositAccount != null
42
+ ? (0, setupViewSelector_1.mapDepositAccToFundingAccount)(depositAccount)
43
+ : undefined,
44
+ saveStatus,
45
+ settingsId,
46
+ sweepAmount,
47
+ treasurySummary: (0, treasuryDetailSelector_1.getTreasuryDetail)(state).accountSummary,
48
+ version: 0,
49
+ };
50
+ };
51
+ exports.getAutoSweepFlow = getAutoSweepFlow;
@@ -0,0 +1,37 @@
1
+ import { Amount } from '../../../../commonStateTypes/amount';
2
+ import { FetchStateAndError, ID } from '../../../../commonStateTypes/common';
3
+ import { ZeniDate } from '../../../../zeniDayJS';
4
+ /**
5
+ * Cadence at which the auto-sweep transfer fires. Lowercase to match the
6
+ * cash-management settings API contract (and the `SweepFrequency` literal
7
+ * already used by `<AutoSweepSetupPage>` in web-components).
8
+ */
9
+ export declare const ALL_AUTO_SWEEP_FREQUENCIES: readonly ["daily", "weekly", "biweekly", "monthly"];
10
+ export declare const toAutoSweepFrequency: (v?: string) => "weekly" | "biweekly" | "monthly" | "daily";
11
+ export type AutoSweepFrequency = NonNullable<ReturnType<typeof toAutoSweepFrequency>>;
12
+ /**
13
+ * Risk presets the auto-sweep setup form exposes. Each level maps to a
14
+ * canonical minimum-buffer amount (USD). Selecting a level in the UI is
15
+ * shorthand for choosing that buffer.
16
+ */
17
+ export declare const ALL_AUTO_SWEEP_RISK_LEVELS: readonly ["low", "moderate", "high"];
18
+ export declare const toAutoSweepRiskLevel: (v?: string) => "high" | "low" | "moderate";
19
+ export type RiskLevel = NonNullable<ReturnType<typeof toAutoSweepRiskLevel>>;
20
+ export declare const RISK_BUFFER_AMOUNT: Record<RiskLevel, number>;
21
+ /**
22
+ * Maps a buffer amount back onto the closest preset risk level. Falls back
23
+ * to `'moderate'` when the amount doesn't match a known preset (e.g. the
24
+ * server returned a custom value). The dropdown in `<AutoSweepSetupPage>`
25
+ * uses this so it can pre-select the user's existing band on edit.
26
+ */
27
+ export declare const bufferAmountToRisk: (amount: number) => RiskLevel;
28
+ export interface AutoSweepFlowState extends FetchStateAndError {
29
+ bufferAmount: Amount;
30
+ frequency: AutoSweepFrequency;
31
+ memo: string;
32
+ saveStatus: FetchStateAndError;
33
+ nextTransferDate?: ZeniDate;
34
+ primaryFundingAccountId?: ID;
35
+ settingsId?: ID;
36
+ }
37
+ export declare const initialAutoSweepFlowState: AutoSweepFlowState;
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.initialAutoSweepFlowState = exports.bufferAmountToRisk = exports.RISK_BUFFER_AMOUNT = exports.toAutoSweepRiskLevel = exports.ALL_AUTO_SWEEP_RISK_LEVELS = exports.toAutoSweepFrequency = exports.ALL_AUTO_SWEEP_FREQUENCIES = void 0;
4
+ const amount_1 = require("../../../../commonStateTypes/amount");
5
+ const stringToUnion_1 = require("../../../../commonStateTypes/stringToUnion");
6
+ /**
7
+ * Cadence at which the auto-sweep transfer fires. Lowercase to match the
8
+ * cash-management settings API contract (and the `SweepFrequency` literal
9
+ * already used by `<AutoSweepSetupPage>` in web-components).
10
+ */
11
+ exports.ALL_AUTO_SWEEP_FREQUENCIES = [
12
+ 'daily',
13
+ 'weekly',
14
+ 'biweekly',
15
+ 'monthly',
16
+ ];
17
+ const toAutoSweepFrequency = (v) => (0, stringToUnion_1.stringToUnion)(v ?? '', exports.ALL_AUTO_SWEEP_FREQUENCIES);
18
+ exports.toAutoSweepFrequency = toAutoSweepFrequency;
19
+ /**
20
+ * Risk presets the auto-sweep setup form exposes. Each level maps to a
21
+ * canonical minimum-buffer amount (USD). Selecting a level in the UI is
22
+ * shorthand for choosing that buffer.
23
+ */
24
+ exports.ALL_AUTO_SWEEP_RISK_LEVELS = ['low', 'moderate', 'high'];
25
+ const toAutoSweepRiskLevel = (v) => (0, stringToUnion_1.stringToUnion)(v ?? '', exports.ALL_AUTO_SWEEP_RISK_LEVELS);
26
+ exports.toAutoSweepRiskLevel = toAutoSweepRiskLevel;
27
+ exports.RISK_BUFFER_AMOUNT = {
28
+ low: 15000,
29
+ moderate: 10000,
30
+ high: 5000,
31
+ };
32
+ /**
33
+ * Maps a buffer amount back onto the closest preset risk level. Falls back
34
+ * to `'moderate'` when the amount doesn't match a known preset (e.g. the
35
+ * server returned a custom value). The dropdown in `<AutoSweepSetupPage>`
36
+ * uses this so it can pre-select the user's existing band on edit.
37
+ */
38
+ const bufferAmountToRisk = (amount) => {
39
+ const match = Object.entries(exports.RISK_BUFFER_AMOUNT).find(([, presetAmount]) => presetAmount === amount);
40
+ return match != null ? match[0] : 'moderate';
41
+ };
42
+ exports.bufferAmountToRisk = bufferAmountToRisk;
43
+ exports.initialAutoSweepFlowState = {
44
+ bufferAmount: (0, amount_1.toAmount)(10000, 'USD', '$'),
45
+ frequency: 'weekly',
46
+ memo: '',
47
+ saveStatus: { fetchState: 'Not-Started', error: undefined },
48
+ nextTransferDate: undefined,
49
+ primaryFundingAccountId: undefined,
50
+ settingsId: undefined,
51
+ fetchState: 'Not-Started',
52
+ error: undefined,
53
+ };
@@ -0,0 +1,14 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { updateDepositAccounts } from '../../../../../entity/depositAccount/depositAccountReducer';
4
+ import { RootState } from '../../../../../reducer';
5
+ import { ZeniAPI } from '../../../../../zeniAPI';
6
+ import { fetchCashManagementSettings, updateCashManagementSettings, updateCashManagementSettingsFetchStatus } from '../autoSweepFlowReducer';
7
+ export type ActionType = ReturnType<typeof fetchCashManagementSettings> | ReturnType<typeof updateCashManagementSettings> | ReturnType<typeof updateCashManagementSettingsFetchStatus> | ReturnType<typeof updateDepositAccounts>;
8
+ /**
9
+ * Hits `GET /cash-management/settings` and hydrates the auto-sweep slice
10
+ * with the server's existing settings (frequency, minimum buffer, settings
11
+ * id). Called from the cash management overview page-fetch epic alongside
12
+ * the other top-level fetches.
13
+ */
14
+ export declare const fetchCashManagementSettingsEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fetchCashManagementSettingsEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const depositAccountReducer_1 = require("../../../../../entity/depositAccount/depositAccountReducer");
7
+ const responsePayload_1 = require("../../../../../responsePayload");
8
+ const autoSweepFlowReducer_1 = require("../autoSweepFlowReducer");
9
+ /**
10
+ * Hits `GET /cash-management/settings` and hydrates the auto-sweep slice
11
+ * with the server's existing settings (frequency, minimum buffer, settings
12
+ * id). Called from the cash management overview page-fetch epic alongside
13
+ * the other top-level fetches.
14
+ */
15
+ const fetchCashManagementSettingsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(autoSweepFlowReducer_1.fetchCashManagementSettings.match), (0, operators_1.switchMap)(() => {
16
+ const endpoint = `${zeniAPI.apiEndPoints.cashManagementAgentBaseUrl}/1.0/cash-management/settings`;
17
+ return zeniAPI
18
+ .getJSON(endpoint)
19
+ .pipe((0, operators_1.mergeMap)((response) => {
20
+ if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
21
+ return (0, rxjs_1.of)(
22
+ // Publish the source deposit account into the shared entity
23
+ // bucket so the selector can hydrate the full `FundingAccount`
24
+ // from `getDepositAccountByDepositAccountId` rather than the
25
+ // auto-sweep slice holding a duplicate copy.
26
+ (0, depositAccountReducer_1.updateDepositAccounts)([response.data.source_bank_account]), (0, autoSweepFlowReducer_1.updateCashManagementSettings)({ data: response.data }));
27
+ }
28
+ return (0, rxjs_1.of)((0, autoSweepFlowReducer_1.updateCashManagementSettingsFetchStatus)({
29
+ fetchState: 'Error',
30
+ error: response.status,
31
+ }));
32
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, autoSweepFlowReducer_1.updateCashManagementSettingsFetchStatus)({
33
+ fetchState: 'Error',
34
+ error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch cash management settings REST API call errored out: ' +
35
+ (error?.message ?? String(error))),
36
+ }))));
37
+ }));
38
+ exports.fetchCashManagementSettingsEpic = fetchCashManagementSettingsEpic;
@@ -0,0 +1,7 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { RootState } from '../../../../../reducer';
4
+ import { ZeniAPI } from '../../../../../zeniAPI';
5
+ import { saveAutoSweepSettings, updateAutoSweepSettingsFetchStatus } from '../autoSweepFlowReducer';
6
+ export type ActionType = ReturnType<typeof saveAutoSweepSettings> | ReturnType<typeof updateAutoSweepSettingsFetchStatus>;
7
+ export declare const saveAutoSweepSettingsEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;