@zeniai/client-epic-state 4.15.22 → 4.15.24

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 (127) hide show
  1. package/lib/commonStateTypes/timePeriod.d.ts +1 -1
  2. package/lib/commonStateTypes/timePeriod.js +2 -2
  3. package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
  4. package/lib/commonStateTypes/viewAndReport/viewAndReport.js +0 -1
  5. package/lib/configureStore.js +1 -2
  6. package/lib/entity/account/accountState.d.ts +1 -1
  7. package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
  8. package/lib/entity/class/classReducer.d.ts +4 -4
  9. package/lib/entity/class/classState.d.ts +1 -1
  10. package/lib/entity/customer/customerPayload.d.ts +1 -1
  11. package/lib/entity/customer/customerPayload.js +6 -16
  12. package/lib/entity/forecast/forecastState.d.ts +1 -1
  13. package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
  14. package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
  15. package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
  16. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  17. package/lib/entity/snackbar/snackbarTypes.js +0 -4
  18. package/lib/entity/task/taskState.d.ts +1 -1
  19. package/lib/entity/tenant/clearAllEpic.d.ts +2 -4
  20. package/lib/entity/tenant/clearAllEpic.js +0 -4
  21. package/lib/entity/tenant/tenantReducer.d.ts +1 -1
  22. package/lib/entity/tenant/tenantReducer.js +2 -7
  23. package/lib/entity/transaction/payloadTypes/customerTransactionPayload.d.ts +1 -1
  24. package/lib/entity/transaction/payloadTypes/customerTransactionPayload.js +2 -1
  25. package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +0 -2
  26. package/lib/entity/transaction/payloadTypes/transactionPayload.js +3 -7
  27. package/lib/entity/transaction/payloadTypes/vendorTransactionPayload.d.ts +1 -9
  28. package/lib/entity/transaction/payloadTypes/vendorTransactionPayload.js +2 -23
  29. package/lib/entity/transaction/stateTypes/transaction.d.ts +1 -3
  30. package/lib/entity/transaction/stateTypes/transactionType.d.ts +1 -1
  31. package/lib/entity/transaction/stateTypes/transactionType.js +0 -1
  32. package/lib/entity/transaction/stateTypes/vendorTransaction.d.ts +0 -5
  33. package/lib/entity/transaction/stateTypes/vendorTransaction.js +1 -5
  34. package/lib/entity/transaction/toSupportedTransaction.js +1 -6
  35. package/lib/entity/transaction/transactionReducer.d.ts +0 -17
  36. package/lib/entity/transaction/transactionReducer.js +2 -47
  37. package/lib/entity/transaction/transactionSelector.d.ts +0 -2
  38. package/lib/entity/transaction/transactionSelector.js +0 -5
  39. package/lib/entity/transaction/transactionState.d.ts +4 -6
  40. package/lib/entity/vendorExpense/vendorExpenseSelector.d.ts +2 -2
  41. package/lib/epic.d.ts +1 -6
  42. package/lib/epic.js +1 -6
  43. package/lib/index.d.ts +8 -16
  44. package/lib/index.js +28 -52
  45. package/lib/reducer.d.ts +1 -7
  46. package/lib/reducer.js +0 -6
  47. package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
  48. package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
  49. package/lib/view/cardBalance/cardBalanceSelector.d.ts +1 -1
  50. package/lib/view/cashBalance/cashBalanceSelector.d.ts +1 -1
  51. package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
  52. package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
  53. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewReducer.d.ts +2 -2
  54. package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
  55. package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.d.ts +1 -2
  56. package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +10 -24
  57. package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.d.ts +1 -2
  58. package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +0 -14
  59. package/lib/view/expenseAutomationView/epics/transactionCategorization/updateTransactionCategorizationEpic.js +4 -20
  60. package/lib/view/expenseAutomationView/expenseAutomationViewReducer.d.ts +2 -2
  61. package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +2 -17
  62. package/lib/view/expenseAutomationView/expenseAutomationViewState.d.ts +2 -2
  63. package/lib/view/expenseAutomationView/expenseAutomationViewState.js +1 -1
  64. package/lib/view/expenseAutomationView/helpers/saveTransactionHelper.js +30 -81
  65. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  66. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +10 -54
  67. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +1 -2
  68. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +4 -5
  69. package/lib/view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes.d.ts +0 -2
  70. package/lib/view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes.js +1 -1
  71. package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +0 -8
  72. package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
  73. package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
  74. package/lib/view/opExByVendor/fetchOpExByVendorReportForTimeframeEpic.js +4 -3
  75. package/lib/view/opExByVendor/opExByVendorReducer.d.ts +4 -1
  76. package/lib/view/opExByVendor/opExByVendorReducer.js +11 -3
  77. package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
  78. package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
  79. package/lib/view/spendManagement/billPay/billsBulkActionView/epics/validateBillsBulkActionEpic.ts.js +3 -4
  80. package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/establishPlaidConnectionEpic.js +3 -11
  81. package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.d.ts +1 -2
  82. package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.js +1 -3
  83. package/lib/view/spendManagement/plaidAccount/plaidAccountViewState.d.ts +1 -1
  84. package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
  85. package/lib/view/topEx/topExSelector.d.ts +1 -1
  86. package/lib/view/transactionDetail/epics/saveTransactionHelper.js +4 -13
  87. package/lib/view/transactionDetail/epics/updateTransactionDetailEpic.js +3 -16
  88. package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +5 -22
  89. package/lib/view/transactionDetail/transactionDetailState.d.ts +0 -1
  90. package/lib/view/transactionDetail/transactionDetailTypes.d.ts +0 -6
  91. package/lib/view/vendorReviewView/vendorGlobalReviewView/vendorGlobalReviewViewState.d.ts +1 -1
  92. package/lib/zeniAPI.d.ts +0 -1
  93. package/package.json +1 -2
  94. package/lib/entity/accountRecon/accountReconPayload.d.ts +0 -70
  95. package/lib/entity/accountRecon/accountReconPayload.js +0 -125
  96. package/lib/entity/accountRecon/accountReconReducer.d.ts +0 -16
  97. package/lib/entity/accountRecon/accountReconReducer.js +0 -71
  98. package/lib/entity/accountRecon/accountReconSelector.d.ts +0 -28
  99. package/lib/entity/accountRecon/accountReconSelector.js +0 -44
  100. package/lib/entity/accountRecon/accountReconState.d.ts +0 -70
  101. package/lib/entity/accountRecon/accountReconState.js +0 -28
  102. package/lib/entity/transaction/payloadTypes/reconciliationTransactionPayloads.d.ts +0 -35
  103. package/lib/entity/transaction/payloadTypes/reconciliationTransactionPayloads.js +0 -53
  104. package/lib/entity/transaction/stateTypes/reconciliationTransaction.d.ts +0 -32
  105. package/lib/entity/transaction/stateTypes/reconciliationTransaction.js +0 -10
  106. package/lib/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.d.ts +0 -15
  107. package/lib/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +0 -118
  108. package/lib/view/expenseAutomationView/epics/accountRecon/initialiseLocalDataForSelectedAccountIdEpic.d.ts +0 -10
  109. package/lib/view/expenseAutomationView/epics/accountRecon/initialiseLocalDataForSelectedAccountIdEpic.js +0 -49
  110. package/lib/view/expenseAutomationView/epics/accountRecon/saveReconciliationDetailEpic.d.ts +0 -14
  111. package/lib/view/expenseAutomationView/epics/accountRecon/saveReconciliationDetailEpic.js +0 -169
  112. package/lib/view/expenseAutomationView/epics/accountRecon/saveReconciliationReviewEpic.d.ts +0 -9
  113. package/lib/view/expenseAutomationView/epics/accountRecon/saveReconciliationReviewEpic.js +0 -154
  114. package/lib/view/expenseAutomationView/epics/accountRecon/updateReconcileTabLocalDataEpic.d.ts +0 -6
  115. package/lib/view/expenseAutomationView/epics/accountRecon/updateReconcileTabLocalDataEpic.js +0 -110
  116. package/lib/view/expenseAutomationView/helpers/reconciliationHelpers.d.ts +0 -7
  117. package/lib/view/expenseAutomationView/helpers/reconciliationHelpers.js +0 -18
  118. package/lib/view/expenseAutomationView/payload/reconciliationPayload.d.ts +0 -25
  119. package/lib/view/expenseAutomationView/payload/reconciliationPayload.js +0 -51
  120. package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.d.ts +0 -66
  121. package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.js +0 -375
  122. package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.d.ts +0 -50
  123. package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.js +0 -7
  124. package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.d.ts +0 -5
  125. package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +0 -249
  126. package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +0 -102
  127. package/lib/view/expenseAutomationView/types/reconciliationViewState.js +0 -38
@@ -12,7 +12,7 @@ export declare const getCashPosition: (accountState: AccountState, cashPositionS
12
12
  firstMonthOfFY: 2 | 1 | 3 | 4 | 8 | 5 | 6 | 10 | 7 | 12 | 11 | 9;
13
13
  dataAvailable: import("../../commonStateTypes/timeframeTick").TimeframeTick | undefined;
14
14
  availableNumberOfPeriods: number | undefined;
15
- reportId: "billing" | "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "flux_analysis_operating_expense" | "account_reconciliation";
15
+ reportId: "billing" | "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "flux_analysis_operating_expense";
16
16
  reportTitle: string;
17
17
  version: string | number | undefined;
18
18
  status: import("../..").Status | undefined;
@@ -36,8 +36,8 @@ export declare const fetchVendorsTabVendorDetails: import("@reduxjs/toolkit").Ac
36
36
  }, "vendorsTabVendorView/fetchVendorsTabVendorDetailPageView", never, never>, updateVendorsTabVendorAllTransactionsTabData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
37
37
  timePeriod: TimePeriod;
38
38
  numberOfQuartersFetched: number;
39
- }, "vendorsTabVendorView/updateVendorsTabVendorAllTransactionsTabData">, resetSelectedTabType: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"vendorsTabVendorView/resetSelectedTabType">, updateSelectedTabType: import("@reduxjs/toolkit").ActionCreatorWithPayload<"spend_transactions" | "all_transactions", "vendorsTabVendorView/updateSelectedTabType">, updateVendorSpendTrendFilterTabValue: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[vendorSpendTrendfilterTabValue: "last_month" | "variance" | "last_30_days" | "last_90_days" | "YTD_spend" | "last_3_months" | "last_6_months" | "last_12_months" | "last_year"], {
40
- vendorSpendTrendfilterTabValue: "last_month" | "variance" | "last_30_days" | "last_90_days" | "YTD_spend" | "last_3_months" | "last_6_months" | "last_12_months" | "last_year";
39
+ }, "vendorsTabVendorView/updateVendorsTabVendorAllTransactionsTabData">, resetSelectedTabType: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"vendorsTabVendorView/resetSelectedTabType">, updateSelectedTabType: import("@reduxjs/toolkit").ActionCreatorWithPayload<"spend_transactions" | "all_transactions", "vendorsTabVendorView/updateSelectedTabType">, updateVendorSpendTrendFilterTabValue: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[vendorSpendTrendfilterTabValue: "last_month" | "last_30_days" | "variance" | "last_90_days" | "YTD_spend" | "last_3_months" | "last_6_months" | "last_12_months" | "last_year"], {
40
+ vendorSpendTrendfilterTabValue: "last_month" | "last_30_days" | "variance" | "last_90_days" | "YTD_spend" | "last_3_months" | "last_6_months" | "last_12_months" | "last_year";
41
41
  }, "vendorsTabVendorView/updateVendorSpendTrendFilterTabValue", never, never>, resetVendorsTabVendorAllTransactionsTabData: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"vendorsTabVendorView/resetVendorsTabVendorAllTransactionsTabData">, updateContactsInVendorTabDetailLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
42
42
  vendorId: ID;
43
43
  localData?: Partial<VendorsTabVendorDetailLocalData>;
@@ -1,12 +1,12 @@
1
1
  import { DashboardState } from './dashboardState';
2
2
  export declare const initialState: DashboardState;
3
- export declare const fetchDashboard: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[userId: string, companyId: string, tenantId: string, fetchFullReport?: any, cacheOverride?: any, excludeResources?: ("billing" | "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "flux_analysis_operating_expense" | "account_reconciliation")[] | undefined], {
3
+ export declare const fetchDashboard: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[userId: string, companyId: string, tenantId: string, fetchFullReport?: any, cacheOverride?: any, excludeResources?: ("billing" | "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "flux_analysis_operating_expense")[] | undefined], {
4
4
  userId: string;
5
5
  companyId: string;
6
6
  tenantId: string;
7
7
  fetchFullReport: any;
8
8
  cacheOverride: any;
9
- excludeResources: ("billing" | "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "flux_analysis_operating_expense" | "account_reconciliation")[];
9
+ excludeResources: ("billing" | "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "flux_analysis_operating_expense")[];
10
10
  }, "dashboard/fetchDashboard", never, never>, clearDashboard: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"dashboard/clearDashboard">;
11
11
  declare const _default: import("redux").Reducer<DashboardState>;
12
12
  export default _default;
@@ -6,7 +6,6 @@ import { fetchAllExpenseAutomationTabs } from '../../expenseAutomationViewReduce
6
6
  import { fetchFluxAnalysisView } from '../../reducers/fluxAnalysisViewReducer';
7
7
  import { fetchJeSchedulesPage } from '../../reducers/jeSchedulesViewReducer';
8
8
  import { fetchMissingReceipts } from '../../reducers/missingReceiptsViewReducer';
9
- import { fetchReconciliation } from '../../reducers/reconciliationViewReducer';
10
9
  import { fetchTransactionCategorizationView } from '../../reducers/transactionsViewReducer';
11
- export type ActionType = ReturnType<typeof fetchAllExpenseAutomationTabs> | ReturnType<typeof fetchMissingReceipts> | ReturnType<typeof fetchMonthEndCloseChecks> | ReturnType<typeof fetchFluxAnalysisView> | ReturnType<typeof fetchJeSchedulesPage> | ReturnType<typeof fetchReconciliation> | ReturnType<typeof fetchTransactionCategorizationView>;
10
+ export type ActionType = ReturnType<typeof fetchAllExpenseAutomationTabs> | ReturnType<typeof fetchMissingReceipts> | ReturnType<typeof fetchMonthEndCloseChecks> | ReturnType<typeof fetchFluxAnalysisView> | ReturnType<typeof fetchJeSchedulesPage> | ReturnType<typeof fetchTransactionCategorizationView>;
12
11
  export declare const fetchAllExpenseAutomationTabsEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
@@ -9,14 +9,10 @@ const expenseAutomationViewReducer_1 = require("../../expenseAutomationViewReduc
9
9
  const fluxAnalysisViewReducer_1 = require("../../reducers/fluxAnalysisViewReducer");
10
10
  const jeSchedulesViewReducer_1 = require("../../reducers/jeSchedulesViewReducer");
11
11
  const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
12
- const reconciliationViewReducer_1 = require("../../reducers/reconciliationViewReducer");
13
12
  const transactionsViewReducer_1 = require("../../reducers/transactionsViewReducer");
14
13
  const fetchAllExpenseAutomationTabsEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(expenseAutomationViewReducer_1.fetchAllExpenseAutomationTabs.match), (0, operators_1.switchMap)((action) => {
15
- var _a, _b;
16
14
  const { cacheOverride, refreshViewInBackground } = action.payload;
17
15
  const state = state$.value;
18
- const { monthEndCloseChecksState } = state;
19
- const { monthEndCloseChecksByTenantId } = monthEndCloseChecksState;
20
16
  const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
21
17
  const companyId = currentTenant.companyId;
22
18
  const selectedPeriod = state.expenseAutomationViewState.selectedPeriodByTenantId[currentTenant.tenantId];
@@ -25,24 +21,22 @@ const fetchAllExpenseAutomationTabsEpic = (actions$, state$) => actions$.pipe((0
25
21
  const timePeriodStart = (0, timePeriod_1.toAbsoluteDay)(period.start);
26
22
  const timePeriodEnd = (0, timePeriod_1.toAbsoluteDay)(period.end);
27
23
  const monthYearPeriodId = (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod);
28
- const monthEndCheckState = (_a = monthEndCloseChecksByTenantId === null || monthEndCloseChecksByTenantId === void 0 ? void 0 : monthEndCloseChecksByTenantId[currentTenant.tenantId]) === null || _a === void 0 ? void 0 : _a[monthYearPeriodId];
29
- const reconciliationEnabled = (_b = monthEndCheckState === null || monthEndCheckState === void 0 ? void 0 : monthEndCheckState.monthEndCloseCheckList.find((list) => list.id === 'reconciliation')) !== null && _b !== void 0 ? _b : false;
30
24
  if (timePeriodStart == null ||
31
25
  timePeriodEnd == null ||
32
26
  companyId == null) {
33
27
  throw Error(`Invalid start - ${timePeriodStart} and end - ${timePeriodEnd} period from given ${selectedPeriod}`);
34
28
  }
35
29
  if (cacheOverride === true) {
36
- const actions = [];
37
- actions.push((0, transactionsViewReducer_1.fetchTransactionCategorizationView)(selectedTransactionCategorizationTab, { start: timePeriodStart, end: timePeriodEnd }, cacheOverride, false, undefined, undefined, refreshViewInBackground), (0, missingReceiptsViewReducer_1.fetchMissingReceipts)({ start: timePeriodStart, end: timePeriodEnd }, {
38
- amount: 75.0,
39
- currencyCode: 'USD',
40
- currencySymbol: '$',
41
- }, cacheOverride, refreshViewInBackground), (0, fluxAnalysisViewReducer_1.fetchFluxAnalysisView)(selectedPeriod, cacheOverride, refreshViewInBackground, null), (0, jeSchedulesViewReducer_1.fetchJeSchedulesPage)({ start: timePeriodStart, end: timePeriodEnd }, cacheOverride));
42
- if (reconciliationEnabled) {
43
- actions.push((0, reconciliationViewReducer_1.fetchReconciliation)(selectedPeriod, undefined, cacheOverride, refreshViewInBackground));
44
- }
45
- return (0, rxjs_1.from)(actions);
30
+ return (0, rxjs_1.from)([
31
+ (0, transactionsViewReducer_1.fetchTransactionCategorizationView)(selectedTransactionCategorizationTab, { start: timePeriodStart, end: timePeriodEnd }, cacheOverride, false, undefined, undefined, refreshViewInBackground),
32
+ (0, missingReceiptsViewReducer_1.fetchMissingReceipts)({ start: timePeriodStart, end: timePeriodEnd }, {
33
+ amount: 75.0,
34
+ currencyCode: 'USD',
35
+ currencySymbol: '$',
36
+ }, cacheOverride, refreshViewInBackground),
37
+ (0, fluxAnalysisViewReducer_1.fetchFluxAnalysisView)(selectedPeriod, cacheOverride, refreshViewInBackground, null),
38
+ (0, jeSchedulesViewReducer_1.fetchJeSchedulesPage)({ start: timePeriodStart, end: timePeriodEnd }, cacheOverride),
39
+ ]);
46
40
  }
47
41
  else {
48
42
  const fetchActions = [];
@@ -74,14 +68,6 @@ const fetchAllExpenseAutomationTabsEpic = (actions$, state$) => actions$.pipe((0
74
68
  null)) {
75
69
  fetchActions.push((0, jeSchedulesViewReducer_1.fetchJeSchedulesPage)({ start: timePeriodStart, end: timePeriodEnd }, cacheOverride));
76
70
  }
77
- if (state.expenseAutomationReconciliationViewState.fetchState !==
78
- 'In-Progress' &&
79
- state.expenseAutomationReconciliationViewState
80
- .accountReconciliationRecordsBySelectedPeriod[monthYearPeriodId] ==
81
- null &&
82
- reconciliationEnabled) {
83
- fetchActions.push((0, reconciliationViewReducer_1.fetchReconciliation)(selectedPeriod, undefined, cacheOverride, refreshViewInBackground));
84
- }
85
71
  if (state.expenseAutomationTransactionsViewState
86
72
  .transactionCategorizationView[selectedTransactionCategorizationTab]
87
73
  .fetchState !== 'In-Progress' &&
@@ -7,7 +7,6 @@ import { refreshExpenseAutomationCurrentTab } from '../../expenseAutomationViewR
7
7
  import { fetchFluxAnalysisView } from '../../reducers/fluxAnalysisViewReducer';
8
8
  import { fetchJeSchedulesPage } from '../../reducers/jeSchedulesViewReducer';
9
9
  import { fetchMissingReceipts } from '../../reducers/missingReceiptsViewReducer';
10
- import { fetchReconciliation } from '../../reducers/reconciliationViewReducer';
11
10
  import { fetchTransactionCategorizationView } from '../../reducers/transactionsViewReducer';
12
- export type ActionType = ReturnType<typeof refreshExpenseAutomationCurrentTab> | ReturnType<typeof fetchCompanyMonthEndReportView> | ReturnType<typeof fetchCompanyMonthEndReportTemplates> | ReturnType<typeof fetchMissingReceipts> | ReturnType<typeof fetchMonthEndCloseChecks> | ReturnType<typeof fetchFluxAnalysisView> | ReturnType<typeof fetchReconciliation> | ReturnType<typeof fetchJeSchedulesPage> | ReturnType<typeof fetchTransactionCategorizationView>;
11
+ export type ActionType = ReturnType<typeof refreshExpenseAutomationCurrentTab> | ReturnType<typeof fetchCompanyMonthEndReportView> | ReturnType<typeof fetchCompanyMonthEndReportTemplates> | ReturnType<typeof fetchMissingReceipts> | ReturnType<typeof fetchMonthEndCloseChecks> | ReturnType<typeof fetchFluxAnalysisView> | ReturnType<typeof fetchJeSchedulesPage> | ReturnType<typeof fetchTransactionCategorizationView>;
13
12
  export declare const refreshExpenseAutomationCurrentTabEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
@@ -10,7 +10,6 @@ const expenseAutomationViewReducer_1 = require("../../expenseAutomationViewReduc
10
10
  const fluxAnalysisViewReducer_1 = require("../../reducers/fluxAnalysisViewReducer");
11
11
  const jeSchedulesViewReducer_1 = require("../../reducers/jeSchedulesViewReducer");
12
12
  const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
13
- const reconciliationViewReducer_1 = require("../../reducers/reconciliationViewReducer");
14
13
  const transactionsViewReducer_1 = require("../../reducers/transactionsViewReducer");
15
14
  const refreshExpenseAutomationCurrentTabEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(expenseAutomationViewReducer_1.refreshExpenseAutomationCurrentTab.match), (0, operators_1.switchMap)(() => {
16
15
  const state = state$.value;
@@ -19,7 +18,6 @@ const refreshExpenseAutomationCurrentTabEpic = (actions$, state$) => actions$.pi
19
18
  const { selectedTransactionCategorizationTab } = state.expenseAutomationTransactionsViewState;
20
19
  const { selectedPeriodByTenantId, currentSelectedView } = state.expenseAutomationViewState;
21
20
  const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
22
- const { selectedAccountId } = state.expenseAutomationReconciliationViewState;
23
21
  const period = (0, timePeriod_1.convertToPeriod)(selectedPeriod);
24
22
  const timePeriodStart = (0, timePeriod_1.toAbsoluteDay)(period.start);
25
23
  const timePeriodEnd = (0, timePeriod_1.toAbsoluteDay)(period.end);
@@ -50,18 +48,6 @@ const refreshExpenseAutomationCurrentTabEpic = (actions$, state$) => actions$.pi
50
48
  (0, companyMonthEndReportViewReducer_1.fetchCompanyMonthEndReportView)(true, companyId, currentTenant.tenantId),
51
49
  (0, companyMonthEndReportViewReducer_1.fetchCompanyMonthEndReportTemplates)(companyId, currentTenant.tenantId),
52
50
  ]);
53
- case 'reconciliation': {
54
- if (selectedAccountId != null) {
55
- return (0, rxjs_1.from)([
56
- (0, reconciliationViewReducer_1.fetchReconciliation)(selectedPeriod, selectedAccountId, true, true),
57
- ]);
58
- }
59
- else {
60
- return (0, rxjs_1.from)([
61
- (0, reconciliationViewReducer_1.fetchReconciliation)(selectedPeriod, undefined, true, true),
62
- ]);
63
- }
64
- }
65
51
  case 'transaction_categorization':
66
52
  default:
67
53
  return (0, rxjs_1.from)([
@@ -40,12 +40,11 @@ const updateTransactionCategorizationEpic = (actions$, state$, zeniAPI) => actio
40
40
  }));
41
41
  exports.updateTransactionCategorizationEpic = updateTransactionCategorizationEpic;
42
42
  function prepareTransactionPayload(selectedTab, transactionState, vendorState, transactionsViewState, transactionId, saveUpdates) {
43
- var _a, _b;
43
+ var _a;
44
44
  const detail = (0, transactionSelector_1.getSupportedTransactionById)(transactionState, transactionId);
45
45
  const tranDetail = (0, get_1.default)(transactionsViewState.transactionCategorizationView[selectedTab]
46
46
  .transactionReviewLocalDataById, transactionId, undefined);
47
47
  const tranVendorUpdates = (_a = tranDetail === null || tranDetail === void 0 ? void 0 : tranDetail.transactionReviewLocalData) === null || _a === void 0 ? void 0 : _a.vendorUpdates;
48
- const tranCustomerUpdates = (_b = tranDetail === null || tranDetail === void 0 ? void 0 : tranDetail.transactionReviewLocalData) === null || _b === void 0 ? void 0 : _b.customerUpdates;
49
48
  let vendorUpdates = undefined;
50
49
  if ((tranVendorUpdates === null || tranVendorUpdates === void 0 ? void 0 : tranVendorUpdates.qboId) != null) {
51
50
  const vendor = (0, vendorSelector_1.getVendorByVendorId)(vendorState, tranVendorUpdates.qboId);
@@ -62,15 +61,8 @@ function prepareTransactionPayload(selectedTab, transactionState, vendorState, t
62
61
  };
63
62
  }
64
63
  }
65
- let customerUpdates = undefined;
66
- if ((tranCustomerUpdates === null || tranCustomerUpdates === void 0 ? void 0 : tranCustomerUpdates.qboId) != null) {
67
- customerUpdates = {
68
- id: tranCustomerUpdates.qboId,
69
- name: tranCustomerUpdates.name,
70
- };
71
- }
72
64
  if (detail != null) {
73
- const transUpdates = toTransactionUpdatePayload(saveUpdates.updates, detail, vendorUpdates, customerUpdates);
65
+ const transUpdates = toTransactionUpdatePayload(saveUpdates.updates, detail, vendorUpdates);
74
66
  const entityUpdates = toEntityUpdatePayload(saveUpdates.entityRelatedUpdates);
75
67
  return {
76
68
  entity_related_updates: entityUpdates,
@@ -99,14 +91,12 @@ function preparePayload(selectedTab, transactionState, vendorState, transactions
99
91
  return payload;
100
92
  }
101
93
  }
102
- const toTransactionUpdatePayload = (updates, detail, vendorUpdates, customerUpdates) => {
94
+ const toTransactionUpdatePayload = (updates, detail, vendorUpdates) => {
103
95
  var _a, _b;
104
96
  const transaction = Object.assign({}, detail);
105
97
  transaction.memo = (_a = updates.memo) !== null && _a !== void 0 ? _a : '';
106
98
  transaction.vendorId = vendorUpdates === null || vendorUpdates === void 0 ? void 0 : vendorUpdates.id;
107
99
  transaction.vendorName = vendorUpdates === null || vendorUpdates === void 0 ? void 0 : vendorUpdates.name;
108
- transaction.customerId = customerUpdates === null || customerUpdates === void 0 ? void 0 : customerUpdates.id;
109
- transaction.customerName = customerUpdates === null || customerUpdates === void 0 ? void 0 : customerUpdates.name;
110
100
  const recommendationUpdates = {};
111
101
  for (const key in updates.updatesByLineId) {
112
102
  const lineUpdates = updates.updatesByLineId[key];
@@ -143,17 +133,11 @@ const toTransactionUpdatePayload = (updates, detail, vendorUpdates, customerUpda
143
133
  transaction.lines = newLineMap;
144
134
  }
145
135
  transaction.recommendations = recommendationUpdates;
146
- // Added this check because now customer are also part of Expense,Journal Entry and Check type of transactions
147
136
  if ((0, customerTransaction_1.isCustomerTransaction)(transaction)) {
148
137
  return (0, customerTransactionPayload_1.toCustomerTransactionPayload)(transaction);
149
138
  }
150
139
  else if ((0, vendorTransaction_1.isVendorTransaction)(transaction)) {
151
- if ((0, vendorTransaction_1.isVendorTransactionWithCustomer)(transaction)) {
152
- return (0, vendorTransactionPayload_1.toVendorTransactionWithCustomerPayload)(transaction, vendorUpdates, customerUpdates);
153
- }
154
- else {
155
- return (0, vendorTransactionPayload_1.toVendorTransactionPayload)(transaction, vendorUpdates);
156
- }
140
+ return (0, vendorTransactionPayload_1.toVendorTransactionPayload)(transaction, vendorUpdates);
157
141
  }
158
142
  else if ((0, otherTransaction_1.isTransferTransaction)(transaction)) {
159
143
  return (0, otherTransactionPayload_1.toTransferTransactionPayload)(transaction);
@@ -8,8 +8,8 @@ export declare const fetchAllExpenseAutomationTabs: import("@reduxjs/toolkit").A
8
8
  }, "expenseAutomationView/fetchAllExpenseAutomationTabs", never, never>, updateCurrentSelectedPeriod: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, newSelectedPeriod: MonthYearPeriod], {
9
9
  newSelectedPeriod: MonthYearPeriod;
10
10
  tenantId: string;
11
- }, "expenseAutomationView/updateCurrentSelectedPeriod", never, never>, updateCurrentSelectedView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[newSelectedView: "transaction_categorization" | "je_schedules" | "reconciliation" | "missing_receipts" | "flux_analysis" | "month_end_insights"], {
12
- newSelectedView: "transaction_categorization" | "je_schedules" | "reconciliation" | "missing_receipts" | "flux_analysis" | "month_end_insights";
11
+ }, "expenseAutomationView/updateCurrentSelectedPeriod", never, never>, updateCurrentSelectedView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[newSelectedView: "transaction_categorization" | "je_schedules" | "account_recon" | "missing_receipts" | "flux_analysis" | "month_end_insights"], {
12
+ newSelectedView: "transaction_categorization" | "je_schedules" | "account_recon" | "missing_receipts" | "flux_analysis" | "month_end_insights";
13
13
  }, "expenseAutomationView/updateCurrentSelectedView", never, never>, clearExpenseAutomationView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationView/clearExpenseAutomationView">, initializeSelectedPeriodForTenants: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
14
14
  selectedPeriodByTenantId: Record<ID, MonthYearPeriod>;
15
15
  }, "expenseAutomationView/initializeSelectedPeriodForTenants">, refreshExpenseAutomationCurrentTab: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationView/refreshExpenseAutomationCurrentTab">;
@@ -11,7 +11,6 @@ const expenseAutomationViewSelectorTypes_1 = require("./selectorTypes/expenseAut
11
11
  const fluxAnalysisViewSelector_1 = require("./selectors/fluxAnalysisViewSelector");
12
12
  const jeSchedulesViewSelector_1 = require("./selectors/jeSchedulesViewSelector");
13
13
  const missingReceiptsSelector_1 = require("./selectors/missingReceiptsSelector");
14
- const reconciliationViewSelector_1 = require("./selectors/reconciliationViewSelector");
15
14
  const transactionCategorizationSelector_1 = require("./selectors/transactionCategorizationSelector");
16
15
  const isPreviousStepDisabled = (selectedTransactionCategorizationTab, allSteps, stepIndex, currentTenant, selectedPeriod, userAllowedToAccessMonthEndInsights, reportEmailSentDate, auditSummary) => {
17
16
  if (stepIndex === 0) {
@@ -25,7 +24,7 @@ const isPreviousStepDisabled = (selectedTransactionCategorizationTab, allSteps,
25
24
  };
26
25
  function getExpenseAutomationView(state) {
27
26
  var _a, _b, _c;
28
- const { expenseAutomationViewState, tenantState, expenseAutomationMissingReceiptsViewState, expenseAutomationJESchedulesViewState, expenseAutomationTransactionsViewState, expenseAutomationReconciliationViewState, monthEndCloseChecksState, companyState, } = state;
27
+ const { expenseAutomationViewState, tenantState, expenseAutomationMissingReceiptsViewState, expenseAutomationJESchedulesViewState, expenseAutomationTransactionsViewState, monthEndCloseChecksState, companyState, } = state;
29
28
  const { loggedInUser, currentTenantId } = tenantState;
30
29
  const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
31
30
  const { currentSelectedView, selectedPeriodByTenantId } = expenseAutomationViewState;
@@ -43,15 +42,9 @@ function getExpenseAutomationView(state) {
43
42
  const missingReceipts = (0, missingReceiptsSelector_1.getExpenseAutomationMissingReceiptsView)(state);
44
43
  const fluxAnalysis = (0, fluxAnalysisViewSelector_1.getExpenseAutomationFluxAnalysisView)(state);
45
44
  const monthEndInsights = (0, companyMonthEndReportViewSelector_1.getCompanyMonthEndReportSelectorView)(state, currentTenant.companyId, loggedInUser);
46
- const reconciliation = (0, reconciliationViewSelector_1.getExpenseAutomationReconciliationView)(state);
47
45
  const expenseAutomationTransactionsView = (0, transactionCategorizationSelector_1.getExpenseAutomationTransactionView)(state);
48
46
  const jeSchedules = (0, jeSchedulesViewSelector_1.getExpenseAutomationJESchedulesView)(state);
49
47
  switch (currentSelectedView) {
50
- case 'reconciliation':
51
- currentSelectedViewFetchState = reconciliation.fetchStatus;
52
- currentSelectedViewBackgroundRefreshFetchState =
53
- reconciliation.refreshStatus;
54
- break;
55
48
  case 'flux_analysis':
56
49
  currentSelectedViewFetchState = fluxAnalysis.fetchStatus;
57
50
  currentSelectedViewBackgroundRefreshFetchState =
@@ -97,7 +90,6 @@ function getExpenseAutomationView(state) {
97
90
  expenseAutomationJESchedulesViewState,
98
91
  monthEndCloseChecksView,
99
92
  expenseAutomationTransactionsView,
100
- expenseAutomationReconciliationViewState,
101
93
  ];
102
94
  let allSteps = [];
103
95
  let auditSummary = undefined;
@@ -130,9 +122,6 @@ function getExpenseAutomationView(state) {
130
122
  ? (0, monthEndCloseChecksViewSelector_1.isMonthEndInsightDisabled)(currentTenant, selectedPeriod, userAllowedToAccessMonthEndInsights, auditSummary)
131
123
  : true });
132
124
  return;
133
- case 'reconciliation':
134
- allStepsOriginal[index] = Object.assign(Object.assign({}, stepDetail), { completionStatus: reconciliation.completionStatus });
135
- return;
136
125
  case 'flux_analysis':
137
126
  default:
138
127
  allStepsOriginal[index] = Object.assign(Object.assign({}, stepDetail), { completionStatus: fluxAnalysis.completionStatus });
@@ -142,10 +131,7 @@ function getExpenseAutomationView(state) {
142
131
  allSteps.forEach((stepDetail, index, allStepsOriginal) => {
143
132
  allStepsOriginal[index] = Object.assign(Object.assign({}, stepDetail), { isNextDisabled: index === allStepsOriginal.length - 1
144
133
  ? allStepsOriginal[0].isDisabled
145
- : stepDetail.step === 'reconciliation' &&
146
- reconciliation.selectedTab === 'review'
147
- ? false
148
- : allStepsOriginal[index + 1].isDisabled, isPrevDisabled: isPreviousStepDisabled(selectedTransactionCategorizationTab, allStepsOriginal, index, currentTenant, selectedPeriod, userAllowedToAccessMonthEndInsights, reportEmailSentDate, auditSummary) });
134
+ : allStepsOriginal[index + 1].isDisabled, isPrevDisabled: isPreviousStepDisabled(selectedTransactionCategorizationTab, allStepsOriginal, index, currentTenant, selectedPeriod, userAllowedToAccessMonthEndInsights, reportEmailSentDate, auditSummary) });
149
135
  });
150
136
  }
151
137
  const reducedFetchStatus = (0, reduceFetchState_1.reduceAnyFetchState)(fetchStateVariables); // Add more states
@@ -160,7 +146,6 @@ function getExpenseAutomationView(state) {
160
146
  jeSchedules,
161
147
  transactionView: expenseAutomationTransactionsView,
162
148
  missingReceipts,
163
- reconciliation,
164
149
  currentSelectedViewFetchState,
165
150
  currentSelectedViewBackgroundRefreshFetchState,
166
151
  fluxAnalysis,
@@ -1,7 +1,7 @@
1
1
  import { FetchStateAndError, FetchedState, ID } from '../../commonStateTypes/common';
2
2
  import { MonthYearPeriod } from '../../commonStateTypes/timePeriod';
3
- export declare const EXPENSE_AUTOMATION_VIEW_TYPES: readonly ["transaction_categorization", "je_schedules", "reconciliation", "missing_receipts", "flux_analysis", "month_end_insights"];
4
- export declare const toExpenseAutomationViewType: (v: string) => "transaction_categorization" | "je_schedules" | "reconciliation" | "missing_receipts" | "flux_analysis" | "month_end_insights";
3
+ export declare const EXPENSE_AUTOMATION_VIEW_TYPES: readonly ["transaction_categorization", "je_schedules", "account_recon", "missing_receipts", "flux_analysis", "month_end_insights"];
4
+ export declare const toExpenseAutomationViewType: (v: string) => "transaction_categorization" | "je_schedules" | "account_recon" | "missing_receipts" | "flux_analysis" | "month_end_insights";
5
5
  export type ExpenseAutomationViewType = ReturnType<typeof toExpenseAutomationViewType>;
6
6
  export interface ExpenseAutomationViewState extends FetchedState {
7
7
  saveStatus: FetchStateAndError;
@@ -5,7 +5,7 @@ const stringToUnion_1 = require("../../commonStateTypes/stringToUnion");
5
5
  exports.EXPENSE_AUTOMATION_VIEW_TYPES = [
6
6
  'transaction_categorization',
7
7
  'je_schedules',
8
- 'reconciliation',
8
+ 'account_recon', // Not part of scope in v1
9
9
  'missing_receipts',
10
10
  'flux_analysis',
11
11
  'month_end_insights',
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.toTransactionUpdatesFromTransactionCategorizationLocalData = void 0;
4
4
  const entity_1 = require("../../../entity/genericEntity/entity");
5
- const customerTransaction_1 = require("../../../entity/transaction/stateTypes/customerTransaction");
6
5
  const vendorTransaction_1 = require("../../../entity/transaction/stateTypes/vendorTransaction");
7
6
  const recommendationState_1 = require("../../recommendation/recommendationState");
8
7
  const saveTransactionHelper_1 = require("../../transactionDetail/epics/saveTransactionHelper");
@@ -11,7 +10,7 @@ const saveTransactionHelper_1 = require("../../transactionDetail/epics/saveTrans
11
10
  * @param transactionCategorizationLocalData
12
11
  */
13
12
  const toTransactionUpdatesFromTransactionCategorizationLocalData = (transactionCategorizationLocalData, transaction, uncategorizedIncomeExpense) => {
14
- var _a, _b;
13
+ var _a, _b, _c;
15
14
  const updates = {
16
15
  updatesByLineId: {},
17
16
  };
@@ -23,18 +22,22 @@ const toTransactionUpdatesFromTransactionCategorizationLocalData = (transactionC
23
22
  if ((0, vendorTransaction_1.isVendorTransaction)(transaction) === true) {
24
23
  updates.vendorId = (_a = transactionCategorizationLocalData.vendorUpdates) === null || _a === void 0 ? void 0 : _a.id;
25
24
  }
26
- // This needs to be changed to customerUpdates as of now we are not updating customerId so we are using the one from the transaction
27
- if ((0, vendorTransaction_1.isVendorTransactionWithCustomer)(transaction) === true) {
28
- updates.customerId = transaction.customerId;
29
- }
30
- const entity = getEntityFromTransaction(transaction);
25
+ const entity = transaction.vendorId != null
26
+ ? {
27
+ id: transaction.vendorId,
28
+ name: (_b = transaction.vendorName) !== null && _b !== void 0 ? _b : '',
29
+ type: (0, entity_1.toEntityType)('vendor'),
30
+ qboId: transaction.vendorId,
31
+ zeniId: transaction.vendorId,
32
+ }
33
+ : undefined;
31
34
  let lastUpdatedCategory;
32
35
  let lastUpdatedClass;
33
36
  // single recommendation to just pick the last recommendation in the list of lines
34
- (_b = transaction.lines) === null || _b === void 0 ? void 0 : _b.forEach((line) => {
35
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
36
- const updatedEntityId = (_b = (_a = transactionCategorizationLocalData.vendorUpdates) === null || _a === void 0 ? void 0 : _a.qboId) !== null && _b !== void 0 ? _b : (_c = transactionCategorizationLocalData.customerUpdates) === null || _c === void 0 ? void 0 : _c.qboId;
37
- const entityDetails = getEntityDetails(entity, transactionCategorizationLocalData.lineItemById[line.id], transactionCategorizationLocalData.vendorUpdates, transactionCategorizationLocalData.customerUpdates);
37
+ (_c = transaction.lines) === null || _c === void 0 ? void 0 : _c.forEach((line) => {
38
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
39
+ const updatedEntityId = (_a = transactionCategorizationLocalData.vendorUpdates) === null || _a === void 0 ? void 0 : _a.qboId;
40
+ const entityDetails = getEntityDetails(entity, transactionCategorizationLocalData.lineItemById[line.id], transactionCategorizationLocalData.vendorUpdates);
38
41
  if (line.type === 'transaction_with_account_and_class_line' ||
39
42
  line.type === 'transaction_with_product_or_service_line' ||
40
43
  line.type === 'journal_entry_transaction_line') {
@@ -47,28 +50,24 @@ const toTransactionUpdatesFromTransactionCategorizationLocalData = (transactionC
47
50
  };
48
51
  if (line.type === 'journal_entry_transaction_line' ||
49
52
  line.platformLineDetailType === 'deposit_line_detail') {
50
- updatesByLineId[line.id] = Object.assign(Object.assign({}, updatesByLineId[line.id]), { vendor: lineItem.vendor, customer: lineItem.customer });
53
+ updatesByLineId[line.id] = Object.assign(Object.assign({}, updatesByLineId[line.id]), { vendor: lineItem.vendor });
51
54
  }
52
55
  let hasCategoryChanged = false;
53
56
  let hasClassChanged = false;
54
57
  const accountLine = line;
55
58
  hasCategoryChanged =
56
- ((_d = lineItem.account) === null || _d === void 0 ? void 0 : _d.qboId) !== accountLine.account.qboId &&
57
- Boolean((_e = lineItem.account) === null || _e === void 0 ? void 0 : _e.qboId);
59
+ ((_b = lineItem.account) === null || _b === void 0 ? void 0 : _b.qboId) !== accountLine.account.qboId &&
60
+ Boolean((_c = lineItem.account) === null || _c === void 0 ? void 0 : _c.qboId);
58
61
  hasClassChanged =
59
- Boolean((_f = lineItem.class) === null || _f === void 0 ? void 0 : _f.qboId) &&
60
- ((_g = lineItem.class) === null || _g === void 0 ? void 0 : _g.qboId) !== accountLine.class.qboId;
62
+ Boolean((_d = lineItem.class) === null || _d === void 0 ? void 0 : _d.qboId) &&
63
+ ((_e = lineItem.class) === null || _e === void 0 ? void 0 : _e.qboId) !== accountLine.class.qboId;
61
64
  const recommendedAccountBase = (0, saveTransactionHelper_1.toRecommendedAccountBase)(lineItem.amount.amount, lineItem.account);
62
65
  const recommendedClassBase = (0, saveTransactionHelper_1.toRecommendedClassBase)(lineItem.amount.amount, lineItem.class);
63
- const updatedLineEntityId = ((_h = accountLine.vendor) === null || _h === void 0 ? void 0 : _h.id) != null
64
- ? ((_j = accountLine.vendor) === null || _j === void 0 ? void 0 : _j.id) != ((_k = lineItem.vendor) === null || _k === void 0 ? void 0 : _k.id)
65
- ? (_l = lineItem.vendor) === null || _l === void 0 ? void 0 : _l.id
66
- : (_m = accountLine.vendor) === null || _m === void 0 ? void 0 : _m.id
67
- : ((_o = accountLine.customer) === null || _o === void 0 ? void 0 : _o.id) != null
68
- ? ((_p = accountLine.customer) === null || _p === void 0 ? void 0 : _p.id) != ((_q = lineItem.customer) === null || _q === void 0 ? void 0 : _q.id)
69
- ? (_r = lineItem.customer) === null || _r === void 0 ? void 0 : _r.id
70
- : (_s = accountLine.customer) === null || _s === void 0 ? void 0 : _s.id
71
- : undefined;
66
+ const updatedLineEntityId = ((_f = accountLine.vendor) === null || _f === void 0 ? void 0 : _f.id) != null
67
+ ? ((_g = accountLine.vendor) === null || _g === void 0 ? void 0 : _g.id) != ((_h = lineItem.vendor) === null || _h === void 0 ? void 0 : _h.id)
68
+ ? (_j = lineItem.vendor) === null || _j === void 0 ? void 0 : _j.id
69
+ : (_k = accountLine.vendor) === null || _k === void 0 ? void 0 : _k.id
70
+ : undefined;
72
71
  if (entityDetails != null &&
73
72
  (hasCategoryChanged === true || hasClassChanged === true)) {
74
73
  lastUpdatedCategory =
@@ -84,16 +83,16 @@ const toTransactionUpdatesFromTransactionCategorizationLocalData = (transactionC
84
83
  if (recommended.class != null ||
85
84
  recommended.account != null ||
86
85
  updatedEntityId != null) {
87
- const vendorIdToUpdate = (_t = transactionCategorizationLocalData.vendorUpdates) === null || _t === void 0 ? void 0 : _t.qboId;
86
+ const vendorIdToUpdate = (_l = transactionCategorizationLocalData.vendorUpdates) === null || _l === void 0 ? void 0 : _l.qboId;
87
+ let entityId = entityDetails.entityId;
88
88
  if (line.type === 'journal_entry_transaction_line' ||
89
89
  line.platformLineDetailType === 'deposit_line_detail') {
90
- const entityId = (_v = (_u = accountLine.vendor) === null || _u === void 0 ? void 0 : _u.id) !== null && _v !== void 0 ? _v : (_w = accountLine.customer) === null || _w === void 0 ? void 0 : _w.id;
90
+ const entityId = (_m = accountLine.vendor) === null || _m === void 0 ? void 0 : _m.id;
91
91
  if (entityId != null) {
92
92
  doUpdateEntityUpdates(entityUpdates, entityId, entityDetails.entityType, recommended, false, updatedLineEntityId);
93
93
  }
94
94
  }
95
95
  else {
96
- let entityId = entityDetails.entityId;
97
96
  if (vendorIdToUpdate != null) {
98
97
  entityId = vendorIdToUpdate;
99
98
  }
@@ -136,8 +135,8 @@ const doUpdateEntityUpdates = (entityUpdates, entityId, entityType, recommendati
136
135
  entityUpdates[entityKey] = Object.assign(Object.assign({}, entityUpdate), { recommendations: recommendation });
137
136
  }
138
137
  };
139
- const getEntityDetails = (entity, lineItemLocalData, vendorUpdates, customerUpdates) => {
140
- var _a, _b, _c, _d;
138
+ const getEntityDetails = (entity, lineItemLocalData, vendorUpdates) => {
139
+ var _a, _b, _c;
141
140
  if (entity != null) {
142
141
  return {
143
142
  entityId: (_a = entity.qboId) !== null && _a !== void 0 ? _a : entity.id,
@@ -156,19 +155,7 @@ const getEntityDetails = (entity, lineItemLocalData, vendorUpdates, customerUpda
156
155
  entityType: 'vendor',
157
156
  };
158
157
  }
159
- if (customerUpdates != null && customerUpdates.id != null) {
160
- return {
161
- entityId: customerUpdates.id,
162
- entityType: 'customer',
163
- };
164
- }
165
- if (((_c = lineItemLocalData.customer) === null || _c === void 0 ? void 0 : _c.id) != null) {
166
- return {
167
- entityId: lineItemLocalData.customer.id,
168
- entityType: 'customer',
169
- };
170
- }
171
- if (((_d = lineItemLocalData.vendor) === null || _d === void 0 ? void 0 : _d.id) != null) {
158
+ if (((_c = lineItemLocalData.vendor) === null || _c === void 0 ? void 0 : _c.id) != null) {
172
159
  return {
173
160
  entityId: lineItemLocalData.vendor.id,
174
161
  entityType: 'vendor',
@@ -176,41 +163,3 @@ const getEntityDetails = (entity, lineItemLocalData, vendorUpdates, customerUpda
176
163
  }
177
164
  return undefined;
178
165
  };
179
- const getEntityFromTransaction = (transaction) => {
180
- if ((0, vendorTransaction_1.isVendorTransaction)(transaction) ||
181
- (0, vendorTransaction_1.isVendorTransactionWithCustomer)(transaction)) {
182
- const vendor = transaction.vendor;
183
- const customer = transaction.customer;
184
- if (customer != null) {
185
- return {
186
- id: customer.id,
187
- name: customer.name,
188
- type: (0, entity_1.toEntityType)('customer'),
189
- qboId: customer.id,
190
- zeniId: customer.id,
191
- };
192
- }
193
- if (vendor != null) {
194
- return {
195
- id: vendor.id,
196
- name: vendor.name,
197
- type: (0, entity_1.toEntityType)('vendor'),
198
- qboId: vendor.id,
199
- zeniId: vendor.id,
200
- };
201
- }
202
- }
203
- if ((0, customerTransaction_1.isCustomerTransaction)(transaction)) {
204
- const customer = transaction.customer;
205
- if (customer) {
206
- return {
207
- id: customer.id,
208
- name: customer.name,
209
- type: (0, entity_1.toEntityType)('customer'),
210
- qboId: customer.id,
211
- zeniId: customer.id,
212
- };
213
- }
214
- }
215
- return undefined;
216
- };
@@ -8,6 +8,6 @@ import { UncategorizedAccounts } from '../../accountList/accountListSelector';
8
8
  import { TransactionReviewLocalData, TransactionsTabViewState } from '../types/transactionsViewState';
9
9
  export declare const MAX_SELECTION_LIMIT = 5;
10
10
  export declare const toTransactionDetailLocalData: (transaction: SupportedTransaction) => TransactionReviewLocalData;
11
- export declare const toSetAllLineItemsToCategoryClass: (draft: TransactionsTabViewState, transaction: SupportedTransaction, transactionId: ID, transactionLineId: ID, transactionDetailLocalData: TransactionReviewLocalData, updatedItem: "category" | "class", uncategorizedAccounts: UncategorizedAccounts, vendorId?: ID, customerId?: ID, selectedAccount?: AccountBase, selectedClassBase?: ClassBase) => TransactionReviewLocalData;
11
+ export declare const toSetAllLineItemsToCategoryClass: (draft: TransactionsTabViewState, transaction: SupportedTransaction, transactionId: ID, transactionLineId: ID, transactionDetailLocalData: TransactionReviewLocalData, updatedItem: "category" | "class", uncategorizedAccounts: UncategorizedAccounts, vendorId?: ID, selectedAccount?: AccountBase, selectedClassBase?: ClassBase) => TransactionReviewLocalData;
12
12
  export declare const setEntityRecommendationForLineIdInLocalData: (draft: TransactionsTabViewState, transaction: SupportedTransaction, transactionDetailLocalData: TransactionReviewLocalData, entity: Entity, recommendationLineIds: ID[], uncategorizedAccounts: UncategorizedAccounts, recommendationByLineId?: RecommendationByLineId) => TransactionReviewLocalData;
13
13
  export declare const checkIfAllLineItemsAreCategoryClassFilled: (transaction: SupportedTransaction, transactionDetailLocalData: TransactionReviewLocalData, uncategorizedAccounts: UncategorizedAccounts) => boolean;