@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
@@ -0,0 +1,52 @@
1
+ import recordGet from 'lodash/get';
2
+ import { reduceAllFetchState } from '../../../commonStateTypes/reduceFetchState';
3
+ import { getAllFundingAccounts, } from '../commonSetup/setupViewSelector';
4
+ import { getAllDepositAccounts } from '../zeniAccounts/depositAccountList/depositAccountListSelector';
5
+ import { getAllPaymentAccounts } from '../zeniAccounts/paymentAccountList/paymentAccountListSelector';
6
+ export const getAutoTransferRules = (state) => {
7
+ const { autotransferRulesState, depositAccountState, paymentAccountState, depositAccountListState, paymentAccountListState, treasuryDetailState, } = state;
8
+ const { rules, error, historyByRuleId, ruleUpdateLocalData, ruleUpdateStatusById, ruleDeleteStatusById, createRuleFetchState, autoTransferReviewDetail, } = autotransferRulesState;
9
+ const depositAccountsView = getAllDepositAccounts(depositAccountState, depositAccountListState);
10
+ const paymentAccountsView = getAllPaymentAccounts(paymentAccountState, paymentAccountListState);
11
+ let transferMoneyParties = [];
12
+ const transferMoneyPartiesFetchState = reduceAllFetchState([
13
+ depositAccountsView,
14
+ paymentAccountsView,
15
+ ]).fetchState;
16
+ const fetchState = reduceAllFetchState([
17
+ autotransferRulesState,
18
+ depositAccountsView,
19
+ paymentAccountsView,
20
+ ]).fetchState;
21
+ if (depositAccountsView.fetchState === 'Completed' &&
22
+ paymentAccountsView.fetchState === 'Completed') {
23
+ transferMoneyParties = getAllFundingAccounts(depositAccountsView.depositAccounts, paymentAccountsView.paymentAccounts, paymentAccountListState.paymentAccountBalanceFetchStatus);
24
+ }
25
+ const treasuryAccount = {
26
+ accType: 'treasuryAccount',
27
+ label: 'Treasury',
28
+ id: 'treasury',
29
+ balance: treasuryDetailState.accountSummary?.availableBalance,
30
+ };
31
+ return {
32
+ autoTransferReviewDetail,
33
+ rules,
34
+ ruleUpdateLocalData,
35
+ ruleUpdateStatusById,
36
+ ruleDeleteStatusById,
37
+ ruleHistory: historyByRuleId,
38
+ treasuryAccount,
39
+ transferMoneyParties,
40
+ transferMoneyPartiesFetchState,
41
+ createRuleFetchState,
42
+ fetchState,
43
+ error,
44
+ version: 0,
45
+ };
46
+ };
47
+ export const getAutoTransferRuleById = (state, ruleId) => {
48
+ return state.autotransferRulesState.rules.find((rule) => rule.autoTransferRuleId === ruleId);
49
+ };
50
+ export const getAutoTransferRuleHistory = (state, ruleId) => {
51
+ return recordGet(state.autotransferRulesState.historyByRuleId, ruleId, undefined);
52
+ };
@@ -0,0 +1,100 @@
1
+ import { from, of } from 'rxjs';
2
+ import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
3
+ import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
4
+ import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
5
+ import { mapPayloadToAutoTransferRule, } from '../autoTransferRulesPayload';
6
+ import { createAutoTransferRule, createAutoTransferRuleFailure, createAutoTransferRuleSuccess, } from '../autoTransferRulesReducer';
7
+ export const createAutoTransferRuleEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(createAutoTransferRule.match), switchMap(() => {
8
+ const requestBody = mapAutoTransferRuleLocalDataToPayload(state$.value.autotransferRulesState.ruleUpdateLocalData);
9
+ return zeniAPI
10
+ .postAndGetJSON(`${zeniAPI.apiEndPoints.bankingMicroServiceBaseUrl}/1.0/rules/transfer/auto`, requestBody)
11
+ .pipe(mergeMap((response) => {
12
+ if (isSuccessResponse(response) && response.data != null) {
13
+ const rule = mapPayloadToAutoTransferRule(response.data.auto_transfer_rule);
14
+ const actions = [
15
+ createAutoTransferRuleSuccess({ rule }),
16
+ openSnackbar({
17
+ messageSection: 'auto_transfer_rule_create',
18
+ messageText: 'success',
19
+ type: 'success',
20
+ }),
21
+ ];
22
+ return from(actions);
23
+ }
24
+ else {
25
+ return from([
26
+ createAutoTransferRuleFailure({
27
+ fetchState: 'Error',
28
+ error: response.status,
29
+ }),
30
+ openSnackbar({
31
+ messageSection: 'auto_transfer_rule_create',
32
+ messageText: 'failed',
33
+ type: 'error',
34
+ variables: [
35
+ {
36
+ variableName: '_api-error_',
37
+ variableValue: response.status.message,
38
+ },
39
+ ],
40
+ }),
41
+ ]);
42
+ }
43
+ }), catchError((error) => of(createAutoTransferRuleFailure({
44
+ fetchState: 'Error',
45
+ error: createZeniAPIStatus('Unexpected Error', 'Create auto transfer rule REST API call errored out ' +
46
+ JSON.stringify(error)),
47
+ }))));
48
+ }));
49
+ export function mapAutoTransferRuleLocalDataToPayload(localData, pauseRule, resumeRule) {
50
+ if (pauseRule === true) {
51
+ return {
52
+ is_active: false,
53
+ };
54
+ }
55
+ if (resumeRule === true) {
56
+ return {
57
+ is_active: true,
58
+ };
59
+ }
60
+ const payload = {
61
+ ...(localData.amount != null &&
62
+ localData.ruleType !== 'percentage_of_balance' && {
63
+ amount: localData.amount.amount,
64
+ currency_code: localData.amount.currencyCode,
65
+ }),
66
+ ...(localData.destinationAccount != null && {
67
+ destination_bank_account_id: localData.destinationAccount.id,
68
+ destination_bank_account_type: accountTypeSubConfigCodeToAccType(localData.destinationAccount.accType),
69
+ }),
70
+ ...(localData.destinationAccountWithPercentAllocation != null && {
71
+ destination_bank_account_metadata: localData.destinationAccountWithPercentAllocation.map((allocation) => ({
72
+ account_id: allocation.account.id,
73
+ account_type: accountTypeSubConfigCodeToAccType(allocation.account.accType),
74
+ percentage: allocation.percentage,
75
+ })),
76
+ }),
77
+ frequency: localData.frequency,
78
+ rule_type: localData.ruleType,
79
+ ...(localData.sourceAccount != null && {
80
+ source_bank_account_id: localData.sourceAccount.id,
81
+ source_bank_account_type: accountTypeSubConfigCodeToAccType(localData.sourceAccount.accType),
82
+ }),
83
+ ...(localData.firstTransferDate != null && {
84
+ first_transfer_date: localData.firstTransferDate.format('YYYY-MM-DD'),
85
+ }),
86
+ };
87
+ return payload;
88
+ }
89
+ export const accountTypeSubConfigCodeToAccType = (code) => {
90
+ switch (code) {
91
+ case 'depositAccount':
92
+ return 'deposit_account';
93
+ case 'paymentAccount':
94
+ return 'payment_account';
95
+ case 'treasuryAccount':
96
+ return 'treasury_account';
97
+ default:
98
+ return undefined;
99
+ }
100
+ };
@@ -0,0 +1,48 @@
1
+ import { from, of } from 'rxjs';
2
+ import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
3
+ import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
4
+ import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
5
+ import { deleteAutoTransferRule, deleteAutoTransferRuleFailure, deleteAutoTransferRuleSuccess, } from '../autoTransferRulesReducer';
6
+ export const deleteAutoTransferRuleEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(deleteAutoTransferRule.match), switchMap((action) => {
7
+ const { ruleId } = action.payload;
8
+ return zeniAPI
9
+ .deleteAndGetJSON(`${zeniAPI.apiEndPoints.bankingMicroServiceBaseUrl}/1.0/rules/transfer/auto/${ruleId}`)
10
+ .pipe(mergeMap((response) => {
11
+ if (isSuccessResponse(response)) {
12
+ const actions = [
13
+ deleteAutoTransferRuleSuccess({ ruleId }),
14
+ openSnackbar({
15
+ messageSection: 'auto_transfer_rule_delete',
16
+ messageText: 'success',
17
+ type: 'success',
18
+ }),
19
+ ];
20
+ return from(actions);
21
+ }
22
+ else {
23
+ return from([
24
+ deleteAutoTransferRuleFailure({
25
+ ruleId,
26
+ fetchState: 'Error',
27
+ error: response.status,
28
+ }),
29
+ openSnackbar({
30
+ messageSection: 'auto_transfer_rule_delete',
31
+ messageText: 'failed',
32
+ type: 'error',
33
+ variables: [
34
+ {
35
+ variableName: '_api-error_',
36
+ variableValue: response.status.message,
37
+ },
38
+ ],
39
+ }),
40
+ ]);
41
+ }
42
+ }), catchError((error) => of(deleteAutoTransferRuleFailure({
43
+ ruleId,
44
+ fetchState: 'Error',
45
+ error: createZeniAPIStatus('Unexpected Error', 'Delete auto transfer rule REST API call errored out ' +
46
+ JSON.stringify(error)),
47
+ }))));
48
+ }));
@@ -0,0 +1,36 @@
1
+ import { of } from 'rxjs';
2
+ import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
3
+ import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
4
+ import { fetchAutoTransferReviewDetail, updateAutoTransferReviewDetail, updateAutoTransferReviewDetailFailure, } from '../autoTransferRulesReducer';
5
+ import { accountTypeSubConfigCodeToAccType } from './createAutoTransferRuleEpic';
6
+ export const fetchAutoTransferReviewDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchAutoTransferReviewDetail.match), switchMap(() => {
7
+ const localData = state$.value.autotransferRulesState.ruleUpdateLocalData;
8
+ const payload = {
9
+ ...(localData.sourceAccount != null && {
10
+ from_account: {
11
+ account_id: localData.sourceAccount.id,
12
+ account_type: accountTypeSubConfigCodeToAccType(localData.sourceAccount.accType) ?? '',
13
+ },
14
+ }),
15
+ ...(localData.destinationAccount != null && {
16
+ to_account: {
17
+ account_id: localData.destinationAccount.id,
18
+ account_type: accountTypeSubConfigCodeToAccType(localData.destinationAccount.accType) ?? '',
19
+ },
20
+ }),
21
+ ...(localData.amount != null && {
22
+ amount: localData.amount.amount,
23
+ currency_code: localData.amount.currencyCode,
24
+ currency_symbol: localData.amount.currencySymbol,
25
+ }),
26
+ };
27
+ return zeniAPI
28
+ .postAndGetJSON(`${zeniAPI.apiEndPoints.bankingMicroServiceBaseUrl}/1.0/deposit-accounts/transfers/review`, payload)
29
+ .pipe(mergeMap((response) => {
30
+ if (isSuccessResponse(response) && response.data != null) {
31
+ return of(updateAutoTransferReviewDetail(response.data));
32
+ }
33
+ return of(updateAutoTransferReviewDetailFailure(response.status));
34
+ }), catchError((error) => of(updateAutoTransferReviewDetailFailure(createZeniAPIStatus('Unexpected Error', 'Fetch auto transfer review detail REST API call errored out ' +
35
+ JSON.stringify(error))))));
36
+ }));
@@ -0,0 +1,45 @@
1
+ import recordGet from 'lodash/get';
2
+ import { concat, from, of } from 'rxjs';
3
+ import { catchError, filter, mergeMap } from 'rxjs/operators';
4
+ import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
5
+ import { fetchAutoTransferRuleHistory, updateAutoTransferRuleHistory, updateAutoTransferRuleHistoryFetchStatus, } from '../autoTransferRulesReducer';
6
+ export const fetchAutoTransferRuleHistoryEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchAutoTransferRuleHistory.match), mergeMap((action) => {
7
+ const { ruleId, cacheOverride } = action.payload;
8
+ const historyActions = [];
9
+ const state = state$.value;
10
+ const historyDetail = recordGet(state.autotransferRulesState.historyByRuleId, ruleId, undefined);
11
+ if (cacheOverride === true ||
12
+ historyDetail == null ||
13
+ historyDetail.fetchState !== 'In-Progress') {
14
+ historyActions.push(updateAutoTransferRuleHistoryFetchStatus({
15
+ ruleId,
16
+ fetchState: 'In-Progress',
17
+ }));
18
+ const getHistoryDetail$ = zeniAPI
19
+ .getJSON(`${zeniAPI.apiEndPoints.bankingMicroServiceBaseUrl}/1.0/rules/transfer/auto/${ruleId}/history`)
20
+ .pipe(mergeMap((response) => {
21
+ if (isSuccessResponse(response) && response.data != null) {
22
+ return of(updateAutoTransferRuleHistory({
23
+ ruleId,
24
+ historicEventsPayload: response.data.activities,
25
+ }));
26
+ }
27
+ else {
28
+ return of(updateAutoTransferRuleHistoryFetchStatus({
29
+ ruleId,
30
+ fetchState: 'Error',
31
+ error: response.status,
32
+ }));
33
+ }
34
+ }), catchError((error) => of(updateAutoTransferRuleHistoryFetchStatus({
35
+ ruleId,
36
+ fetchState: 'Error',
37
+ error: createZeniAPIStatus('Unexpected Error', 'Fetch auto transfer rule history REST API call errored out ' +
38
+ JSON.stringify(error)),
39
+ }))));
40
+ return concat(from(historyActions), getHistoryDetail$);
41
+ }
42
+ else {
43
+ return from(historyActions);
44
+ }
45
+ }));
@@ -0,0 +1,50 @@
1
+ import { from, of } from 'rxjs';
2
+ import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
3
+ import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
4
+ import { fetchTreasuryOverviewDetail } from '../../treasury/treasuryList/treasuryDetailReducer';
5
+ import { fetchDepositAccountList } from '../../zeniAccounts/depositAccountList/depositAccountListReducer';
6
+ import { fetchPaymentAccountList } from '../../zeniAccounts/paymentAccountList/paymentAccountListReducer';
7
+ import { mapPayloadToAutoTransferRule, } from '../autoTransferRulesPayload';
8
+ import { fetchAutoTransferRules, updateAutoTransferRules, updateAutoTransferRulesFailure, } from '../autoTransferRulesReducer';
9
+ export const fetchAutoTransferRulesEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchAutoTransferRules.match), switchMap((action) => {
10
+ const state = state$.value;
11
+ const { cacheOverride } = action.payload;
12
+ const { autotransferRulesState, depositAccountListState, paymentAccountListState, } = state;
13
+ if (cacheOverride === true ||
14
+ (autotransferRulesState.hasValidState() === false &&
15
+ autotransferRulesState.fetchState !== 'In-Progress')) {
16
+ return zeniAPI
17
+ .getJSON(`${zeniAPI.apiEndPoints.bankingMicroServiceBaseUrl}/1.0/rules/transfer/auto/list`)
18
+ .pipe(mergeMap((response) => {
19
+ if (isSuccessResponse(response) && response.data != null) {
20
+ const rules = response.data.auto_transfer_rules.map(mapPayloadToAutoTransferRule);
21
+ const actions = [
22
+ updateAutoTransferRules({ rules }),
23
+ ];
24
+ if (depositAccountListState.fetchState !== 'In-Progress' &&
25
+ depositAccountListState.fetchState !== 'Completed') {
26
+ actions.push(fetchDepositAccountList());
27
+ }
28
+ if (paymentAccountListState.fetchState !== 'In-Progress' &&
29
+ paymentAccountListState.fetchState !== 'Completed') {
30
+ actions.push(fetchPaymentAccountList());
31
+ }
32
+ actions.push(fetchTreasuryOverviewDetail(false, true));
33
+ return from(actions);
34
+ }
35
+ else {
36
+ return of(updateAutoTransferRulesFailure({
37
+ fetchState: 'Error',
38
+ error: response.status,
39
+ }));
40
+ }
41
+ }), catchError((error) => of(updateAutoTransferRulesFailure({
42
+ fetchState: 'Error',
43
+ error: createZeniAPIStatus('Unexpected Error', 'Fetch auto transfer rules REST API call errored out ' +
44
+ JSON.stringify(error)),
45
+ }))));
46
+ }
47
+ else {
48
+ return from([]);
49
+ }
50
+ }));
@@ -0,0 +1,69 @@
1
+ import { from, of } from 'rxjs';
2
+ import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
3
+ import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
4
+ import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
5
+ import { mapPayloadToAutoTransferRule, } from '../autoTransferRulesPayload';
6
+ import { updateAutoTransferRule, updateAutoTransferRuleFailure, updateAutoTransferRuleSuccess, } from '../autoTransferRulesReducer';
7
+ import { mapAutoTransferRuleLocalDataToPayload } from './createAutoTransferRuleEpic';
8
+ export const updateAutoTransferRuleEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(updateAutoTransferRule.match), switchMap((action) => {
9
+ const { ruleId, pauseRule, resumeRule } = action.payload;
10
+ const requestBody = mapAutoTransferRuleLocalDataToPayload(state$.value.autotransferRulesState.ruleUpdateLocalData, pauseRule, resumeRule);
11
+ return zeniAPI
12
+ .putAndGetJSON(`${zeniAPI.apiEndPoints.bankingMicroServiceBaseUrl}/1.0/rules/transfer/auto/${ruleId}`, requestBody)
13
+ .pipe(mergeMap((response) => {
14
+ if (isSuccessResponse(response) && response.data != null) {
15
+ const rule = mapPayloadToAutoTransferRule(response.data.auto_transfer_rule);
16
+ const isPauseOrResumeOnly = Object.keys(requestBody).length === 1 &&
17
+ 'is_active' in requestBody;
18
+ const messageSection = isPauseOrResumeOnly
19
+ ? requestBody.is_active === false
20
+ ? 'auto_transfer_rule_pause'
21
+ : 'auto_transfer_rule_resume'
22
+ : 'auto_transfer_rule_update';
23
+ const actions = [
24
+ updateAutoTransferRuleSuccess({ rule }),
25
+ openSnackbar({
26
+ messageSection,
27
+ messageText: 'success',
28
+ type: 'success',
29
+ variables: [
30
+ {
31
+ variableName: '__ruleName__',
32
+ variableValue: rule.ruleType === 'minimum_balance'
33
+ ? 'Maintain a Minimum Balance'
34
+ : rule.ruleType === 'recurring'
35
+ ? 'Make a Recurring Transfer'
36
+ : 'Distribute Balance by Percentage',
37
+ },
38
+ ],
39
+ }),
40
+ ];
41
+ return from(actions);
42
+ }
43
+ else {
44
+ return from([
45
+ updateAutoTransferRuleFailure({
46
+ ruleId,
47
+ fetchState: 'Error',
48
+ error: response.status,
49
+ }),
50
+ openSnackbar({
51
+ messageSection: 'auto_transfer_rule_update',
52
+ messageText: 'failed',
53
+ type: 'error',
54
+ variables: [
55
+ {
56
+ variableName: '_api-error_',
57
+ variableValue: response.status.message,
58
+ },
59
+ ],
60
+ }),
61
+ ]);
62
+ }
63
+ }), catchError((error) => of(updateAutoTransferRuleFailure({
64
+ ruleId,
65
+ fetchState: 'Error',
66
+ error: createZeniAPIStatus('Unexpected Error', 'Update auto transfer rule REST API call errored out ' +
67
+ JSON.stringify(error)),
68
+ }))));
69
+ }));
@@ -53,7 +53,7 @@ export const fetchBillDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe(
53
53
  response.data?.transaction?.transaction_id != null) {
54
54
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
55
55
  const transcationId = response.data.transaction.transaction_id;
56
- const vendorInResponse = response.data?.vendors[0];
56
+ const vendorInResponse = response.data?.vendors?.[0];
57
57
  const flattenedContacts = vendorInResponse?.contacts ?? [];
58
58
  const flattenedAddresses = getFlattenedAddress(response.data?.vendors ?? []);
59
59
  const flattenedBankAccounts = vendorInResponse?.bank_accounts ?? [];
@@ -85,7 +85,7 @@ export const fetchBillDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe(
85
85
  ...response.data.bank_accounts,
86
86
  ]),
87
87
  updatePaymentInstruments(flattenedPaymentInstruments),
88
- updateVendors(response.data.vendors),
88
+ updateVendors(response.data.vendors ?? []),
89
89
  // end: save all vendor related entities
90
90
  ];
91
91
  if (vendorInResponse == null &&
@@ -94,15 +94,15 @@ export const fetchBillDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe(
94
94
  fetchActions.push(fetchVendorsList({
95
95
  searchString: response.data?.transaction.candidate_vendor_name,
96
96
  }));
97
- fetchActions.push(waitForVendorByNameThenUpdateBillDetail(billId, response.data, response.data.vendors[0]?.vendor_id));
97
+ fetchActions.push(waitForVendorByNameThenUpdateBillDetail(billId, response.data, undefined));
98
98
  }
99
99
  else {
100
100
  fetchActions.push(updateBillDetail({ billId, billDetail: response.data }));
101
- fetchActions.push(updateBillDetailFetchState(transcationId, 'Completed', undefined, response.data.vendors[0]?.vendor_id));
101
+ fetchActions.push(updateBillDetailFetchState(transcationId, 'Completed', undefined, vendorInResponse?.vendor_id));
102
102
  const transactionInResponse = response.data?.transaction;
103
103
  if (transactionInResponse != null &&
104
104
  transactionInResponse.total_amount != null &&
105
- Boolean(vendorInResponse) === true) {
105
+ vendorInResponse != null) {
106
106
  fetchActions.push(fetchDuplicateBill(vendorInResponse.vendor_name, vendorInResponse.vendor_id, transactionInResponse.total_amount, transactionInResponse.recipient_total_amount, transactionInResponse.document_id, billId));
107
107
  }
108
108
  const billHasPaymentError = [
@@ -416,6 +416,14 @@ export const getBillListOnSort = (sortKey, sortOrder, currentTab, transactions)
416
416
  transactionsWithNoSortKeyValue.push(transaction);
417
417
  }
418
418
  break;
419
+ case 'invoiceNumber':
420
+ if (transaction.documentId != null) {
421
+ transactionsWithSortKeyValue.push(transaction);
422
+ }
423
+ else {
424
+ transactionsWithNoSortKeyValue.push(transaction);
425
+ }
426
+ break;
419
427
  case 'dueDate':
420
428
  if (currentTab === 'draft') {
421
429
  if (Boolean(transaction.dueDate) === true) {
@@ -518,6 +526,8 @@ export const getBillListOnSort = (sortKey, sortOrder, currentTab, transactions)
518
526
  return transaction.totalAmountInUSD?.amount ?? 0;
519
527
  case 'paymentMethod':
520
528
  return transaction.billPayInfo.billPaymentMethodType.name;
529
+ case 'invoiceNumber':
530
+ return transaction.documentId;
521
531
  }
522
532
  }, getColumnWiseSortOrder(sortOrder));
523
533
  return [
@@ -43,6 +43,7 @@ const ALL_BILL_PAY_SORT_KEYS = [
43
43
  'invoiceDate',
44
44
  'name',
45
45
  'paymentMethod',
46
+ 'invoiceNumber',
46
47
  ];
47
48
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
48
49
  const toBillPaySortKeyType = (v) => stringToUnion(v, ALL_BILL_PAY_SORT_KEYS);
@@ -2,6 +2,7 @@ import recordGet from 'lodash/get';
2
2
  import { reduceFetchState } from '../../../../commonStateTypes/reduceFetchState';
3
3
  import { getContactsByIds } from '../../../../entity/billPay/contact/contactSelector';
4
4
  import { getPaymentAccountsByPaymentAccountIds } from '../../../../entity/paymentAccount/paymentAccountSelector';
5
+ import { getIsAccountingClassesEnabled } from '../../../../entity/tenant/tenantSelector';
5
6
  import { getVendorByVendorId } from '../../../../entity/vendor/vendorSelector';
6
7
  import { getAccountList } from '../../../accountList/accountListSelector';
7
8
  import { getAllFundingAccounts, } from '../../commonSetup/setupViewSelector';
@@ -73,11 +74,14 @@ export const getReviewPageBillDetail = (state, billId) => {
73
74
  }
74
75
  }
75
76
  if (sourceBillDetail != null) {
76
- sourceBillDetailFetchState = reduceFetchState([
77
+ const fetchStateList = [
77
78
  sourceBillDetail.fetchStatus,
78
79
  accountListState.byReportId['billPayAccountList'],
79
- classListState,
80
- ]).fetchState;
80
+ ];
81
+ if (getIsAccountingClassesEnabled(state)) {
82
+ fetchStateList.push(classListState);
83
+ }
84
+ sourceBillDetailFetchState = reduceFetchState(fetchStateList).fetchState;
81
85
  }
82
86
  }
83
87
  else {
@@ -3,6 +3,7 @@ import cloneDeep from 'lodash/cloneDeep';
3
3
  import { reduceAllFetchState, reduceAnyFetchState, } from '../../../../commonStateTypes/reduceFetchState';
4
4
  import { getApprovalRulesByIds } from '../../../../entity/approvalRule/approvalRuleSelector';
5
5
  import { getClassesByIds } from '../../../../entity/class/classSelector';
6
+ import { getIsAccountingClassesEnabled } from '../../../../entity/tenant/tenantSelector';
6
7
  import { getUserByUserId } from '../../../../entity/user/userSelector';
7
8
  import { getUserRoleByUserId } from '../../../../entity/userRole/userRoleSelector';
8
9
  export const getBillPaySetupApproverView = createSelector((state) => state.billPaySetupApproverViewState, (state) => state.approvalRuleState, (state) => state.userState, (billPaySetupApproverViewState, approvalRuleState, userState) => {
@@ -44,7 +45,7 @@ export const getBillPaySetupApproverView = createSelector((state) => state.billP
44
45
  newApprovalRuleId,
45
46
  };
46
47
  });
47
- export const getBillPaySetupApproverUpdateDataView = createSelector((state) => state.billPaySetupApproverViewState, (state) => state.approvalRuleState, (state) => state.userState, (state) => state.classState, (state) => state.classListState, (state) => state.userRoleState, (billPaySetupApproverViewState, approvalRuleState, userState, classState, classListState, userRoleState) => {
48
+ export const getBillPaySetupApproverUpdateDataView = createSelector((state) => state.billPaySetupApproverViewState, (state) => state.approvalRuleState, (state) => state.userState, (state) => state.classState, (state) => state.classListState, (state) => state.userRoleState, (state) => getIsAccountingClassesEnabled(state), (billPaySetupApproverViewState, approvalRuleState, userState, classState, classListState, userRoleState, isAccountingClassesEnabled) => {
48
49
  const { affectedEntityIds, approvalRuleIds, approverListState, billPaySetupApproverViewUpdateData, fetchState, error, listeningToPusherEvent, } = billPaySetupApproverViewState;
49
50
  const { approverIds, attributes } = approverListState;
50
51
  const allApprovalRules = getApprovalRulesByIds(approvalRuleState, approvalRuleIds);
@@ -92,10 +93,9 @@ export const getBillPaySetupApproverUpdateDataView = createSelector((state) => s
92
93
  allAttributes,
93
94
  filteredAttributes,
94
95
  billPaySetupApproverViewUpdateData,
95
- approverListFetchStatus: reduceAllFetchState([
96
- approverListState.fetchStatus,
97
- classListState,
98
- ]),
96
+ approverListFetchStatus: isAccountingClassesEnabled
97
+ ? reduceAllFetchState([approverListState.fetchStatus, classListState])
98
+ : approverListState.fetchStatus,
99
99
  fetchState,
100
100
  allAccountingClasses,
101
101
  error,
@@ -1,22 +1,27 @@
1
1
  import { concat, from } from 'rxjs';
2
2
  import { filter, mergeMap } from 'rxjs/operators';
3
+ import { getIsAccountingClassesEnabled } from '../../../../../entity/tenant/tenantSelector';
3
4
  import { fetchClassList } from '../../../../classList/classListReducer';
4
5
  import { fetchBillPayApproversDetails, fetchBillPayApproversList, } from '../billPaySetupApproverViewReducer';
5
6
  export const fetchBillPayApproversDetailsEpic = (actions$, state$) => actions$.pipe(filter(fetchBillPayApproversDetails.match), mergeMap((action) => {
6
7
  const { cacheOverride, includeUserRoles } = action.payload;
7
8
  const { billPaySetupApproverViewState, classListState } = state$.value;
8
9
  const { approverListState } = billPaySetupApproverViewState;
10
+ const isAccountingClassesEnabled = getIsAccountingClassesEnabled(state$.value);
9
11
  const actions = [];
10
12
  if (cacheOverride === true) {
11
13
  actions.push(fetchBillPayApproversList(cacheOverride, includeUserRoles));
12
- actions.push(fetchClassList());
14
+ if (isAccountingClassesEnabled) {
15
+ actions.push(fetchClassList());
16
+ }
13
17
  }
14
18
  else {
15
19
  if (billPaySetupApproverViewState.hasValidState() === false &&
16
20
  approverListState.fetchStatus.fetchState !== 'In-Progress') {
17
21
  actions.push(fetchBillPayApproversList(true, includeUserRoles));
18
22
  }
19
- if (classListState.hasValidState() === false &&
23
+ if (isAccountingClassesEnabled &&
24
+ classListState.hasValidState() === false &&
20
25
  classListState.fetchState !== 'In-Progress') {
21
26
  actions.push(fetchClassList());
22
27
  }
@@ -7,6 +7,7 @@ import { getCompanyByCompanyId } from '../../../../entity/company/companySelecto
7
7
  import { getDepositAccountByDepositAccountId } from '../../../../entity/depositAccount/depositAccountSelector';
8
8
  import { getPaymentAccountByPaymentAccountId, getPaymentAccountsByPaymentAccountIds, } from '../../../../entity/paymentAccount/paymentAccountSelector';
9
9
  import { getPaymentInstrumentById, getPaymentInstrumentsByIds, } from '../../../../entity/paymentInstrument/paymentInstrumentSelector';
10
+ import { getIsAccountingClassesEnabled } from '../../../../entity/tenant/tenantSelector';
10
11
  import { getUserByUserId } from '../../../../entity/user/userSelector';
11
12
  import { getVendorByQboId, getVendorByVendorId, } from '../../../../entity/vendor/vendorSelector';
12
13
  import { dateNow } from '../../../../zeniDayJS';
@@ -172,12 +173,15 @@ export const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, i
172
173
  isCancelled = sourceBillDetail.billDetailLocalData.isCancelled;
173
174
  billStage = billPayInfo?.stage.code ?? 'draft';
174
175
  if (billViewState != null) {
175
- fetchState = reduceFetchState([
176
+ const fetchStateList = [
176
177
  sourceBillDetail.fetchStatus,
177
178
  accountListState.byReportId.billPayAccountList,
178
- classListState,
179
179
  billPaySetupApproverViewState,
180
- ]).fetchState;
180
+ ];
181
+ if (getIsAccountingClassesEnabled(state)) {
182
+ fetchStateList.push(classListState);
183
+ }
184
+ fetchState = reduceFetchState(fetchStateList).fetchState;
181
185
  deleteStatus = billViewState.deleteStatus;
182
186
  billActivities = getBillActivities(state, billId, billPayInfo?.stage.code);
183
187
  }
@@ -191,11 +195,14 @@ export const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, i
191
195
  }
192
196
  }
193
197
  else {
194
- fetchState = reduceFetchState([
198
+ const newBillFetchStateList = [
195
199
  accountListState.byReportId.billPayAccountList,
196
- classListState,
197
200
  billPaySetupApproverViewState,
198
- ]).fetchState;
201
+ ];
202
+ if (getIsAccountingClassesEnabled(state)) {
203
+ newBillFetchStateList.push(classListState);
204
+ }
205
+ fetchState = reduceFetchState(newBillFetchStateList).fetchState;
199
206
  }
200
207
  if (sourceBillDetail != null && fetchState == 'Completed') {
201
208
  const updatedRecord = sourceBillDetail.billDetailLocalData;
@@ -75,6 +75,7 @@ const ALL_CHARGE_CARD_SORT_KEYS = [
75
75
  'cardName',
76
76
  'department',
77
77
  'cardType',
78
+ 'accountType',
78
79
  'status',
79
80
  'utilisation',
80
81
  'limit',
@@ -219,6 +219,8 @@ const getCardsBySortKey = (card, sortKey) => {
219
219
  return card.cardName.toLowerCase();
220
220
  case 'cardType':
221
221
  return card.type.code;
222
+ case 'accountType':
223
+ return card.type.code.includes('credit') ? 'credit' : 'debit';
222
224
  case 'status':
223
225
  return card.status.code;
224
226
  case 'utilisation':