@zeniai/client-epic-state 5.1.0-betaSS3 → 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 +21 -49
  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 +22 -50
  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,7 +1,7 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.clearBillPaySetupApproverView = exports.setListeningToPusherEvent = exports.clearBillPaySetupApproverViewUpdateData = exports.saveBillPaySetupApproverViewUpdateData = exports.initializeBillPaySetupApproverViewUpdateData = exports.saveBillPaySetupApproverViewUpdatesFailure = exports.saveBillPaySetupApproverViewUpdatesSuccess = exports.saveBillPaySetupApproverViewUpdates = exports.deleteBillPayApprovalRuleFailure = exports.deleteBillPayApprovalRuleSuccess = exports.deleteBillPayApprovalRule = exports.fetchBillPayApproversListFailure = exports.fetchBillPayApproversListSuccess = exports.fetchBillPayApproversList = exports.fetchBillPayApproversDetails = exports.fetchBillPaySetupApproverViewFailure = exports.fetchBillPaySetupApproverViewSuccess = exports.fetchBillPaySetupApproverView = exports.initialState = void 0;
4
+ exports.clearBillPaySetupApproverView = exports.setListeningToPusherEvent = exports.clearBillPaySetupApproverViewUpdateData = exports.saveBillPaySetupApproverViewUpdateData = exports.initializeBillPaySetupApproverViewUpdateData = exports.saveBillPaySetupApproverViewUpdatesFailure = exports.saveBillPaySetupApproverViewUpdatesSuccess = exports.saveBillPaySetupApproverViewUpdates = exports.reorderBillPayApprovalRulesFailure = exports.reorderBillPayApprovalRulesSuccess = exports.reorderBillPayApprovalRules = exports.deleteBillPayApprovalRuleFailure = exports.deleteBillPayApprovalRuleSuccess = exports.deleteBillPayApprovalRule = exports.fetchBillPayApproversListFailure = exports.fetchBillPayApproversListSuccess = exports.fetchBillPayApproversList = exports.fetchBillPayApproversDetails = exports.fetchBillPaySetupApproverViewFailure = exports.fetchBillPaySetupApproverViewSuccess = exports.fetchBillPaySetupApproverView = exports.initialState = void 0;
5
5
  const toolkit_1 = require("@reduxjs/toolkit");
6
6
  exports.initialState = {
7
7
  fetchState: 'Not-Started',
@@ -17,6 +17,7 @@ exports.initialState = {
17
17
  newApprovalRuleId: undefined,
18
18
  approvalRulesDeleteStatusById: {},
19
19
  billPaySetupApproverViewUpdateData: undefined,
20
+ reorderStatus: { fetchState: 'Not-Started', error: undefined },
20
21
  hasValidState() {
21
22
  return this.fetchState === 'Completed';
22
23
  },
@@ -30,8 +31,13 @@ const billPaySetupApproverView = (0, toolkit_1.createSlice)({
30
31
  draft.fetchState = 'In-Progress';
31
32
  draft.error = undefined;
32
33
  },
33
- prepare(cacheOverride = false, includeUserRoles = true) {
34
- return { payload: { cacheOverride, includeUserRoles } };
34
+ // Approval Rules 3.0 `useV3` arrives from the screen connector
35
+ // ('approval_rule_v3_config' dynamic config) and picks the v1
36
+ // vs v2 endpoint in the fetch epic. Required (no default) so a
37
+ // missing screen-connector wire surfaces at compile time rather
38
+ // than silently falling back to v1 on a v3 tenant.
39
+ prepare(cacheOverride = false, includeUserRoles = true, useV3) {
40
+ return { payload: { cacheOverride, includeUserRoles, useV3 } };
35
41
  },
36
42
  },
37
43
  fetchBillPaySetupApproverViewSuccess: {
@@ -116,8 +122,12 @@ const billPaySetupApproverView = (0, toolkit_1.createSlice)({
116
122
  error: undefined,
117
123
  };
118
124
  },
119
- prepare(approvalRuleId) {
120
- return { payload: { approvalRuleId } };
125
+ // Approval Rules 3.0 — `useV3` flows from the screen connector
126
+ // ('approval_rule_v3_config' dynamic config) so the delete epic
127
+ // can pick the v1 vs v2 endpoint. Required (no default) so a
128
+ // missing connector wire surfaces at compile time.
129
+ prepare(approvalRuleId, useV3) {
130
+ return { payload: { approvalRuleId, useV3 } };
121
131
  },
122
132
  },
123
133
  deleteBillPayApprovalRuleSuccess: {
@@ -149,13 +159,100 @@ const billPaySetupApproverView = (0, toolkit_1.createSlice)({
149
159
  };
150
160
  },
151
161
  },
152
- saveBillPaySetupApproverViewUpdates(draft) {
153
- if (draft.billPaySetupApproverViewUpdateData != null) {
154
- draft.billPaySetupApproverViewUpdateData.updateStatus = {
155
- fetchState: 'In-Progress',
156
- error: undefined,
157
- };
158
- }
162
+ /**
163
+ * Approval Rules 3.0 list-page drag-and-drop reorder.
164
+ *
165
+ * The trigger action carries the desired ordering as an ID list.
166
+ * The reducer optimistically replaces 'approvalRuleIds' so the
167
+ * list page renders the new order immediately; the epic then
168
+ * fires the PUT and either confirms (success — pulls updated
169
+ * priorities from the response) or recovers (failure — refetches
170
+ * the view so we don't strand a stale local order).
171
+ */
172
+ reorderBillPayApprovalRules: {
173
+ reducer(draft, action) {
174
+ const { approvalRuleIds } = action.payload;
175
+ const wasReorderInFlight = draft.reorderStatus.fetchState === 'In-Progress';
176
+ draft.reorderStatus = { fetchState: 'In-Progress', error: undefined };
177
+ // Stash the pre-reorder order so 'Failure' can restore it
178
+ // synchronously. The epic's refetch on failure remains as a
179
+ // safety net (covers cases where the server's truth has
180
+ // drifted from the local snapshot), but the snappy UX path
181
+ // is the in-memory rollback.
182
+ //
183
+ // Only capture a fresh snapshot when no reorder is already in
184
+ // flight. If a second drag fires before the first PUT lands,
185
+ // the existing snapshot already holds the last server-backed
186
+ // order; overwriting it with the first reorder's optimistic
187
+ // result would mean a Failure rolls back to an uncommitted
188
+ // intermediate order instead of the last good list.
189
+ if (!wasReorderInFlight) {
190
+ draft.reorderRollbackIds = draft.approvalRuleIds;
191
+ }
192
+ // Optimistic: render new order immediately. On failure, the
193
+ // reducer restores 'reorderRollbackIds' and the epic refetch
194
+ // reconciles any drift.
195
+ draft.approvalRuleIds = approvalRuleIds;
196
+ },
197
+ // Approval Rules 3.0 — `useV3` required so a missing wire
198
+ // surfaces at compile time. The reorder epic always hits the
199
+ // v2 endpoint (v1 has no reorder route), but the payload still
200
+ // carries the flag for the failure-path refetch which needs it.
201
+ prepare(approvalRuleIds, useV3) {
202
+ return { payload: { approvalRuleIds, useV3 } };
203
+ },
204
+ },
205
+ reorderBillPayApprovalRulesSuccess: {
206
+ reducer(draft, action) {
207
+ const { approvalRuleIds } = action.payload;
208
+ draft.reorderStatus = { fetchState: 'Completed', error: undefined };
209
+ // The API response is authoritative — overwrite with the
210
+ // server's reported order in case it normalised anything.
211
+ draft.approvalRuleIds = approvalRuleIds;
212
+ // Reorder succeeded — discard the snapshot so the next
213
+ // reorder starts from this committed order.
214
+ draft.reorderRollbackIds = undefined;
215
+ },
216
+ prepare(approvalRuleIds) {
217
+ return { payload: { approvalRuleIds } };
218
+ },
219
+ },
220
+ reorderBillPayApprovalRulesFailure: {
221
+ reducer(draft, action) {
222
+ const { status } = action.payload;
223
+ draft.reorderStatus = { fetchState: 'Error', error: status };
224
+ // Restore the snapshot taken on the trigger reducer before
225
+ // the optimistic mutation. The epic still fires a refetch
226
+ // alongside the failure action for cross-tab drift recovery,
227
+ // but locally the user sees their last good order instantly.
228
+ if (draft.reorderRollbackIds != null) {
229
+ draft.approvalRuleIds = draft.reorderRollbackIds;
230
+ draft.reorderRollbackIds = undefined;
231
+ }
232
+ },
233
+ prepare(status) {
234
+ return { payload: { status } };
235
+ },
236
+ },
237
+ saveBillPaySetupApproverViewUpdates: {
238
+ // Approval Rules 3.0 — `useV3` is sourced from the
239
+ // `approval_rule_v3_config` dynamic config in the screen
240
+ // connector. The reducer doesn't read it (the field only
241
+ // matters in the save epic), but it must be declared so the
242
+ // action's payload type is correctly inferred for downstream
243
+ // consumers.
244
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
245
+ reducer(draft, _action) {
246
+ if (draft.billPaySetupApproverViewUpdateData != null) {
247
+ draft.billPaySetupApproverViewUpdateData.updateStatus = {
248
+ fetchState: 'In-Progress',
249
+ error: undefined,
250
+ };
251
+ }
252
+ },
253
+ prepare(useV3) {
254
+ return { payload: { useV3 } };
255
+ },
159
256
  },
160
257
  saveBillPaySetupApproverViewUpdatesSuccess: {
161
258
  reducer(draft, action) {
@@ -244,5 +341,5 @@ const billPaySetupApproverView = (0, toolkit_1.createSlice)({
244
341
  },
245
342
  },
246
343
  });
247
- _a = billPaySetupApproverView.actions, exports.fetchBillPaySetupApproverView = _a.fetchBillPaySetupApproverView, exports.fetchBillPaySetupApproverViewSuccess = _a.fetchBillPaySetupApproverViewSuccess, exports.fetchBillPaySetupApproverViewFailure = _a.fetchBillPaySetupApproverViewFailure, exports.fetchBillPayApproversDetails = _a.fetchBillPayApproversDetails, exports.fetchBillPayApproversList = _a.fetchBillPayApproversList, exports.fetchBillPayApproversListSuccess = _a.fetchBillPayApproversListSuccess, exports.fetchBillPayApproversListFailure = _a.fetchBillPayApproversListFailure, exports.deleteBillPayApprovalRule = _a.deleteBillPayApprovalRule, exports.deleteBillPayApprovalRuleSuccess = _a.deleteBillPayApprovalRuleSuccess, exports.deleteBillPayApprovalRuleFailure = _a.deleteBillPayApprovalRuleFailure, exports.saveBillPaySetupApproverViewUpdates = _a.saveBillPaySetupApproverViewUpdates, exports.saveBillPaySetupApproverViewUpdatesSuccess = _a.saveBillPaySetupApproverViewUpdatesSuccess, exports.saveBillPaySetupApproverViewUpdatesFailure = _a.saveBillPaySetupApproverViewUpdatesFailure, exports.initializeBillPaySetupApproverViewUpdateData = _a.initializeBillPaySetupApproverViewUpdateData, exports.saveBillPaySetupApproverViewUpdateData = _a.saveBillPaySetupApproverViewUpdateData, exports.clearBillPaySetupApproverViewUpdateData = _a.clearBillPaySetupApproverViewUpdateData, exports.setListeningToPusherEvent = _a.setListeningToPusherEvent, exports.clearBillPaySetupApproverView = _a.clearBillPaySetupApproverView;
344
+ _a = billPaySetupApproverView.actions, exports.fetchBillPaySetupApproverView = _a.fetchBillPaySetupApproverView, exports.fetchBillPaySetupApproverViewSuccess = _a.fetchBillPaySetupApproverViewSuccess, exports.fetchBillPaySetupApproverViewFailure = _a.fetchBillPaySetupApproverViewFailure, exports.fetchBillPayApproversDetails = _a.fetchBillPayApproversDetails, exports.fetchBillPayApproversList = _a.fetchBillPayApproversList, exports.fetchBillPayApproversListSuccess = _a.fetchBillPayApproversListSuccess, exports.fetchBillPayApproversListFailure = _a.fetchBillPayApproversListFailure, exports.deleteBillPayApprovalRule = _a.deleteBillPayApprovalRule, exports.deleteBillPayApprovalRuleSuccess = _a.deleteBillPayApprovalRuleSuccess, exports.deleteBillPayApprovalRuleFailure = _a.deleteBillPayApprovalRuleFailure, exports.reorderBillPayApprovalRules = _a.reorderBillPayApprovalRules, exports.reorderBillPayApprovalRulesSuccess = _a.reorderBillPayApprovalRulesSuccess, exports.reorderBillPayApprovalRulesFailure = _a.reorderBillPayApprovalRulesFailure, exports.saveBillPaySetupApproverViewUpdates = _a.saveBillPaySetupApproverViewUpdates, exports.saveBillPaySetupApproverViewUpdatesSuccess = _a.saveBillPaySetupApproverViewUpdatesSuccess, exports.saveBillPaySetupApproverViewUpdatesFailure = _a.saveBillPaySetupApproverViewUpdatesFailure, exports.initializeBillPaySetupApproverViewUpdateData = _a.initializeBillPaySetupApproverViewUpdateData, exports.saveBillPaySetupApproverViewUpdateData = _a.saveBillPaySetupApproverViewUpdateData, exports.clearBillPaySetupApproverViewUpdateData = _a.clearBillPaySetupApproverViewUpdateData, exports.setListeningToPusherEvent = _a.setListeningToPusherEvent, exports.clearBillPaySetupApproverView = _a.clearBillPaySetupApproverView;
248
345
  exports.default = billPaySetupApproverView.reducer;
@@ -9,8 +9,24 @@ export interface BillPaySetupApproverViewState extends FetchedState {
9
9
  attributes: AttributeType[];
10
10
  fetchStatus: FetchStateAndError;
11
11
  };
12
+ /**
13
+ * Tracks the in-flight status of the list-page reorder PUT
14
+ * (approval-rules-v2/reorder). The reducer optimistically updates
15
+ * 'approvalRuleIds' on the trigger action. On Failure the reducer
16
+ * restores the snapshot below before the epic's safety-net refetch
17
+ * fires, so the UI bounces back to the user's last good order
18
+ * without waiting for a network roundtrip.
19
+ */
20
+ reorderStatus: FetchStateAndError;
12
21
  affectedEntityIds?: ID[];
13
22
  billPaySetupApproverViewUpdateData?: ApproverViewUpdateData;
14
23
  listeningToPusherEvent?: boolean;
15
24
  newApprovalRuleId?: ID;
25
+ /**
26
+ * Pre-reorder snapshot of 'approvalRuleIds'. Stashed on the trigger
27
+ * reducer right before the optimistic mutation and consumed on
28
+ * Failure to restore the previous order. Cleared on Success so the
29
+ * next reorder starts from a clean slate.
30
+ */
31
+ reorderRollbackIds?: ID[];
16
32
  }
@@ -9,9 +9,17 @@ const userReducer_1 = require("../../../../../entity/user/userReducer");
9
9
  const responsePayload_1 = require("../../../../../responsePayload");
10
10
  const billPaySetupApproverViewReducer_1 = require("../billPaySetupApproverViewReducer");
11
11
  const deleteBillPayApprovalRuleEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(billPaySetupApproverViewReducer_1.deleteBillPayApprovalRule.match), (0, operators_1.switchMap)((action) => {
12
- const { approvalRuleId } = action.payload;
12
+ const { approvalRuleId, useV3 } = action.payload;
13
+ // Approval Rules 3.0 — flag-gated endpoint selection.
14
+ // Explicit `=== true` keeps `strict-boolean-expressions` happy
15
+ // when RTK's payload type widens to `any` in some configs.
16
+ const endpoint = useV3 === true
17
+ ? `${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/bill-pay/approval-rules-v2`
18
+ : `${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/bill-pay/approval-rules`;
13
19
  return zeniAPI
14
- .deleteAndGetJSON(`${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/bill-pay/approval-rules`, { approval_rule_id: approvalRuleId })
20
+ .deleteAndGetJSON(endpoint, {
21
+ approval_rule_id: approvalRuleId,
22
+ })
15
23
  .pipe((0, operators_1.mergeMap)((response) => {
16
24
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
17
25
  const approvalRuleIds = response.data.approval_rules.map((approvalRule) => approvalRule.approval_rule_id);
@@ -9,7 +9,7 @@ const userReducer_1 = require("../../../../../entity/user/userReducer");
9
9
  const responsePayload_1 = require("../../../../../responsePayload");
10
10
  const billPaySetupApproverViewReducer_1 = require("../billPaySetupApproverViewReducer");
11
11
  const fetchBillPaySetupApproverViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(billPaySetupApproverViewReducer_1.fetchBillPaySetupApproverView.match), (0, operators_1.switchMap)((action) => {
12
- const { cacheOverride } = action.payload;
12
+ const { cacheOverride, useV3 } = action.payload;
13
13
  const { billPaySetupApproverViewState, approvalRuleState } = state$.value;
14
14
  const approvalRules = (0, approvalRuleSelector_1.getApprovalRulesByIds)(approvalRuleState, billPaySetupApproverViewState.approvalRuleIds);
15
15
  if (cacheOverride === true ||
@@ -17,9 +17,13 @@ const fetchBillPaySetupApproverViewEpic = (actions$, state$, zeniAPI) => actions
17
17
  billPaySetupApproverViewState.approvalRuleIds.length ||
18
18
  (billPaySetupApproverViewState.hasValidState() === false &&
19
19
  billPaySetupApproverViewState.fetchState !== 'In-Progress')) {
20
- return zeniAPI
21
- .getJSON(`${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/bill-pay/approval-rules`)
22
- .pipe((0, operators_1.mergeMap)((response) => {
20
+ // Approval Rules 3.0 — flag-gated endpoint selection.
21
+ // Explicit `=== true` keeps `strict-boolean-expressions` happy
22
+ // when RTK's payload type widens to `any` in some configs.
23
+ const endpoint = useV3 === true
24
+ ? `${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/bill-pay/approval-rules-v2`
25
+ : `${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/bill-pay/approval-rules`;
26
+ return zeniAPI.getJSON(endpoint).pipe((0, operators_1.mergeMap)((response) => {
23
27
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
24
28
  const approvalRuleIds = response.data.approval_rules.map((approvalRule) => approvalRule.approval_rule_id);
25
29
  const actions = [
@@ -11,16 +11,20 @@ const initializeBillPaySetupApproverViewUpdateDataEpic = (actions$, state$) => a
11
11
  if (approvalRuleId != null) {
12
12
  const approvalRule = (0, approvalRuleSelector_1.getApprovalRuleById)(state$.value.approvalRuleState, approvalRuleId);
13
13
  if (approvalRule != null) {
14
- const criteria = approvalRule.criteria[0];
15
- const range = criteria?.range;
16
14
  const billPaySetupApproverViewUpdateData = {
17
15
  approvalRuleId,
18
16
  steps: approvalRule.steps,
19
17
  criteria: {
20
- rangeType: criteria?.rangeType,
21
- rangeEntity: criteria?.rangeEntity,
22
- range,
18
+ amount: (0, approvalRuleSelector_1.getAmountCriteria)(approvalRule.criteria),
19
+ vendor: (0, approvalRuleSelector_1.getVendorCriteria)(approvalRule.criteria),
20
+ department: (0, approvalRuleSelector_1.getDepartmentCriteria)(approvalRule.criteria),
23
21
  },
22
+ // Approval Rules 3.0 — seed rule-level fields so the form can
23
+ // round-trip them on edit. Each may be undefined on legacy rules.
24
+ name: approvalRule.name,
25
+ description: approvalRule.description,
26
+ separationOfDuties: approvalRule.separationOfDuties,
27
+ isFallback: approvalRule.isFallback,
24
28
  };
25
29
  fetchActions.push((0, billPaySetupApproverViewReducer_1.clearBillPaySetupApproverViewUpdateData)(), (0, billPaySetupApproverViewReducer_1.saveBillPaySetupApproverViewUpdateData)(billPaySetupApproverViewUpdateData));
26
30
  }
@@ -28,7 +32,7 @@ const initializeBillPaySetupApproverViewUpdateDataEpic = (actions$, state$) => a
28
32
  else {
29
33
  const billPaySetupApproverViewCreateData = {
30
34
  steps: [],
31
- criteria: undefined,
35
+ criteria: {},
32
36
  };
33
37
  fetchActions.push((0, billPaySetupApproverViewReducer_1.clearBillPaySetupApproverViewUpdateData)(), (0, billPaySetupApproverViewReducer_1.saveBillPaySetupApproverViewUpdateData)(billPaySetupApproverViewCreateData));
34
38
  }
@@ -0,0 +1,23 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { updateApprovalRules } from '../../../../../entity/approvalRule/approvalRuleReducer';
4
+ import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
5
+ import { RootState } from '../../../../../reducer';
6
+ import { ZeniAPI } from '../../../../../zeniAPI';
7
+ import { fetchBillPaySetupApproverView, reorderBillPayApprovalRules, reorderBillPayApprovalRulesFailure, reorderBillPayApprovalRulesSuccess } from '../billPaySetupApproverViewReducer';
8
+ /**
9
+ * Approval Rules 3.0 — list-page drag-and-drop reorder.
10
+ *
11
+ * PUT /bill-pay/approval-rules-v2/reorder with the new ID order in
12
+ * 'rule_ids'. Returns the updated 'approval_rules' (with refreshed
13
+ * priorities). The reducer optimistically updated 'approvalRuleIds'
14
+ * on the trigger action, so:
15
+ * - on success: dispatch the updated approval rule payloads into
16
+ * the entity slice, then 'Success' to normalise the slice's
17
+ * ordered ID list to whatever the server returned.
18
+ * - on failure: snackbar + dispatch 'fetchBillPaySetupApproverView'
19
+ * with cacheOverride to roll the optimistic state back to server
20
+ * truth.
21
+ */
22
+ export type ActionType = ReturnType<typeof reorderBillPayApprovalRules> | ReturnType<typeof reorderBillPayApprovalRulesSuccess> | ReturnType<typeof reorderBillPayApprovalRulesFailure> | ReturnType<typeof updateApprovalRules> | ReturnType<typeof fetchBillPaySetupApproverView> | ReturnType<typeof openSnackbar>;
23
+ export declare const reorderBillPayApprovalRulesEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.reorderBillPayApprovalRulesEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const approvalRuleReducer_1 = require("../../../../../entity/approvalRule/approvalRuleReducer");
7
+ const snackbarReducer_1 = require("../../../../../entity/snackbar/snackbarReducer");
8
+ const responsePayload_1 = require("../../../../../responsePayload");
9
+ const billPaySetupApproverViewReducer_1 = require("../billPaySetupApproverViewReducer");
10
+ const reorderBillPayApprovalRulesEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(billPaySetupApproverViewReducer_1.reorderBillPayApprovalRules.match), (0, operators_1.switchMap)((action) => {
11
+ const { approvalRuleIds, useV3 } = action.payload;
12
+ // Approval Rules 3.0 — flag-gated endpoint selection. Mirrors
13
+ // the pattern used by delete + fetch epics: the v3 dev host
14
+ // until the production base URL ships the v2 reorder route.
15
+ const endpoint = `${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/bill-pay/approval-rules-v2/reorder`;
16
+ return zeniAPI
17
+ .putAndGetJSON(endpoint, {
18
+ rule_ids: approvalRuleIds,
19
+ })
20
+ .pipe((0, operators_1.mergeMap)((response) => {
21
+ if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
22
+ const serverOrderedIds = response.data.approval_rules.map((approvalRule) => approvalRule.approval_rule_id);
23
+ const actions = [
24
+ (0, approvalRuleReducer_1.updateApprovalRules)(response.data.approval_rules),
25
+ (0, billPaySetupApproverViewReducer_1.reorderBillPayApprovalRulesSuccess)(serverOrderedIds),
26
+ (0, snackbarReducer_1.openSnackbar)({
27
+ messageSection: `bill_pay_approval_reorder`,
28
+ messageText: 'success',
29
+ type: 'success',
30
+ }),
31
+ ];
32
+ return (0, rxjs_1.from)(actions);
33
+ }
34
+ else {
35
+ const recovery = [
36
+ (0, billPaySetupApproverViewReducer_1.reorderBillPayApprovalRulesFailure)(response.status),
37
+ (0, snackbarReducer_1.openSnackbar)({
38
+ messageSection: `bill_pay_approval_reorder`,
39
+ messageText: 'failed',
40
+ type: 'error',
41
+ }),
42
+ // Refetch to revert the optimistic order to server truth.
43
+ (0, billPaySetupApproverViewReducer_1.fetchBillPaySetupApproverView)(true, true, useV3),
44
+ ];
45
+ return (0, rxjs_1.from)(recovery);
46
+ }
47
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.from)([
48
+ (0, billPaySetupApproverViewReducer_1.reorderBillPayApprovalRulesFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Reorder Bill Pay Approval Rules errored out' +
49
+ JSON.stringify(error))),
50
+ (0, snackbarReducer_1.openSnackbar)({
51
+ messageSection: `bill_pay_approval_reorder`,
52
+ messageText: 'failed',
53
+ type: 'error',
54
+ }),
55
+ (0, billPaySetupApproverViewReducer_1.fetchBillPaySetupApproverView)(true, true, useV3),
56
+ ])));
57
+ }));
58
+ exports.reorderBillPayApprovalRulesEpic = reorderBillPayApprovalRulesEpic;
@@ -9,14 +9,23 @@ const userReducer_1 = require("../../../../../entity/user/userReducer");
9
9
  const responsePayload_1 = require("../../../../../responsePayload");
10
10
  const billPaySetupApproverViewReducer_1 = require("../billPaySetupApproverViewReducer");
11
11
  const commonPayload_1 = require("../types/commonPayload");
12
- const saveBillPaySetupApproverViewUpdatesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(billPaySetupApproverViewReducer_1.saveBillPaySetupApproverViewUpdates.match), (0, operators_1.switchMap)(() => {
12
+ const saveBillPaySetupApproverViewUpdatesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(billPaySetupApproverViewReducer_1.saveBillPaySetupApproverViewUpdates.match), (0, operators_1.switchMap)((action) => {
13
13
  const { billPaySetupApproverViewState } = state$.value;
14
14
  const billPaySetupApproverViewUpdateData = billPaySetupApproverViewState.billPaySetupApproverViewUpdateData;
15
15
  if (billPaySetupApproverViewUpdateData != null &&
16
16
  billPaySetupApproverViewUpdateData.data != null) {
17
- const payload = (0, commonPayload_1.toApprovalChangableInfoPayload)(billPaySetupApproverViewUpdateData.data);
17
+ // Approval Rules 3.0 — gate URL + write-side payload mapper on
18
+ // the `approval_rule_v3_config` dynamic config. `useV3` arrives
19
+ // on the action payload from the screen connector.
20
+ const { useV3 } = action.payload;
21
+ const payload = useV3
22
+ ? (0, commonPayload_1.toApprovalChangableInfoPayload)(billPaySetupApproverViewUpdateData.data)
23
+ : (0, commonPayload_1.toApprovalChangableInfoPayloadV1)(billPaySetupApproverViewUpdateData.data);
24
+ const endpoint = useV3
25
+ ? `${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/bill-pay/approval-rules-v2`
26
+ : `${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/bill-pay/approval-rules`;
18
27
  return zeniAPI
19
- .postAndGetJSON(`${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/bill-pay/approval-rules`, payload)
28
+ .postAndGetJSON(endpoint, payload)
20
29
  .pipe((0, operators_1.mergeMap)((response) => {
21
30
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
22
31
  const approvalRuleIds = response.data.approval_rules.map((approvalRule) => approvalRule.approval_rule_id);
@@ -14,9 +14,67 @@ interface ApproverViewStepPayload extends Omit<StepPayload, 'actors'> {
14
14
  }
15
15
  interface ApprovalUpdatableInfoPayload {
16
16
  approval_rule_id: ID;
17
- criteria: CriteriaPayload[];
17
+ criteria: CriteriaPayload;
18
18
  is_applicable_on_pending_approval_entity: boolean;
19
19
  steps: ApproverViewStepPayload[];
20
+ description?: string;
21
+ is_fallback?: boolean;
22
+ is_separation_of_duty_enabled?: boolean;
23
+ /**
24
+ * Approval Rules 3.0 — rule-level wire fields. The backend accepts these
25
+ * as optional today; once 3.0 ships they become first-class. The SoD
26
+ * field name matches the GET response shape (confirmed with backend),
27
+ * so the same identifier flows both directions on the wire.
28
+ */
29
+ name?: string;
30
+ }
31
+ /**
32
+ * V1 / pre-3.0 wire shape. Kept so the rollback flag (gated by
33
+ * 'approval_rule_v3_config' dynamic config) can target the original
34
+ * '/approval-rules' endpoint with the legacy snake_case array of
35
+ * range entries. None of the 3.0 rule-level fields are sent.
36
+ *
37
+ * Reference: 'entityApprovalStatusPayload.json' fixture, which carries
38
+ * a real V1 approval rule from the legacy backend:
39
+ * criteria: [{type: 'range', range_entity: 'currency',
40
+ * min, max, currency_code, currency_symbol}]
41
+ * with 'min' / 'max' as scalar numbers and 'null' representing an
42
+ * absent bound for one-sided rules. The read-side mapper in
43
+ * 'approvalRulePayload.ts' (see 'LegacyAmountRangeCriterionPayload')
44
+ * decodes the same shape — write-side has to match.
45
+ */
46
+ interface ApprovalUpdatableInfoPayloadV1CriterionEntry {
47
+ currency_code: string;
48
+ currency_symbol: string;
49
+ /** Upper bound. 'null' for a 'greater_than' (open-upper) rule. */
50
+ max: number | null;
51
+ /** Lower bound. 'null' for a 'less_than' (open-lower) rule. */
52
+ min: number | null;
53
+ range_entity: 'currency';
54
+ type: 'range';
55
+ }
56
+ interface ApprovalUpdatableInfoPayloadV1 {
57
+ criteria: ApprovalUpdatableInfoPayloadV1CriterionEntry[];
58
+ is_applicable_on_pending_approval_entity: boolean;
59
+ steps: ApproverViewStepPayload[];
60
+ approval_rule_id?: ID;
20
61
  }
21
62
  export declare const toApprovalChangableInfoPayload: (approverViewUpdateData: ApprovalRuleUpdateData | ApprovalRuleCreateData) => Partial<ApprovalUpdatableInfoPayload>;
63
+ /**
64
+ * V1 wire mapper — used when 'approval_rule_v3_config' resolves to OFF
65
+ * for the current tenant. Emits the legacy snake_case array shape that
66
+ * '/approval-rules' historically consumed (see the V1 fixture in
67
+ * 'entity/entityApprovalStatus/__mocks__/json/entityApprovalStatusPayload.json'):
68
+ * criteria: [{type: 'range', range_entity: 'currency', min, max,
69
+ * currency_code, currency_symbol}]
70
+ *
71
+ * Open-ended semantics are preserved on the wire: an absent 'min' or
72
+ * 'max' is sent as 'null' rather than synthesised to '0' or
73
+ * 'MAX_SAFE_INTEGER', so a 'greater_than' / 'less_than' rule stays
74
+ * one-sided after rollback rather than collapsing into a closed range.
75
+ *
76
+ * The V1 backend does not understand vendor / department criteria or
77
+ * the rule-level 3.0 fields, so those are dropped on the wire.
78
+ */
79
+ export declare const toApprovalChangableInfoPayloadV1: (approverViewUpdateData: ApprovalRuleUpdateData | ApprovalRuleCreateData) => Partial<ApprovalUpdatableInfoPayloadV1>;
22
80
  export {};
@@ -1,23 +1,51 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toApprovalChangableInfoPayload = void 0;
3
+ exports.toApprovalChangableInfoPayloadV1 = exports.toApprovalChangableInfoPayload = void 0;
4
4
  const toApprovalChangableInfoPayload = (approverViewUpdateData) => {
5
- let criteriaPayload = [];
5
+ // Form-side criteria is a structured object with optional slots for
6
+ // amount / vendor / department; flatten it into the wire format's
7
+ // `conditions[]` array.
8
+ let criteriaPayload;
6
9
  if (approverViewUpdateData.criteria != null) {
7
- const criteria = approverViewUpdateData.criteria;
8
- const { rangeType, rangeEntity, range } = criteria;
9
- const { min, max } = range;
10
- const { currencyCode, currencySymbol } = min;
11
- criteriaPayload = [
12
- {
13
- type: rangeType,
14
- range_entity: rangeEntity,
15
- min: min.amount,
16
- max: max?.amount ?? null,
17
- currency_code: currencyCode,
18
- currency_symbol: currencySymbol,
19
- },
20
- ];
10
+ const { amount, vendor, department } = approverViewUpdateData.criteria;
11
+ const conditions = [];
12
+ if (amount?.min != null) {
13
+ conditions.push({
14
+ field: 'amount',
15
+ type: 'gte',
16
+ value: amount.min.amount,
17
+ });
18
+ }
19
+ if (amount?.max != null) {
20
+ conditions.push({
21
+ field: 'amount',
22
+ type: 'lte',
23
+ value: amount.max.amount,
24
+ });
25
+ }
26
+ if (vendor != null && vendor.vendorIds.length > 0) {
27
+ conditions.push({
28
+ field: 'vendor_id',
29
+ type: vendor.operator === 'is_not' ? 'not_in' : 'in',
30
+ value: vendor.vendorIds,
31
+ });
32
+ }
33
+ if (department != null && department.departmentIds.length > 0) {
34
+ conditions.push({
35
+ field: 'department_id',
36
+ type: department.operator === 'is_not' ? 'not_in' : 'in',
37
+ value: department.departmentIds,
38
+ });
39
+ }
40
+ if (conditions.length > 0) {
41
+ const currency = amount?.min ?? amount?.max ?? null;
42
+ criteriaPayload = {
43
+ conditions,
44
+ criteria_operator: 'and',
45
+ currency_code: currency?.currencyCode ?? 'USD',
46
+ currency_symbol: currency?.currencySymbol ?? '$',
47
+ };
48
+ }
21
49
  }
22
50
  const steps = approverViewUpdateData.steps.map((step) => {
23
51
  return {
@@ -38,13 +66,110 @@ const toApprovalChangableInfoPayload = (approverViewUpdateData) => {
38
66
  });
39
67
  const isUpdate = approverViewUpdateData.approvalRuleId != null;
40
68
  const payload = {
41
- criteria: criteriaPayload,
42
69
  steps,
43
70
  is_applicable_on_pending_approval_entity: approverViewUpdateData.isApplicableOnPendingApprovalEntity ?? true,
44
71
  };
72
+ if (criteriaPayload != null) {
73
+ payload.criteria = criteriaPayload;
74
+ }
75
+ // Approval Rules 3.0 — surface rule-level fields when the form set them.
76
+ // Send only what the user actually entered: an undefined value means
77
+ // "no opinion" and stays off the wire.
78
+ if (approverViewUpdateData.name != null) {
79
+ payload.name = approverViewUpdateData.name;
80
+ }
81
+ if (approverViewUpdateData.description != null) {
82
+ payload.description = approverViewUpdateData.description;
83
+ }
84
+ if (approverViewUpdateData.separationOfDuties != null) {
85
+ payload.is_separation_of_duty_enabled =
86
+ approverViewUpdateData.separationOfDuties;
87
+ }
88
+ if (approverViewUpdateData.isFallback != null) {
89
+ payload.is_fallback = approverViewUpdateData.isFallback;
90
+ }
45
91
  if (isUpdate) {
46
92
  payload.approval_rule_id = approverViewUpdateData.approvalRuleId;
47
93
  }
48
94
  return payload;
49
95
  };
50
96
  exports.toApprovalChangableInfoPayload = toApprovalChangableInfoPayload;
97
+ /**
98
+ * V1 wire mapper — used when 'approval_rule_v3_config' resolves to OFF
99
+ * for the current tenant. Emits the legacy snake_case array shape that
100
+ * '/approval-rules' historically consumed (see the V1 fixture in
101
+ * 'entity/entityApprovalStatus/__mocks__/json/entityApprovalStatusPayload.json'):
102
+ * criteria: [{type: 'range', range_entity: 'currency', min, max,
103
+ * currency_code, currency_symbol}]
104
+ *
105
+ * Open-ended semantics are preserved on the wire: an absent 'min' or
106
+ * 'max' is sent as 'null' rather than synthesised to '0' or
107
+ * 'MAX_SAFE_INTEGER', so a 'greater_than' / 'less_than' rule stays
108
+ * one-sided after rollback rather than collapsing into a closed range.
109
+ *
110
+ * The V1 backend does not understand vendor / department criteria or
111
+ * the rule-level 3.0 fields, so those are dropped on the wire.
112
+ */
113
+ const toApprovalChangableInfoPayloadV1 = (approverViewUpdateData) => {
114
+ const amount = approverViewUpdateData.criteria?.amount;
115
+ const minAmount = amount?.min;
116
+ const maxAmount = amount?.max;
117
+ const currencyCode = minAmount?.currencyCode ?? maxAmount?.currencyCode ?? 'USD';
118
+ const currencySymbol = minAmount?.currencySymbol ?? maxAmount?.currencySymbol ?? '$';
119
+ const steps = approverViewUpdateData.steps.map((step) => {
120
+ return {
121
+ action: step.action,
122
+ operator: step.operator,
123
+ actors: step.actors
124
+ .filter((actor) => actor.subType !== 'admin')
125
+ .map((actor) => {
126
+ return {
127
+ type: actor.type,
128
+ id: actor.userId ?? null,
129
+ sub_type: actor.subType ?? null,
130
+ id_type: actor.idType ?? null,
131
+ is_implicit_actor: actor.isImplicitActor ?? false,
132
+ };
133
+ }),
134
+ };
135
+ });
136
+ const isUpdate = approverViewUpdateData.approvalRuleId != null;
137
+ const minValue = minAmount?.amount ?? null;
138
+ const maxValue = maxAmount?.amount ?? null;
139
+ // Approval Rules 3.0 — guard against the both-null case. The form
140
+ // is expected to always set at least one bound, but if drift ever
141
+ // hands us a rule with no min and no max we'd otherwise emit
142
+ // '[{type: range, min: null, max: null, ...}]' — a payload that
143
+ // (a) the read-side 'legacyAmountRangeToCriteria' decodes back to
144
+ // '[]' (asymmetric round-trip), and (b) the V1 backend will
145
+ // reject anyway. Emit 'criteria: []' instead so the save fails
146
+ // cleanly on the server side and we leave a breadcrumb in the
147
+ // console for diagnosis rather than persisting mis-shaped data.
148
+ const criteria = [];
149
+ if (minValue == null && maxValue == null) {
150
+ console.warn('[approvalRules][V1] toApprovalChangableInfoPayloadV1: rule has ' +
151
+ 'no amount bounds; emitting empty criteria array. The V1 backend ' +
152
+ 'will reject this save — caller should ensure at least one bound ' +
153
+ 'is set on the form.');
154
+ }
155
+ else {
156
+ criteria.push({
157
+ type: 'range',
158
+ range_entity: 'currency',
159
+ min: minValue,
160
+ max: maxValue,
161
+ currency_code: currencyCode,
162
+ currency_symbol: currencySymbol,
163
+ });
164
+ }
165
+ const payload = {
166
+ steps,
167
+ is_applicable_on_pending_approval_entity: approverViewUpdateData.isApplicableOnPendingApprovalEntity ?? true,
168
+ criteria,
169
+ };
170
+ if (isUpdate) {
171
+ payload.approval_rule_id = approverViewUpdateData.approvalRuleId;
172
+ }
173
+ return payload;
174
+ };
175
+ exports.toApprovalChangableInfoPayloadV1 = toApprovalChangableInfoPayloadV1;