@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
@@ -8,9 +8,9 @@ import { Transaction, TransactionID } from '../../entity/transaction/stateTypes/
8
8
  import { VendorBase } from '../../entity/vendor/vendorState';
9
9
  import { EntityRecommendationKey } from '../recommendation/recommendationState';
10
10
  import { TransactionDetailLocalData } from './transactionDetailTypes';
11
- export declare const getTransactionDetailKey: (transactionId: TransactionID) => `${string}_invoice` | `${string}_payment` | `${string}_credit_memo` | `${string}_sales_receipt` | `${string}_delayed_credit` | `${string}_delayed_charge` | `${string}_refund` | `${string}_expense` | `${string}_check` | `${string}_bill` | `${string}_bill_payment` | `${string}_bill_payment_check` | `${string}_bill_payment_credit_card` | `${string}_vendor_credit` | `${string}_credit_card_credit` | `${string}_transfer` | `${string}_credit_card_payment` | `${string}_deposit` | `${string}_journal_entry`;
11
+ export declare const getTransactionDetailKey: (transactionId: TransactionID) => `${string}_transfer` | `${string}_invoice` | `${string}_payment` | `${string}_credit_memo` | `${string}_sales_receipt` | `${string}_delayed_credit` | `${string}_delayed_charge` | `${string}_refund` | `${string}_expense` | `${string}_check` | `${string}_bill` | `${string}_bill_payment` | `${string}_bill_payment_check` | `${string}_bill_payment_credit_card` | `${string}_vendor_credit` | `${string}_credit_card_credit` | `${string}_credit_card_payment` | `${string}_deposit` | `${string}_journal_entry`;
12
12
  export type TransactionDetailKey = ReturnType<typeof getTransactionDetailKey>;
13
- export declare const getZeniTransactionDetailKey: (transactionId: TransactionID) => `${string}_invoice` | `${string}_payment` | `${string}_credit_memo` | `${string}_sales_receipt` | `${string}_delayed_credit` | `${string}_delayed_charge` | `${string}_refund` | `${string}_expense` | `${string}_check` | `${string}_bill` | `${string}_bill_payment` | `${string}_bill_payment_check` | `${string}_bill_payment_credit_card` | `${string}_vendor_credit` | `${string}_credit_card_credit` | `${string}_transfer` | `${string}_credit_card_payment` | `${string}_deposit` | `${string}_journal_entry`;
13
+ export declare const getZeniTransactionDetailKey: (transactionId: TransactionID) => `${string}_transfer` | `${string}_invoice` | `${string}_payment` | `${string}_credit_memo` | `${string}_sales_receipt` | `${string}_delayed_credit` | `${string}_delayed_charge` | `${string}_refund` | `${string}_expense` | `${string}_check` | `${string}_bill` | `${string}_bill_payment` | `${string}_bill_payment_check` | `${string}_bill_payment_credit_card` | `${string}_vendor_credit` | `${string}_credit_card_credit` | `${string}_credit_card_payment` | `${string}_deposit` | `${string}_journal_entry`;
14
14
  export type ZeniTransactionDetailKey = ReturnType<typeof getTransactionDetailKey>;
15
15
  export declare const getThirdPartyIdFromTransactionId: (transactionId: TransactionID) => string;
16
16
  /**
@@ -59,7 +59,6 @@ export interface TransactionUpdates {
59
59
  memo?: string;
60
60
  updatesByLineId: Record<ID, TransactionLineUpdates>;
61
61
  vendorId?: ID;
62
- customerId?: ID;
63
62
  }
64
63
  export interface EntityRelatedRecommendationUpdates {
65
64
  entityId: ID;
@@ -35,7 +35,6 @@ export interface TransactionDetailLineItemData extends TransactionLineBase {
35
35
  recommendations?: Recommendation[];
36
36
  isCategoryMiscategorized: boolean;
37
37
  isClassMiscategorized: boolean;
38
- selectedEntityLine?: Entity;
39
38
  }
40
39
  export interface TransactionDetailLocalData {
41
40
  memo?: string;
@@ -45,13 +44,6 @@ export interface TransactionDetailLocalData {
45
44
  name: string;
46
45
  qboId: ID;
47
46
  };
48
- customerDetails?: {
49
- id: ID;
50
- name: string;
51
- qboId: ID;
52
- };
53
- selectedEntity?: Entity;
54
- customerUpdates?: TransactionVendorUpdates;
55
47
  vendorUpdates?: TransactionVendorUpdates;
56
48
  updatePreviousTransactionsWithUpdatedVendor?: boolean;
57
49
  isVendorUpdateAllChecked: boolean;
@@ -25,6 +25,7 @@ const getTransactionListByEntity = (transactionState, transactionListState, filt
25
25
  .filter((eTransaction) => eTransaction != null);
26
26
  const fetchState = (0, reduceTransactionListFetchState_1.reduceFetchState)(entityTransactions);
27
27
  let transactions = [];
28
+ // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
28
29
  if ((0, reduceTransactionListFetchState_1.isAnyFetchCompleted)(entityTransactions)) {
29
30
  const allTransactionIDs = (0, flatMap_1.default)(entityTransactions, (value) => value.transactionIDs);
30
31
  const transactionsUnsorted = allTransactionIDs
@@ -74,6 +75,7 @@ const getTransactionListByEntityForSinglePeriod = (state, entity, numberOfQuarte
74
75
  .filter((eTransaction) => eTransaction != null);
75
76
  const fetchState = (0, reduceTransactionListFetchState_1.reduceFetchState)(entityTransactions);
76
77
  let transactions = [];
78
+ // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
77
79
  if ((0, reduceTransactionListFetchState_1.isAnyFetchCompleted)(entityTransactions)) {
78
80
  const allTransactionIDs = (0, flatMap_1.default)(entityTransactions, (value) => value.transactionIDs);
79
81
  const transactionsUnsorted = allTransactionIDs
@@ -303,8 +303,9 @@ exports.default = transactionList.reducer;
303
303
  function doUpdateTransactionListByAccount(draft, payload) {
304
304
  const transactionIDs = payload.account.transactions.map((transactionPaylod) => transactionPaylod.transaction_id);
305
305
  const account = (0, accountPayload_1.mapAccountBasePayloadToAccountBase)(payload.account);
306
- const start = (0, timePeriod_1.toAbsoluteDay)(payload.query.start_date);
307
- const end = (0, timePeriod_1.toAbsoluteDay)(payload.query.end_date);
306
+ const start = (0, timePeriod_1.toAbsoluteDay)(payload.query.start_date); // eslint-disable-line @typescript-eslint/no-non-null-assertion
307
+ const end = (0, timePeriod_1.toAbsoluteDay)(payload.query.end_date); // eslint-disable-line @typescript-eslint/no-non-null-assertion
308
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
308
309
  const key = (0, transactionListState_1.getAcTranKey)(account.accountId, account.accountType, {
309
310
  start,
310
311
  end,
@@ -324,8 +325,9 @@ function doUpdateTransactionListByClass(draft, payload) {
324
325
  const transactionIDs = payload.account.transactions.map((transactionPaylod) => transactionPaylod.transaction_id);
325
326
  const account = (0, accountPayload_1.mapAccountBasePayloadToAccountBase)(payload.account);
326
327
  const classId = payload.query.accounting_class_id;
327
- const start = (0, timePeriod_1.toAbsoluteDay)(payload.query.start_date);
328
- const end = (0, timePeriod_1.toAbsoluteDay)(payload.query.end_date);
328
+ const start = (0, timePeriod_1.toAbsoluteDay)(payload.query.start_date); // eslint-disable-line @typescript-eslint/no-non-null-assertion
329
+ const end = (0, timePeriod_1.toAbsoluteDay)(payload.query.end_date); // eslint-disable-line @typescript-eslint/no-non-null-assertion
330
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
329
331
  const key = (0, transactionListState_1.getClassAcTranKey)(account.accountId, account.accountType, classId, {
330
332
  start,
331
333
  end,
@@ -48,6 +48,7 @@ const trendWithTransactions = (0, toolkit_1.createSlice)({
48
48
  },
49
49
  },
50
50
  clearTrendWithTransactions: {
51
+ // eslint-disable-next-line @typescript-eslint/no-inferrable-types
51
52
  prepare(keepUiState = true) {
52
53
  return { payload: { keepUiState } };
53
54
  },
@@ -11,7 +11,9 @@ const userFinancialAccount = (0, toolkit_1.createSlice)({
11
11
  initialState: exports.initialState,
12
12
  reducers: {
13
13
  fetchUserFinancialAccount: {
14
- reducer(draft, action) {
14
+ reducer(draft,
15
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
16
+ action) {
15
17
  const { userId } = action.payload;
16
18
  draft.financialAccountByUserId[userId] = {
17
19
  hasValidState() {
@@ -20,7 +20,7 @@ export interface VendorFiling1099ListQuery {
20
20
  sortOrder: SortOrder;
21
21
  sortKey: VendorFiling1099ListViewSortKey;
22
22
  }
23
- declare const toVendorFiling1099ListViewSortKey: (v: string) => "status" | "w9" | "legal_name" | "total" | "tax_classification" | "filing1099type";
23
+ declare const toVendorFiling1099ListViewSortKey: (v: string) => "total" | "status" | "w9" | "legal_name" | "tax_classification" | "filing1099type";
24
24
  export type VendorFiling1099ListViewSortKey = ReturnType<typeof toVendorFiling1099ListViewSortKey>;
25
25
  export type Type1099Download = 'nec' | 'misc' | 'int';
26
26
  export {};
@@ -12,7 +12,7 @@ export interface FirstReviewPageCurrentSelectionByColumn {
12
12
  rename: boolean;
13
13
  customMerchant: boolean;
14
14
  }
15
- export declare const toVendorFirstReviewViewColumnKeyType: (v: string) => "vendor" | "status" | "action" | "retain" | "updateTo" | "ytd" | "viewTenantInvoice";
15
+ export declare const toVendorFirstReviewViewColumnKeyType: (v: string) => "action" | "status" | "vendor" | "retain" | "updateTo" | "ytd" | "viewTenantInvoice";
16
16
  export type VendorFirstReviewViewColumnKey = ReturnType<typeof toVendorFirstReviewViewColumnKeyType>;
17
17
  export interface RecommendedNonExistingGlobalMerchant extends Omit<GlobalMerchant, 'globalMerchantId'> {
18
18
  globalMerchantId?: ID;
@@ -3,7 +3,7 @@ import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderType
3
3
  import { PageToken } from '../../../commonStateTypes/viewAndReport/viewAndReport';
4
4
  import { GlobalVendorReviewRowCurrentSelection } from '../common/state/commonTypes';
5
5
  import { RecommendedNonExistingGlobalMerchant } from '../vendorFirstReviewView/vendorFirstReviewViewState';
6
- export declare const toVendorGlobalReviewColumnSortKeyType: (v: string) => "tenants" | "recommended" | "originalVendor" | "requestedVendor";
6
+ export declare const toVendorGlobalReviewColumnSortKeyType: (v: string) => "tenants" | "originalVendor" | "recommended" | "requestedVendor";
7
7
  export type VendorGlobalReviewViewColumnSortKey = ReturnType<typeof toVendorGlobalReviewColumnSortKeyType>;
8
8
  export interface GlobalReviewPageCurrentSelectionByColumn {
9
9
  requested: boolean;
package/lib/zeniAPI.d.ts CHANGED
@@ -18,7 +18,6 @@ export interface RESTAPIEndpoints {
18
18
  readonly cardMicroServiceBaseUrl: string;
19
19
  readonly taskMicroServiceBaseUrl: string;
20
20
  readonly notificationMicroServiceBaseUrl: string;
21
- readonly reconciliationMicroServiceBaseUrl: string;
22
21
  }
23
22
  export interface ZeniAPI<ResponseType = FetchResponse> {
24
23
  readonly apiEndPoints: RESTAPIEndpoints;
package/lib/zeniUrl.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import parseUrl from 'url-parse';
2
- export declare function toZeniUrl(urlString: string, parseQueryString?: boolean): parseUrl<Record<string, string | undefined>> | parseUrl<string>;
2
+ export declare function toZeniUrl(urlString: string, parseQueryString?: boolean): parseUrl<string> | parseUrl<Record<string, string | undefined>>;
3
3
  export declare function toZeniUrlWithoutBaseURL(urlString: string): parseUrl<string>;
4
4
  type ZeniUrl = ReturnType<typeof toZeniUrl>;
5
5
  export { ZeniUrl };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.15.52",
3
+ "version": "4.15.54",
4
4
  "description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -25,29 +25,30 @@
25
25
  },
26
26
  "homepage": "https://github.com/zeni-ai/client-epic-state#readme",
27
27
  "devDependencies": {
28
- "@eslint/eslintrc": "^3.3.1",
29
- "@eslint/js": "^9.24.0",
30
28
  "@liveblocks/client": "^2.23.0",
31
29
  "@trivago/prettier-plugin-sort-imports": "^5.2.2",
30
+ "@types/chai": "^5.0.1",
31
+ "@types/jest": "^29.5.14",
32
32
  "@types/lodash": "^4.17.16",
33
33
  "@types/node": "^20.17.23",
34
34
  "@types/url-parse": "^1.4.11",
35
35
  "@typescript-eslint/eslint-plugin": "^8.26.0",
36
36
  "@typescript-eslint/parser": "^8.26.0",
37
- "c8": "^10.1.3",
37
+ "chai": "^4.5.0",
38
+ "chai-better-shallow-deep-equal": "^1.1.1",
38
39
  "concurrently": "^9.1.2",
39
- "eslint": "^9.24.0",
40
+ "eslint": "^8.57.1",
40
41
  "eslint-config-prettier": "^10.0.2",
41
42
  "eslint-plugin-prettier": "^5.2.3",
42
43
  "eslint-plugin-unused-imports": "^4.1.4",
43
- "globals": "^16.0.0",
44
+ "jest": "^29.7.0",
44
45
  "prettier": "^3.5.3",
45
46
  "prettier-plugin-import-sort": "^0.0.7",
46
47
  "rimraf": "^6.0.1",
48
+ "ts-jest": "^29.2.6",
47
49
  "ts-prune": "^0.10.3",
48
50
  "ts-unused-exports": "^11.0.1",
49
- "typescript": "^5.7.3",
50
- "vitest": "^3.1.2"
51
+ "typescript": "^5.7.3"
51
52
  },
52
53
  "dependencies": {
53
54
  "@redux-devtools/extension": "^3.3.0",
@@ -76,19 +77,17 @@
76
77
  "@babel/traverse": ">=7.23.2",
77
78
  "cross-spawn": ">=7.0.5",
78
79
  "@babel/runtime": ">=7.26.10",
79
- "@babel/helpers": ">=7.26.10",
80
- "minimatch": ">=10.0.1",
81
- "minimatch@3.1.2": "3.1.2"
80
+ "@babel/helpers": ">=7.26.10"
82
81
  },
83
82
  "scripts": {
84
83
  "clean": "rimraf lib",
85
- "test": "vitest run",
84
+ "test": "jest --config jest.config.json --detectOpenHandles",
86
85
  "lint": "eslint . --ext .js,.jsx,.ts,.tsx --fix",
87
86
  "find-dead-code": "ts-prune | grep -v '(used in module)'",
88
87
  "find-unused-exports": "ts-unused-exports ./tsconfig.json",
89
88
  "circular-dependency": "npx madge --circular --extensions ts ./src",
90
- "build": "concurrently --kill-others-on-fail --handle-input \"eslint . --ext .js,.jsx,.ts,.tsx\" \"tsc\" \"vitest run\" && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
91
- "only-build": "concurrently --kill-others-on-fail --handle-input \"eslint . --ext .js,.jsx,.ts,.tsx\" \"tsc\" && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
89
+ "build": "concurrently --kill-others-on-fail \"eslint . --ext .js,.jsx,.ts,.tsx\" \"tsc\" \"jest --config jest.config.json\" && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
90
+ "only-build": "concurrently --kill-others-on-fail \"eslint . --ext .js,.jsx,.ts,.tsx\" \"tsc\" && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
92
91
  "format": "prettier --write --ignore-unknown \"src/**/*\"",
93
92
  "format-watch": "(git diff --name-only --diff-filter=ACM && git ls-files --others --exclude-standard) | grep -E '\\.(ts|tsx)$' | xargs prettier --write",
94
93
  "check-version": "node ./scripts/check_version.js",
@@ -1,71 +0,0 @@
1
- import { StatusCodeWithLabelPayload } from '../../commonPayloadTypes/statusPayload';
2
- import { CurrencyPayload } from '../../commonPayloadTypes/v2/viewAndReportPayloadv2';
3
- import { ID } from '../../commonStateTypes/common';
4
- import { MatchedTransactionPayload } from '../transaction/payloadTypes/reconciliationTransactionPayloads';
5
- import { AccountReconciliationData, RecommendedReviewTransaction, TransactionsToReview } from './accountReconState';
6
- export interface ReconciliationDataPayload {
7
- reconciliation_id: string | null;
8
- account_id: ID;
9
- transactions: ReconcileReviewTransactionsPayload;
10
- bank_status: StatusCodeWithLabelPayload;
11
- currency: CurrencyPayload;
12
- start_date: string;
13
- end_date: string;
14
- balance_data_status: StatusCodeWithLabelPayload | null;
15
- reconciliation_status: StatusCodeWithLabelPayload | null;
16
- variance: number | null;
17
- bank_balance: number | null;
18
- cleared_balance: number | null;
19
- initial_cleared_balance: number | null;
20
- error_message: string | null;
21
- source: string | null;
22
- created_at: string | null;
23
- updated_at: string | null;
24
- payment_account_updated_at: string | null;
25
- user_id: ID | null;
26
- retry_count: number | null;
27
- }
28
- export interface RecommendedReviewTransactionPayload {
29
- transaction_date: string;
30
- amount: number;
31
- transaction_memo: string;
32
- confidence_score: number;
33
- recommendation_reasons: string[];
34
- transaction_id?: string | null;
35
- transaction_type?: string;
36
- account_id?: ID | null;
37
- account_name?: string | null;
38
- class_id?: ID | null;
39
- class_name?: string | null;
40
- merchant_id?: ID | null;
41
- merchant_name?: string | null;
42
- merchant_type?: string | null;
43
- book_transaction_id?: string | null;
44
- }
45
- interface RecommendedActionPayload {
46
- recommended_actions: string;
47
- recommended_action_description: string;
48
- recommended_transactions: RecommendedReviewTransactionPayload[];
49
- }
50
- export interface TransactionsToReviewPayload {
51
- amount: number;
52
- transaction_direction: string;
53
- transaction_memo: string;
54
- recommended_action: RecommendedActionPayload;
55
- status: string;
56
- transaction_date: string;
57
- transaction_id: string;
58
- merchant_id?: ID | null;
59
- merchant_name?: string | null;
60
- merchant_type?: string | null;
61
- }
62
- export interface ReconcileReviewTransactionsPayload {
63
- reconcile: MatchedTransactionPayload[];
64
- review: TransactionsToReviewPayload[];
65
- }
66
- export declare const toTransactionsToReview: (payload: TransactionsToReviewPayload, currencyPayload: CurrencyPayload) => TransactionsToReview;
67
- export declare const toTransactionsToReviewPayload: (payload: TransactionsToReview) => TransactionsToReviewPayload;
68
- export declare const toAccountReconciliationData: (payload: ReconciliationDataPayload) => AccountReconciliationData;
69
- export declare const toRecommendedReviewTransaction: (payload: RecommendedReviewTransactionPayload, currencyPayload: CurrencyPayload) => RecommendedReviewTransaction;
70
- export declare const toRecommendedReviewTransactionPayload: (payload: RecommendedReviewTransaction) => RecommendedReviewTransactionPayload;
71
- export {};
@@ -1,131 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toRecommendedReviewTransactionPayload = exports.toRecommendedReviewTransaction = exports.toAccountReconciliationData = exports.toTransactionsToReviewPayload = exports.toTransactionsToReview = void 0;
4
- const amount_1 = require("../../commonStateTypes/amount");
5
- const formatZeniDateFY_1 = require("../../commonStateTypes/fiscalYearHelpers/formatZeniDateFY");
6
- const zeniDayJS_1 = require("../../zeniDayJS");
7
- const reconciliationTransaction_1 = require("../transaction/stateTypes/reconciliationTransaction");
8
- const accountReconState_1 = require("./accountReconState");
9
- const toTransactionsToReview = (payload, currencyPayload) => {
10
- var _a, _b;
11
- return {
12
- transactionId: payload.transaction_id,
13
- transactionDirection: (0, reconciliationTransaction_1.toTransactionDirectionType)(payload.transaction_direction),
14
- amount: {
15
- amount: payload.amount,
16
- currencyCode: currencyPayload.currency_code,
17
- currencySymbol: currencyPayload.currency_symbol,
18
- },
19
- status: payload.status,
20
- transactionDate: (0, zeniDayJS_1.date)(payload.transaction_date),
21
- memo: payload.transaction_memo,
22
- merchantId: (_a = payload.merchant_id) !== null && _a !== void 0 ? _a : undefined,
23
- merchantName: (_b = payload.merchant_name) !== null && _b !== void 0 ? _b : undefined,
24
- merchantType: payload.merchant_type != null
25
- ? (0, reconciliationTransaction_1.toMerchantType)(payload.merchant_type)
26
- : undefined,
27
- recommendedAction: {
28
- action: (0, accountReconState_1.toRecommendedActionCodeType)(payload.recommended_action.recommended_actions),
29
- reason: payload.recommended_action.recommended_action_description,
30
- recommendedTransactions: payload.recommended_action.recommended_transactions.map((transaction) => (0, exports.toRecommendedReviewTransaction)(transaction, currencyPayload)),
31
- },
32
- };
33
- };
34
- exports.toTransactionsToReview = toTransactionsToReview;
35
- const toTransactionsToReviewPayload = (payload) => {
36
- return {
37
- transaction_id: payload.transactionId,
38
- transaction_direction: (0, reconciliationTransaction_1.toTransactionDirectionType)(payload.transactionDirection),
39
- amount: payload.amount.amount,
40
- status: payload.status,
41
- transaction_date: payload.transactionDate.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT),
42
- transaction_memo: payload.memo,
43
- recommended_action: {
44
- recommended_actions: (0, accountReconState_1.toRecommendedActionCodeType)(payload.recommendedAction.action),
45
- recommended_action_description: payload.recommendedAction.reason,
46
- recommended_transactions: payload.recommendedAction.recommendedTransactions.map((transaction) => (0, exports.toRecommendedReviewTransactionPayload)(transaction)),
47
- },
48
- };
49
- };
50
- exports.toTransactionsToReviewPayload = toTransactionsToReviewPayload;
51
- const toAccountReconciliationData = (payload) => {
52
- var _a, _b;
53
- const variance = payload.bank_balance != null && payload.cleared_balance != null
54
- ? (0, amount_1.toAmount)(Math.abs(payload.cleared_balance - payload.bank_balance), payload.currency.currency_code, payload.currency.currency_symbol)
55
- : undefined;
56
- const variancePercentage = variance != null && payload.bank_balance != null && payload.bank_balance !== 0
57
- ? (variance.amount / Math.abs(payload.bank_balance)) * 100
58
- : undefined;
59
- return {
60
- reconciliationId: (_a = payload.reconciliation_id) !== null && _a !== void 0 ? _a : undefined,
61
- accountId: payload.account_id,
62
- reconciliationStatus: payload.reconciliation_status
63
- ? {
64
- code: (0, accountReconState_1.toReconciliationStatusCodeType)(payload.reconciliation_status.code),
65
- label: payload.reconciliation_status.label,
66
- }
67
- : undefined,
68
- balanceDataStatus: payload.balance_data_status
69
- ? {
70
- code: (0, accountReconState_1.toBalanceDataStatusCodeType)(payload.balance_data_status.code),
71
- label: payload.balance_data_status.label,
72
- }
73
- : undefined,
74
- currency: {
75
- currencyCode: payload.currency.currency_code,
76
- currencySymbol: payload.currency.currency_symbol,
77
- },
78
- transactionsToReview: payload.transactions.review.map((transaction) => (0, exports.toTransactionsToReview)(transaction, payload.currency)),
79
- transactionsToReconcile: payload.transactions.reconcile.map((transaction) => transaction.transaction_id),
80
- userId: (_b = payload.user_id) !== null && _b !== void 0 ? _b : undefined,
81
- variance: variance,
82
- variancePercentage: variancePercentage,
83
- bankBalance: payload.bank_balance != null
84
- ? (0, amount_1.toAmount)(payload.bank_balance, payload.currency.currency_code, payload.currency.currency_symbol)
85
- : undefined,
86
- clearedBalance: payload.cleared_balance != null
87
- ? (0, amount_1.toAmount)(payload.cleared_balance, payload.currency.currency_code, payload.currency.currency_symbol)
88
- : undefined,
89
- initialClearedBalance: payload.initial_cleared_balance != null
90
- ? (0, amount_1.toAmount)(payload.initial_cleared_balance, payload.currency.currency_code, payload.currency.currency_symbol)
91
- : undefined,
92
- startDate: (0, zeniDayJS_1.date)(payload.start_date),
93
- endDate: (0, zeniDayJS_1.date)(payload.end_date),
94
- accountUpdatedAt: payload.payment_account_updated_at != null
95
- ? (0, zeniDayJS_1.date)(payload.payment_account_updated_at)
96
- : undefined,
97
- };
98
- };
99
- exports.toAccountReconciliationData = toAccountReconciliationData;
100
- const toRecommendedReviewTransaction = (payload, currencyPayload) => {
101
- var _a, _b, _c, _d, _e, _f, _g;
102
- return {
103
- transactionId: (_a = payload.transaction_id) !== null && _a !== void 0 ? _a : undefined,
104
- merchantId: (_b = payload.merchant_id) !== null && _b !== void 0 ? _b : undefined,
105
- merchantName: (_c = payload.merchant_name) !== null && _c !== void 0 ? _c : undefined,
106
- merchantType: payload.merchant_type != null
107
- ? (0, reconciliationTransaction_1.toMerchantType)(payload.merchant_type)
108
- : undefined,
109
- classId: (_d = payload.class_id) !== null && _d !== void 0 ? _d : undefined,
110
- accountId: (_e = payload.account_id) !== null && _e !== void 0 ? _e : undefined,
111
- date: (0, zeniDayJS_1.date)(payload.transaction_date),
112
- amount: (0, amount_1.toAmount)(payload.amount, currencyPayload.currency_code, currencyPayload.currency_symbol),
113
- memo: (_f = payload.transaction_memo) !== null && _f !== void 0 ? _f : undefined,
114
- confidenceScore: payload.confidence_score,
115
- recommendedReasons: payload.recommendation_reasons,
116
- bookTransactionId: (_g = payload.book_transaction_id) !== null && _g !== void 0 ? _g : undefined,
117
- };
118
- };
119
- exports.toRecommendedReviewTransaction = toRecommendedReviewTransaction;
120
- const toRecommendedReviewTransactionPayload = (payload) => {
121
- return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ transaction_date: payload.date.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT), confidence_score: payload.confidenceScore, transaction_memo: payload.memo, recommendation_reasons: payload.recommendedReasons, amount: payload.amount.amount }, (payload.transactionId != null
122
- ? { transaction_id: payload.transactionId }
123
- : {})), (payload.merchantId != null ? { merchant_id: payload.merchantId } : {})), (payload.merchantName != null
124
- ? { merchant_name: payload.merchantName }
125
- : {})), (payload.merchantType != null
126
- ? { merchant_type: (0, reconciliationTransaction_1.toMerchantType)(payload.merchantType) }
127
- : {})), (payload.classId != null ? { class_id: payload.classId } : {})), (payload.accountId != null ? { account_id: payload.accountId } : {})), (payload.bookTransactionId != null
128
- ? { book_transaction_id: payload.bookTransactionId }
129
- : {}));
130
- };
131
- exports.toRecommendedReviewTransactionPayload = toRecommendedReviewTransactionPayload;
@@ -1,16 +0,0 @@
1
- import { MonthYearPeriod } from '../../commonStateTypes/timePeriod';
2
- import { ReconciliationDataPayload } from './accountReconPayload';
3
- import { AccountReconState } from './accountReconState';
4
- export declare const initialState: AccountReconState;
5
- export declare const updateAccountRecon: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedPeriod: MonthYearPeriod, accountReconDataPayload: ReconciliationDataPayload[]], {
6
- selectedPeriod: MonthYearPeriod;
7
- accountReconDataPayload: ReconciliationDataPayload[];
8
- }, "accountRecon/updateAccountRecon", never, never>, excludeReconReviewTransaction: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[accountReconKey: string, excludedTransactionId: string], {
9
- accountReconKey: string;
10
- excludedTransactionId: string;
11
- }, "accountRecon/excludeReconReviewTransaction", never, never>, clearAllAccountRecon: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"accountRecon/clearAllAccountRecon">, addTransactionToReconcileList: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[accountReconKey: string, transactionId: string], {
12
- accountReconKey: string;
13
- transactionId: string;
14
- }, "accountRecon/addTransactionToReconcileList", never, never>;
15
- declare const _default: import("redux").Reducer<AccountReconState>;
16
- export default _default;
@@ -1,71 +0,0 @@
1
- "use strict";
2
- var _a;
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.addTransactionToReconcileList = exports.clearAllAccountRecon = exports.excludeReconReviewTransaction = exports.updateAccountRecon = exports.initialState = void 0;
5
- const toolkit_1 = require("@reduxjs/toolkit");
6
- const accountReconPayload_1 = require("./accountReconPayload");
7
- const accountReconState_1 = require("./accountReconState");
8
- exports.initialState = {
9
- accountReconByAccountReconKey: {},
10
- };
11
- const accountRecon = (0, toolkit_1.createSlice)({
12
- name: 'accountRecon',
13
- initialState: exports.initialState,
14
- reducers: {
15
- updateAccountRecon: {
16
- prepare(selectedPeriod, accountReconDataPayload) {
17
- return {
18
- payload: {
19
- selectedPeriod,
20
- accountReconDataPayload,
21
- },
22
- };
23
- },
24
- reducer(draft, action) {
25
- doUpdateAccountRecon(draft, action.payload.selectedPeriod, action.payload.accountReconDataPayload);
26
- },
27
- },
28
- excludeReconReviewTransaction: {
29
- prepare(accountReconKey, excludedTransactionId) {
30
- return {
31
- payload: {
32
- accountReconKey,
33
- excludedTransactionId,
34
- },
35
- };
36
- },
37
- reducer(draft, action) {
38
- const { accountReconKey, excludedTransactionId } = action.payload;
39
- draft.accountReconByAccountReconKey[accountReconKey] = Object.assign(Object.assign({}, draft.accountReconByAccountReconKey[accountReconKey]), { transactionsToReview: draft.accountReconByAccountReconKey[accountReconKey].transactionsToReview.filter((txn) => txn.transactionId !== excludedTransactionId) });
40
- },
41
- },
42
- addTransactionToReconcileList: {
43
- prepare(accountReconKey, transactionId) {
44
- return {
45
- payload: {
46
- accountReconKey,
47
- transactionId,
48
- },
49
- };
50
- },
51
- reducer(draft, action) {
52
- const { accountReconKey, transactionId } = action.payload;
53
- draft.accountReconByAccountReconKey[accountReconKey] = Object.assign(Object.assign({}, draft.accountReconByAccountReconKey[accountReconKey]), { transactionsToReconcile: [
54
- ...draft.accountReconByAccountReconKey[accountReconKey]
55
- .transactionsToReconcile,
56
- transactionId,
57
- ] });
58
- },
59
- },
60
- clearAllAccountRecon(draft) {
61
- Object.assign(draft, exports.initialState);
62
- },
63
- },
64
- });
65
- _a = accountRecon.actions, exports.updateAccountRecon = _a.updateAccountRecon, exports.excludeReconReviewTransaction = _a.excludeReconReviewTransaction, exports.clearAllAccountRecon = _a.clearAllAccountRecon, exports.addTransactionToReconcileList = _a.addTransactionToReconcileList;
66
- exports.default = accountRecon.reducer;
67
- const doUpdateAccountRecon = (draft, selectedPeriod, accountReconDataPayload) => {
68
- accountReconDataPayload.forEach((accountReconData) => {
69
- draft.accountReconByAccountReconKey[(0, accountReconState_1.toAccountReconKey)(accountReconData.account_id, selectedPeriod)] = (0, accountReconPayload_1.toAccountReconciliationData)(accountReconData);
70
- });
71
- };
@@ -1,34 +0,0 @@
1
- import { Amount, Currency } from '../../commonStateTypes/amount';
2
- import { ID } from '../../commonStateTypes/common';
3
- import { MonthYearPeriod } from '../../commonStateTypes/timePeriod';
4
- import { RootState } from '../../reducer';
5
- import { ZeniDate } from '../../zeniDayJS';
6
- import { AccountBase } from '../account/accountState';
7
- import { MatchedTransaction } from '../transaction/stateTypes/reconciliationTransaction';
8
- import { User } from '../user/userState';
9
- import { BalanceDataStatusCodeType, ReconciliationStatusCodeType, TransactionsToReview } from './accountReconState';
10
- export interface AccountReconciliationEntity {
11
- account: AccountBase;
12
- startDate: ZeniDate;
13
- endDate: ZeniDate;
14
- transactionsToReview: TransactionsToReview[];
15
- transactionsToReconcile: MatchedTransaction[];
16
- currency: Currency;
17
- reconciliationId?: ID;
18
- user?: User;
19
- balance?: Amount;
20
- clearedBalance?: Amount;
21
- initialClearedBalance?: Amount;
22
- variance?: Amount;
23
- variancePercentage?: number;
24
- reconciliationStatus?: {
25
- code: ReconciliationStatusCodeType;
26
- label: string;
27
- };
28
- balanceDataStatus?: {
29
- code: BalanceDataStatusCodeType;
30
- label: string;
31
- };
32
- accountUpdatedAt?: ZeniDate;
33
- }
34
- export declare const getAccountReconByAccountIdAndSelectedPeriod: (state: RootState, accountId: ID, selectedPeriod: MonthYearPeriod) => AccountReconciliationEntity | undefined;
@@ -1,47 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getAccountReconByAccountIdAndSelectedPeriod = void 0;
4
- const toolkit_1 = require("@reduxjs/toolkit");
5
- const accountSelector_1 = require("../account/accountSelector");
6
- const transactionSelector_1 = require("../transaction/transactionSelector");
7
- const userSelector_1 = require("../user/userSelector");
8
- const accountReconState_1 = require("./accountReconState");
9
- exports.getAccountReconByAccountIdAndSelectedPeriod = (0, toolkit_1.createSelector)((state) => state.accountState, (state) => state.userState, (state) => state.transactionState, (state) => state.accountReconState, (_state, accountId) => accountId, (_state, _accountId, selectedPeriod) => selectedPeriod, (accountState, userState, transactionState, accountReconState, accountId, selectedPeriod) => {
10
- const accountReconKey = (0, accountReconState_1.toAccountReconKey)(accountId, selectedPeriod);
11
- const accountRecon = accountReconState.accountReconByAccountReconKey[accountReconKey];
12
- if (accountRecon == null) {
13
- return undefined;
14
- }
15
- const account = (0, accountSelector_1.getAccountBase)(accountState, accountRecon.accountId, 'account_reconciliation');
16
- if (!account) {
17
- throw new Error(`Account not found for: ${accountRecon.accountId}`);
18
- }
19
- const user = accountRecon.userId != null
20
- ? (0, userSelector_1.getUserByUserId)(userState, accountRecon.userId)
21
- : undefined;
22
- const transactionsToReconcile = accountRecon.transactionsToReconcile.map((transactionId) => {
23
- const matchedTransaction = (0, transactionSelector_1.getMatchedTransactionById)(transactionState, transactionId);
24
- if (!matchedTransaction) {
25
- throw new Error(`Transaction not found for: ${transactionId}`);
26
- }
27
- return matchedTransaction;
28
- });
29
- return {
30
- account,
31
- startDate: accountRecon.startDate,
32
- endDate: accountRecon.endDate,
33
- currency: accountRecon.currency,
34
- balance: accountRecon.bankBalance,
35
- variance: accountRecon.variance,
36
- clearedBalance: accountRecon.clearedBalance,
37
- initialClearedBalance: accountRecon.initialClearedBalance,
38
- reconciliationId: accountRecon.reconciliationId,
39
- user,
40
- transactionsToReview: accountRecon.transactionsToReview,
41
- transactionsToReconcile,
42
- reconciliationStatus: accountRecon.reconciliationStatus,
43
- balanceDataStatus: accountRecon.balanceDataStatus,
44
- variancePercentage: accountRecon.variancePercentage,
45
- accountUpdatedAt: accountRecon.accountUpdatedAt,
46
- };
47
- });