@zeniai/client-epic-state 4.15.52 → 4.15.54

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 (240) hide show
  1. package/README.md +1 -19
  2. package/lib/commonPayloadTypes/recommendationPayload.d.ts +0 -1
  3. package/lib/commonStateTypes/common.d.ts +1 -1
  4. package/lib/commonStateTypes/fiscalYearHelpers/getFYMonths.d.ts +2 -2
  5. package/lib/commonStateTypes/fiscalYearHelpers/getFYQuarterAndYear.d.ts +2 -2
  6. package/lib/commonStateTypes/timePeriod.d.ts +7 -7
  7. package/lib/commonStateTypes/timePeriod.js +2 -2
  8. package/lib/commonStateTypes/viewAndReport/agingReportStateTypes.d.ts +1 -1
  9. package/lib/commonStateTypes/viewAndReport/agingReportStateTypes.js +1 -1
  10. package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
  11. package/lib/commonStateTypes/viewAndReport/viewAndReport.js +0 -1
  12. package/lib/configureStore.js +1 -2
  13. package/lib/entity/account/accountSelector.d.ts +3 -3
  14. package/lib/entity/account/accountState.d.ts +1 -1
  15. package/lib/entity/account/pickAndMergeForecastAccountReport.d.ts +1 -1
  16. package/lib/entity/accountGroup/accountGroupSelector.d.ts +22 -22
  17. package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
  18. package/lib/entity/approvalRule/approvalRuleState.d.ts +2 -2
  19. package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +4 -4
  20. package/lib/entity/chargeCard/chargeCard.d.ts +1 -1
  21. package/lib/entity/chargeCardTransaction/chargeCardTransaction.d.ts +1 -1
  22. package/lib/entity/class/classReducer.d.ts +4 -4
  23. package/lib/entity/class/classState.d.ts +1 -1
  24. package/lib/entity/company/companyReducer.js +1 -0
  25. package/lib/entity/customer/customerPayload.d.ts +1 -1
  26. package/lib/entity/customer/customerPayload.js +6 -16
  27. package/lib/entity/depositAccountTransaction/depositAccountTransaction.d.ts +1 -1
  28. package/lib/entity/entityApprovalStatus/entityApprovalStatusState.d.ts +2 -2
  29. package/lib/entity/file/fileState.d.ts +3 -3
  30. package/lib/entity/forecast/forecastState.d.ts +1 -1
  31. package/lib/entity/jeSchedules/jeSchedulesReducer.d.ts +2 -2
  32. package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +2 -2
  33. package/lib/entity/notification/types/notificationTypes.d.ts +2 -2
  34. package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
  35. package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
  36. package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
  37. package/lib/entity/snackbar/snackbarTypes.d.ts +2 -2
  38. package/lib/entity/snackbar/snackbarTypes.js +0 -4
  39. package/lib/entity/task/taskState.d.ts +3 -3
  40. package/lib/entity/tenant/clearAllEpic.d.ts +2 -4
  41. package/lib/entity/tenant/clearAllEpic.js +0 -4
  42. package/lib/entity/tenant/tenantReducer.d.ts +2 -2
  43. package/lib/entity/tenant/tenantReducer.js +9 -18
  44. package/lib/entity/tenant/tenantSelector.d.ts +0 -2
  45. package/lib/entity/tenant/tenantSelector.js +0 -6
  46. package/lib/entity/tenant/tenantState.d.ts +0 -3
  47. package/lib/entity/transaction/payloadTypes/customerTransactionPayload.d.ts +1 -1
  48. package/lib/entity/transaction/payloadTypes/customerTransactionPayload.js +2 -1
  49. package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +0 -2
  50. package/lib/entity/transaction/payloadTypes/transactionPayload.js +6 -9
  51. package/lib/entity/transaction/payloadTypes/vendorTransactionPayload.d.ts +1 -9
  52. package/lib/entity/transaction/payloadTypes/vendorTransactionPayload.js +2 -24
  53. package/lib/entity/transaction/stateTypes/attachment.d.ts +2 -2
  54. package/lib/entity/transaction/stateTypes/transaction.d.ts +1 -3
  55. package/lib/entity/transaction/stateTypes/transactionType.d.ts +1 -1
  56. package/lib/entity/transaction/stateTypes/transactionType.js +1 -1
  57. package/lib/entity/transaction/stateTypes/vendorTransaction.d.ts +0 -5
  58. package/lib/entity/transaction/stateTypes/vendorTransaction.js +1 -5
  59. package/lib/entity/transaction/toSupportedTransaction.js +1 -6
  60. package/lib/entity/transaction/transactionReducer.d.ts +0 -17
  61. package/lib/entity/transaction/transactionReducer.js +2 -47
  62. package/lib/entity/transaction/transactionSelector.d.ts +0 -2
  63. package/lib/entity/transaction/transactionSelector.js +0 -5
  64. package/lib/entity/transaction/transactionState.d.ts +4 -6
  65. package/lib/entity/vendorExpense/vendorExpenseReducer.js +1 -0
  66. package/lib/entity/vendorExpense/vendorExpenseSelector.d.ts +2 -2
  67. package/lib/epic.d.ts +1 -6
  68. package/lib/epic.js +1 -6
  69. package/lib/index.d.ts +14 -22
  70. package/lib/index.js +27 -57
  71. package/lib/init.d.ts +1 -2
  72. package/lib/init.js +2 -9
  73. package/lib/reducer.d.ts +1 -7
  74. package/lib/reducer.js +0 -6
  75. package/lib/responsePayload.d.ts +0 -2
  76. package/lib/responsePayload.js +1 -9
  77. package/lib/view/accountList/accountListReducer.js +3 -1
  78. package/lib/view/accountMappingView/accountMappingReducer.js +1 -0
  79. package/lib/view/apAgingView/apAgingDetail/apAgingDetailReducer.js +2 -1
  80. package/lib/view/auditReportView/auditReportViewReducer.d.ts +2 -2
  81. package/lib/view/auditReportView/auditReportViewState.d.ts +2 -2
  82. package/lib/view/balanceSheet/balanceSheetReducer.js +6 -1
  83. package/lib/view/bankAccountView/bankAccountViewReducer.js +1 -0
  84. package/lib/view/billPayCard/billPayCardSelector.d.ts +2 -2
  85. package/lib/view/cardBalance/cardBalanceSelector.d.ts +3 -3
  86. package/lib/view/cashBalance/cashBalanceSelector.d.ts +3 -3
  87. package/lib/view/cashFlow/cashFlowReducer.js +4 -1
  88. package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +2 -2
  89. package/lib/view/cashPosition/cashPositionReducer.js +1 -0
  90. package/lib/view/cashPosition/cashPositionSelector.d.ts +2 -2
  91. package/lib/view/common/reportsHelpers.d.ts +1 -1
  92. package/lib/view/commonVendorView/transactionVendorView/epics/saveTransactionVendorEpic.js +2 -20
  93. package/lib/view/commonVendorView/vendorView/epics/fetchAndUpdateVendorRecommendationsEpic.js +3 -1
  94. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewReducer.d.ts +2 -2
  95. package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.d.ts +2 -2
  96. package/lib/view/companyView/companyViewReducer.d.ts +1 -1
  97. package/lib/view/companyView/companyViewReducer.js +10 -1
  98. package/lib/view/companyView/types/cockpitTypes.d.ts +3 -3
  99. package/lib/view/companyView/types/companyPassport/companyUsersLocalData.d.ts +1 -1
  100. package/lib/view/dashboard/dashboardEpic.js +2 -0
  101. package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
  102. package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.d.ts +1 -2
  103. package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +10 -24
  104. package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.d.ts +1 -2
  105. package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +0 -14
  106. package/lib/view/expenseAutomationView/epics/transactionCategorization/updateTransactionCategorizationEpic.js +7 -30
  107. package/lib/view/expenseAutomationView/expenseAutomationViewReducer.d.ts +2 -2
  108. package/lib/view/expenseAutomationView/expenseAutomationViewReducer.js +5 -1
  109. package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +2 -17
  110. package/lib/view/expenseAutomationView/expenseAutomationViewState.d.ts +2 -2
  111. package/lib/view/expenseAutomationView/expenseAutomationViewState.js +1 -1
  112. package/lib/view/expenseAutomationView/helpers/saveTransactionHelper.js +53 -53
  113. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  114. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +10 -86
  115. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +11 -11
  116. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +1 -12
  117. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +7 -66
  118. package/lib/view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes.d.ts +0 -2
  119. package/lib/view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes.js +1 -1
  120. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +2 -5
  121. package/lib/view/expenseAutomationView/types/fluxAnalysisViewState.d.ts +1 -1
  122. package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +1 -1
  123. package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +2 -12
  124. package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
  125. package/lib/view/financeStatement/financeStatementReducer.js +4 -1
  126. package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +4 -4
  127. package/lib/view/netBurnOrIncome/netBurnOrIncomeReducer.js +10 -3
  128. package/lib/view/netBurnOrIncomeClassesView/netBurnOrIncomeClassesViewReducer.js +6 -1
  129. package/lib/view/netBurnOrIncomeStoryCard/netBurnOrIncomeStoryCardReducer.js +1 -0
  130. package/lib/view/netBurnOrIncomeStoryCard/netBurnOrIncomeStoryCardState.d.ts +1 -1
  131. package/lib/view/notificationView/notificationViewReducer.d.ts +8 -8
  132. package/lib/view/notificationView/notificationViewState.d.ts +2 -2
  133. package/lib/view/onboardingView/cockpitView/onboardingCockpitViewReducer.js +3 -0
  134. package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.d.ts +2 -2
  135. package/lib/view/opEx/opExForTimeFrameEpic.js +1 -1
  136. package/lib/view/opEx/opExReducer.js +14 -4
  137. package/lib/view/opExByVendor/opExByVendorReducer.js +3 -1
  138. package/lib/view/opExByVendor/opExByVendorState.d.ts +1 -1
  139. package/lib/view/opExClassesView/opExClassesViewReducer.js +6 -1
  140. package/lib/view/people/fetchPeopleEpic.js +3 -1
  141. package/lib/view/people/invitePeopleEpic.js +3 -1
  142. package/lib/view/people/inviteZeniPeopleEpic.js +3 -1
  143. package/lib/view/people/peopleReducer.js +1 -0
  144. package/lib/view/people/peopleSaveUpdatesEpic.js +1 -1
  145. package/lib/view/profitAndLoss/profitAndLossReducer.js +6 -1
  146. package/lib/view/profitAndLossClassesView/profitAndLossClassesViewReducer.js +6 -1
  147. package/lib/view/recommendation/recommendationReducer.js +4 -1
  148. package/lib/view/referralView/referralState.d.ts +1 -1
  149. package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +2 -2
  150. package/lib/view/reportUIOptions/reportUIOptionsReducer.d.ts +8 -8
  151. package/lib/view/reportUIOptions/updateReportUIOptionThisPeriodEpic.js +3 -1
  152. package/lib/view/revenue/revenueReducer.js +10 -3
  153. package/lib/view/revenueClassesView/revenueClassesViewReducer.js +6 -1
  154. package/lib/view/scheduleView/scheduleAccruedDetailView/LinkBillExpenseView/linkBillExpense.d.ts +1 -1
  155. package/lib/view/scheduleView/scheduleDetailView/scheduleDetailReducer.d.ts +4 -4
  156. package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +2 -2
  157. package/lib/view/settingsView/settingsViewReducer.js +1 -0
  158. package/lib/view/settingsView/settingsViewState.d.ts +1 -1
  159. package/lib/view/spendManagement/billPay/billList/billListReducer.d.ts +1 -1
  160. package/lib/view/spendManagement/billPay/billList/billListReducer.js +1 -0
  161. package/lib/view/spendManagement/billPay/billList/billListState.d.ts +2 -2
  162. package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigState.d.ts +1 -1
  163. package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigState.js +6 -0
  164. package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewReducer.d.ts +2 -2
  165. package/lib/view/spendManagement/billPay/billsBulkActionView/epics/validateBillsBulkActionEpic.ts.js +3 -4
  166. package/lib/view/spendManagement/billPay/editBillView/epics/fetchBillAndInitializeLocalStoreEpic.js +3 -1
  167. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.d.ts +2 -2
  168. package/lib/view/spendManagement/commonHistoryView/commonHistory.d.ts +1 -1
  169. package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +7 -7
  170. package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +1 -1
  171. package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/establishPlaidConnectionEpic.js +3 -11
  172. package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.d.ts +10 -11
  173. package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.js +1 -3
  174. package/lib/view/spendManagement/plaidAccount/plaidAccountViewState.d.ts +1 -1
  175. package/lib/view/spendManagement/reimbursement/editRemiView/epics/fetchRecommendationsAndUpdateMerchantRecommendationsEpic.js +6 -2
  176. package/lib/view/spendManagement/reimbursement/editRemiView/epics/fetchRemiAndInitializeLocalStoreEpic.js +3 -1
  177. package/lib/view/spendManagement/reimbursement/remiListView/remiListReducer.d.ts +1 -1
  178. package/lib/view/spendManagement/reimbursement/remiListView/remiListReducer.js +1 -0
  179. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +4 -4
  180. package/lib/view/spendManagement/reimbursement/remisBulkActionView/remisBulkActionViewReducer.d.ts +2 -2
  181. package/lib/view/subscriptionView/subscriptionViewReducer.js +1 -0
  182. package/lib/view/subscriptionView/types/subscriptionTypes.js +1 -0
  183. package/lib/view/taskManager/taskListView/epics/dragNDropTasksEpic.js +3 -1
  184. package/lib/view/taskManager/taskListView/taskList.d.ts +3 -3
  185. package/lib/view/taskManager/taskListView/taskListSelector.d.ts +1 -1
  186. package/lib/view/tasksCard/fetchTasksCardEpic.js +2 -1
  187. package/lib/view/tasksCard/tasksCardSelector.d.ts +2 -2
  188. package/lib/view/tasksCard/tasksCardSelector.js +1 -1
  189. package/lib/view/topEx/topExSelector.d.ts +3 -3
  190. package/lib/view/transactionDetail/epics/saveTransactionHelper.js +59 -34
  191. package/lib/view/transactionDetail/epics/updateTransactionDetailEpic.js +4 -22
  192. package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +13 -66
  193. package/lib/view/transactionDetail/transactionDetailReducer.d.ts +4 -13
  194. package/lib/view/transactionDetail/transactionDetailReducer.js +21 -51
  195. package/lib/view/transactionDetail/transactionDetailState.d.ts +2 -3
  196. package/lib/view/transactionDetail/transactionDetailTypes.d.ts +0 -8
  197. package/lib/view/transactionList/transactionListByEntitySelector.js +2 -0
  198. package/lib/view/transactionList/transactionListReducer.js +6 -4
  199. package/lib/view/trendWithTransactions/trendWithTransactionsReducer.js +1 -0
  200. package/lib/view/userFinancialAccount/userFinancialAccountReducer.js +3 -1
  201. package/lib/view/vendorFiling1099/vendorFiling1099List/vendorFiling1099ListState.d.ts +1 -1
  202. package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewState.d.ts +1 -1
  203. package/lib/view/vendorReviewView/vendorGlobalReviewView/vendorGlobalReviewViewState.d.ts +1 -1
  204. package/lib/zeniAPI.d.ts +0 -1
  205. package/lib/zeniUrl.d.ts +1 -1
  206. package/package.json +13 -14
  207. package/lib/entity/accountRecon/accountReconPayload.d.ts +0 -71
  208. package/lib/entity/accountRecon/accountReconPayload.js +0 -131
  209. package/lib/entity/accountRecon/accountReconReducer.d.ts +0 -16
  210. package/lib/entity/accountRecon/accountReconReducer.js +0 -71
  211. package/lib/entity/accountRecon/accountReconSelector.d.ts +0 -34
  212. package/lib/entity/accountRecon/accountReconSelector.js +0 -47
  213. package/lib/entity/accountRecon/accountReconState.d.ts +0 -76
  214. package/lib/entity/accountRecon/accountReconState.js +0 -35
  215. package/lib/entity/transaction/payloadTypes/reconciliationTransactionPayloads.d.ts +0 -35
  216. package/lib/entity/transaction/payloadTypes/reconciliationTransactionPayloads.js +0 -53
  217. package/lib/entity/transaction/stateTypes/reconciliationTransaction.d.ts +0 -32
  218. package/lib/entity/transaction/stateTypes/reconciliationTransaction.js +0 -10
  219. package/lib/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.d.ts +0 -15
  220. package/lib/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +0 -118
  221. package/lib/view/expenseAutomationView/epics/accountRecon/initialiseLocalDataForSelectedAccountIdEpic.d.ts +0 -10
  222. package/lib/view/expenseAutomationView/epics/accountRecon/initialiseLocalDataForSelectedAccountIdEpic.js +0 -49
  223. package/lib/view/expenseAutomationView/epics/accountRecon/saveReconciliationDetailEpic.d.ts +0 -14
  224. package/lib/view/expenseAutomationView/epics/accountRecon/saveReconciliationDetailEpic.js +0 -178
  225. package/lib/view/expenseAutomationView/epics/accountRecon/saveReconciliationReviewEpic.d.ts +0 -9
  226. package/lib/view/expenseAutomationView/epics/accountRecon/saveReconciliationReviewEpic.js +0 -154
  227. package/lib/view/expenseAutomationView/epics/accountRecon/updateReconcileTabLocalDataEpic.d.ts +0 -6
  228. package/lib/view/expenseAutomationView/epics/accountRecon/updateReconcileTabLocalDataEpic.js +0 -110
  229. package/lib/view/expenseAutomationView/helpers/reconciliationHelpers.d.ts +0 -7
  230. package/lib/view/expenseAutomationView/helpers/reconciliationHelpers.js +0 -18
  231. package/lib/view/expenseAutomationView/payload/reconciliationPayload.d.ts +0 -28
  232. package/lib/view/expenseAutomationView/payload/reconciliationPayload.js +0 -51
  233. package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.d.ts +0 -66
  234. package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.js +0 -384
  235. package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.d.ts +0 -53
  236. package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.js +0 -7
  237. package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.d.ts +0 -5
  238. package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +0 -278
  239. package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +0 -103
  240. package/lib/view/expenseAutomationView/types/reconciliationViewState.js +0 -37
@@ -1,278 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.isAccountReconReport = exports.getExpenseAutomationReconciliationView = void 0;
7
- const toolkit_1 = require("@reduxjs/toolkit");
8
- const keys_1 = __importDefault(require("lodash/keys"));
9
- const omit_1 = __importDefault(require("lodash/omit"));
10
- const orderBy_1 = __importDefault(require("lodash/orderBy"));
11
- const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
12
- const accountReconSelector_1 = require("../../../entity/accountRecon/accountReconSelector");
13
- const tenantSelector_1 = require("../../../entity/tenant/tenantSelector");
14
- const vendorSelector_1 = require("../../../entity/vendor/vendorSelector");
15
- const accountListSelector_1 = require("../../accountList/accountListSelector");
16
- const classListSelector_1 = require("../../classList/classListSelector");
17
- const reconciliationViewReducer_1 = require("../reducers/reconciliationViewReducer");
18
- const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
19
- exports.getExpenseAutomationReconciliationView = (0, toolkit_1.createSelector)((state) => state, (state) => (0, tenantSelector_1.getCurrentTenant)(state), (state) => state.expenseAutomationReconciliationViewState, (state) => state.expenseAutomationViewState, (state) => state.plaidAccountViewState, (state) => state.accountListState, (state) => state.accountState, (state) => state.classListState, (state) => state.classState, (state) => state.monthEndCloseChecksState, (state) => state.vendorState, (state, currentTenant, reconciliationViewState, expenseAutomationViewState, plaidAccountViewState, accountListState, accountState, classListState, classState, monthEndCloseChecksState, vendorState) => {
20
- var _a;
21
- const { selectedPeriodByTenantId } = expenseAutomationViewState;
22
- const reconcileTabUiState = reconciliationViewState.reconTabsState.reconcile.uiState;
23
- const reviewTabUiState = reconciliationViewState.reconTabsState.review.uiState;
24
- const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
25
- const accountReconForMonthYearPeriod = selectedPeriod != null
26
- ? reconciliationViewState.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]
27
- : undefined;
28
- if (accountReconForMonthYearPeriod == null) {
29
- return {
30
- accountListNestedAccountHierarchy: [],
31
- classListNestedAccountHierarchy: [],
32
- allAccountList: [],
33
- allClassList: [],
34
- fetchStatus: {
35
- fetchState: reconciliationViewState.fetchState,
36
- error: reconciliationViewState.error,
37
- },
38
- plaidConnectionDetails: plaidAccountViewState['expense_automation_reconcile']
39
- .plaidConnectionDetails,
40
- completionStatus: 'incomplete',
41
- refreshStatus: reconciliationViewState.refreshStatus,
42
- selectedTab: reconciliationViewState.selectedTab,
43
- monthYearPeriod: selectedPeriod,
44
- selectedAccountId: reconciliationViewState.selectedAccountId,
45
- accountReconciliationsByAccountID: {},
46
- reconciliationTabsState: reconciliationViewReducer_1.initialReconciliationTabsState,
47
- actionFetchStates: reconciliationViewReducer_1.initialActionFetchState,
48
- reviewTabSelectedVendorByTransactionId: {},
49
- accountReconciliationBySectionID: {
50
- assets: {
51
- sectionId: 'assets',
52
- accountIDs: [],
53
- totalBankBalance: undefined,
54
- totalClearedBalance: undefined,
55
- totalReconciledBalance: undefined,
56
- totalVariance: undefined,
57
- totalVariancePercentage: undefined,
58
- },
59
- liabilities: {
60
- sectionId: 'liabilities',
61
- accountIDs: [],
62
- totalBankBalance: undefined,
63
- totalClearedBalance: undefined,
64
- totalReconciledBalance: undefined,
65
- totalVariance: undefined,
66
- totalVariancePercentage: undefined,
67
- },
68
- },
69
- };
70
- }
71
- const allAccountIDs = accountReconForMonthYearPeriod.accountIDs;
72
- const reconList = {};
73
- const assetAccountIDs = [];
74
- const liabilityAccountIDs = [];
75
- const assetTotals = {};
76
- const liabilityTotals = {};
77
- allAccountIDs.forEach((accountID) => {
78
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
79
- const accountRecon = (0, accountReconSelector_1.getAccountReconByAccountIdAndSelectedPeriod)(state, accountID, selectedPeriod);
80
- if (accountRecon == null) {
81
- console.error(`Account reconciliation not found for account ${accountID} in period ${selectedPeriod.toString()}`);
82
- return;
83
- }
84
- const accountConnectionStatus = reconciliationViewState.accountConnectionStatusByAccountID[accountID];
85
- if (accountConnectionStatus == null) {
86
- console.error(`Account connection status not found for account ${accountID} in period ${selectedPeriod.toString()}`);
87
- return;
88
- }
89
- const account = accountRecon.account;
90
- const sortedReconcileTransactions = sortReconcileTransactions(accountRecon.transactionsToReconcile, reconcileTabUiState);
91
- accountRecon.transactionsToReconcile = sortedReconcileTransactions;
92
- const sortedReviewTabTransactions = sortReviewTabTransactions(accountRecon.transactionsToReview, reviewTabUiState);
93
- accountRecon.transactionsToReview = sortedReviewTabTransactions;
94
- if (accountConnectionStatus.status === 'connected') {
95
- if ((account === null || account === void 0 ? void 0 : account.accountType) === 'bank') {
96
- if (accountRecon.balance != null &&
97
- accountRecon.clearedBalance != null &&
98
- accountRecon.variance != null) {
99
- assetTotals.balanceTotal = Object.assign(Object.assign({}, accountRecon.balance), { amount: ((_b = (_a = assetTotals.balanceTotal) === null || _a === void 0 ? void 0 : _a.amount) !== null && _b !== void 0 ? _b : 0) +
100
- accountRecon.balance.amount });
101
- assetTotals.clearedTotal = Object.assign(Object.assign({}, accountRecon.clearedBalance), { amount: ((_d = (_c = assetTotals.clearedTotal) === null || _c === void 0 ? void 0 : _c.amount) !== null && _d !== void 0 ? _d : 0) +
102
- accountRecon.clearedBalance.amount });
103
- assetTotals.varianceTotal = Object.assign(Object.assign({}, accountRecon.variance), { amount: ((_f = (_e = assetTotals.varianceTotal) === null || _e === void 0 ? void 0 : _e.amount) !== null && _f !== void 0 ? _f : 0) +
104
- accountRecon.variance.amount });
105
- assetTotals.variancePercentage =
106
- assetTotals.varianceTotal.amount != null &&
107
- assetTotals.balanceTotal.amount != null &&
108
- assetTotals.balanceTotal.amount !== 0
109
- ? (assetTotals.varianceTotal.amount /
110
- assetTotals.balanceTotal.amount) *
111
- 100
112
- : undefined;
113
- }
114
- }
115
- else if (account.accountType === 'credit_card') {
116
- if (accountRecon.balance != null &&
117
- accountRecon.clearedBalance != null &&
118
- accountRecon.variance != null) {
119
- liabilityTotals.balanceTotal = Object.assign(Object.assign({}, accountRecon.balance), { amount: ((_h = (_g = liabilityTotals.balanceTotal) === null || _g === void 0 ? void 0 : _g.amount) !== null && _h !== void 0 ? _h : 0) +
120
- accountRecon.balance.amount });
121
- liabilityTotals.clearedTotal = Object.assign(Object.assign({}, accountRecon.clearedBalance), { amount: ((_k = (_j = liabilityTotals.clearedTotal) === null || _j === void 0 ? void 0 : _j.amount) !== null && _k !== void 0 ? _k : 0) +
122
- accountRecon.clearedBalance.amount });
123
- liabilityTotals.varianceTotal = Object.assign(Object.assign({}, accountRecon.variance), { amount: ((_m = (_l = liabilityTotals.varianceTotal) === null || _l === void 0 ? void 0 : _l.amount) !== null && _m !== void 0 ? _m : 0) +
124
- accountRecon.variance.amount });
125
- liabilityTotals.variancePercentage =
126
- liabilityTotals.varianceTotal.amount != null &&
127
- liabilityTotals.balanceTotal.amount != null &&
128
- liabilityTotals.balanceTotal.amount !== 0
129
- ? (liabilityTotals.varianceTotal.amount /
130
- liabilityTotals.balanceTotal.amount) *
131
- 100
132
- : undefined;
133
- }
134
- }
135
- }
136
- if ((account === null || account === void 0 ? void 0 : account.accountType) === 'bank') {
137
- assetAccountIDs.push(accountID);
138
- }
139
- else if (account.accountType === 'credit_card') {
140
- liabilityAccountIDs.push(accountID);
141
- }
142
- reconList[accountID] = {
143
- accountConnectionStatus: accountConnectionStatus.status,
144
- paymentAccountId: accountConnectionStatus.paymentAccountId,
145
- connectionInProgress: accountConnectionStatus.connectionInProgress,
146
- accountReconEntity: accountRecon,
147
- refreshStatus: accountReconForMonthYearPeriod.reconciliationByAccountID[accountID]
148
- .refreshStatus,
149
- transactionFetchState: accountReconForMonthYearPeriod.reconciliationByAccountID[accountID]
150
- .transactionFetchState, // transaction fetch state
151
- };
152
- });
153
- const accountReconciliationBySectionID = {
154
- assets: {
155
- sectionId: 'assets',
156
- accountIDs: assetAccountIDs,
157
- totalBankBalance: assetTotals.balanceTotal,
158
- totalClearedBalance: assetTotals.clearedTotal,
159
- totalReconciledBalance: assetTotals.varianceTotal,
160
- totalVariance: assetTotals.varianceTotal,
161
- totalVariancePercentage: assetTotals.variancePercentage,
162
- },
163
- liabilities: {
164
- sectionId: 'liabilities',
165
- accountIDs: liabilityAccountIDs,
166
- totalBankBalance: liabilityTotals.balanceTotal,
167
- totalClearedBalance: liabilityTotals.clearedTotal,
168
- totalReconciledBalance: liabilityTotals.varianceTotal,
169
- totalVariance: liabilityTotals.varianceTotal,
170
- totalVariancePercentage: liabilityTotals.variancePercentage,
171
- },
172
- };
173
- const accountListNestedAccountHierarchy = (0, accountListSelector_1.getNestedAccountListHierarchy)(accountListState, 'accountList');
174
- const classListNestedAccountHierarchy = (0, classListSelector_1.getNestedClassListHierarchy)(classListState);
175
- const accountsList = (0, accountListSelector_1.getAccountList)(accountState, accountListState, 'accountList');
176
- const classList = (0, classListSelector_1.getClassList)(classState, classListState);
177
- const allClasses = classList.classes.map((classData) => {
178
- return (0, omit_1.default)(classData, ['accountIds', 'key']);
179
- });
180
- const allSteps = selectedPeriod != null
181
- ? (0, expenseAutomationViewSelectorTypes_1.getAllSteps)(monthEndCloseChecksState, (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod), currentTenant.tenantId)
182
- : [];
183
- const reconciliationCompletionStatus = (_a = allSteps.find((step) => step.step === 'reconciliation')) === null || _a === void 0 ? void 0 : _a.completionStatus;
184
- const completionStatus = reconciliationCompletionStatus !== null && reconciliationCompletionStatus !== void 0 ? reconciliationCompletionStatus : 'incomplete';
185
- const reviewTabTransactionIds = (0, keys_1.default)(reconciliationViewState.reconTabsState.review.localData);
186
- const reviewTabSelectedVendorByTransactionId = Object.fromEntries(reviewTabTransactionIds
187
- .map((currTxnId) => {
188
- var _a;
189
- const transactionLocalData = reconciliationViewState.reconTabsState.review.localData[currTxnId];
190
- const selectedVendorId = (_a = transactionLocalData === null || transactionLocalData === void 0 ? void 0 : transactionLocalData.vendor) === null || _a === void 0 ? void 0 : _a.id;
191
- if (selectedVendorId == null) {
192
- return null;
193
- }
194
- const vendor = (0, vendorSelector_1.getVendorByVendorId)(vendorState, selectedVendorId);
195
- if (vendor == null) {
196
- return null;
197
- }
198
- return [currTxnId, vendor];
199
- })
200
- .filter((entry) => entry !== null));
201
- return {
202
- accountReconciliationsByAccountID: reconList,
203
- fetchStatus: {
204
- fetchState: reconciliationViewState.fetchState,
205
- error: reconciliationViewState.error,
206
- },
207
- plaidConnectionDetails: plaidAccountViewState['expense_automation_reconcile']
208
- .plaidConnectionDetails,
209
- reconciliationTabsState: reconciliationViewState.reconTabsState,
210
- completionStatus,
211
- refreshStatus: reconciliationViewState.refreshStatus,
212
- selectedTab: reconciliationViewState.selectedTab,
213
- selectedDrawerAccountId: reconciliationViewState.selectedDrawerAccountId,
214
- monthYearPeriod: selectedPeriod,
215
- accountReconciliationBySectionID,
216
- selectedAccountId: reconciliationViewState.selectedAccountId,
217
- selectedReconAccount: reconciliationViewState.selectedAccountId != null &&
218
- reconList[reconciliationViewState.selectedAccountId] != null
219
- ? reconList[reconciliationViewState.selectedAccountId]
220
- : undefined, // Selects the reconciliation account based on the selectedAccountId
221
- accountListNestedAccountHierarchy,
222
- actionFetchStates: reconciliationViewState.actionFetchState,
223
- classListNestedAccountHierarchy,
224
- allAccountList: accountsList.accounts,
225
- allClassList: allClasses,
226
- reviewTabSelectedVendorByTransactionId,
227
- };
228
- });
229
- const isAccountReconReport = (reportId) => {
230
- return reportId.endsWith('reconciliation');
231
- };
232
- exports.isAccountReconReport = isAccountReconReport;
233
- function sortReconcileTransactions(transactions, uiState) {
234
- const { sortKey, sortOrder } = uiState;
235
- return (0, orderBy_1.default)(transactions, (transaction) => {
236
- var _a, _b, _c, _d, _e, _f;
237
- switch (sortKey) {
238
- case 'clearedDate':
239
- return (_b = (_a = transaction.clearedDate) === null || _a === void 0 ? void 0 : _a.valueOf()) !== null && _b !== void 0 ? _b : null;
240
- case 'type':
241
- return transaction.type.toLowerCase();
242
- case 'payee':
243
- return (_d = (_c = transaction.merchantName) === null || _c === void 0 ? void 0 : _c.toLowerCase()) !== null && _d !== void 0 ? _d : null;
244
- case 'account':
245
- return (_f = (_e = transaction.accountName) === null || _e === void 0 ? void 0 : _e.toLowerCase()) !== null && _f !== void 0 ? _f : null;
246
- case 'transactionDirection':
247
- return transaction.transactionDirection.toLowerCase();
248
- case 'memo':
249
- return transaction.memo.toLowerCase();
250
- case 'amount':
251
- return transaction.amount.amount;
252
- case 'date':
253
- default:
254
- return transaction.date.valueOf();
255
- }
256
- }, sortOrder === 'ascending' ? 'asc' : 'desc');
257
- }
258
- function sortReviewTabTransactions(transactions, uiState) {
259
- const { sortKey, sortOrder } = uiState;
260
- return (0, orderBy_1.default)(transactions, (transaction) => {
261
- var _a, _b, _c, _d, _e;
262
- switch (sortKey) {
263
- case 'match':
264
- return ((_b = (_a = transaction.recommendedAction) === null || _a === void 0 ? void 0 : _a.recommendedTransactions.length) !== null && _b !== void 0 ? _b : null);
265
- case 'payee':
266
- return ((_e = (_d = (_c = transaction.recommendedAction.recommendedTransactions[0]) === null || _c === void 0 ? void 0 : _c.merchantName) === null || _d === void 0 ? void 0 : _d.toLowerCase()) !== null && _e !== void 0 ? _e : null);
267
- case 'direction':
268
- return transaction.transactionDirection.toLowerCase();
269
- case 'memo':
270
- return transaction.memo.toLowerCase();
271
- case 'amount':
272
- return transaction.amount.amount;
273
- case 'date':
274
- default:
275
- return transaction.transactionDate.valueOf();
276
- }
277
- }, sortOrder === 'ascending' ? 'asc' : 'desc');
278
- }
@@ -1,103 +0,0 @@
1
- import { Amount } from '../../../commonStateTypes/amount';
2
- import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
3
- import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
4
- import { MonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
5
- import { BankStatusCodeType } from '../../../entity/accountRecon/accountReconState';
6
- import { VendorBase } from '../../../entity/vendor/vendorState';
7
- import { ZeniAPIStatus } from '../../../responsePayload';
8
- export declare const RECONCILE_ACTIONS: readonly ["reconcile", "save_reconcile_for_later", "exclude"];
9
- export declare const toReconcileActions: (v: string) => "reconcile" | "save_reconcile_for_later" | "exclude";
10
- export type ReconcileActionType = ReturnType<typeof toReconcileActions>;
11
- export type SaveReconcileDetailActionPayload = {
12
- reconcileAction: 'exclude';
13
- excludeTransactionId: ID;
14
- } | {
15
- reconcileAction: 'reconcile' | 'save_reconcile_for_later';
16
- };
17
- export interface SaveReconciliationDetailFailurePayload {
18
- fetchStateByAction: SaveReconcileDetailActionPayload;
19
- error: ZeniAPIStatus;
20
- }
21
- export declare const toReconciliationTabsType: (v: string) => "reconcile" | "review";
22
- export declare type ReconciliationViewTabType = ReturnType<typeof toReconciliationTabsType>;
23
- declare const toReconReconcileSortKeysType: (v: string) => "date" | "amount" | "account" | "type" | "memo" | "transactionDirection" | "clearedDate" | "payee" | "recommended";
24
- export declare type ReconReconcileSortKey = ReturnType<typeof toReconReconcileSortKeysType>;
25
- export interface ReconciliationReconcileTabLocalData {
26
- selectedTransactionIds: ID[];
27
- }
28
- export interface ReconciliationReconcileTabViewUiState {
29
- scrollYOffset?: number;
30
- sortKey: ReconReconcileSortKey;
31
- sortOrder: SortOrder;
32
- }
33
- export interface TransactionSummary {
34
- count: number;
35
- totalAmount: Amount;
36
- }
37
- export interface BalancesLocalData {
38
- variance: Amount;
39
- clearedBalance: Amount;
40
- variancePercentage: number;
41
- payments: TransactionSummary;
42
- deposits: TransactionSummary;
43
- }
44
- export interface ReconciliationTabsState {
45
- reconcile: {
46
- localData: ReconciliationReconcileTabLocalData;
47
- uiState: ReconciliationReconcileTabViewUiState;
48
- };
49
- review: {
50
- localData: Record<ID, ReconciliationReviewTabLocalData>;
51
- uiState: ReconciliationReviewTabViewUiState;
52
- };
53
- balances: BalancesLocalData;
54
- }
55
- declare const toReconReviewSortKey: (v: string) => "date" | "amount" | "memo" | "direction" | "match" | "payee";
56
- export type ReconReviewSortKey = ReturnType<typeof toReconReviewSortKey>;
57
- export interface ReconciliationReviewTabViewUiState {
58
- scrollPosition: {
59
- scrollLeft?: number;
60
- scrollTop: number;
61
- } | undefined;
62
- sortKey: ReconReviewSortKey;
63
- sortOrder: SortOrder;
64
- }
65
- export interface ReconciliationReviewTabLocalData {
66
- memo: string;
67
- categoryId?: ID;
68
- classId?: ID;
69
- vendor?: VendorBase;
70
- matchedTransactionId?: ID;
71
- }
72
- export interface ActionFetchStates {
73
- excludeFetchById: Record<ID, FetchStateAndError>;
74
- saveForLaterFetch: FetchStateAndError;
75
- reconcileFetch: FetchStateAndError;
76
- saveReconciliationReviewFetch: Record<ID, FetchStateAndError>;
77
- }
78
- export interface ReconciliationViewState extends FetchStateAndError {
79
- accountReconciliationRecordsBySelectedPeriod: Record<MonthYearPeriodId, AccountReconciliationRecords>;
80
- refreshStatus: FetchStateAndError;
81
- accountConnectionStatusByAccountID: Record<ID, BankConnectionStatus>;
82
- selectedTab: ReconciliationViewTabType;
83
- selectedAccountId?: ID;
84
- selectedDrawerAccountId?: ID;
85
- reconTabsState: ReconciliationTabsState;
86
- actionFetchState: ActionFetchStates;
87
- }
88
- export interface BankConnectionStatus {
89
- status: BankStatusCodeType;
90
- connectionInProgress: boolean;
91
- paymentAccountId?: ID;
92
- }
93
- export interface AccountReconciliationRecords {
94
- accountIDs: ID[];
95
- reconciliationByAccountID: Record<ID, AccountReconciliationDataWithTransactionFetchState>;
96
- }
97
- export interface AccountReconciliationDataWithTransactionFetchState {
98
- accountId: ID;
99
- reconciliationId?: ID;
100
- transactionFetchState: FetchStateAndError;
101
- refreshStatus: FetchStateAndError;
102
- }
103
- export {};
@@ -1,37 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toReconciliationTabsType = exports.toReconcileActions = exports.RECONCILE_ACTIONS = void 0;
4
- const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
5
- exports.RECONCILE_ACTIONS = [
6
- 'reconcile',
7
- 'save_reconcile_for_later',
8
- 'exclude',
9
- ];
10
- const toReconcileActions = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.RECONCILE_ACTIONS);
11
- exports.toReconcileActions = toReconcileActions;
12
- const RECONCILIATION_VIEW_TABS = ['reconcile', 'review'];
13
- const toReconciliationTabsType = (v) => (0, stringToUnion_1.stringToUnion)(v, RECONCILIATION_VIEW_TABS);
14
- exports.toReconciliationTabsType = toReconciliationTabsType;
15
- const RECON_RECONCILE_SORT_KEYS = [
16
- 'date',
17
- 'clearedDate',
18
- 'type',
19
- 'payee',
20
- 'account',
21
- 'transactionDirection',
22
- 'memo',
23
- 'amount',
24
- 'recommended',
25
- ];
26
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
27
- const toReconReconcileSortKeysType = (v) => (0, stringToUnion_1.stringToUnion)(v, RECON_RECONCILE_SORT_KEYS);
28
- const RECON_REVIEW_SORT_KEYS = [
29
- 'date',
30
- 'payee',
31
- 'memo',
32
- 'amount',
33
- 'direction',
34
- 'match',
35
- ];
36
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
37
- const toReconReviewSortKey = (v) => (0, stringToUnion_1.stringToUnion)(v, RECON_REVIEW_SORT_KEYS);