@zeniai/client-epic-state 4.13.15 → 4.13.17

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 (319) hide show
  1. package/lib/commonPayloadTypes/commonPayload.d.ts +7 -0
  2. package/lib/commonStateTypes/common.d.ts +2 -0
  3. package/lib/commonStateTypes/common.js +5 -1
  4. package/lib/commonStateTypes/fiscalYearHelpers/formatZeniDateFY.d.ts +1 -0
  5. package/lib/commonStateTypes/fiscalYearHelpers/formatZeniDateFY.js +2 -1
  6. package/lib/commonStateTypes/timePeriod.d.ts +16 -0
  7. package/lib/commonStateTypes/timePeriod.js +31 -1
  8. package/lib/commonStateTypes/viewAndReport/reportIDHelper.d.ts +1 -0
  9. package/lib/commonStateTypes/viewAndReport/reportIDHelper.js +3 -1
  10. package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
  11. package/lib/commonStateTypes/viewAndReport/viewAndReport.js +2 -0
  12. package/lib/entity/account/accountState.d.ts +1 -1
  13. package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
  14. package/lib/entity/chargeCard/chargeCard.d.ts +16 -2
  15. package/lib/entity/chargeCard/chargeCard.js +18 -1
  16. package/lib/entity/chargeCard/chargeCardPayload.d.ts +14 -5
  17. package/lib/entity/chargeCard/chargeCardPayload.js +24 -7
  18. package/lib/entity/class/classReducer.d.ts +4 -4
  19. package/lib/entity/class/classState.d.ts +1 -1
  20. package/lib/entity/company/companyPayload.d.ts +4 -0
  21. package/lib/entity/company/companyPayload.js +6 -3
  22. package/lib/entity/company/companyReducer.d.ts +4 -1
  23. package/lib/entity/company/companyReducer.js +6 -2
  24. package/lib/entity/company/companyStateTypes.d.ts +5 -1
  25. package/lib/entity/file/fileState.d.ts +3 -3
  26. package/lib/entity/file/fileState.js +2 -0
  27. package/lib/entity/forecast/forecastState.d.ts +1 -1
  28. package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +1 -0
  29. package/lib/entity/jeSchedules/jeSchedulesPayload.js +7 -1
  30. package/lib/entity/jeSchedules/jeSchedulesReducer.d.ts +2 -2
  31. package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +3 -1
  32. package/lib/entity/jeSchedules/jeSchedulesSelector.js +2 -1
  33. package/lib/entity/jeSchedules/jeSchedulesState.d.ts +3 -1
  34. package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +2 -0
  35. package/lib/entity/jeSchedules/jeSchedulesTypes.js +12 -1
  36. package/lib/entity/monthEndCloseChecks/monthEndCloseChecksPayload.d.ts +32 -0
  37. package/lib/entity/monthEndCloseChecks/monthEndCloseChecksPayload.js +60 -0
  38. package/lib/entity/monthEndCloseChecks/monthEndCloseChecksReducer.d.ts +12 -0
  39. package/lib/entity/monthEndCloseChecks/monthEndCloseChecksReducer.js +25 -0
  40. package/lib/entity/monthEndCloseChecks/monthEndCloseChecksSelector.d.ts +7 -0
  41. package/lib/entity/monthEndCloseChecks/monthEndCloseChecksSelector.js +36 -0
  42. package/lib/entity/monthEndCloseChecks/monthEndCloseChecksState.d.ts +38 -0
  43. package/lib/entity/monthEndCloseChecks/monthEndCloseChecksState.js +10 -0
  44. package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
  45. package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
  46. package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
  47. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  48. package/lib/entity/snackbar/snackbarTypes.js +5 -0
  49. package/lib/entity/tenant/clearAllEpic.d.ts +12 -2
  50. package/lib/entity/tenant/clearAllEpic.js +20 -0
  51. package/lib/entity/tenant/epic/fetchActiveTenantEpic.d.ts +2 -1
  52. package/lib/entity/tenant/epic/fetchActiveTenantEpic.js +9 -1
  53. package/lib/entity/tenant/epic/fetchAllTenantsEpic.d.ts +7 -1
  54. package/lib/entity/tenant/epic/fetchAllTenantsEpic.js +34 -2
  55. package/lib/entity/tenant/tenantPayload.d.ts +1 -0
  56. package/lib/entity/tenant/tenantReducer.js +3 -0
  57. package/lib/entity/tenant/tenantState.d.ts +1 -0
  58. package/lib/entity/toastNotification/epic/pushToastNotificationEpic.d.ts +1 -1
  59. package/lib/entity/transaction/payloadTypes/attachmentPayload.d.ts +1 -1
  60. package/lib/entity/transaction/payloadTypes/attachmentPayload.js +3 -3
  61. package/lib/entity/transaction/stateTypes/transactionType.d.ts +2 -2
  62. package/lib/entity/transaction/transactionSelector.d.ts +1 -0
  63. package/lib/entity/transaction/transactionSelector.js +7 -1
  64. package/lib/entity/user/userPayload.d.ts +1 -0
  65. package/lib/entity/user/userReducer.js +9 -8
  66. package/lib/entity/user/userState.d.ts +1 -0
  67. package/lib/entity/vendor/__mocks__/vendorStateMocks.d.ts +1 -0
  68. package/lib/entity/vendor/__mocks__/vendorStateMocks.js +35 -1
  69. package/lib/entity/vendor/vendorPayload.js +3 -2
  70. package/lib/entity/vendor/vendorState.d.ts +3 -3
  71. package/lib/entity/vendor/vendorType.d.ts +0 -2
  72. package/lib/entity/vendor/vendorType.js +1 -4
  73. package/lib/entity/vendorExpense/vendorExpenseSelector.d.ts +2 -2
  74. package/lib/entity/vendorExpense/vendorExpenseSelector.js +1 -0
  75. package/lib/epic.d.ts +20 -2
  76. package/lib/epic.js +20 -2
  77. package/lib/index.d.ts +65 -21
  78. package/lib/index.js +104 -28
  79. package/lib/reducer.d.ts +31 -1
  80. package/lib/reducer.js +31 -1
  81. package/lib/view/addressView/__mocks__/json/createCompanyAddressSuccess.json +7 -1
  82. package/lib/view/addressView/__mocks__/json/createCompanyUserAddressSuccess.json +7 -1
  83. package/lib/view/addressView/addressViewState.d.ts +1 -1
  84. package/lib/view/addressView/toAddressViewLocalData.d.ts +2 -0
  85. package/lib/view/addressView/toAddressViewLocalData.js +9 -3
  86. package/lib/view/auditReportView/auditReportViewState.d.ts +2 -2
  87. package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
  88. package/lib/view/cardBalance/cardBalanceSelector.d.ts +1 -1
  89. package/lib/view/cardPayment/epic/addCardPaymentSourceEpic.d.ts +1 -1
  90. package/lib/view/cardPayment/epic/confirmCardSetupIntentEpic.d.ts +1 -1
  91. package/lib/view/cardPayment/epic/createCardSetupIntentEpic.d.ts +1 -1
  92. package/lib/view/cardPayment/epic/fetchPaymentSourcesEpic.d.ts +1 -1
  93. package/lib/view/cashBalance/cashBalanceSelector.d.ts +1 -1
  94. package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
  95. package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
  96. package/lib/view/commonVendorView/vendorView/vendorViewSelector.d.ts +1 -1
  97. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewReducer.d.ts +2 -2
  98. package/lib/view/companyMonthEndReportView/companyMonthEndReportViewReducer.d.ts +10 -5
  99. package/lib/view/companyMonthEndReportView/companyMonthEndReportViewReducer.js +10 -7
  100. package/lib/view/companyMonthEndReportView/epics/fetchCompanyMonthEndReportTemplatesEpic.js +4 -4
  101. package/lib/view/companyMonthEndReportView/epics/fetchCompanyMonthEndReportViewEpic.js +4 -4
  102. package/lib/view/companyMonthEndReportView/epics/improveUsingZeniGPTEpic.js +5 -3
  103. package/lib/view/companyMonthEndReportView/epics/saveCompanyMonthEndReportEpic.js +3 -3
  104. package/lib/view/companyMonthEndReportView/epics/sendCompanyMonthEndReportEpic.js +3 -3
  105. package/lib/view/companyView/epic/companyPassport/updateCompanyPassportLocalStoreDataEpic.js +1 -6
  106. package/lib/view/companyView/selectorHelpers/getCompanyView.js +4 -0
  107. package/lib/view/companyView/types/cockpitTypes.d.ts +2 -2
  108. package/lib/view/companyView/types/companyPassport/companyUsersLocalData.d.ts +2 -0
  109. package/lib/view/companyView/types/companyPassport/companyUsersLocalData.js +7 -1
  110. package/lib/view/companyView/types/companyView.d.ts +1 -0
  111. package/lib/view/countryList/countryListReducer.d.ts +17 -0
  112. package/lib/view/countryList/countryListReducer.js +58 -0
  113. package/lib/view/countryList/countryListSelector.d.ts +7 -0
  114. package/lib/view/countryList/countryListSelector.js +13 -0
  115. package/lib/view/countryList/countryListState.d.ts +12 -0
  116. package/lib/view/countryList/countryListState.js +2 -0
  117. package/lib/view/countryList/epics/fetchCountryListEpic.d.ts +6 -0
  118. package/lib/view/countryList/epics/fetchCountryListEpic.js +19 -0
  119. package/lib/view/countryList/epics/fetchNationalityCountryListEpic.d.ts +7 -0
  120. package/lib/view/countryList/epics/fetchNationalityCountryListEpic.js +38 -0
  121. package/lib/view/countryList/payloads/countryListPayload.d.ts +6 -0
  122. package/lib/view/countryList/payloads/countryListPayload.js +10 -0
  123. package/lib/view/countryList/payloads/nationalityCountryListPayload.d.ts +11 -0
  124. package/lib/view/countryList/payloads/nationalityCountryListPayload.js +2 -0
  125. package/lib/view/dashboard/dashboardEpic.d.ts +2 -1
  126. package/lib/view/dashboard/dashboardEpic.js +22 -2
  127. package/lib/view/dashboard/dashboardReducer.d.ts +3 -2
  128. package/lib/view/dashboard/dashboardReducer.js +2 -1
  129. package/lib/view/dashboard/dashboardSelector.d.ts +2 -0
  130. package/lib/view/dashboard/dashboardSelector.js +10 -2
  131. package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.d.ts +10 -0
  132. package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +73 -0
  133. package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.d.ts +11 -0
  134. package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +55 -0
  135. package/lib/view/expenseAutomationView/epics/fluxAnalysis/fetchFluxAnalysisViewEpic.d.ts +11 -0
  136. package/lib/view/expenseAutomationView/epics/fluxAnalysis/fetchFluxAnalysisViewEpic.js +72 -0
  137. package/lib/view/expenseAutomationView/epics/fluxAnalysis/reviewFluxAnalysisEpic.d.ts +12 -0
  138. package/lib/view/expenseAutomationView/epics/fluxAnalysis/reviewFluxAnalysisEpic.js +77 -0
  139. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.d.ts +7 -0
  140. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +22 -0
  141. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.d.ts +8 -0
  142. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +59 -0
  143. package/lib/view/expenseAutomationView/epics/jeSchedule/ignoreRecommendedJeScheduleEpic.d.ts +8 -0
  144. package/lib/view/expenseAutomationView/epics/jeSchedule/ignoreRecommendedJeScheduleEpic.js +78 -0
  145. package/lib/view/expenseAutomationView/epics/jeSchedule/initializeJeScheduleLocalDataEpic.d.ts +6 -0
  146. package/lib/view/expenseAutomationView/epics/jeSchedule/initializeJeScheduleLocalDataEpic.js +28 -0
  147. package/lib/view/expenseAutomationView/epics/jeSchedule/retryJeSchedulesEpic.d.ts +9 -0
  148. package/lib/view/expenseAutomationView/epics/jeSchedule/retryJeSchedulesEpic.js +78 -0
  149. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMissingReceiptsEpic.d.ts +8 -0
  150. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMissingReceiptsEpic.js +58 -0
  151. package/lib/view/expenseAutomationView/epics/missingReceipts/uploadMissingReceiptSuccessEpic.d.ts +10 -0
  152. package/lib/view/expenseAutomationView/epics/missingReceipts/uploadMissingReceiptSuccessEpic.js +12 -0
  153. package/lib/view/expenseAutomationView/expenseAutomationViewPayload.d.ts +3 -0
  154. package/lib/view/expenseAutomationView/expenseAutomationViewPayload.js +2 -0
  155. package/lib/view/expenseAutomationView/expenseAutomationViewReducer.d.ts +17 -0
  156. package/lib/view/expenseAutomationView/expenseAutomationViewReducer.js +66 -0
  157. package/lib/view/expenseAutomationView/expenseAutomationViewSelector.d.ts +3 -0
  158. package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +100 -0
  159. package/lib/view/expenseAutomationView/expenseAutomationViewState.d.ts +11 -0
  160. package/lib/view/expenseAutomationView/expenseAutomationViewState.js +14 -0
  161. package/lib/view/expenseAutomationView/helpers/helpers.d.ts +7 -0
  162. package/lib/view/expenseAutomationView/helpers/helpers.js +67 -0
  163. package/lib/view/expenseAutomationView/payload/fluxAnalysisPayload.d.ts +76 -0
  164. package/lib/view/expenseAutomationView/payload/fluxAnalysisPayload.js +9 -0
  165. package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +36 -0
  166. package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.js +58 -0
  167. package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.d.ts +16 -0
  168. package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.js +2 -0
  169. package/lib/view/expenseAutomationView/reducers/fluxAnalysisViewReducer.d.ts +47 -0
  170. package/lib/view/expenseAutomationView/reducers/fluxAnalysisViewReducer.js +241 -0
  171. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +53 -0
  172. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +245 -0
  173. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +31 -0
  174. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +130 -0
  175. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +5 -0
  176. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +45 -0
  177. package/lib/view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes.d.ts +34 -0
  178. package/lib/view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes.js +44 -0
  179. package/lib/view/expenseAutomationView/selectorTypes/fluxAnalysisViewSelectorTypes.d.ts +32 -0
  180. package/lib/view/expenseAutomationView/selectorTypes/fluxAnalysisViewSelectorTypes.js +2 -0
  181. package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +28 -0
  182. package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.js +2 -0
  183. package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +11 -0
  184. package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.js +2 -0
  185. package/lib/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.d.ts +3 -0
  186. package/lib/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +89 -0
  187. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.d.ts +7 -0
  188. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +95 -0
  189. package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.d.ts +3 -0
  190. package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +61 -0
  191. package/lib/view/expenseAutomationView/types/fluxAnalysisViewState.d.ts +54 -0
  192. package/lib/view/expenseAutomationView/types/fluxAnalysisViewState.js +5 -0
  193. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +31 -0
  194. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +2 -0
  195. package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +20 -0
  196. package/lib/view/expenseAutomationView/types/missingReceiptsViewState.js +13 -0
  197. package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +28 -0
  198. package/lib/view/expenseAutomationView/types/transactionsViewState.js +15 -0
  199. package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
  200. package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
  201. package/lib/view/monthEndCloseChecksView/epics/fetchMonthEndCloseChecksEpic.d.ts +8 -0
  202. package/lib/view/monthEndCloseChecksView/epics/fetchMonthEndCloseChecksEpic.js +58 -0
  203. package/lib/view/monthEndCloseChecksView/monthEndCloseChecksViewPayload.d.ts +3 -0
  204. package/lib/view/monthEndCloseChecksView/monthEndCloseChecksViewPayload.js +2 -0
  205. package/lib/view/monthEndCloseChecksView/monthEndCloseChecksViewReducer.d.ts +16 -0
  206. package/lib/view/monthEndCloseChecksView/monthEndCloseChecksViewReducer.js +36 -0
  207. package/lib/view/monthEndCloseChecksView/monthEndCloseChecksViewSelector.d.ts +10 -0
  208. package/lib/view/monthEndCloseChecksView/monthEndCloseChecksViewSelector.js +27 -0
  209. package/lib/view/monthEndCloseChecksView/monthEndCloseChecksViewState.d.ts +5 -0
  210. package/lib/view/monthEndCloseChecksView/monthEndCloseChecksViewState.js +2 -0
  211. package/lib/view/onboardingView/customerView/epic/customerDetails/fetchOnboardingCustomerViewEpic.d.ts +8 -1
  212. package/lib/view/onboardingView/customerView/epic/customerDetails/fetchOnboardingCustomerViewEpic.js +3 -1
  213. package/lib/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewEpic.js +5 -4
  214. package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.d.ts +2 -0
  215. package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.js +6 -3
  216. package/lib/view/people/changeZeniPersonRolesEpic.d.ts +1 -1
  217. package/lib/view/people/deletePersonEpic.d.ts +1 -1
  218. package/lib/view/people/invitePeopleEpic.d.ts +1 -1
  219. package/lib/view/people/inviteZeniPeopleEpic.d.ts +1 -1
  220. package/lib/view/people/resendInviteEpic.d.ts +1 -1
  221. package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
  222. package/lib/view/reviewCompanyView/reviewCompanyViewState.d.ts +1 -1
  223. package/lib/view/scheduleView/scheduleAccruedDetailView/LinkBillExpenseView/linkBillExpense.d.ts +1 -1
  224. package/lib/view/scheduleView/scheduleDetailView/epics/fetchScheduleDetailsEpic.js +3 -2
  225. package/lib/view/scheduleView/scheduleDetailView/epics/fetchScheduleDetailsPageEpic.js +1 -1
  226. package/lib/view/scheduleView/scheduleDetailView/epics/saveScheduleDetailsEpic.js +2 -2
  227. package/lib/view/scheduleView/scheduleDetailView/scheduleDetailLocalDataHelper.js +19 -5
  228. package/lib/view/scheduleView/scheduleDetailView/scheduleDetailPayload.d.ts +8 -3
  229. package/lib/view/scheduleView/scheduleDetailView/scheduleDetailPayload.js +39 -57
  230. package/lib/view/scheduleView/scheduleDetailView/scheduleDetailReducer.d.ts +13 -8
  231. package/lib/view/scheduleView/scheduleDetailView/scheduleDetailReducer.js +19 -12
  232. package/lib/view/scheduleView/scheduleDetailView/scheduleDetailSelector.d.ts +1 -0
  233. package/lib/view/scheduleView/scheduleDetailView/scheduleDetailSelector.js +4 -3
  234. package/lib/view/scheduleView/scheduleDetailView/scheduleDetailState.d.ts +2 -0
  235. package/lib/view/scheduleView/scheduleListView/scheduleListSelector.js +1 -1
  236. package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
  237. package/lib/view/settingsView/epic/saveNotificationSettingsEpic.d.ts +1 -1
  238. package/lib/view/settingsView/epic/updateMyProfileEpic.js +6 -4
  239. package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigState.d.ts +1 -4
  240. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +2 -0
  241. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +3 -0
  242. package/lib/view/spendManagement/billPay/editBillView/epics/parseInvoiceToBillEpic.js +2 -2
  243. package/lib/view/spendManagement/billPay/internationalWire/internationalWireSelector.d.ts +2 -1
  244. package/lib/view/spendManagement/billPay/internationalWireVerification/epics/fetchIntlVerificationFormEpic.d.ts +7 -0
  245. package/lib/view/spendManagement/billPay/internationalWireVerification/epics/fetchIntlVerificationFormEpic.js +36 -0
  246. package/lib/view/spendManagement/billPay/internationalWireVerification/epics/initializeIntlVerificationFormEpic.d.ts +6 -0
  247. package/lib/view/spendManagement/billPay/internationalWireVerification/epics/initializeIntlVerificationFormEpic.js +42 -0
  248. package/lib/view/spendManagement/billPay/internationalWireVerification/epics/submitIntlVerificationEpic.d.ts +9 -0
  249. package/lib/view/spendManagement/billPay/internationalWireVerification/epics/submitIntlVerificationEpic.js +67 -0
  250. package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationPayload.d.ts +26 -0
  251. package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationPayload.js +22 -0
  252. package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationReducer.d.ts +22 -0
  253. package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationReducer.js +89 -0
  254. package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationSelector.d.ts +15 -0
  255. package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationSelector.js +30 -0
  256. package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationState.d.ts +20 -0
  257. package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationState.js +2 -0
  258. package/lib/view/spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingReducer.d.ts +3 -1
  259. package/lib/view/spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingReducer.js +6 -2
  260. package/lib/view/spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingSelector.d.ts +2 -3
  261. package/lib/view/spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingSelector.js +3 -3
  262. package/lib/view/spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingState.d.ts +1 -3
  263. package/lib/view/spendManagement/chargeCards/cardUserOnboarding/epics/initializeCardUserOnboardingLocalDataEpic.d.ts +1 -2
  264. package/lib/view/spendManagement/chargeCards/cardUserOnboarding/epics/initializeCardUserOnboardingLocalDataEpic.js +1 -21
  265. package/lib/view/spendManagement/chargeCards/cardUserOnboarding/epics/saveCardOnboardingUserDetailsEpic.js +1 -3
  266. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.d.ts +1 -0
  267. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.js +4 -0
  268. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.d.ts +8 -1
  269. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +25 -2
  270. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.d.ts +1 -0
  271. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.js +8 -4
  272. package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.js +2 -1
  273. package/lib/view/spendManagement/chargeCards/chargeCardDetail/updatePhysicalChargeCardAttemptEpic.d.ts +11 -0
  274. package/lib/view/spendManagement/chargeCards/chargeCardDetail/updatePhysicalChargeCardAttemptEpic.js +42 -0
  275. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -14
  276. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +2 -13
  277. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.d.ts +3 -6
  278. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +2 -17
  279. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.d.ts +8 -2
  280. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +55 -15
  281. package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchIssueCardPageEpic.d.ts +9 -0
  282. package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchIssueCardPageEpic.js +44 -0
  283. package/lib/view/spendManagement/chargeCards/{chargeCardList → issueChargeCard}/issueChargeCardEpic.d.ts +3 -2
  284. package/lib/view/spendManagement/chargeCards/{chargeCardList → issueChargeCard}/issueChargeCardEpic.js +35 -18
  285. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.d.ts +15 -0
  286. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.js +65 -0
  287. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.d.ts +22 -0
  288. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.js +77 -0
  289. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardState.d.ts +28 -0
  290. package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardState.js +23 -0
  291. package/lib/view/spendManagement/commonSetup/epic/setup/updateBusinessVerificationDetailsEpic.d.ts +1 -1
  292. package/lib/view/spendManagement/commonSetup/epic/setup/updateBusinessVerificationDetailsEpic.js +31 -6
  293. package/lib/view/spendManagement/commonSetup/epic/setup/updateSetupViewLocalStoreDataEpic.d.ts +2 -2
  294. package/lib/view/spendManagement/commonSetup/epic/setup/updateSetupViewLocalStoreDataEpic.js +5 -2
  295. package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +4 -1
  296. package/lib/view/spendManagement/commonSetup/setupViewSelector.js +6 -2
  297. package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +1 -0
  298. package/lib/view/spendManagement/commonSetup/types/businessVerification.d.ts +4 -0
  299. package/lib/view/spendManagement/reimbursement/editRemiView/epics/parseReceiptsToRemiEpic.js +2 -2
  300. package/lib/view/subscriptionView/types/subscriptionTypes.d.ts +1 -1
  301. package/lib/view/tagView/epics/createTagEpic.d.ts +1 -1
  302. package/lib/view/tagView/epics/deleteTagEpic.d.ts +1 -1
  303. package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
  304. package/lib/view/topEx/topExSelector.d.ts +1 -1
  305. package/lib/view/transactionDetail/epics/uploadMissingReceiptSuccessEpic.js +2 -2
  306. package/lib/view/transactionDetail/transactionDetailState.d.ts +2 -2
  307. package/lib/view/userListView/fetchUserListByTypeEpic.js +4 -1
  308. package/lib/view/vendorFiling1099/__mock__/vendorFiling1099ListMock.js +1 -1
  309. package/lib/view/vendorFiling1099/__mock__/vendorFiling1099ListSelectorMock.js +1 -1
  310. package/lib/view/vendorReviewView/common/state/commonTypes.d.ts +1 -1
  311. package/lib/view/vendorReviewView/vendorFirstReviewView/epics/saveVendorFirstReviewViewEpic.js +34 -3
  312. package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewReducer.d.ts +1 -1
  313. package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewReducer.js +2 -2
  314. package/lib/view/zeniAccStatementList/zeniAccStatementList.d.ts +2 -5
  315. package/package.json +2 -2
  316. package/lib/commonPayloadTypes/v2/getSumOfBalancesGroupedByPeriod.d.ts +0 -0
  317. package/lib/commonPayloadTypes/v2/getSumOfBalancesGroupedByPeriod.js +0 -1
  318. package/lib/commonStateTypes/selectorTypes/pickAndMergeForecastSectionWithAcOnly.d.ts +0 -0
  319. package/lib/commonStateTypes/selectorTypes/pickAndMergeForecastSectionWithAcOnly.js +0 -1
@@ -28,10 +28,14 @@ const apAgingReducer_1 = require("../apAgingView/apAgingReport/apAgingReducer");
28
28
  const arAgingReducer_1 = require("../arAgingView/arAgingReport/arAgingReducer");
29
29
  const zeniAccountsPromoCardReducer_1 = require("../zeniAccountsPromoCard/zeniAccountsPromoCardReducer");
30
30
  const referralReducer_1 = require("../referralView/referralReducer");
31
+ const monthEndCloseChecksViewReducer_1 = require("../monthEndCloseChecksView/monthEndCloseChecksViewReducer");
32
+ const timePeriod_1 = require("../../commonStateTypes/timePeriod");
33
+ const fetchAllTenantsEpic_1 = require("../../entity/tenant/epic/fetchAllTenantsEpic");
31
34
  const fetchDashboardEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(dashboardReducer_1.fetchDashboard.match), (0, operators_1.switchMap)((action) => {
32
- var _a, _b, _c, _d;
33
- const { userId, companyId, fetchFullReport, cacheOverride, excludeResources, } = action.payload;
35
+ var _a, _b, _c, _d, _e, _f, _g, _h;
36
+ const { userId, companyId, fetchFullReport, cacheOverride, excludeResources, tenantId, } = action.payload;
34
37
  const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state$.value);
38
+ const zeniBookCloseDate = currentTenant.zeniBookCloseDate;
35
39
  const isReimbursementFeatureEnabled = (_a = currentTenant.company) === null || _a === void 0 ? void 0 : _a.featuresActivationInfo.isReimbursementFeatureEnabled;
36
40
  const isAdmin = Boolean(currentTenant === null || currentTenant === void 0 ? void 0 : currentTenant.userRole) === true
37
41
  ? (0, userRoleType_1.hasAdminLevelAccess)(currentTenant.userRole)
@@ -39,6 +43,7 @@ const fetchDashboardEpic = (actions$, state$) => actions$.pipe((0, operators_1.f
39
43
  const isInvestorBanker = (0, userRoleType_1.hasInvestorBankerLevelAccess)(currentTenant.userRole);
40
44
  const arAgingDate = state$.value.arAgingState.uiState.selectedDate;
41
45
  const apAgingDate = state$.value.apAgingState.uiState.selectedDate;
46
+ const monthEndChecksPeriod = (0, fetchAllTenantsEpic_1.getMonthYearPeriodFromBookCloseDate)(zeniBookCloseDate);
42
47
  if (cacheOverride === true) {
43
48
  const actions = [
44
49
  (0, tenantReducer_1.fetchAllTenants)(userId),
@@ -73,6 +78,12 @@ const fetchDashboardEpic = (actions$, state$) => actions$.pipe((0, operators_1.f
73
78
  if (excludeResources.includes('rewards_card') === false) {
74
79
  actions.push((0, referralReducer_1.fetchRewardsPlan)(true));
75
80
  }
81
+ if (excludeResources.includes('expense_automation_card') === false) {
82
+ actions.push((0, monthEndCloseChecksViewReducer_1.fetchMonthEndCloseChecks)({
83
+ tenantId,
84
+ period: monthEndChecksPeriod,
85
+ }));
86
+ }
76
87
  return (0, rxjs_1.from)(actions);
77
88
  }
78
89
  else {
@@ -170,6 +181,15 @@ const fetchDashboardEpic = (actions$, state$) => actions$.pipe((0, operators_1.f
170
181
  excludeResources.includes('rewards_card') === false) {
171
182
  fetchActions.push((0, referralReducer_1.fetchRewardsPlan)(true));
172
183
  }
184
+ const monthEndChecksId = (0, timePeriod_1.toMonthYearPeriodId)(monthEndChecksPeriod);
185
+ if (((_f = (_e = state.monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]) === null || _e === void 0 ? void 0 : _e[monthEndChecksId]) === null || _f === void 0 ? void 0 : _f.fetchState) !== 'In-Progress' &&
186
+ ((_h = (_g = state.monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]) === null || _g === void 0 ? void 0 : _g[monthEndChecksId]) === null || _h === void 0 ? void 0 : _h.fetchState) !== 'Completed' &&
187
+ excludeResources.includes('expense_automation_card') === false) {
188
+ fetchActions.push((0, monthEndCloseChecksViewReducer_1.fetchMonthEndCloseChecks)({
189
+ tenantId,
190
+ period: monthEndChecksPeriod,
191
+ }));
192
+ }
173
193
  return (0, rxjs_1.from)(fetchActions);
174
194
  }
175
195
  }));
@@ -1,11 +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, fetchFullReport?: any, cacheOverride?: any, excludeResources?: ("cash_balance" | "card_balance" | "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" | "charge_cards" | "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")[] | 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" | "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" | "charge_cards" | "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")[] | undefined], {
4
4
  userId: string;
5
5
  companyId: string;
6
+ tenantId: string;
6
7
  fetchFullReport: any;
7
8
  cacheOverride: any;
8
- excludeResources: ("cash_balance" | "card_balance" | "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" | "charge_cards" | "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")[];
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" | "charge_cards" | "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")[];
9
10
  }, string, never, never>, clearDashboard: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
10
11
  declare const _default: import("@reduxjs/toolkit").Reducer<DashboardState, import("@reduxjs/toolkit").AnyAction>;
11
12
  export default _default;
@@ -15,11 +15,12 @@ const dashboard = (0, toolkit_1.createSlice)({
15
15
  reducer(draft) {
16
16
  draft.lastFetchRequestTime = (0, zeniDayJS_1.dateNow)();
17
17
  },
18
- prepare(userId, companyId, fetchFullReport = false, cacheOverride = false, excludeResources = []) {
18
+ prepare(userId, companyId, tenantId, fetchFullReport = false, cacheOverride = false, excludeResources = []) {
19
19
  return {
20
20
  payload: {
21
21
  userId,
22
22
  companyId,
23
+ tenantId,
23
24
  fetchFullReport,
24
25
  cacheOverride,
25
26
  excludeResources,
@@ -18,6 +18,7 @@ import { ApAgingReport } from '../apAgingView/apAgingReport/apAgingSelector';
18
18
  import { ArAgingReport } from '../arAgingView/arAgingReport/arAgingSelector';
19
19
  import { ZeniAccountsPromoCardReport } from '../zeniAccountsPromoCard/zeniAccountsPromoCardSelector';
20
20
  import { RewardsPlanCardReport } from '../referralView/referralSelector';
21
+ import { MonthEndCloseChecksView } from '../monthEndCloseChecksView/monthEndCloseChecksViewSelector';
21
22
  export interface DashboardReport extends SelectorReport {
22
23
  tenantsOrdered: TenantsOrdered;
23
24
  currentTenant?: Tenant;
@@ -38,5 +39,6 @@ export interface DashboardReport extends SelectorReport {
38
39
  arAgingReport: ArAgingReport;
39
40
  zeniAccountsPromoCard: ZeniAccountsPromoCardReport;
40
41
  rewardsPlanCard: RewardsPlanCardReport;
42
+ monthEndCloseChecksView: MonthEndCloseChecksView;
41
43
  }
42
44
  export declare const getDashboard: (state: RootState, additionalExcludedReports: ReportID[]) => DashboardReport;
@@ -24,6 +24,7 @@ const apAgingSelector_1 = require("../apAgingView/apAgingReport/apAgingSelector"
24
24
  const arAgingSelector_1 = require("../arAgingView/arAgingReport/arAgingSelector");
25
25
  const zeniAccountsPromoCardSelector_1 = require("../zeniAccountsPromoCard/zeniAccountsPromoCardSelector");
26
26
  const referralSelector_1 = require("../referralView/referralSelector");
27
+ const monthEndCloseChecksViewSelector_1 = require("../monthEndCloseChecksView/monthEndCloseChecksViewSelector");
27
28
  const getNetBurnOrIncomeForLast4Periods = (state) => {
28
29
  return (0, netBurnOrIncomeSelector_1.getNetBurnOrIncomeReport)(state.accountState, state.accountGroupState, state.sectionAccountsViewState, state.netBurnOrIncomeState, state.forecastState, state.forecastListState, (0, coaBalancesFilter_1.newBalancesFilter)(state.netBurnOrIncomeState.netBurnOrIncome.firstMonthOfFY, state.netBurnOrIncomeState.uiState.timeframe, 4, undefined, 'ascending_date', state.netBurnOrIncomeState.uiState.selectedAdditionalBalances));
29
30
  };
@@ -40,7 +41,10 @@ const tenantSelector = (0, toolkit_1.createSelector)(tenantSelector_1.getTenants
40
41
  tenantsOrdered,
41
42
  currentTenant,
42
43
  }));
43
- exports.getDashboard = (0, toolkit_1.createSelector)(tenantSelector, cardBalanceSelector_1.getCardBalance, cashBalanceSelector_1.getCashBalance, getOperatingExpensesForLast5Periods, getRevenueForLast4Periods, topExSelector_1.getTop6Expenses, getNetBurnOrIncomeForLast4Periods, getNetBurnOrIncomeStoryCard, getCashPositionLast5Periods, getCashInCashOutLast4Periods, insightsCardSelector_1.getInsights, companyPassportViewSelector_1.getCompanyPassportView, tasksCardSelector_1.getTasksCardReport, billPayCardSelector_1.getBillPayCardReport, reimbursementCardSelector_1.getReimbursementCardReport, apAgingSelector, arAgingSelector, zeniAccountsPromoCardSelector_1.getZeniAccountsPromoCard, referralSelector_1.getRewardsPlanCard, (state) => state.tenantState, (_state, additionalExcludedReports) => additionalExcludedReports, (tenants, cardBalance, cashBalance, opEx, revenue, topEx, netBurnOrIncome, netBurnOrIncomeStoryCard, cashPosition, cashInCashOut, insightsView, companyPassportView, tasksCard, billPayCard, reimbursementCard, apAgingReport, arAgingReport, zeniAccountsPromoCard, rewardsPlanCard, tenantState, additionalExcludedReports) => {
44
+ exports.getDashboard = (0, toolkit_1.createSelector)(tenantSelector, cardBalanceSelector_1.getCardBalance, cashBalanceSelector_1.getCashBalance, getOperatingExpensesForLast5Periods, getRevenueForLast4Periods, topExSelector_1.getTop6Expenses, getNetBurnOrIncomeForLast4Periods, getNetBurnOrIncomeStoryCard, getCashPositionLast5Periods, getCashInCashOutLast4Periods, insightsCardSelector_1.getInsights, companyPassportViewSelector_1.getCompanyPassportView, tasksCardSelector_1.getTasksCardReport, billPayCardSelector_1.getBillPayCardReport, reimbursementCardSelector_1.getReimbursementCardReport, apAgingSelector, arAgingSelector, zeniAccountsPromoCardSelector_1.getZeniAccountsPromoCard, referralSelector_1.getRewardsPlanCard, (state) => {
45
+ const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
46
+ return (0, monthEndCloseChecksViewSelector_1.getMonthEndCloseChecksViewByTenantId)(state, currentTenant.tenantId);
47
+ }, (state) => state.tenantState, (_state, additionalExcludedReports) => additionalExcludedReports, (tenants, cardBalance, cashBalance, opEx, revenue, topEx, netBurnOrIncome, netBurnOrIncomeStoryCard, cashPosition, cashInCashOut, insightsView, companyPassportView, tasksCard, billPayCard, reimbursementCard, apAgingReport, arAgingReport, zeniAccountsPromoCard, rewardsPlanCard, monthEndCloseChecksView, tenantState, additionalExcludedReports) => {
44
48
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
45
49
  const isReimbursementFeatureEnabled = (_a = tenants.currentTenant.company) === null || _a === void 0 ? void 0 : _a.featuresActivationInfo.isReimbursementFeatureEnabled;
46
50
  const isAdmin = Boolean((_b = tenants.currentTenant) === null || _b === void 0 ? void 0 : _b.userRole) === true
@@ -63,6 +67,9 @@ exports.getDashboard = (0, toolkit_1.createSelector)(tenantSelector, cardBalance
63
67
  insightsView,
64
68
  Object.assign(Object.assign({}, companyPassportView), { reportId: 'company_details', reportTitle: 'Company Details' }),
65
69
  ];
70
+ if (additionalExcludedReports.includes('expense_automation_card') === false) {
71
+ reportsInOrder.push(monthEndCloseChecksView);
72
+ }
66
73
  if (additionalExcludedReports.includes('accounts_payable_aging') === false) {
67
74
  reportsInOrder.push(apAgingReport);
68
75
  }
@@ -106,5 +113,6 @@ exports.getDashboard = (0, toolkit_1.createSelector)(tenantSelector, cardBalance
106
113
  apAgingReport,
107
114
  arAgingReport,
108
115
  zeniAccountsPromoCard,
109
- rewardsPlanCard });
116
+ rewardsPlanCard,
117
+ monthEndCloseChecksView });
110
118
  });
@@ -0,0 +1,10 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { RootState } from '../../../../reducer';
4
+ import { fetchAllExpenseAutomationTabs } from '../../expenseAutomationViewReducer';
5
+ import { fetchMissingReceipts } from '../../reducers/missingReceiptsViewReducer';
6
+ import { fetchFluxAnalysisView } from '../../reducers/fluxAnalysisViewReducer';
7
+ import { fetchMonthEndCloseChecks } from '../../../monthEndCloseChecksView/monthEndCloseChecksViewReducer';
8
+ import { fetchJeSchedulesPage } from '../../reducers/jeSchedulesViewReducer';
9
+ export declare type ActionType = ReturnType<typeof fetchAllExpenseAutomationTabs> | ReturnType<typeof fetchMissingReceipts> | ReturnType<typeof fetchMonthEndCloseChecks> | ReturnType<typeof fetchFluxAnalysisView> | ReturnType<typeof fetchJeSchedulesPage>;
10
+ export declare const fetchAllExpenseAutomationTabsEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fetchAllExpenseAutomationTabsEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const expenseAutomationViewReducer_1 = require("../../expenseAutomationViewReducer");
7
+ const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
8
+ const fluxAnalysisViewReducer_1 = require("../../reducers/fluxAnalysisViewReducer");
9
+ const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
10
+ const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
11
+ const jeSchedulesViewReducer_1 = require("../../reducers/jeSchedulesViewReducer");
12
+ const fetchAllExpenseAutomationTabsEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(expenseAutomationViewReducer_1.fetchAllExpenseAutomationTabs.match), (0, operators_1.switchMap)((action) => {
13
+ const { cacheOverride, refreshViewInBackground } = action.payload;
14
+ const state = state$.value;
15
+ const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
16
+ const companyId = currentTenant.companyId;
17
+ const selectedPeriod = state.expenseAutomationViewState.selectedPeriodByTenantId[currentTenant.tenantId];
18
+ const period = (0, timePeriod_1.convertToPeriod)(selectedPeriod);
19
+ const timePeriodStart = (0, timePeriod_1.toAbsoluteDay)(period.start);
20
+ const timePeriodEnd = (0, timePeriod_1.toAbsoluteDay)(period.end);
21
+ const monthYearPeriodId = (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod);
22
+ if (timePeriodStart == null ||
23
+ timePeriodEnd == null ||
24
+ companyId == null) {
25
+ throw Error(`Invalid start - ${timePeriodStart} and end - ${timePeriodEnd} period from given ${selectedPeriod}`);
26
+ }
27
+ if (cacheOverride === true) {
28
+ return (0, rxjs_1.from)([
29
+ (0, missingReceiptsViewReducer_1.fetchMissingReceipts)({ start: timePeriodStart, end: timePeriodEnd }, {
30
+ amount: 75.0,
31
+ currencyCode: 'USD',
32
+ currencySymbol: '$',
33
+ }, cacheOverride, refreshViewInBackground),
34
+ // TOODO - Vivek - Add fetch state
35
+ (0, fluxAnalysisViewReducer_1.fetchFluxAnalysisView)(selectedPeriod, cacheOverride, refreshViewInBackground, null),
36
+ (0, jeSchedulesViewReducer_1.fetchJeSchedulesPage)({ start: timePeriodStart, end: timePeriodEnd }, cacheOverride),
37
+ ]);
38
+ }
39
+ else {
40
+ const fetchActions = [];
41
+ if (state.expenseAutomationMissingReceiptsViewState.fetchState !==
42
+ 'In-Progress' &&
43
+ (!state.expenseAutomationMissingReceiptsViewState.hasValidState() ||
44
+ state.expenseAutomationMissingReceiptsViewState
45
+ .transactionIdsBySelectedPeriod[monthYearPeriodId] == null)) {
46
+ fetchActions.push((0, missingReceiptsViewReducer_1.fetchMissingReceipts)({ start: timePeriodStart, end: timePeriodEnd }, {
47
+ amount: 75.0,
48
+ currencyCode: '',
49
+ currencySymbol: '',
50
+ }, cacheOverride, refreshViewInBackground));
51
+ }
52
+ // TOODO - Vivek - Add fetch state
53
+ if (state.expenseAutomationFluxAnalysisViewState.fetchState !==
54
+ 'In-Progress' &&
55
+ (!state.expenseAutomationFluxAnalysisViewState.hasValidState() ||
56
+ state.expenseAutomationFluxAnalysisViewState
57
+ .operatingExpenseIdsBySelectedPeriod[monthYearPeriodId] == null)) {
58
+ fetchActions.push((0, fluxAnalysisViewReducer_1.fetchFluxAnalysisView)(selectedPeriod, cacheOverride, refreshViewInBackground, null));
59
+ }
60
+ if (state.expenseAutomationJESchedulesViewState.fetchState !==
61
+ 'In-Progress' &&
62
+ (!state.expenseAutomationJESchedulesViewState.hasValidState() ||
63
+ state.expenseAutomationJESchedulesViewState
64
+ .jeScheduleTransactionKeysByPeriod[monthYearPeriodId] == null ||
65
+ state.expenseAutomationJESchedulesViewState
66
+ .failedJeScheduleTransactionKeysByPeriod[monthYearPeriodId] ==
67
+ null)) {
68
+ fetchActions.push((0, jeSchedulesViewReducer_1.fetchJeSchedulesPage)({ start: timePeriodStart, end: timePeriodEnd }, cacheOverride));
69
+ }
70
+ return (0, rxjs_1.from)(fetchActions);
71
+ }
72
+ }));
73
+ exports.fetchAllExpenseAutomationTabsEpic = fetchAllExpenseAutomationTabsEpic;
@@ -0,0 +1,11 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { RootState } from '../../../../reducer';
4
+ import { refreshExpenseAutomationCurrentTab } from '../../expenseAutomationViewReducer';
5
+ import { fetchMissingReceipts } from '../../reducers/missingReceiptsViewReducer';
6
+ import { fetchFluxAnalysisView } from '../../reducers/fluxAnalysisViewReducer';
7
+ import { fetchCompanyMonthEndReportView, fetchCompanyMonthEndReportTemplates } from '../../../companyMonthEndReportView/companyMonthEndReportViewReducer';
8
+ import { fetchMonthEndCloseChecks } from '../../../monthEndCloseChecksView/monthEndCloseChecksViewReducer';
9
+ import { fetchJeSchedulesPage } from '../../reducers/jeSchedulesViewReducer';
10
+ export declare type ActionType = ReturnType<typeof refreshExpenseAutomationCurrentTab> | ReturnType<typeof fetchCompanyMonthEndReportView> | ReturnType<typeof fetchCompanyMonthEndReportTemplates> | ReturnType<typeof fetchMissingReceipts> | ReturnType<typeof fetchMonthEndCloseChecks> | ReturnType<typeof fetchFluxAnalysisView> | ReturnType<typeof fetchJeSchedulesPage>;
11
+ export declare const refreshExpenseAutomationCurrentTabEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.refreshExpenseAutomationCurrentTabEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const expenseAutomationViewReducer_1 = require("../../expenseAutomationViewReducer");
7
+ const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
8
+ const fluxAnalysisViewReducer_1 = require("../../reducers/fluxAnalysisViewReducer");
9
+ const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
10
+ const companyMonthEndReportViewReducer_1 = require("../../../companyMonthEndReportView/companyMonthEndReportViewReducer");
11
+ const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
12
+ const jeSchedulesViewReducer_1 = require("../../reducers/jeSchedulesViewReducer");
13
+ const refreshExpenseAutomationCurrentTabEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(expenseAutomationViewReducer_1.refreshExpenseAutomationCurrentTab.match), (0, operators_1.switchMap)(() => {
14
+ const state = state$.value;
15
+ const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
16
+ const companyId = currentTenant.companyId;
17
+ const { selectedPeriodByTenantId, currentSelectedView } = state.expenseAutomationViewState;
18
+ const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
19
+ const period = (0, timePeriod_1.convertToPeriod)(selectedPeriod);
20
+ const timePeriodStart = (0, timePeriod_1.toAbsoluteDay)(period.start);
21
+ const timePeriodEnd = (0, timePeriod_1.toAbsoluteDay)(period.end);
22
+ if (timePeriodStart == null ||
23
+ timePeriodEnd == null ||
24
+ companyId == null) {
25
+ throw Error(`Invalid start - ${timePeriodStart} and end - ${timePeriodEnd} period from given ${selectedPeriod}`);
26
+ }
27
+ switch (currentSelectedView) {
28
+ case 'missing_receipts':
29
+ return (0, rxjs_1.from)([
30
+ (0, missingReceiptsViewReducer_1.fetchMissingReceipts)({ start: timePeriodStart, end: timePeriodEnd }, {
31
+ amount: 75.0,
32
+ currencyCode: 'USD',
33
+ currencySymbol: '$',
34
+ }, true, true),
35
+ ]);
36
+ case 'flux_analysis':
37
+ return (0, rxjs_1.from)([
38
+ (0, fluxAnalysisViewReducer_1.fetchFluxAnalysisView)(selectedPeriod, true, true, null),
39
+ ]);
40
+ case 'je_schedules':
41
+ return (0, rxjs_1.from)([
42
+ (0, jeSchedulesViewReducer_1.fetchJeSchedulesPage)({ start: timePeriodStart, end: timePeriodEnd }, true),
43
+ ]);
44
+ case 'month_end_insights':
45
+ return (0, rxjs_1.from)([
46
+ (0, companyMonthEndReportViewReducer_1.fetchCompanyMonthEndReportView)(true, companyId),
47
+ (0, companyMonthEndReportViewReducer_1.fetchCompanyMonthEndReportTemplates)(companyId),
48
+ ]);
49
+ case 'transaction_categorization':
50
+ default:
51
+ // TODO - Vivek - Add fetch state
52
+ return (0, rxjs_1.from)([]);
53
+ }
54
+ }));
55
+ exports.refreshExpenseAutomationCurrentTabEpic = refreshExpenseAutomationCurrentTabEpic;
@@ -0,0 +1,11 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { ZeniAPI } from '../../../../zeniAPI';
4
+ import { RootState } from '../../../../reducer';
5
+ import { fetchFluxAnalysisView, fetchFluxAnalysisViewSuccess, fetchFluxAnalysisViewFailure, updateFluxAnalysisViewPageMetaData } from '../../reducers/fluxAnalysisViewReducer';
6
+ import { updateAccounts } from '../../../../entity/account/accountReducer';
7
+ import { updateClasses } from '../../../../entity/class/classReducer';
8
+ import { updateVendors } from '../../../../entity/vendor/vendorReducer';
9
+ import { updateAllUsers } from '../../../../entity/user/userReducer';
10
+ export declare type ActionType = ReturnType<typeof fetchFluxAnalysisView> | ReturnType<typeof updateFluxAnalysisViewPageMetaData> | ReturnType<typeof fetchFluxAnalysisViewSuccess> | ReturnType<typeof fetchFluxAnalysisViewFailure> | ReturnType<typeof updateAccounts> | ReturnType<typeof updateClasses> | ReturnType<typeof updateVendors> | ReturnType<typeof updateAllUsers>;
11
+ export declare const fetchFluxAnalysisViewEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fetchFluxAnalysisViewEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const responsePayload_1 = require("../../../../responsePayload");
7
+ const fluxAnalysisViewReducer_1 = require("../../reducers/fluxAnalysisViewReducer");
8
+ const helpers_1 = require("../../helpers/helpers");
9
+ const accountReducer_1 = require("../../../../entity/account/accountReducer");
10
+ const classReducer_1 = require("../../../../entity/class/classReducer");
11
+ const vendorReducer_1 = require("../../../../entity/vendor/vendorReducer");
12
+ const userReducer_1 = require("../../../../entity/user/userReducer");
13
+ const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
14
+ const sortOrderPayload_1 = require("../../../../commonPayloadTypes/sortOrderPayload");
15
+ const fetchFluxAnalysisViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(fluxAnalysisViewReducer_1.fetchFluxAnalysisView.match), (0, operators_1.switchMap)((action) => {
16
+ var _a;
17
+ const { expenseAutomationFluxAnalysisViewState: { fetchState, operatingExpenseIdsBySelectedPeriod, uiState, }, } = state$.value;
18
+ const { monthAndYear, cacheOverride, pageToken, keepExistingListItems } = action.payload;
19
+ const operatingExpenseIds = (_a = operatingExpenseIdsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(monthAndYear)]) !== null && _a !== void 0 ? _a : [];
20
+ if (cacheOverride === true ||
21
+ operatingExpenseIds.length === 0 ||
22
+ fetchState === 'Not-Started') {
23
+ const queryParam = {
24
+ month_and_year: (0, timePeriod_1.toMonthYearPeriodQuery)(monthAndYear),
25
+ sort_by: (0, helpers_1.toVendorFluxAnalysisSortKeyPayload)(uiState.sortKey),
26
+ sort_order: (0, sortOrderPayload_1.getSortOrder)(uiState.sortOrder),
27
+ page_token: pageToken,
28
+ };
29
+ return zeniAPI
30
+ .getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/month-close/flux-analysis?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
31
+ .pipe((0, operators_1.mergeMap)((response) => {
32
+ var _a, _b;
33
+ if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
34
+ const updateActions = [];
35
+ updateActions.push((0, accountReducer_1.updateAccounts)(response.data.accounts, 'account_list'));
36
+ updateActions.push((0, classReducer_1.updateClasses)('class_list', response.data.accounting_class));
37
+ updateActions.push((0, vendorReducer_1.updateVendors)(response.data.vendors, 'merge'));
38
+ updateActions.push((0, userReducer_1.updateAllUsers)({
39
+ users: response.data.users,
40
+ updateType: 'merge',
41
+ }));
42
+ updateActions.push((0, fluxAnalysisViewReducer_1.updateFluxAnalysisViewPageMetaData)({
43
+ pageMetaData: response.data.page_metadata,
44
+ }));
45
+ if (((_a = response.data.flux_analysis_entities) === null || _a === void 0 ? void 0 : _a.operating_expenses) !=
46
+ null) {
47
+ updateActions.push((0, fluxAnalysisViewReducer_1.fetchFluxAnalysisViewSuccess)({
48
+ expensesPayload: (_b = response.data.flux_analysis_entities) === null || _b === void 0 ? void 0 : _b.operating_expenses,
49
+ currency: response.data.currency,
50
+ selectedPeriod: monthAndYear,
51
+ keepExistingListItems,
52
+ }));
53
+ }
54
+ return (0, rxjs_1.from)(updateActions);
55
+ }
56
+ else {
57
+ return (0, rxjs_1.of)((0, fluxAnalysisViewReducer_1.fetchFluxAnalysisViewFailure)({
58
+ status: response.status,
59
+ selectedPeriod: monthAndYear,
60
+ }));
61
+ }
62
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, fluxAnalysisViewReducer_1.fetchFluxAnalysisViewFailure)({
63
+ status: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'fetch flux analysis view REST API call errored out' +
64
+ JSON.stringify(error)),
65
+ selectedPeriod: monthAndYear,
66
+ }))));
67
+ }
68
+ else {
69
+ return (0, rxjs_1.from)([]);
70
+ }
71
+ }));
72
+ exports.fetchFluxAnalysisViewEpic = fetchFluxAnalysisViewEpic;
@@ -0,0 +1,12 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { ZeniAPI } from '../../../../zeniAPI';
4
+ import { RootState } from '../../../../reducer';
5
+ import { reviewFluxAnalysisView, reviewFluxAnalysisViewFailure, reviewFluxAnalysisViewSuccess } from '../../reducers/fluxAnalysisViewReducer';
6
+ import { updateAccounts } from '../../../../entity/account/accountReducer';
7
+ import { updateClasses } from '../../../../entity/class/classReducer';
8
+ import { updateVendors } from '../../../../entity/vendor/vendorReducer';
9
+ import { updateAllUsers } from '../../../../entity/user/userReducer';
10
+ import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
11
+ export declare type ActionType = ReturnType<typeof reviewFluxAnalysisView> | ReturnType<typeof reviewFluxAnalysisViewSuccess> | ReturnType<typeof reviewFluxAnalysisViewFailure> | ReturnType<typeof openSnackbar> | ReturnType<typeof updateAccounts> | ReturnType<typeof updateClasses> | ReturnType<typeof updateVendors> | ReturnType<typeof updateAllUsers>;
12
+ export declare const reviewFluxAnalysisViewEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.reviewFluxAnalysisViewEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const responsePayload_1 = require("../../../../responsePayload");
7
+ const fluxAnalysisViewReducer_1 = require("../../reducers/fluxAnalysisViewReducer");
8
+ const accountReducer_1 = require("../../../../entity/account/accountReducer");
9
+ const classReducer_1 = require("../../../../entity/class/classReducer");
10
+ const vendorReducer_1 = require("../../../../entity/vendor/vendorReducer");
11
+ const userReducer_1 = require("../../../../entity/user/userReducer");
12
+ const helpers_1 = require("../../helpers/helpers");
13
+ const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
14
+ const reviewFluxAnalysisViewEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(fluxAnalysisViewReducer_1.reviewFluxAnalysisView.match), (0, operators_1.switchMap)((action) => {
15
+ const { actionType, operatingExpenseIds, selectedPeriod, isBulk } = action.payload;
16
+ const payload = Object.assign({}, getReviewFluxPayload(actionType, operatingExpenseIds));
17
+ return zeniAPI
18
+ .putAndGetJSON(`https://qa.api.zeni.ai/version/accounting/komal/1.0/month-close/flux-analysis`, payload)
19
+ .pipe((0, operators_1.mergeMap)((response) => {
20
+ var _a, _b;
21
+ if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
22
+ const updateActions = [];
23
+ updateActions.push((0, accountReducer_1.updateAccounts)(response.data.accounts, 'account_list'));
24
+ updateActions.push((0, classReducer_1.updateClasses)('class_list', response.data.accounting_class));
25
+ updateActions.push((0, vendorReducer_1.updateVendors)(response.data.vendors, 'merge'));
26
+ updateActions.push((0, userReducer_1.updateAllUsers)({
27
+ users: response.data.users,
28
+ updateType: 'merge',
29
+ }));
30
+ if (response.data.flux_analysis_entities != null) {
31
+ updateActions.push((0, fluxAnalysisViewReducer_1.reviewFluxAnalysisViewSuccess)({
32
+ expensesPayload: (_b = (_a = response.data.flux_analysis_entities) === null || _a === void 0 ? void 0 : _a.operating_expenses) !== null && _b !== void 0 ? _b : [],
33
+ currency: response.data.currency,
34
+ selectedPeriod: selectedPeriod,
35
+ isBulk,
36
+ }));
37
+ }
38
+ updateActions.push((0, snackbarReducer_1.openSnackbar)({
39
+ messageSection: actionType === 'review'
40
+ ? 'flux_analysis_reviewed'
41
+ : 'flux_analysis_unreviewed',
42
+ messageText: 'success',
43
+ type: 'success',
44
+ variables: [
45
+ {
46
+ variableName: '_vendors_count_',
47
+ variableValue: `${operatingExpenseIds.length}`,
48
+ },
49
+ {
50
+ variableName: '_vendor_',
51
+ variableValue: operatingExpenseIds.length === 1 ? 'vendor' : 'vendors',
52
+ },
53
+ ],
54
+ }));
55
+ return (0, rxjs_1.from)(updateActions);
56
+ }
57
+ else {
58
+ return (0, rxjs_1.of)((0, fluxAnalysisViewReducer_1.reviewFluxAnalysisViewFailure)({
59
+ operatingExpenseIds: operatingExpenseIds,
60
+ status: response.status,
61
+ isBulk,
62
+ }));
63
+ }
64
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, fluxAnalysisViewReducer_1.reviewFluxAnalysisViewFailure)({
65
+ operatingExpenseIds: operatingExpenseIds,
66
+ status: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'review flux analysis view REST API call errored out' +
67
+ JSON.stringify(error)),
68
+ isBulk,
69
+ }))));
70
+ }));
71
+ exports.reviewFluxAnalysisViewEpic = reviewFluxAnalysisViewEpic;
72
+ const getReviewFluxPayload = (actionType, operatingExpenseIds) => {
73
+ return {
74
+ action: (0, helpers_1.toVendorFluxAnalysisReviewActionPayload)(actionType),
75
+ flux_analysis_entity_ids: operatingExpenseIds,
76
+ };
77
+ };
@@ -0,0 +1,7 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { fetchAccountList } from '../../../accountList/accountListReducer';
4
+ import { fetchJeSchedulesPage, fetchJeSchedules } from '../../reducers/jeSchedulesViewReducer';
5
+ import { RootState } from '../../../../reducer';
6
+ export declare type ActionType = ReturnType<typeof fetchJeSchedulesPage> | ReturnType<typeof fetchJeSchedules> | ReturnType<typeof fetchAccountList>;
7
+ export declare const fetchJeSchedulesPageEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fetchJeSchedulesPageEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const accountListReducer_1 = require("../../../accountList/accountListReducer");
7
+ const jeSchedulesViewReducer_1 = require("../../reducers/jeSchedulesViewReducer");
8
+ const scheduleListHelper_1 = require("../../../scheduleView/scheduleListView/scheduleListHelper");
9
+ const fetchJeSchedulesPageEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(jeSchedulesViewReducer_1.fetchJeSchedulesPage.match), (0, operators_1.mergeMap)((action) => {
10
+ const jeSchedulePageActions = [];
11
+ const { period, refreshViewInBackground } = action.payload;
12
+ const accountType = (0, scheduleListHelper_1.getAccountsTypesForScheduleEpics)();
13
+ const accountListState = state$.value.accountListState;
14
+ if (accountListState.byReportId[accountType.accountListKey].fetchState ===
15
+ 'Not-Started') {
16
+ // call this only if the account list for schedules is not fetched already
17
+ jeSchedulePageActions.push((0, accountListReducer_1.fetchAccountList)(accountType.accountListKey, true, false, false, false, accountType.allowedAccountList));
18
+ }
19
+ jeSchedulePageActions.push((0, jeSchedulesViewReducer_1.fetchJeSchedules)(period, refreshViewInBackground));
20
+ return (0, rxjs_1.concat)((0, rxjs_1.from)(jeSchedulePageActions));
21
+ }));
22
+ exports.fetchJeSchedulesPageEpic = fetchJeSchedulesPageEpic;
@@ -0,0 +1,8 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { ZeniAPI } from '../../../../zeniAPI';
4
+ import { RootState } from '../../../../reducer';
5
+ import { fetchJeSchedules, fetchJeSchedulesFailure, fetchJeSchedulesSuccess, initializeJeScheduleLocalData } from '../../reducers/jeSchedulesViewReducer';
6
+ import { updateJESchedules, updateJESchedulesDetails } from '../../../../entity/jeSchedules/jeSchedulesReducer';
7
+ export declare type ActionType = ReturnType<typeof fetchJeSchedules> | ReturnType<typeof fetchJeSchedulesFailure> | ReturnType<typeof fetchJeSchedulesSuccess> | ReturnType<typeof initializeJeScheduleLocalData> | ReturnType<typeof updateJESchedules> | ReturnType<typeof updateJESchedulesDetails>;
8
+ export declare const fetchJeSchedulesEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fetchJeSchedulesEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const responsePayload_1 = require("../../../../responsePayload");
7
+ const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
8
+ const jeSchedulesViewReducer_1 = require("../../reducers/jeSchedulesViewReducer");
9
+ const jeSchedulesReducer_1 = require("../../../../entity/jeSchedules/jeSchedulesReducer");
10
+ const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
11
+ const fetchJeSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(jeSchedulesViewReducer_1.fetchJeSchedules.match), (0, operators_1.switchMap)((action) => {
12
+ const state = state$.value;
13
+ const {
14
+ // expenseAutomationJESchedulesViewState: {fetchState},
15
+ expenseAutomationViewState: { selectedPeriodByTenantId }, } = state;
16
+ const { period } = action.payload;
17
+ const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
18
+ const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
19
+ // if (fetchState !== 'Not-Started') {
20
+ const queryParam = {
21
+ start_date: (0, timePeriod_1.toString)(period.start),
22
+ end_date: (0, timePeriod_1.toString)(period.end),
23
+ };
24
+ return zeniAPI
25
+ .getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/expenses_automation/je_schedules?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
26
+ .pipe((0, operators_1.mergeMap)((response) => {
27
+ if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
28
+ const updateActions = [];
29
+ updateActions.push((0, jeSchedulesReducer_1.updateJESchedules)([
30
+ ...response.data.draft_je_schedules,
31
+ ...response.data.failed_je_postings.je_schedules,
32
+ ]), (0, jeSchedulesReducer_1.updateJESchedulesDetails)([...response.data.failed_je_postings.je_schedules], response.data.failed_je_postings.scheduled_journal_entries), (0, jeSchedulesViewReducer_1.initializeJeScheduleLocalData)([
33
+ ...response.data.failed_je_postings.je_schedules,
34
+ ]));
35
+ updateActions.push((0, jeSchedulesViewReducer_1.fetchJeSchedulesSuccess)({
36
+ jeSchedules: [...response.data.draft_je_schedules],
37
+ failedJeSchedules: [
38
+ ...response.data.failed_je_postings.je_schedules,
39
+ ],
40
+ selectedPeriod: selectedPeriod,
41
+ }));
42
+ return (0, rxjs_1.from)(updateActions);
43
+ }
44
+ else {
45
+ return (0, rxjs_1.of)((0, jeSchedulesViewReducer_1.fetchJeSchedulesFailure)({
46
+ status: response.status,
47
+ selectedPeriod,
48
+ }));
49
+ }
50
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, jeSchedulesViewReducer_1.fetchJeSchedulesFailure)({
51
+ status: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'fetch JE schedules REST API call errored out' +
52
+ JSON.stringify(error)),
53
+ selectedPeriod,
54
+ }))));
55
+ // } else {
56
+ // return from([] as ActionType[]);
57
+ // }
58
+ }));
59
+ exports.fetchJeSchedulesEpic = fetchJeSchedulesEpic;
@@ -0,0 +1,8 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { ZeniAPI } from '../../../../zeniAPI';
3
+ import { RootState } from '../../../../reducer';
4
+ import { updateJESchedulesDetails, updateJESchedules } from '../../../../entity/jeSchedules/jeSchedulesReducer';
5
+ import { ignoreRecommendedJeSchedule, ignoreRecommendedJeScheduleSuccess, ignoreRecommendedJeScheduleFailure, removeJeScheduleTransactionKey } from '../../reducers/jeSchedulesViewReducer';
6
+ import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
7
+ export declare type ActionType = ReturnType<typeof ignoreRecommendedJeSchedule> | ReturnType<typeof ignoreRecommendedJeScheduleFailure> | ReturnType<typeof ignoreRecommendedJeScheduleSuccess> | ReturnType<typeof openSnackbar> | ReturnType<typeof removeJeScheduleTransactionKey> | ReturnType<typeof updateJESchedules> | ReturnType<typeof updateJESchedulesDetails>;
8
+ export declare const ignoreRecommendedJeScheduleEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<ActionType>;