@zeniai/client-epic-state 4.20.3-betaSS12 → 4.20.3-betaSS14

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 (431) hide show
  1. package/lib/common/aiCfo/aiCfoSuggestedQuestionsPageContext.d.ts +19 -0
  2. package/lib/common/aiCfo/aiCfoSuggestedQuestionsPageContext.js +2 -0
  3. package/lib/commonPayloadTypes/subAccountView/reportBySubAccountPayload.d.ts +2 -0
  4. package/lib/commonStateTypes/animations.d.ts +1 -1
  5. package/lib/commonStateTypes/animations.js +4 -0
  6. package/lib/commonStateTypes/coaBalance/coaBalancesFilterProjectView.d.ts +13 -0
  7. package/lib/commonStateTypes/coaBalance/coaBalancesFilterProjectView.js +9 -0
  8. package/lib/commonStateTypes/common.d.ts +1 -1
  9. package/lib/commonStateTypes/projectView/projectViewParentID.d.ts +5 -0
  10. package/lib/commonStateTypes/projectView/projectViewParentID.js +2 -0
  11. package/lib/commonStateTypes/viewAndReport/reportIDHelper.d.ts +1 -0
  12. package/lib/commonStateTypes/viewAndReport/reportIDHelper.js +3 -1
  13. package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
  14. package/lib/commonStateTypes/viewAndReport/viewAndReport.js +2 -0
  15. package/lib/entity/account/accountPayload.d.ts +2 -0
  16. package/lib/entity/account/accountReducer.d.ts +5 -2
  17. package/lib/entity/account/accountReducer.js +13 -5
  18. package/lib/entity/account/accountSelector.d.ts +7 -0
  19. package/lib/entity/account/accountSelector.js +4 -2
  20. package/lib/entity/account/accountState.d.ts +3 -1
  21. package/lib/entity/account/accountState.js +4 -1
  22. package/lib/entity/account/pickAndMergeForecastAccountReport.d.ts +1 -0
  23. package/lib/entity/account/subAccountSelector.d.ts +2 -0
  24. package/lib/entity/account/subAccountSelector.js +2 -0
  25. package/lib/entity/accountGroup/accountGroupSelector.d.ts +22 -0
  26. package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
  27. package/lib/entity/accountRecon/accountReconPayload.d.ts +1 -1
  28. package/lib/entity/accountRecon/accountReconPayload.js +4 -2
  29. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerPayload.d.ts +52 -0
  30. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerPayload.js +70 -0
  31. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerReducer.d.ts +10 -0
  32. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerReducer.js +51 -0
  33. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerSelector.d.ts +48 -0
  34. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerSelector.js +66 -0
  35. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerState.d.ts +52 -0
  36. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerState.js +37 -0
  37. package/lib/entity/aiCfo/aiCfoSelector.d.ts +1 -2
  38. package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +4 -4
  39. package/lib/entity/chargeCard/chargeCard.d.ts +1 -1
  40. package/lib/entity/class/classReducer.d.ts +4 -4
  41. package/lib/entity/class/classState.d.ts +1 -1
  42. package/lib/entity/depositAccountTransaction/depositAccountTransaction.d.ts +1 -1
  43. package/lib/entity/entityApprovalStatus/entityApprovalStatusState.d.ts +2 -2
  44. package/lib/entity/forecast/forecastState.d.ts +1 -1
  45. package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +38 -0
  46. package/lib/entity/jeSchedules/jeSchedulesPayload.js +78 -0
  47. package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +4 -1
  48. package/lib/entity/jeSchedules/jeSchedulesSelector.js +5 -1
  49. package/lib/entity/jeSchedules/jeSchedulesState.d.ts +37 -0
  50. package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +1 -1
  51. package/lib/entity/project/projectPayload.d.ts +13 -0
  52. package/lib/entity/project/projectPayload.js +30 -0
  53. package/lib/entity/project/projectReducer.d.ts +10 -0
  54. package/lib/entity/project/projectReducer.js +31 -0
  55. package/lib/entity/project/projectSelector.d.ts +5 -0
  56. package/lib/entity/project/projectSelector.js +12 -0
  57. package/lib/entity/project/projectState.d.ts +13 -0
  58. package/lib/entity/project/projectState.js +2 -0
  59. package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
  60. package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
  61. package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
  62. package/lib/entity/sectionProjectView/sectionProjectView.d.ts +13 -0
  63. package/lib/entity/sectionProjectView/sectionProjectView.js +6 -0
  64. package/lib/entity/sectionProjectView/sectionProjectViewEpic.d.ts +6 -0
  65. package/lib/entity/sectionProjectView/sectionProjectViewEpic.js +56 -0
  66. package/lib/entity/sectionProjectView/sectionProjectViewHelper.d.ts +11 -0
  67. package/lib/entity/sectionProjectView/sectionProjectViewHelper.js +15 -0
  68. package/lib/entity/sectionProjectView/sectionProjectViewReducer.d.ts +15 -0
  69. package/lib/entity/sectionProjectView/sectionProjectViewReducer.js +64 -0
  70. package/lib/entity/sectionProjectView/sectionProjectViewSelector.d.ts +11 -0
  71. package/lib/entity/sectionProjectView/sectionProjectViewSelector.js +57 -0
  72. package/lib/entity/sectionProjectView/sectionProjectViewSelectorTypes.d.ts +16 -0
  73. package/lib/entity/sectionProjectView/sectionProjectViewSelectorTypes.js +2 -0
  74. package/lib/entity/sectionProjectView/sectionProjectViewState.d.ts +4 -0
  75. package/lib/entity/sectionProjectView/sectionProjectViewState.js +2 -0
  76. package/lib/entity/snackbar/snackbarTypes.d.ts +2 -2
  77. package/lib/entity/snackbar/snackbarTypes.js +10 -0
  78. package/lib/entity/tenant/clearAllEpic.d.ts +8 -2
  79. package/lib/entity/tenant/clearAllEpic.js +12 -0
  80. package/lib/entity/tenant/tenantPayload.d.ts +2 -0
  81. package/lib/entity/tenant/tenantReducer.d.ts +5 -2
  82. package/lib/entity/tenant/tenantReducer.js +10 -2
  83. package/lib/entity/tenant/tenantSelector.d.ts +2 -0
  84. package/lib/entity/tenant/tenantSelector.js +17 -1
  85. package/lib/entity/tenant/tenantState.d.ts +2 -0
  86. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.d.ts +4 -1
  87. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.js +1 -0
  88. package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +11 -0
  89. package/lib/entity/transaction/payloadTypes/transactionPayload.js +114 -1
  90. package/lib/entity/transaction/stateTypes/scheduleTransaction.d.ts +1 -0
  91. package/lib/entity/transaction/stateTypes/transaction.d.ts +11 -0
  92. package/lib/entity/transaction/stateTypes/transactionLine.d.ts +1 -1
  93. package/lib/entity/userRole/userRoleType.d.ts +2 -2
  94. package/lib/epic.d.ts +22 -2
  95. package/lib/epic.js +22 -2
  96. package/lib/esm/common/aiCfo/aiCfoSuggestedQuestionsPageContext.js +1 -0
  97. package/lib/esm/commonStateTypes/animations.js +4 -0
  98. package/lib/esm/commonStateTypes/coaBalance/coaBalancesFilterProjectView.js +5 -0
  99. package/lib/esm/commonStateTypes/projectView/projectViewParentID.js +1 -0
  100. package/lib/esm/commonStateTypes/viewAndReport/reportIDHelper.js +1 -0
  101. package/lib/esm/commonStateTypes/viewAndReport/viewAndReport.js +2 -0
  102. package/lib/esm/entity/account/accountReducer.js +12 -4
  103. package/lib/esm/entity/account/accountSelector.js +4 -2
  104. package/lib/esm/entity/account/accountState.js +4 -1
  105. package/lib/esm/entity/account/subAccountSelector.js +2 -0
  106. package/lib/esm/entity/accountRecon/accountReconPayload.js +4 -2
  107. package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerPayload.js +64 -0
  108. package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerReducer.js +47 -0
  109. package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerSelector.js +62 -0
  110. package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerState.js +31 -0
  111. package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +78 -0
  112. package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +5 -1
  113. package/lib/esm/entity/project/projectPayload.js +26 -0
  114. package/lib/esm/entity/project/projectReducer.js +27 -0
  115. package/lib/esm/entity/project/projectSelector.js +8 -0
  116. package/lib/esm/entity/project/projectState.js +1 -0
  117. package/lib/esm/entity/sectionProjectView/sectionProjectView.js +3 -0
  118. package/lib/esm/entity/sectionProjectView/sectionProjectViewEpic.js +52 -0
  119. package/lib/esm/entity/sectionProjectView/sectionProjectViewHelper.js +11 -0
  120. package/lib/esm/entity/sectionProjectView/sectionProjectViewReducer.js +60 -0
  121. package/lib/esm/entity/sectionProjectView/sectionProjectViewSelector.js +50 -0
  122. package/lib/esm/entity/sectionProjectView/sectionProjectViewSelectorTypes.js +1 -0
  123. package/lib/esm/entity/sectionProjectView/sectionProjectViewState.js +1 -0
  124. package/lib/esm/entity/snackbar/snackbarTypes.js +10 -0
  125. package/lib/esm/entity/tenant/clearAllEpic.js +12 -0
  126. package/lib/esm/entity/tenant/tenantReducer.js +9 -1
  127. package/lib/esm/entity/tenant/tenantSelector.js +14 -0
  128. package/lib/esm/entity/transaction/payloadTypes/scheduleTransactionPayload.js +1 -0
  129. package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +114 -1
  130. package/lib/esm/epic.js +22 -2
  131. package/lib/esm/index.js +32 -19
  132. package/lib/esm/reducer.js +20 -2
  133. package/lib/esm/view/aiAccountantView/aiAccountantViewPayload.js +2 -0
  134. package/lib/esm/view/aiAccountantView/aiAccountantViewReducer.js +152 -0
  135. package/lib/esm/view/aiAccountantView/aiAccountantViewSelector.js +77 -0
  136. package/lib/esm/view/aiAccountantView/aiAccountantViewState.js +11 -0
  137. package/lib/esm/view/aiAccountantView/epics/cancelAiAccountantOnboardingEpic.js +46 -0
  138. package/lib/esm/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.js +27 -0
  139. package/lib/esm/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.js +47 -0
  140. package/lib/esm/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +76 -0
  141. package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +82 -1
  142. package/lib/esm/view/aiCfoView/aiCfoViewSelector.js +8 -2
  143. package/lib/esm/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +29 -0
  144. package/lib/esm/view/classList/fetchClassListEpic.js +9 -2
  145. package/lib/esm/view/commonVendorView/vendorView/vendorViewSelector.js +18 -5
  146. package/lib/esm/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +6 -2
  147. package/lib/esm/view/companyTaskManagerView/companyTaskManagerViewReducer.js +19 -1
  148. package/lib/esm/view/companyTaskManagerView/companyTaskManagerViewSelector.js +3 -1
  149. package/lib/esm/view/companyTaskManagerView/epics/fetchTaskManagerMetricsEpic.js +17 -0
  150. package/lib/esm/view/companyView/companyViewReducer.js +26 -1
  151. package/lib/esm/view/companyView/epic/companyPassport/updateAccountingClassesEnabledEpic.js +61 -0
  152. package/lib/esm/view/companyView/types/companyPassport/companyPassportViewState.js +4 -0
  153. package/lib/esm/view/creditAgentView/creditAgentViewReducer.js +74 -76
  154. package/lib/esm/view/creditAgentView/creditAgentViewSelector.js +0 -1
  155. package/lib/esm/view/creditAgentView/creditAgentViewState.js +1 -28
  156. package/lib/esm/view/creditAgentView/epics/downloadCreditReportEpic.js +20 -17
  157. package/lib/esm/view/creditAgentView/epics/fetchCardProfilesEpic.js +5 -5
  158. package/lib/esm/view/creditAgentView/epics/fetchCreditAgentAccessEpic.js +8 -8
  159. package/lib/esm/view/creditAgentView/epics/fetchCreditAgentMacroEpic.js +7 -7
  160. package/lib/esm/view/creditAgentView/epics/saveCreditAgentMacroEpic.js +8 -3
  161. package/lib/esm/view/creditAgentView/epics/updateCardProfileEpic.js +5 -11
  162. package/lib/esm/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.js +63 -0
  163. package/lib/esm/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +4 -9
  164. package/lib/esm/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.js +65 -0
  165. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +2 -2
  166. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadMatchResultToastEpic.js +33 -0
  167. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +3 -3
  168. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +6 -4
  169. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +20 -5
  170. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/refetchCompletedTransactionsOnBulkUploadSortEpic.js +12 -0
  171. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.js +98 -0
  172. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +7 -13
  173. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +21 -5
  174. package/lib/esm/view/expenseAutomationView/expenseAutomationViewSelector.js +0 -1
  175. package/lib/esm/view/expenseAutomationView/helpers/bulkUploadTiming.js +16 -0
  176. package/lib/esm/view/expenseAutomationView/helpers/rollingCalendarDateRangeInclusive.js +13 -0
  177. package/lib/esm/view/expenseAutomationView/helpers/saveTransactionHelper.js +2 -2
  178. package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
  179. package/lib/esm/view/expenseAutomationView/payload/missingReceiptsPayload.js +9 -0
  180. package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +21 -1
  181. package/lib/esm/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +29 -6
  182. package/lib/esm/view/expenseAutomationView/reducers/reconciliationViewReducer.js +167 -3
  183. package/lib/esm/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.js +1 -2
  184. package/lib/esm/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +10 -2
  185. package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +63 -6
  186. package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +14 -4
  187. package/lib/esm/view/expenseAutomationView/selectors/reconciliationViewSelector.js +136 -9
  188. package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +15 -5
  189. package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +24 -1
  190. package/lib/esm/view/financeStatement/financeStatementSelector.js +12 -1
  191. package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +3 -0
  192. package/lib/esm/view/profitAndLossProjectView/profitAndLossForTimeframeProjectViewEpic.js +47 -0
  193. package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewEpic.js +30 -0
  194. package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewPayload.js +1 -0
  195. package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewReducer.js +113 -0
  196. package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewSelector.js +65 -0
  197. package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewSelectorTypes.js +1 -0
  198. package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewState.js +1 -0
  199. package/lib/esm/view/reportsResync/reportsClassViewRefetchingEpic.js +4 -0
  200. package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesPayload.js +26 -0
  201. package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesReducer.js +199 -0
  202. package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesSelector.js +52 -0
  203. package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesState.js +1 -0
  204. package/lib/esm/view/spendManagement/autotransferRules/epics/createAutoTransferRuleEpic.js +100 -0
  205. package/lib/esm/view/spendManagement/autotransferRules/epics/deleteAutoTransferRuleEpic.js +48 -0
  206. package/lib/esm/view/spendManagement/autotransferRules/epics/fetchAutoTransferReviewDetailEpic.js +36 -0
  207. package/lib/esm/view/spendManagement/autotransferRules/epics/fetchAutoTransferRuleHistory.js +45 -0
  208. package/lib/esm/view/spendManagement/autotransferRules/epics/fetchAutoTransferRulesEpic.js +50 -0
  209. package/lib/esm/view/spendManagement/autotransferRules/epics/updateAutoTransferRuleEpic.js +69 -0
  210. package/lib/esm/view/spendManagement/billPay/billDetailView/epics/fetchBillDetailEpic.js +5 -5
  211. package/lib/esm/view/spendManagement/billPay/billList/billListSelector.js +10 -0
  212. package/lib/esm/view/spendManagement/billPay/billList/billListState.js +1 -0
  213. package/lib/esm/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +7 -3
  214. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
  215. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +7 -2
  216. package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +13 -6
  217. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -0
  218. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +2 -0
  219. package/lib/esm/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +7 -4
  220. package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListSelector.js +12 -0
  221. package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListState.js +1 -0
  222. package/lib/esm/view/spendManagement/treasury/treasuryList/epics/fetchTreasuryDetailEpic.js +2 -2
  223. package/lib/esm/view/spendManagement/treasury/treasuryList/treasuryDetailReducer.js +2 -1
  224. package/lib/esm/view/spendManagement/zeniAccounts/zeniAccountList/zeniAccountListSelector.js +10 -3
  225. package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +2 -2
  226. package/lib/esm/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
  227. package/lib/esm/view/transactionDetail/transactionDetailLocalDataHelper.js +16 -14
  228. package/lib/esm/view/transactionDetail/transactionDetailSelector.js +9 -2
  229. package/lib/esm/view/twoFactorAuthentication/resendOtpEpic.js +16 -2
  230. package/lib/index.d.ts +51 -28
  231. package/lib/index.js +117 -49
  232. package/lib/reducer.d.ts +20 -2
  233. package/lib/reducer.js +20 -2
  234. package/lib/view/aiAccountantView/aiAccountantViewPayload.d.ts +33 -0
  235. package/lib/view/aiAccountantView/aiAccountantViewPayload.js +8 -0
  236. package/lib/view/aiAccountantView/aiAccountantViewReducer.d.ts +29 -0
  237. package/lib/view/aiAccountantView/aiAccountantViewReducer.js +156 -0
  238. package/lib/view/aiAccountantView/aiAccountantViewSelector.d.ts +16 -0
  239. package/lib/view/aiAccountantView/aiAccountantViewSelector.js +83 -0
  240. package/lib/view/aiAccountantView/aiAccountantViewState.d.ts +26 -0
  241. package/lib/view/aiAccountantView/aiAccountantViewState.js +13 -0
  242. package/lib/view/aiAccountantView/epics/cancelAiAccountantOnboardingEpic.d.ts +33 -0
  243. package/lib/view/aiAccountantView/epics/cancelAiAccountantOnboardingEpic.js +50 -0
  244. package/lib/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.d.ts +23 -0
  245. package/lib/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.js +31 -0
  246. package/lib/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.d.ts +33 -0
  247. package/lib/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.js +51 -0
  248. package/lib/view/aiAccountantView/epics/triggerAiAccountantJobEpic.d.ts +28 -0
  249. package/lib/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +80 -0
  250. package/lib/view/aiCfoView/aiCfoViewPayload.d.ts +7 -0
  251. package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +15 -1
  252. package/lib/view/aiCfoView/aiCfoViewReducer.js +83 -2
  253. package/lib/view/aiCfoView/aiCfoViewSelector.d.ts +4 -1
  254. package/lib/view/aiCfoView/aiCfoViewSelector.js +9 -2
  255. package/lib/view/aiCfoView/aiCfoViewState.d.ts +15 -1
  256. package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.d.ts +8 -0
  257. package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +33 -0
  258. package/lib/view/auditReportView/auditReportViewState.d.ts +2 -2
  259. package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
  260. package/lib/view/cardBalance/cardBalanceSelector.d.ts +2 -1
  261. package/lib/view/cashBalance/cashBalanceSelector.d.ts +2 -1
  262. package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
  263. package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
  264. package/lib/view/classList/fetchClassListEpic.d.ts +1 -1
  265. package/lib/view/classList/fetchClassListEpic.js +8 -1
  266. package/lib/view/commonVendorView/vendorView/vendorViewSelector.d.ts +1 -0
  267. package/lib/view/commonVendorView/vendorView/vendorViewSelector.js +18 -5
  268. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.d.ts +1 -0
  269. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +6 -2
  270. package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.d.ts +2 -2
  271. package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.js +20 -2
  272. package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.d.ts +4 -1
  273. package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.js +3 -1
  274. package/lib/view/companyTaskManagerView/companyTaskManagerViewState.d.ts +9 -1
  275. package/lib/view/companyTaskManagerView/epics/fetchTaskManagerMetricsEpic.d.ts +7 -0
  276. package/lib/view/companyTaskManagerView/epics/fetchTaskManagerMetricsEpic.js +21 -0
  277. package/lib/view/companyView/companyViewReducer.d.ts +6 -1
  278. package/lib/view/companyView/companyViewReducer.js +28 -2
  279. package/lib/view/companyView/epic/companyPassport/updateAccountingClassesEnabledEpic.d.ts +10 -0
  280. package/lib/view/companyView/epic/companyPassport/updateAccountingClassesEnabledEpic.js +65 -0
  281. package/lib/view/companyView/types/cockpitTypes.d.ts +6 -5
  282. package/lib/view/companyView/types/companyPassport/companyPassportViewState.d.ts +1 -0
  283. package/lib/view/companyView/types/companyPassport/companyPassportViewState.js +4 -0
  284. package/lib/view/creditAgentView/creditAgentViewPayload.d.ts +0 -36
  285. package/lib/view/creditAgentView/creditAgentViewReducer.d.ts +20 -9
  286. package/lib/view/creditAgentView/creditAgentViewReducer.js +77 -79
  287. package/lib/view/creditAgentView/creditAgentViewSelector.d.ts +0 -1
  288. package/lib/view/creditAgentView/creditAgentViewSelector.js +1 -2
  289. package/lib/view/creditAgentView/creditAgentViewState.d.ts +5 -46
  290. package/lib/view/creditAgentView/creditAgentViewState.js +0 -29
  291. package/lib/view/creditAgentView/epics/downloadCreditReportEpic.d.ts +20 -5
  292. package/lib/view/creditAgentView/epics/downloadCreditReportEpic.js +21 -16
  293. package/lib/view/creditAgentView/epics/fetchCardProfilesEpic.d.ts +4 -4
  294. package/lib/view/creditAgentView/epics/fetchCardProfilesEpic.js +4 -4
  295. package/lib/view/creditAgentView/epics/fetchCreditAgentAccessEpic.d.ts +6 -6
  296. package/lib/view/creditAgentView/epics/fetchCreditAgentAccessEpic.js +5 -5
  297. package/lib/view/creditAgentView/epics/fetchCreditAgentMacroEpic.d.ts +5 -5
  298. package/lib/view/creditAgentView/epics/fetchCreditAgentMacroEpic.js +5 -5
  299. package/lib/view/creditAgentView/epics/saveCreditAgentMacroEpic.js +8 -3
  300. package/lib/view/creditAgentView/epics/updateCardProfileEpic.d.ts +5 -5
  301. package/lib/view/creditAgentView/epics/updateCardProfileEpic.js +4 -10
  302. package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
  303. package/lib/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.d.ts +9 -0
  304. package/lib/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.js +67 -0
  305. package/lib/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +4 -9
  306. package/lib/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.d.ts +10 -0
  307. package/lib/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.js +69 -0
  308. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +2 -2
  309. package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadMatchResultToastEpic.d.ts +13 -0
  310. package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadMatchResultToastEpic.js +37 -0
  311. package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +2 -2
  312. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +5 -3
  313. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +20 -5
  314. package/lib/view/expenseAutomationView/epics/missingReceipts/refetchCompletedTransactionsOnBulkUploadSortEpic.d.ts +10 -0
  315. package/lib/view/expenseAutomationView/epics/missingReceipts/refetchCompletedTransactionsOnBulkUploadSortEpic.js +16 -0
  316. package/lib/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.d.ts +18 -0
  317. package/lib/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.js +102 -0
  318. package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +7 -13
  319. package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.d.ts +2 -2
  320. package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +20 -4
  321. package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +0 -1
  322. package/lib/view/expenseAutomationView/helpers/bulkUploadTiming.d.ts +16 -0
  323. package/lib/view/expenseAutomationView/helpers/bulkUploadTiming.js +19 -0
  324. package/lib/view/expenseAutomationView/helpers/rollingCalendarDateRangeInclusive.d.ts +7 -0
  325. package/lib/view/expenseAutomationView/helpers/rollingCalendarDateRangeInclusive.js +16 -0
  326. package/lib/view/expenseAutomationView/helpers/saveTransactionHelper.js +2 -2
  327. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +2 -2
  328. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
  329. package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +1 -1
  330. package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.d.ts +5 -0
  331. package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.js +10 -0
  332. package/lib/view/expenseAutomationView/payload/reconciliationPayload.d.ts +45 -0
  333. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +2 -2
  334. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +22 -2
  335. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +18 -2
  336. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +30 -7
  337. package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.d.ts +18 -4
  338. package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.js +168 -4
  339. package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +2 -0
  340. package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +2 -0
  341. package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.d.ts +7 -2
  342. package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.js +2 -2
  343. package/lib/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +10 -2
  344. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +63 -6
  345. package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +14 -4
  346. package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +136 -9
  347. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +13 -3
  348. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +8 -0
  349. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +27 -0
  350. package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +5 -1
  351. package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +14 -0
  352. package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
  353. package/lib/view/financeStatement/financeStatementSelector.d.ts +2 -0
  354. package/lib/view/financeStatement/financeStatementSelector.js +12 -1
  355. package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
  356. package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +3 -0
  357. package/lib/view/profitAndLossProjectView/profitAndLossForTimeframeProjectViewEpic.d.ts +9 -0
  358. package/lib/view/profitAndLossProjectView/profitAndLossForTimeframeProjectViewEpic.js +51 -0
  359. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewEpic.d.ts +6 -0
  360. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewEpic.js +34 -0
  361. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewPayload.d.ts +33 -0
  362. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewPayload.js +2 -0
  363. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewReducer.d.ts +33 -0
  364. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewReducer.js +117 -0
  365. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelector.d.ts +9 -0
  366. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelector.js +69 -0
  367. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelectorTypes.d.ts +19 -0
  368. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelectorTypes.js +2 -0
  369. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewState.d.ts +22 -0
  370. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewState.js +2 -0
  371. package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
  372. package/lib/view/reportsResync/reportsClassViewRefetchingEpic.d.ts +2 -1
  373. package/lib/view/reportsResync/reportsClassViewRefetchingEpic.js +4 -0
  374. package/lib/view/reportsResync/reportsResyncReducer.d.ts +2 -2
  375. package/lib/view/reviewCompanyView/reviewCompanyViewState.d.ts +1 -1
  376. package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
  377. package/lib/view/spendManagement/autotransferRules/autoTransferRulesPayload.d.ts +75 -0
  378. package/lib/view/spendManagement/autotransferRules/autoTransferRulesPayload.js +30 -0
  379. package/lib/view/spendManagement/autotransferRules/autoTransferRulesReducer.d.ts +50 -0
  380. package/lib/view/spendManagement/autotransferRules/autoTransferRulesReducer.js +206 -0
  381. package/lib/view/spendManagement/autotransferRules/autoTransferRulesSelector.d.ts +24 -0
  382. package/lib/view/spendManagement/autotransferRules/autoTransferRulesSelector.js +61 -0
  383. package/lib/view/spendManagement/autotransferRules/autoTransferRulesState.d.ts +38 -0
  384. package/lib/view/spendManagement/autotransferRules/autoTransferRulesState.js +2 -0
  385. package/lib/view/spendManagement/autotransferRules/epics/createAutoTransferRuleEpic.d.ts +12 -0
  386. package/lib/view/spendManagement/autotransferRules/epics/createAutoTransferRuleEpic.js +106 -0
  387. package/lib/view/spendManagement/autotransferRules/epics/deleteAutoTransferRuleEpic.d.ts +8 -0
  388. package/lib/view/spendManagement/autotransferRules/epics/deleteAutoTransferRuleEpic.js +52 -0
  389. package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferReviewDetailEpic.d.ts +7 -0
  390. package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferReviewDetailEpic.js +40 -0
  391. package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferRuleHistory.d.ts +7 -0
  392. package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferRuleHistory.js +52 -0
  393. package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferRulesEpic.d.ts +10 -0
  394. package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferRulesEpic.js +54 -0
  395. package/lib/view/spendManagement/autotransferRules/epics/updateAutoTransferRuleEpic.d.ts +8 -0
  396. package/lib/view/spendManagement/autotransferRules/epics/updateAutoTransferRuleEpic.js +73 -0
  397. package/lib/view/spendManagement/billPay/billDetailView/epics/fetchBillDetailEpic.js +5 -5
  398. package/lib/view/spendManagement/billPay/billList/billListReducer.d.ts +1 -1
  399. package/lib/view/spendManagement/billPay/billList/billListSelector.js +10 -0
  400. package/lib/view/spendManagement/billPay/billList/billListState.d.ts +2 -2
  401. package/lib/view/spendManagement/billPay/billList/billListState.js +1 -0
  402. package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +7 -3
  403. package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
  404. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +7 -2
  405. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +13 -6
  406. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.d.ts +4 -4
  407. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
  408. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -0
  409. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +2 -0
  410. package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +6 -3
  411. package/lib/view/spendManagement/reimbursement/remiListView/remiListReducer.d.ts +1 -1
  412. package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.d.ts +1 -0
  413. package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.js +12 -0
  414. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +4 -4
  415. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.js +1 -0
  416. package/lib/view/spendManagement/treasury/treasuryList/epics/fetchTreasuryDetailEpic.js +2 -2
  417. package/lib/view/spendManagement/treasury/treasuryList/treasuryDetailReducer.d.ts +2 -1
  418. package/lib/view/spendManagement/treasury/treasuryList/treasuryDetailReducer.js +2 -1
  419. package/lib/view/spendManagement/zeniAccounts/zeniAccountList/zeniAccountListSelector.d.ts +9 -1
  420. package/lib/view/spendManagement/zeniAccounts/zeniAccountList/zeniAccountListSelector.js +10 -3
  421. package/lib/view/subscriptionView/types/subscriptionTypes.d.ts +1 -1
  422. package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +2 -2
  423. package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
  424. package/lib/view/topEx/topExSelector.d.ts +1 -1
  425. package/lib/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
  426. package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +16 -14
  427. package/lib/view/transactionDetail/transactionDetailSelector.d.ts +1 -0
  428. package/lib/view/transactionDetail/transactionDetailSelector.js +9 -2
  429. package/lib/view/twoFactorAuthentication/resendOtpEpic.d.ts +1 -1
  430. package/lib/view/twoFactorAuthentication/resendOtpEpic.js +15 -1
  431. package/package.json +1 -1
@@ -1,31 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.initialCreditAgentViewState = void 0;
4
- exports.initialCreditAgentViewState = {
5
- access: {
6
- fetchState: 'Not-Started',
7
- isAllowed: null,
8
- },
9
- cardProfiles: {
10
- downloadState: 'Not-Started',
11
- error: undefined,
12
- fetchState: 'Not-Started',
13
- rows: [],
14
- },
15
- macro: {
16
- data: null,
17
- error: undefined,
18
- fetchState: 'Not-Started',
19
- updateState: 'Not-Started',
20
- },
21
- report: {
22
- count: 0,
23
- error: undefined,
24
- fetchState: 'Not-Started',
25
- rows: [],
26
- },
27
- scheduleCron: {
28
- error: undefined,
29
- fetchState: 'Not-Started',
30
- },
31
- };
@@ -1,12 +1,27 @@
1
1
  import { ActionsObservable, StateObservable } from 'redux-observable';
2
2
  import { RootState } from '../../../reducer';
3
3
  import { ZeniAPI } from '../../../zeniAPI';
4
- import { downloadCreditReport, downloadCreditReportCompleted, downloadCreditReportFailed } from '../creditAgentViewReducer';
5
- export type ActionType = ReturnType<typeof downloadCreditReport> | ReturnType<typeof downloadCreditReportCompleted> | ReturnType<typeof downloadCreditReportFailed>;
4
+ import { CardTenantProfileRow } from '../creditAgentViewState';
5
+ import { downloadCreditReport, downloadCreditReportFailure, downloadCreditReportSuccess } from '../creditAgentViewReducer';
6
+ export type ActionType = ReturnType<typeof downloadCreditReport> | ReturnType<typeof downloadCreditReportSuccess> | ReturnType<typeof downloadCreditReportFailure>;
7
+ export declare const CSV_HEADERS: string[];
8
+ export declare function rowToCsvLine(row: CardTenantProfileRow): string;
9
+ export declare function buildCsvString(rows: CardTenantProfileRow[]): string;
10
+ /**
11
+ * Epic: gather rows from state and emit downloadCreditReportSuccess with CSV data.
12
+ *
13
+ * This epic intentionally does NOT touch the DOM (no Blob, no document, no
14
+ * URL.createObjectURL). Those browser-only APIs would break SSR and React Native
15
+ * consumers of this shared package. The consuming web app should listen for
16
+ * downloadCreditReportSuccess and perform the actual file-save using its own
17
+ * platform-appropriate mechanism.
18
+ */
6
19
  export declare const downloadCreditReportEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, _zeniAPI: ZeniAPI) => import("rxjs").Observable<{
7
- payload: undefined;
8
- type: "creditAgentView/downloadCreditReportCompleted";
20
+ payload: {
21
+ csv: string;
22
+ };
23
+ type: "creditAgentView/downloadCreditReportSuccess";
9
24
  } | {
10
25
  payload: undefined;
11
- type: "creditAgentView/downloadCreditReportFailed";
26
+ type: "creditAgentView/downloadCreditReportFailure";
12
27
  }>;
@@ -1,10 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.downloadCreditReportEpic = void 0;
3
+ exports.downloadCreditReportEpic = exports.CSV_HEADERS = void 0;
4
+ exports.rowToCsvLine = rowToCsvLine;
5
+ exports.buildCsvString = buildCsvString;
4
6
  const rxjs_1 = require("rxjs");
5
7
  const operators_1 = require("rxjs/operators");
6
8
  const creditAgentViewReducer_1 = require("../creditAgentViewReducer");
7
- const CSV_HEADERS = [
9
+ exports.CSV_HEADERS = [
8
10
  'Customer Name',
9
11
  'Card Status',
10
12
  'Credit Limit ($)',
@@ -40,24 +42,27 @@ function rowToCsvLine(row) {
40
42
  })
41
43
  .join(',');
42
44
  }
45
+ function buildCsvString(rows) {
46
+ const csvLines = [exports.CSV_HEADERS.join(','), ...rows.map(rowToCsvLine)];
47
+ return csvLines.join('\n');
48
+ }
49
+ /**
50
+ * Epic: gather rows from state and emit downloadCreditReportSuccess with CSV data.
51
+ *
52
+ * This epic intentionally does NOT touch the DOM (no Blob, no document, no
53
+ * URL.createObjectURL). Those browser-only APIs would break SSR and React Native
54
+ * consumers of this shared package. The consuming web app should listen for
55
+ * downloadCreditReportSuccess and perform the actual file-save using its own
56
+ * platform-appropriate mechanism.
57
+ */
43
58
  const downloadCreditReportEpic = (actions$, state$, _zeniAPI) => actions$.pipe((0, operators_1.filter)(creditAgentViewReducer_1.downloadCreditReport.match), (0, operators_1.switchMap)(() => {
44
59
  try {
45
60
  const rows = state$.value.creditAgentViewState.cardProfiles.rows;
46
- const csvLines = [CSV_HEADERS.join(','), ...rows.map(rowToCsvLine)];
47
- const csv = csvLines.join('\n');
48
- const blob = new Blob([csv], { type: 'text/csv;charset=utf-8;' });
49
- const objectUrl = URL.createObjectURL(blob);
50
- const link = document.createElement('a');
51
- link.href = objectUrl;
52
- link.setAttribute('download', 'card-tenant-profiles.csv');
53
- document.body.appendChild(link);
54
- link.click();
55
- document.body.removeChild(link);
56
- URL.revokeObjectURL(objectUrl);
57
- return (0, rxjs_1.of)((0, creditAgentViewReducer_1.downloadCreditReportCompleted)());
61
+ const csv = buildCsvString(rows);
62
+ return (0, rxjs_1.of)((0, creditAgentViewReducer_1.downloadCreditReportSuccess)(csv));
58
63
  }
59
64
  catch {
60
- return (0, rxjs_1.of)((0, creditAgentViewReducer_1.downloadCreditReportFailed)());
65
+ return (0, rxjs_1.of)((0, creditAgentViewReducer_1.downloadCreditReportFailure)());
61
66
  }
62
- }), (0, operators_1.catchError)(() => (0, rxjs_1.of)((0, creditAgentViewReducer_1.downloadCreditReportFailed)())));
67
+ }), (0, operators_1.catchError)(() => (0, rxjs_1.of)((0, creditAgentViewReducer_1.downloadCreditReportFailure)())));
63
68
  exports.downloadCreditReportEpic = downloadCreditReportEpic;
@@ -1,12 +1,12 @@
1
1
  import { ActionsObservable, StateObservable } from 'redux-observable';
2
2
  import { RootState } from '../../../reducer';
3
3
  import { ZeniAPI } from '../../../zeniAPI';
4
- import { fetchCardProfiles, fetchCardProfilesCompleted, fetchCardProfilesFailed } from '../creditAgentViewReducer';
5
- export type ActionType = ReturnType<typeof fetchCardProfiles> | ReturnType<typeof fetchCardProfilesCompleted> | ReturnType<typeof fetchCardProfilesFailed>;
4
+ import { fetchCardProfiles, fetchCardProfilesFailure, fetchCardProfilesSuccess } from '../creditAgentViewReducer';
5
+ export type ActionType = ReturnType<typeof fetchCardProfiles> | ReturnType<typeof fetchCardProfilesSuccess> | ReturnType<typeof fetchCardProfilesFailure>;
6
6
  export declare const fetchCardProfilesEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
7
7
  payload: import("../creditAgentViewState").CardTenantProfileRow[];
8
- type: "creditAgentView/fetchCardProfilesCompleted";
8
+ type: "creditAgentView/fetchCardProfilesSuccess";
9
9
  } | {
10
10
  payload: import("../../../responsePayload").ZeniAPIStatus<Record<string, unknown>>;
11
- type: "creditAgentView/fetchCardProfilesFailed";
11
+ type: "creditAgentView/fetchCardProfilesFailure";
12
12
  }>;
@@ -8,13 +8,13 @@ const creditAgentViewReducer_1 = require("../creditAgentViewReducer");
8
8
  const fetchCardProfilesEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(creditAgentViewReducer_1.fetchCardProfiles.match), (0, operators_1.switchMap)(() => {
9
9
  const url = `${zeniAPI.apiEndPoints.cardMicroServiceBaseUrl}/1.0/cockpit/card-tenant-profiles`;
10
10
  return zeniAPI.getJSON(url).pipe((0, operators_1.mergeMap)((response) => {
11
- if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
11
+ if ((0, responsePayload_1.isSuccessResponse)(response)) {
12
12
  const rows = (response.data.rows ?? []).map(creditAgentViewReducer_1.mapCardTenantProfileRowPayload);
13
- return (0, rxjs_1.of)((0, creditAgentViewReducer_1.fetchCardProfilesCompleted)(rows));
13
+ return (0, rxjs_1.of)((0, creditAgentViewReducer_1.fetchCardProfilesSuccess)(rows));
14
14
  }
15
15
  else {
16
- return (0, rxjs_1.of)((0, creditAgentViewReducer_1.fetchCardProfilesFailed)(response.status));
16
+ return (0, rxjs_1.of)((0, creditAgentViewReducer_1.fetchCardProfilesFailure)(response.status));
17
17
  }
18
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, creditAgentViewReducer_1.fetchCardProfilesFailed)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'REST API call errored out: ' + JSON.stringify(error))))));
18
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, creditAgentViewReducer_1.fetchCardProfilesFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'REST API call errored out: ' + JSON.stringify(error))))));
19
19
  }));
20
20
  exports.fetchCardProfilesEpic = fetchCardProfilesEpic;
@@ -1,12 +1,12 @@
1
1
  import { ActionsObservable, StateObservable } from 'redux-observable';
2
2
  import { RootState } from '../../../reducer';
3
3
  import { ZeniAPI } from '../../../zeniAPI';
4
- import { fetchCreditAgentAccess, fetchCreditAgentAccessCompleted, fetchCreditAgentAccessFailed } from '../creditAgentViewReducer';
5
- export type ActionType = ReturnType<typeof fetchCreditAgentAccess> | ReturnType<typeof fetchCreditAgentAccessCompleted> | ReturnType<typeof fetchCreditAgentAccessFailed>;
6
- export declare const fetchCreditAgentAccessEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
4
+ import { fetchCreditAgentAccess, fetchCreditAgentAccessFailure, fetchCreditAgentAccessSuccess } from '../creditAgentViewReducer';
5
+ export type ActionType = ReturnType<typeof fetchCreditAgentAccess> | ReturnType<typeof fetchCreditAgentAccessSuccess> | ReturnType<typeof fetchCreditAgentAccessFailure>;
6
+ export declare const fetchCreditAgentAccessEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
7
7
  payload: boolean;
8
- type: "creditAgentView/fetchCreditAgentAccessCompleted";
8
+ type: "creditAgentView/fetchCreditAgentAccessSuccess";
9
9
  } | {
10
- payload: undefined;
11
- type: "creditAgentView/fetchCreditAgentAccessFailed";
10
+ payload: import("../../../responsePayload").ZeniAPIStatus<Record<string, unknown>>;
11
+ type: "creditAgentView/fetchCreditAgentAccessFailure";
12
12
  }>;
@@ -5,13 +5,13 @@ const rxjs_1 = require("rxjs");
5
5
  const operators_1 = require("rxjs/operators");
6
6
  const responsePayload_1 = require("../../../responsePayload");
7
7
  const creditAgentViewReducer_1 = require("../creditAgentViewReducer");
8
- const fetchCreditAgentAccessEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(creditAgentViewReducer_1.fetchCreditAgentAccess.match), (0, operators_1.switchMap)(() => {
8
+ const fetchCreditAgentAccessEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(creditAgentViewReducer_1.fetchCreditAgentAccess.match), (0, operators_1.withLatestFrom)(state$), (0, operators_1.filter)(([, state]) => state.creditAgentViewState.access.fetchState !== 'In-Progress'), (0, operators_1.switchMap)(() => {
9
9
  const url = `${zeniAPI.apiEndPoints.cardMicroServiceBaseUrl}/1.0/cockpit/cards-cockpit-access`;
10
10
  return zeniAPI.getJSON(url).pipe((0, operators_1.switchMap)((response) => {
11
- if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
12
- return (0, rxjs_1.of)((0, creditAgentViewReducer_1.fetchCreditAgentAccessCompleted)(response.data.is_allowed === true));
11
+ if ((0, responsePayload_1.isSuccessResponse)(response)) {
12
+ return (0, rxjs_1.of)((0, creditAgentViewReducer_1.fetchCreditAgentAccessSuccess)(response.data.is_allowed === true));
13
13
  }
14
- return (0, rxjs_1.of)((0, creditAgentViewReducer_1.fetchCreditAgentAccessCompleted)(false));
15
- }), (0, operators_1.catchError)(() => (0, rxjs_1.of)((0, creditAgentViewReducer_1.fetchCreditAgentAccessFailed)())));
14
+ return (0, rxjs_1.of)((0, creditAgentViewReducer_1.fetchCreditAgentAccessFailure)(response.status));
15
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, creditAgentViewReducer_1.fetchCreditAgentAccessFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'REST API call errored out: ' + JSON.stringify(error))))));
16
16
  }));
17
17
  exports.fetchCreditAgentAccessEpic = fetchCreditAgentAccessEpic;
@@ -1,12 +1,12 @@
1
1
  import { ActionsObservable, StateObservable } from 'redux-observable';
2
2
  import { RootState } from '../../../reducer';
3
3
  import { ZeniAPI } from '../../../zeniAPI';
4
- import { fetchCreditAgentMacro, updateCreditAgentMacro, updateCreditAgentMacroFailure } from '../creditAgentViewReducer';
5
- export type ActionType = ReturnType<typeof fetchCreditAgentMacro> | ReturnType<typeof updateCreditAgentMacro> | ReturnType<typeof updateCreditAgentMacroFailure>;
6
- export declare const fetchCreditAgentMacroEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
4
+ import { fetchCreditAgentMacro, fetchCreditAgentMacroFailure, fetchCreditAgentMacroSuccess } from '../creditAgentViewReducer';
5
+ export type ActionType = ReturnType<typeof fetchCreditAgentMacro> | ReturnType<typeof fetchCreditAgentMacroSuccess> | ReturnType<typeof fetchCreditAgentMacroFailure>;
6
+ export declare const fetchCreditAgentMacroEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
7
7
  payload: import("../creditAgentViewPayload").MacroPayload;
8
- type: "creditAgentView/updateCreditAgentMacro";
8
+ type: "creditAgentView/fetchCreditAgentMacroSuccess";
9
9
  } | {
10
10
  payload: import("../../../responsePayload").ZeniAPIStatus<Record<string, unknown>>;
11
- type: "creditAgentView/updateCreditAgentMacroFailure";
11
+ type: "creditAgentView/fetchCreditAgentMacroFailure";
12
12
  }>;
@@ -5,15 +5,15 @@ const rxjs_1 = require("rxjs");
5
5
  const operators_1 = require("rxjs/operators");
6
6
  const responsePayload_1 = require("../../../responsePayload");
7
7
  const creditAgentViewReducer_1 = require("../creditAgentViewReducer");
8
- const fetchCreditAgentMacroEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(creditAgentViewReducer_1.fetchCreditAgentMacro.match), (0, operators_1.switchMap)(() => {
8
+ const fetchCreditAgentMacroEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(creditAgentViewReducer_1.fetchCreditAgentMacro.match), (0, operators_1.withLatestFrom)(state$), (0, operators_1.filter)(([, state]) => state.creditAgentViewState.macro.fetchState !== 'In-Progress'), (0, operators_1.switchMap)(() => {
9
9
  const url = `${zeniAPI.apiEndPoints.aiCfoMicroServiceBaseUrl}/1.0/macros/credit-agent`;
10
10
  return zeniAPI.getJSON(url).pipe((0, operators_1.mergeMap)((response) => {
11
- if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
12
- return (0, rxjs_1.of)((0, creditAgentViewReducer_1.updateCreditAgentMacro)(response.data));
11
+ if ((0, responsePayload_1.isSuccessResponse)(response)) {
12
+ return (0, rxjs_1.of)((0, creditAgentViewReducer_1.fetchCreditAgentMacroSuccess)(response.data));
13
13
  }
14
14
  else {
15
- return (0, rxjs_1.of)((0, creditAgentViewReducer_1.updateCreditAgentMacroFailure)(response.status));
15
+ return (0, rxjs_1.of)((0, creditAgentViewReducer_1.fetchCreditAgentMacroFailure)(response.status));
16
16
  }
17
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, creditAgentViewReducer_1.updateCreditAgentMacroFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'REST API call errored out: ' + JSON.stringify(error))))));
17
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, creditAgentViewReducer_1.fetchCreditAgentMacroFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'REST API call errored out: ' + JSON.stringify(error))))));
18
18
  }));
19
19
  exports.fetchCreditAgentMacroEpic = fetchCreditAgentMacroEpic;
@@ -8,14 +8,19 @@ const creditAgentViewReducer_1 = require("../creditAgentViewReducer");
8
8
  const saveCreditAgentMacroEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(creditAgentViewReducer_1.saveCreditAgentMacro.match), (0, operators_1.switchMap)((action) => {
9
9
  const { instructions } = action.payload;
10
10
  const existingMacro = state$.value.creditAgentViewState.macro.data;
11
+ // Fail fast if macro has not been loaded yet — avoids overwriting server-side
12
+ // name/description fields with empty defaults.
13
+ if (existingMacro == null) {
14
+ return (0, rxjs_1.of)((0, creditAgentViewReducer_1.saveCreditAgentMacroFailure)((0, responsePayload_1.createZeniAPIStatus)('Save failed', 'Cannot save macro: macro data has not been loaded yet.')));
15
+ }
11
16
  const url = `${zeniAPI.apiEndPoints.aiCfoMicroServiceBaseUrl}/1.0/macros/credit-agent`;
12
17
  const body = {
13
18
  instructions,
14
- name: existingMacro?.name ?? 'credit-agent',
15
- description: existingMacro?.description ?? '',
19
+ name: existingMacro.name,
20
+ description: existingMacro.description,
16
21
  };
17
22
  return zeniAPI.putAndGetJSON(url, body).pipe((0, operators_1.mergeMap)((response) => {
18
- if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
23
+ if ((0, responsePayload_1.isSuccessResponse)(response)) {
19
24
  return (0, rxjs_1.of)((0, creditAgentViewReducer_1.saveCreditAgentMacroSuccess)(response.data));
20
25
  }
21
26
  else {
@@ -1,15 +1,15 @@
1
1
  import { ActionsObservable, StateObservable } from 'redux-observable';
2
2
  import { RootState } from '../../../reducer';
3
3
  import { ZeniAPI } from '../../../zeniAPI';
4
- import { updateCardProfile, updateCardProfileCompleted, updateCardProfileFailed } from '../creditAgentViewReducer';
5
- export type ActionType = ReturnType<typeof updateCardProfile> | ReturnType<typeof updateCardProfileCompleted> | ReturnType<typeof updateCardProfileFailed>;
4
+ import { updateCardProfile, updateCardProfileFailure, updateCardProfileSuccess } from '../creditAgentViewReducer';
5
+ export type ActionType = ReturnType<typeof updateCardProfile> | ReturnType<typeof updateCardProfileSuccess> | ReturnType<typeof updateCardProfileFailure>;
6
6
  export declare const updateCardProfileEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
7
7
  payload: {
8
- profile: Partial<import("../creditAgentViewState").CardTenantProfileRow>;
8
+ profile: import("../creditAgentViewState").CardTenantProfileRow;
9
9
  tenantNamespace: string;
10
10
  };
11
- type: "creditAgentView/updateCardProfileCompleted";
11
+ type: "creditAgentView/updateCardProfileSuccess";
12
12
  } | {
13
13
  payload: import("../../../responsePayload").ZeniAPIStatus<Record<string, unknown>>;
14
- type: "creditAgentView/updateCardProfileFailed";
14
+ type: "creditAgentView/updateCardProfileFailure";
15
15
  }>;
@@ -26,20 +26,14 @@ const updateCardProfileEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0,
26
26
  return zeniAPI.putAndGetJSON(url, body).pipe((0, operators_1.mergeMap)((response) => {
27
27
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data?.profile != null) {
28
28
  const mapped = (0, creditAgentViewReducer_1.mapCardTenantProfileRowPayload)(response.data.profile);
29
- return (0, rxjs_1.of)((0, creditAgentViewReducer_1.updateCardProfileCompleted)({
30
- profile: {
31
- cardStatus: mapped.cardStatus,
32
- creditLimit: mapped.creditLimit,
33
- updatedByName: mapped.updatedByName,
34
- updatedByUserId: mapped.updatedByUserId,
35
- updatedOn: mapped.updatedOn,
36
- },
29
+ return (0, rxjs_1.of)((0, creditAgentViewReducer_1.updateCardProfileSuccess)({
30
+ profile: mapped,
37
31
  tenantNamespace,
38
32
  }));
39
33
  }
40
34
  else {
41
- return (0, rxjs_1.of)((0, creditAgentViewReducer_1.updateCardProfileFailed)(response.status));
35
+ return (0, rxjs_1.of)((0, creditAgentViewReducer_1.updateCardProfileFailure)(response.status));
42
36
  }
43
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, creditAgentViewReducer_1.updateCardProfileFailed)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'REST API call errored out: ' + JSON.stringify(error))))));
37
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, creditAgentViewReducer_1.updateCardProfileFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'REST API call errored out: ' + JSON.stringify(error))))));
44
38
  }));
45
39
  exports.updateCardProfileEpic = updateCardProfileEpic;
@@ -1,12 +1,12 @@
1
1
  import { DashboardState } from './dashboardState';
2
2
  export declare const initialState: DashboardState;
3
- export declare const fetchDashboard: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[userId: string, companyId: string, tenantId: string, fetchFullReport?: any, cacheOverride?: any, excludeResources?: ("cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card")[] | undefined], {
3
+ export declare const fetchDashboard: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[userId: string, companyId: string, tenantId: string, fetchFullReport?: any, cacheOverride?: any, excludeResources?: ("cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation")[] | undefined], {
4
4
  userId: string;
5
5
  companyId: string;
6
6
  tenantId: string;
7
7
  fetchFullReport: any;
8
8
  cacheOverride: any;
9
- excludeResources: ("cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card")[];
9
+ excludeResources: ("cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation")[];
10
10
  }, "dashboard/fetchDashboard", never, never>, updateTreasuryVideoClosed: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"dashboard/updateTreasuryVideoClosed">, clearDashboard: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"dashboard/clearDashboard">;
11
11
  declare const _default: import("redux").Reducer<DashboardState>;
12
12
  export default _default;
@@ -0,0 +1,9 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { changeAccountKey } from '../../../../entity/account/accountReducer';
4
+ import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
5
+ import { RootState } from '../../../../reducer';
6
+ import { ZeniAPI } from '../../../../zeniAPI';
7
+ import { excludeAccountFromReconciliation, excludeAccountFromReconciliationFailure, excludeAccountFromReconciliationSuccess } from '../../reducers/reconciliationViewReducer';
8
+ export type ActionType = ReturnType<typeof excludeAccountFromReconciliation> | ReturnType<typeof changeAccountKey> | ReturnType<typeof excludeAccountFromReconciliationSuccess> | ReturnType<typeof excludeAccountFromReconciliationFailure> | ReturnType<typeof openSnackbar>;
9
+ export declare const excludeAccountFromReconciliationEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.excludeAccountFromReconciliationEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const accountReducer_1 = require("../../../../entity/account/accountReducer");
7
+ const accountState_1 = require("../../../../entity/account/accountState");
8
+ const accountReconSelector_1 = require("../../../../entity/accountRecon/accountReconSelector");
9
+ const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
10
+ const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
11
+ const responsePayload_1 = require("../../../../responsePayload");
12
+ const reconciliationViewReducer_1 = require("../../reducers/reconciliationViewReducer");
13
+ const excludeAccountFromReconciliationEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(reconciliationViewReducer_1.excludeAccountFromReconciliation.match), (0, operators_1.mergeMap)((action) => {
14
+ const { accountId } = action.payload;
15
+ const state = state$.value;
16
+ const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
17
+ const selectedPeriod = state.expenseAutomationViewState.selectedPeriodByTenantId[currentTenant.tenantId];
18
+ const reconciliationData = (0, accountReconSelector_1.getAccountReconByAccountIdAndSelectedPeriod)(state, accountId, selectedPeriod);
19
+ const payload = {
20
+ account_id: accountId,
21
+ bank_balance: reconciliationData?.balance?.amount ?? null,
22
+ cleared_balance: reconciliationData?.clearedBalance?.amount ?? null,
23
+ variance: reconciliationData?.variance?.amount ?? null,
24
+ };
25
+ const apiUrl = `${zeniAPI.apiEndPoints.reconciliationMicroServiceBaseUrl}/1.0/reconciliation/excluded-accounts`;
26
+ return zeniAPI
27
+ .postAndGetJSON(apiUrl, payload)
28
+ .pipe((0, operators_1.mergeMap)((response) => {
29
+ if ((0, responsePayload_1.isSuccessResponse)(response)) {
30
+ const newAccountKey = (0, accountState_1.getAccountKey)('excluded_account_reconciliation', accountId);
31
+ const oldAccountKey = (0, accountState_1.getAccountKey)('account_reconciliation', accountId);
32
+ return (0, rxjs_1.of)((0, reconciliationViewReducer_1.excludeAccountFromReconciliationSuccess)({
33
+ account: response.data?.excluded_account ?? undefined,
34
+ selectedPeriod,
35
+ }), (0, accountReducer_1.changeAccountKey)({
36
+ oldKey: oldAccountKey,
37
+ newKey: newAccountKey,
38
+ }), (0, snackbarReducer_1.openSnackbar)({
39
+ messageSection: 'account_excluded_from_reconciliation',
40
+ messageText: 'success',
41
+ type: 'success',
42
+ variables: [
43
+ {
44
+ variableName: '_account-name_',
45
+ variableValue: reconciliationData?.account.accountName ?? '',
46
+ },
47
+ ],
48
+ }));
49
+ }
50
+ else {
51
+ return (0, rxjs_1.of)((0, reconciliationViewReducer_1.excludeAccountFromReconciliationFailure)({
52
+ error: response.status,
53
+ }), (0, snackbarReducer_1.openSnackbar)({
54
+ messageSection: 'account_excluded_from_reconciliation',
55
+ messageText: 'failed',
56
+ type: 'error',
57
+ }));
58
+ }
59
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, reconciliationViewReducer_1.excludeAccountFromReconciliationFailure)({
60
+ error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', `Exclude account from reconciliation REST API call errored out ${JSON.stringify(error)}`),
61
+ }), (0, snackbarReducer_1.openSnackbar)({
62
+ messageSection: 'account_excluded_from_reconciliation',
63
+ messageText: 'failed',
64
+ type: 'error',
65
+ }))));
66
+ }));
67
+ exports.excludeAccountFromReconciliationEpic = excludeAccountFromReconciliationEpic;
@@ -56,22 +56,17 @@ const fetchReconciliationViewEpic = (actions$, state$, zeniAPI) => actions$.pipe
56
56
  return zeniAPI.getJSON(apiUrl).pipe((0, operators_1.mergeMap)((response) => {
57
57
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
58
58
  const updateActions = [];
59
- updateActions.push((0, accountReducer_1.updateAccounts)(response.data.accounts, 'account_reconciliation'));
60
- updateActions.push((0, userReducer_1.updateAllUsers)({
59
+ const allTransactionsPerRecon = (0, reconciliationHelpers_1.getAllReviewTransactionsFromReconcilePayload)(response.data.reconciliation);
60
+ updateActions.push((0, accountReducer_1.updateAccounts)(response.data.accounts, 'account_reconciliation'), (0, accountReducer_1.updateAccounts)(response.data.excluded_accounts ?? [], 'excluded_account_reconciliation'), (0, userReducer_1.updateAllUsers)({
61
61
  users: response.data.users ?? [],
62
62
  updateType: 'merge',
63
- }));
64
- updateActions.push((0, fileReducer_1.updateFiles)({ files: response.data.files ?? [] }));
65
- const allTransactionsPerRecon = (0, reconciliationHelpers_1.getAllReviewTransactionsFromReconcilePayload)(response.data.reconciliation);
66
- updateActions.push((0, transactionReducer_1.updateMultipleReconcileTransactions)(allTransactionsPerRecon, 'merge'));
67
- updateActions.push((0, accountReconReducer_1.updateAccountRecon)(selectedPeriod, response.data.reconciliation));
63
+ }), (0, fileReducer_1.updateFiles)({ files: response.data.files ?? [] }), (0, transactionReducer_1.updateMultipleReconcileTransactions)(allTransactionsPerRecon, 'merge'), (0, accountReconReducer_1.updateAccountRecon)(selectedPeriod, response.data.reconciliation));
68
64
  const reviewTabLocalData = (0, exports.prepareReviewTabLocalData)(response.data.reconciliation[0]?.transactions?.review ?? []);
69
65
  if (accountId != null) {
70
66
  const selectedTransactionIds = (0, saveReconciliationDetailEpic_1.getTransactionIdFromCheckedMatchedTransactionPayload)(response.data.reconciliation[0].transactions.reconcile);
71
67
  updateActions.push((0, reconciliationViewReducer_1.updateReconcileTabLocalData)({
72
68
  selectedTransactionIds: selectedTransactionIds,
73
- }));
74
- updateActions.push((0, reconciliationViewReducer_1.initializeReconciliationReviewTabLocalData)(reviewTabLocalData));
69
+ }), (0, reconciliationViewReducer_1.initializeReconciliationReviewTabLocalData)(reviewTabLocalData));
75
70
  }
76
71
  updateActions.push((0, reconciliationViewReducer_1.fetchReconciliationSuccess)(selectedPeriod, response.data, refreshViewInBackground, accountId));
77
72
  return (0, rxjs_1.from)(updateActions);
@@ -0,0 +1,10 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { changeAccountKey } from '../../../../entity/account/accountReducer';
4
+ import { updateAccountRecon } from '../../../../entity/accountRecon/accountReconReducer';
5
+ import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
6
+ import { RootState } from '../../../../reducer';
7
+ import { ZeniAPI } from '../../../../zeniAPI';
8
+ import { includeAccountInReconciliation, includeAccountInReconciliationFailure, includeAccountInReconciliationSuccess } from '../../reducers/reconciliationViewReducer';
9
+ export type ActionType = ReturnType<typeof includeAccountInReconciliation> | ReturnType<typeof includeAccountInReconciliationSuccess> | ReturnType<typeof includeAccountInReconciliationFailure> | ReturnType<typeof changeAccountKey> | ReturnType<typeof openSnackbar> | ReturnType<typeof updateAccountRecon>;
10
+ export declare const includeAccountInReconciliationEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.includeAccountInReconciliationEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
7
+ const accountReducer_1 = require("../../../../entity/account/accountReducer");
8
+ const accountSelector_1 = require("../../../../entity/account/accountSelector");
9
+ const accountState_1 = require("../../../../entity/account/accountState");
10
+ const accountReconReducer_1 = require("../../../../entity/accountRecon/accountReconReducer");
11
+ const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
12
+ const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
13
+ const responsePayload_1 = require("../../../../responsePayload");
14
+ const reconciliationViewReducer_1 = require("../../reducers/reconciliationViewReducer");
15
+ const includeAccountInReconciliationEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(reconciliationViewReducer_1.includeAccountInReconciliation.match), (0, operators_1.mergeMap)((action) => {
16
+ const { accountId } = action.payload;
17
+ const state = state$.value;
18
+ const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
19
+ const selectedPeriod = state.expenseAutomationViewState.selectedPeriodByTenantId[currentTenant.tenantId];
20
+ const account = (0, accountSelector_1.getAccountBase)(state.accountState, accountId, 'excluded_account_reconciliation');
21
+ const period = (0, timePeriod_1.convertToPeriod)(selectedPeriod, true);
22
+ const query = JSON.stringify({
23
+ start_date: period.start,
24
+ end_date: period.end,
25
+ });
26
+ const apiUrl = `${zeniAPI.apiEndPoints.reconciliationMicroServiceBaseUrl}/1.0/reconciliation/excluded-accounts/${accountId}?query=${encodeURIComponent(query)}`;
27
+ return zeniAPI
28
+ .deleteAndGetJSON(apiUrl)
29
+ .pipe((0, operators_1.mergeMap)((response) => {
30
+ if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
31
+ const reconciliation = response.data.reconciliation;
32
+ const oldAccountKey = (0, accountState_1.getAccountKey)('excluded_account_reconciliation', reconciliation.account_id);
33
+ const newAccountKey = (0, accountState_1.getAccountKey)('account_reconciliation', reconciliation.account_id);
34
+ return (0, rxjs_1.of)((0, accountReconReducer_1.updateAccountRecon)(selectedPeriod, [reconciliation]), (0, reconciliationViewReducer_1.includeAccountInReconciliationSuccess)({
35
+ reconciliation,
36
+ selectedPeriod,
37
+ }), (0, accountReducer_1.changeAccountKey)({
38
+ oldKey: oldAccountKey,
39
+ newKey: newAccountKey,
40
+ }), (0, snackbarReducer_1.openSnackbar)({
41
+ messageSection: 'account_included_in_reconciliation',
42
+ messageText: 'success',
43
+ type: 'success',
44
+ variables: [
45
+ {
46
+ variableName: '_account-name_',
47
+ variableValue: account?.accountName ?? '',
48
+ },
49
+ ],
50
+ }));
51
+ }
52
+ else {
53
+ return (0, rxjs_1.of)((0, reconciliationViewReducer_1.includeAccountInReconciliationFailure)({
54
+ error: response.status,
55
+ }), (0, snackbarReducer_1.openSnackbar)({
56
+ messageSection: 'account_included_in_reconciliation',
57
+ messageText: 'failed',
58
+ type: 'error',
59
+ }));
60
+ }
61
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, reconciliationViewReducer_1.includeAccountInReconciliationFailure)({
62
+ error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', `Include account in reconciliation REST API call errored out ${JSON.stringify(error)}`),
63
+ }), (0, snackbarReducer_1.openSnackbar)({
64
+ messageSection: 'account_included_in_reconciliation',
65
+ messageText: 'failed',
66
+ type: 'error',
67
+ }))));
68
+ }));
69
+ exports.includeAccountInReconciliationEpic = includeAccountInReconciliationEpic;
@@ -24,13 +24,13 @@ const fetchJeSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, op
24
24
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
25
25
  const updateActions = [];
26
26
  updateActions.push((0, jeSchedulesReducer_1.updateJESchedules)([
27
- ...response.data.draft_je_schedules,
27
+ ...response.data.je_schedules,
28
28
  ...response.data.failed_je_postings.je_schedules,
29
29
  ]), (0, jeSchedulesReducer_1.updateJESchedulesDetails)([...response.data.failed_je_postings.je_schedules], response.data.failed_je_postings.scheduled_journal_entries), (0, jeSchedulesViewReducer_1.initializeJeScheduleLocalData)([
30
30
  ...response.data.failed_je_postings.je_schedules,
31
31
  ]));
32
32
  updateActions.push((0, jeSchedulesViewReducer_1.fetchJeSchedulesSuccess)({
33
- jeSchedules: [...response.data.draft_je_schedules],
33
+ jeSchedules: [...response.data.je_schedules],
34
34
  failedJeSchedules: [
35
35
  ...response.data.failed_je_postings.je_schedules,
36
36
  ],
@@ -0,0 +1,13 @@
1
+ import { ActionsObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
4
+ import { bulkUploadReceiptsSuccess, clearBulkUpload, fetchBulkUploadBatchDetailsSuccess, restoreBulkUploadMatchingState, storeBatchDetails } from '../../reducers/missingReceiptsViewReducer';
5
+ export type ActionType = ReturnType<typeof bulkUploadReceiptsSuccess> | ReturnType<typeof restoreBulkUploadMatchingState> | ReturnType<typeof fetchBulkUploadBatchDetailsSuccess> | ReturnType<typeof storeBatchDetails> | ReturnType<typeof clearBulkUpload> | ReturnType<typeof openSnackbar>;
6
+ /**
7
+ * Show a success toast when batch details arrive for the current upload batch,
8
+ * e.g. "17 out of 20 Receipts Matched". Scoped per upload session so it fires
9
+ * only once: starts on `bulkUploadReceiptsSuccess` (or `restoreBulkUploadMatchingState`
10
+ * for a restored session), waits for the first batch-details action for that batch,
11
+ * emits the toast, then stops. `clearBulkUpload` cancels the in-flight wait.
12
+ */
13
+ export declare const bulkUploadMatchResultToastEpic: (actions$: ActionsObservable<ActionType>) => Observable<ActionType>;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.bulkUploadMatchResultToastEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
7
+ const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
8
+ /**
9
+ * Show a success toast when batch details arrive for the current upload batch,
10
+ * e.g. "17 out of 20 Receipts Matched". Scoped per upload session so it fires
11
+ * only once: starts on `bulkUploadReceiptsSuccess` (or `restoreBulkUploadMatchingState`
12
+ * for a restored session), waits for the first batch-details action for that batch,
13
+ * emits the toast, then stops. `clearBulkUpload` cancels the in-flight wait.
14
+ */
15
+ const bulkUploadMatchResultToastEpic = (actions$) => actions$.pipe((0, operators_1.filter)((action) => missingReceiptsViewReducer_1.bulkUploadReceiptsSuccess.match(action) ||
16
+ missingReceiptsViewReducer_1.restoreBulkUploadMatchingState.match(action)), (0, operators_1.switchMap)((uploadAction) => {
17
+ const { batchId } = uploadAction.payload;
18
+ return (0, rxjs_1.merge)(actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.fetchBulkUploadBatchDetailsSuccess.match)), actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.storeBatchDetails.match))).pipe((0, operators_1.filter)((a) => a.payload.batchId === batchId), (0, operators_1.take)(1), (0, operators_1.mergeMap)((action) => {
19
+ const { summary } = action.payload;
20
+ return (0, rxjs_1.of)((0, snackbarReducer_1.openSnackbar)({
21
+ messageSection: 'receipts_bulk_match',
22
+ messageText: 'success',
23
+ type: 'success',
24
+ variables: [
25
+ {
26
+ variableName: '_matched_',
27
+ variableValue: String(summary.matched),
28
+ },
29
+ {
30
+ variableName: '_total_',
31
+ variableValue: String(summary.total),
32
+ },
33
+ ],
34
+ }));
35
+ }), (0, operators_1.takeUntil)(actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.clearBulkUpload.match))));
36
+ }));
37
+ exports.bulkUploadMatchResultToastEpic = bulkUploadMatchResultToastEpic;