@zeniai/client-epic-state 4.20.3-betaJK9 → 4.20.3-betaML4

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 (87) hide show
  1. package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
  2. package/lib/commonStateTypes/viewAndReport/viewAndReport.js +0 -1
  3. package/lib/entity/account/accountPayload.d.ts +0 -2
  4. package/lib/entity/account/accountReducer.d.ts +2 -5
  5. package/lib/entity/account/accountReducer.js +2 -7
  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/forecast/forecastState.d.ts +1 -1
  11. package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
  12. package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
  13. package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
  14. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  15. package/lib/entity/snackbar/snackbarTypes.js +0 -3
  16. package/lib/entity/tenant/tenantReducer.d.ts +2 -5
  17. package/lib/entity/tenant/tenantReducer.js +2 -8
  18. package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +0 -6
  19. package/lib/entity/transaction/payloadTypes/transactionPayload.js +0 -62
  20. package/lib/entity/transaction/stateTypes/transaction.d.ts +0 -6
  21. package/lib/epic.d.ts +7 -10
  22. package/lib/epic.js +7 -10
  23. package/lib/esm/commonStateTypes/viewAndReport/viewAndReport.js +0 -1
  24. package/lib/esm/entity/account/accountReducer.js +1 -6
  25. package/lib/esm/entity/snackbar/snackbarTypes.js +0 -3
  26. package/lib/esm/entity/tenant/tenantReducer.js +1 -7
  27. package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +0 -62
  28. package/lib/esm/epic.js +7 -10
  29. package/lib/esm/index.js +7 -7
  30. package/lib/esm/view/companyView/companyViewReducer.js +1 -26
  31. package/lib/esm/view/companyView/types/companyPassport/companyPassportViewState.js +0 -4
  32. package/lib/esm/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +9 -4
  33. package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +1 -5
  34. package/lib/esm/view/expenseAutomationView/reducers/reconciliationViewReducer.js +3 -167
  35. package/lib/esm/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.js +2 -1
  36. package/lib/esm/view/expenseAutomationView/selectors/reconciliationViewSelector.js +0 -114
  37. package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +6 -10
  38. package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +0 -6
  39. package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +2 -4
  40. package/lib/esm/view/spendManagement/autotransferRules/epics/createAutoTransferRuleEpic.js +1 -2
  41. package/lib/esm/view/spendManagement/autotransferRules/epics/fetchAutoTransferReviewDetailEpic.js +1 -1
  42. package/lib/index.d.ts +7 -7
  43. package/lib/index.js +32 -39
  44. package/lib/tsconfig.typecheck.tsbuildinfo +1 -0
  45. package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
  46. package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
  47. package/lib/view/cardBalance/cardBalanceSelector.d.ts +1 -1
  48. package/lib/view/cashBalance/cashBalanceSelector.d.ts +1 -1
  49. package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
  50. package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
  51. package/lib/view/companyView/companyViewReducer.d.ts +1 -6
  52. package/lib/view/companyView/companyViewReducer.js +2 -28
  53. package/lib/view/companyView/types/companyPassport/companyPassportViewState.d.ts +0 -1
  54. package/lib/view/companyView/types/companyPassport/companyPassportViewState.js +0 -4
  55. package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
  56. package/lib/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +9 -4
  57. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  58. package/lib/view/expenseAutomationView/payload/reconciliationPayload.d.ts +0 -45
  59. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +1 -5
  60. package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.d.ts +4 -18
  61. package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.js +4 -168
  62. package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.d.ts +2 -7
  63. package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.js +2 -2
  64. package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +0 -114
  65. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +5 -9
  66. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +0 -3
  67. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +1 -8
  68. package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +0 -14
  69. package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
  70. package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
  71. package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +2 -4
  72. package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
  73. package/lib/view/reportsResync/reportsResyncReducer.d.ts +2 -2
  74. package/lib/view/spendManagement/autotransferRules/epics/createAutoTransferRuleEpic.js +1 -2
  75. package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferReviewDetailEpic.js +1 -1
  76. package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
  77. package/lib/view/topEx/topExSelector.d.ts +1 -1
  78. package/package.json +1 -1
  79. package/lib/esm/view/companyView/epic/companyPassport/updateAccountingClassesEnabledEpic.js +0 -61
  80. package/lib/esm/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.js +0 -63
  81. package/lib/esm/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.js +0 -65
  82. package/lib/view/companyView/epic/companyPassport/updateAccountingClassesEnabledEpic.d.ts +0 -10
  83. package/lib/view/companyView/epic/companyPassport/updateAccountingClassesEnabledEpic.js +0 -65
  84. package/lib/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.d.ts +0 -9
  85. package/lib/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.js +0 -67
  86. package/lib/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.d.ts +0 -10
  87. package/lib/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.js +0 -69
@@ -2,8 +2,8 @@ import { ReportID } from '../../commonStateTypes/viewAndReport/viewAndReport';
2
2
  import { ZeniAPIStatus } from '../../responsePayload';
3
3
  import { ReportsResyncState } from './reportsResyncState';
4
4
  export declare const initialReportsResyncState: ReportsResyncState;
5
- export declare const initiateReportsResync: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[reportIdToResync: "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" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation"], {
6
- reportIdToResync: "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" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation";
5
+ export declare const initiateReportsResync: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[reportIdToResync: "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" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card"], {
6
+ reportIdToResync: "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" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card";
7
7
  }, "initiateReportsResync/initiateReportsResync", never, never>, initiateReportsClassViewRefetching: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
8
8
  reportIdToResync: ReportID;
9
9
  }, "initiateReportsResync/initiateReportsClassViewRefetching">, reportsResyncSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
@@ -63,8 +63,7 @@ function mapAutoTransferRuleLocalDataToPayload(localData, pauseRule, resumeRule)
63
63
  };
64
64
  }
65
65
  const payload = {
66
- ...(localData.amount != null &&
67
- localData.ruleType !== 'percentage_of_balance' && {
66
+ ...(localData.amount != null && {
68
67
  amount: localData.amount.amount,
69
68
  currency_code: localData.amount.currencyCode,
70
69
  }),
@@ -28,7 +28,7 @@ const fetchAutoTransferReviewDetailEpic = (actions$, state$, zeniAPI) => actions
28
28
  }),
29
29
  };
30
30
  return zeniAPI
31
- .postAndGetJSON(`${zeniAPI.apiEndPoints.bankingMicroServiceBaseUrl}/1.0/deposit-accounts/transfers/review`, payload)
31
+ .postAndGetJSON(`${zeniAPI.apiEndPoints.bankingMicroServiceBaseUrl}/1.0/rules/transfer/auto/review`, payload)
32
32
  .pipe((0, operators_1.mergeMap)((response) => {
33
33
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
34
34
  return (0, rxjs_1.of)((0, autoTransferRulesReducer_1.updateAutoTransferReviewDetail)(response.data));
@@ -1,6 +1,6 @@
1
1
  import { RootState } from '../../reducer';
2
2
  export declare const getTasksCardReport: (state: RootState) => {
3
- reportId: "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" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation";
3
+ reportId: "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" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card";
4
4
  reportTitle: string;
5
5
  version: string | number | undefined;
6
6
  status: import("../..").Status | undefined;
@@ -4,7 +4,7 @@ import { RootState } from '../../reducer';
4
4
  import { TopExReport, TopExTimePeriodWithMetaData } from './topExSelectorTypes';
5
5
  import { TopExState } from './topExState';
6
6
  export declare const getTopExpenses: (accountState: AccountState, topExState: TopExState, numberOfExpenses?: number) => {
7
- reportId: "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" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation";
7
+ reportId: "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" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card";
8
8
  reportTitle: string;
9
9
  version: string | number | undefined;
10
10
  status: import("../..").Status | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.20.3-betaJK9",
3
+ "version": "4.20.3-betaML4",
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
  "module": "lib/esm/index.js",
@@ -1,61 +0,0 @@
1
- import { from } from 'rxjs';
2
- import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
3
- import { updateCompanies } from '../../../../entity/company/companyReducer';
4
- import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
5
- import { updateTenantAccountingClassesEnabled } from '../../../../entity/tenant/tenantReducer';
6
- import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
7
- import { updateAccountingClassesEnabled, updateAccountingClassesEnabledFailure, updateAccountingClassesEnabledSuccess, } from '../../companyViewReducer';
8
- export const updateAccountingClassesEnabledEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(updateAccountingClassesEnabled.match), switchMap((action) => {
9
- const { companyId, enabled } = action.payload;
10
- const tenantId = Object.values(state$.value.tenantState.tenantsById).find((t) => t.companyId === companyId)?.tenantId;
11
- return zeniAPI
12
- .putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/companies/${companyId}`, { is_accounting_classes_enabled: enabled })
13
- .pipe(mergeMap((response) => {
14
- const companies = response.data?.companies ?? [];
15
- if (isSuccessResponse(response) && companies.length > 0) {
16
- const actions = [
17
- updateCompanies({
18
- payload: companies,
19
- schema: {},
20
- }),
21
- ];
22
- if (tenantId != null) {
23
- actions.push(updateTenantAccountingClassesEnabled({
24
- enabled,
25
- tenantId,
26
- }));
27
- }
28
- actions.push(updateAccountingClassesEnabledSuccess());
29
- actions.push(openSnackbar({
30
- messageSection: 'accounting_classes_enabled_update',
31
- messageText: 'success',
32
- type: 'success',
33
- }));
34
- return from(actions);
35
- }
36
- else {
37
- return from([
38
- updateAccountingClassesEnabledFailure({
39
- status: response.status,
40
- }),
41
- openSnackbar({
42
- messageSection: 'accounting_classes_enabled_update',
43
- messageText: 'failed',
44
- type: 'error',
45
- }),
46
- ]);
47
- }
48
- }), catchError((error) => from([
49
- updateAccountingClassesEnabledFailure({
50
- status: createZeniAPIStatus('Unexpected error', 'Update Accounting Classes Enabled errored out' +
51
- (error instanceof Error
52
- ? error.message
53
- : JSON.stringify(error))),
54
- }),
55
- openSnackbar({
56
- messageSection: 'accounting_classes_enabled_update',
57
- messageText: 'failed',
58
- type: 'error',
59
- }),
60
- ])));
61
- }));
@@ -1,63 +0,0 @@
1
- import { of } from 'rxjs';
2
- import { catchError, filter, mergeMap } from 'rxjs/operators';
3
- import { changeAccountKey } from '../../../../entity/account/accountReducer';
4
- import { getAccountKey } from '../../../../entity/account/accountState';
5
- import { getAccountReconByAccountIdAndSelectedPeriod } from '../../../../entity/accountRecon/accountReconSelector';
6
- import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
7
- import { getCurrentTenant } from '../../../../entity/tenant/tenantSelector';
8
- import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
9
- import { excludeAccountFromReconciliation, excludeAccountFromReconciliationFailure, excludeAccountFromReconciliationSuccess, } from '../../reducers/reconciliationViewReducer';
10
- export const excludeAccountFromReconciliationEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(excludeAccountFromReconciliation.match), mergeMap((action) => {
11
- const { accountId } = action.payload;
12
- const state = state$.value;
13
- const currentTenant = getCurrentTenant(state);
14
- const selectedPeriod = state.expenseAutomationViewState.selectedPeriodByTenantId[currentTenant.tenantId];
15
- const reconciliationData = getAccountReconByAccountIdAndSelectedPeriod(state, accountId, selectedPeriod);
16
- const payload = {
17
- account_id: accountId,
18
- bank_balance: reconciliationData?.balance?.amount ?? null,
19
- cleared_balance: reconciliationData?.clearedBalance?.amount ?? null,
20
- variance: reconciliationData?.variance?.amount ?? null,
21
- };
22
- const apiUrl = `${zeniAPI.apiEndPoints.reconciliationMicroServiceBaseUrl}/1.0/reconciliation/excluded-accounts`;
23
- return zeniAPI
24
- .postAndGetJSON(apiUrl, payload)
25
- .pipe(mergeMap((response) => {
26
- if (isSuccessResponse(response)) {
27
- const newAccountKey = getAccountKey('excluded_account_reconciliation', accountId);
28
- const oldAccountKey = getAccountKey('account_reconciliation', accountId);
29
- return of(excludeAccountFromReconciliationSuccess({
30
- account: response.data?.excluded_account ?? undefined,
31
- selectedPeriod,
32
- }), changeAccountKey({
33
- oldKey: oldAccountKey,
34
- newKey: newAccountKey,
35
- }), openSnackbar({
36
- messageSection: 'account_excluded_from_reconciliation',
37
- messageText: 'success',
38
- type: 'success',
39
- variables: [
40
- {
41
- variableName: '_account-name_',
42
- variableValue: reconciliationData?.account.accountName ?? '',
43
- },
44
- ],
45
- }));
46
- }
47
- else {
48
- return of(excludeAccountFromReconciliationFailure({
49
- error: response.status,
50
- }), openSnackbar({
51
- messageSection: 'account_excluded_from_reconciliation',
52
- messageText: 'failed',
53
- type: 'error',
54
- }));
55
- }
56
- }), catchError((error) => of(excludeAccountFromReconciliationFailure({
57
- error: createZeniAPIStatus('Unexpected Error', `Exclude account from reconciliation REST API call errored out ${JSON.stringify(error)}`),
58
- }), openSnackbar({
59
- messageSection: 'account_excluded_from_reconciliation',
60
- messageText: 'failed',
61
- type: 'error',
62
- }))));
63
- }));
@@ -1,65 +0,0 @@
1
- import { of } from 'rxjs';
2
- import { catchError, filter, mergeMap } from 'rxjs/operators';
3
- import { convertToPeriod } from '../../../../commonStateTypes/timePeriod';
4
- import { changeAccountKey } from '../../../../entity/account/accountReducer';
5
- import { getAccountBase } from '../../../../entity/account/accountSelector';
6
- import { getAccountKey } from '../../../../entity/account/accountState';
7
- import { updateAccountRecon } from '../../../../entity/accountRecon/accountReconReducer';
8
- import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
9
- import { getCurrentTenant } from '../../../../entity/tenant/tenantSelector';
10
- import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
11
- import { includeAccountInReconciliation, includeAccountInReconciliationFailure, includeAccountInReconciliationSuccess, } from '../../reducers/reconciliationViewReducer';
12
- export const includeAccountInReconciliationEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(includeAccountInReconciliation.match), mergeMap((action) => {
13
- const { accountId } = action.payload;
14
- const state = state$.value;
15
- const currentTenant = getCurrentTenant(state);
16
- const selectedPeriod = state.expenseAutomationViewState.selectedPeriodByTenantId[currentTenant.tenantId];
17
- const account = getAccountBase(state.accountState, accountId, 'excluded_account_reconciliation');
18
- const period = convertToPeriod(selectedPeriod, true);
19
- const query = JSON.stringify({
20
- start_date: period.start,
21
- end_date: period.end,
22
- });
23
- const apiUrl = `${zeniAPI.apiEndPoints.reconciliationMicroServiceBaseUrl}/1.0/reconciliation/excluded-accounts/${accountId}?query=${encodeURIComponent(query)}`;
24
- return zeniAPI
25
- .deleteAndGetJSON(apiUrl)
26
- .pipe(mergeMap((response) => {
27
- if (isSuccessResponse(response) && response.data != null) {
28
- const reconciliation = response.data.reconciliation;
29
- const oldAccountKey = getAccountKey('excluded_account_reconciliation', reconciliation.account_id);
30
- const newAccountKey = getAccountKey('account_reconciliation', reconciliation.account_id);
31
- return of(updateAccountRecon(selectedPeriod, [reconciliation]), includeAccountInReconciliationSuccess({
32
- reconciliation,
33
- selectedPeriod,
34
- }), changeAccountKey({
35
- oldKey: oldAccountKey,
36
- newKey: newAccountKey,
37
- }), openSnackbar({
38
- messageSection: 'account_included_in_reconciliation',
39
- messageText: 'success',
40
- type: 'success',
41
- variables: [
42
- {
43
- variableName: '_account-name_',
44
- variableValue: account?.accountName ?? '',
45
- },
46
- ],
47
- }));
48
- }
49
- else {
50
- return of(includeAccountInReconciliationFailure({
51
- error: response.status,
52
- }), openSnackbar({
53
- messageSection: 'account_included_in_reconciliation',
54
- messageText: 'failed',
55
- type: 'error',
56
- }));
57
- }
58
- }), catchError((error) => of(includeAccountInReconciliationFailure({
59
- error: createZeniAPIStatus('Unexpected Error', `Include account in reconciliation REST API call errored out ${JSON.stringify(error)}`),
60
- }), openSnackbar({
61
- messageSection: 'account_included_in_reconciliation',
62
- messageText: 'failed',
63
- type: 'error',
64
- }))));
65
- }));
@@ -1,10 +0,0 @@
1
- import { ActionsObservable, StateObservable } from 'redux-observable';
2
- import { Observable } from 'rxjs';
3
- import { updateCompanies } from '../../../../entity/company/companyReducer';
4
- import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
5
- import { updateTenantAccountingClassesEnabled } from '../../../../entity/tenant/tenantReducer';
6
- import { RootState } from '../../../../reducer';
7
- import { ZeniAPI } from '../../../../zeniAPI';
8
- import { updateAccountingClassesEnabled, updateAccountingClassesEnabledFailure, updateAccountingClassesEnabledSuccess } from '../../companyViewReducer';
9
- export type ActionType = ReturnType<typeof updateCompanies> | ReturnType<typeof updateTenantAccountingClassesEnabled> | ReturnType<typeof openSnackbar> | ReturnType<typeof updateAccountingClassesEnabled> | ReturnType<typeof updateAccountingClassesEnabledSuccess> | ReturnType<typeof updateAccountingClassesEnabledFailure>;
10
- export declare const updateAccountingClassesEnabledEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -1,65 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateAccountingClassesEnabledEpic = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const companyReducer_1 = require("../../../../entity/company/companyReducer");
7
- const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
8
- const tenantReducer_1 = require("../../../../entity/tenant/tenantReducer");
9
- const responsePayload_1 = require("../../../../responsePayload");
10
- const companyViewReducer_1 = require("../../companyViewReducer");
11
- const updateAccountingClassesEnabledEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(companyViewReducer_1.updateAccountingClassesEnabled.match), (0, operators_1.switchMap)((action) => {
12
- const { companyId, enabled } = action.payload;
13
- const tenantId = Object.values(state$.value.tenantState.tenantsById).find((t) => t.companyId === companyId)?.tenantId;
14
- return zeniAPI
15
- .putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/companies/${companyId}`, { is_accounting_classes_enabled: enabled })
16
- .pipe((0, operators_1.mergeMap)((response) => {
17
- const companies = response.data?.companies ?? [];
18
- if ((0, responsePayload_1.isSuccessResponse)(response) && companies.length > 0) {
19
- const actions = [
20
- (0, companyReducer_1.updateCompanies)({
21
- payload: companies,
22
- schema: {},
23
- }),
24
- ];
25
- if (tenantId != null) {
26
- actions.push((0, tenantReducer_1.updateTenantAccountingClassesEnabled)({
27
- enabled,
28
- tenantId,
29
- }));
30
- }
31
- actions.push((0, companyViewReducer_1.updateAccountingClassesEnabledSuccess)());
32
- actions.push((0, snackbarReducer_1.openSnackbar)({
33
- messageSection: 'accounting_classes_enabled_update',
34
- messageText: 'success',
35
- type: 'success',
36
- }));
37
- return (0, rxjs_1.from)(actions);
38
- }
39
- else {
40
- return (0, rxjs_1.from)([
41
- (0, companyViewReducer_1.updateAccountingClassesEnabledFailure)({
42
- status: response.status,
43
- }),
44
- (0, snackbarReducer_1.openSnackbar)({
45
- messageSection: 'accounting_classes_enabled_update',
46
- messageText: 'failed',
47
- type: 'error',
48
- }),
49
- ]);
50
- }
51
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.from)([
52
- (0, companyViewReducer_1.updateAccountingClassesEnabledFailure)({
53
- status: (0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'Update Accounting Classes Enabled errored out' +
54
- (error instanceof Error
55
- ? error.message
56
- : JSON.stringify(error))),
57
- }),
58
- (0, snackbarReducer_1.openSnackbar)({
59
- messageSection: 'accounting_classes_enabled_update',
60
- messageText: 'failed',
61
- type: 'error',
62
- }),
63
- ])));
64
- }));
65
- exports.updateAccountingClassesEnabledEpic = updateAccountingClassesEnabledEpic;
@@ -1,9 +0,0 @@
1
- import { ActionsObservable, StateObservable } from 'redux-observable';
2
- import { Observable } from 'rxjs';
3
- import { changeAccountKey } from '../../../../entity/account/accountReducer';
4
- import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
5
- import { RootState } from '../../../../reducer';
6
- import { ZeniAPI } from '../../../../zeniAPI';
7
- import { excludeAccountFromReconciliation, excludeAccountFromReconciliationFailure, excludeAccountFromReconciliationSuccess } from '../../reducers/reconciliationViewReducer';
8
- export type ActionType = ReturnType<typeof excludeAccountFromReconciliation> | ReturnType<typeof changeAccountKey> | ReturnType<typeof openSnackbar> | ReturnType<typeof excludeAccountFromReconciliationSuccess> | ReturnType<typeof excludeAccountFromReconciliationFailure>;
9
- export declare const excludeAccountFromReconciliationEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -1,67 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.excludeAccountFromReconciliationEpic = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const accountReducer_1 = require("../../../../entity/account/accountReducer");
7
- const accountState_1 = require("../../../../entity/account/accountState");
8
- const accountReconSelector_1 = require("../../../../entity/accountRecon/accountReconSelector");
9
- const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
10
- const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
11
- const responsePayload_1 = require("../../../../responsePayload");
12
- const reconciliationViewReducer_1 = require("../../reducers/reconciliationViewReducer");
13
- const excludeAccountFromReconciliationEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(reconciliationViewReducer_1.excludeAccountFromReconciliation.match), (0, operators_1.mergeMap)((action) => {
14
- const { accountId } = action.payload;
15
- const state = state$.value;
16
- const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
17
- const selectedPeriod = state.expenseAutomationViewState.selectedPeriodByTenantId[currentTenant.tenantId];
18
- const reconciliationData = (0, accountReconSelector_1.getAccountReconByAccountIdAndSelectedPeriod)(state, accountId, selectedPeriod);
19
- const payload = {
20
- account_id: accountId,
21
- bank_balance: reconciliationData?.balance?.amount ?? null,
22
- cleared_balance: reconciliationData?.clearedBalance?.amount ?? null,
23
- variance: reconciliationData?.variance?.amount ?? null,
24
- };
25
- const apiUrl = `${zeniAPI.apiEndPoints.reconciliationMicroServiceBaseUrl}/1.0/reconciliation/excluded-accounts`;
26
- return zeniAPI
27
- .postAndGetJSON(apiUrl, payload)
28
- .pipe((0, operators_1.mergeMap)((response) => {
29
- if ((0, responsePayload_1.isSuccessResponse)(response)) {
30
- const newAccountKey = (0, accountState_1.getAccountKey)('excluded_account_reconciliation', accountId);
31
- const oldAccountKey = (0, accountState_1.getAccountKey)('account_reconciliation', accountId);
32
- return (0, rxjs_1.of)((0, reconciliationViewReducer_1.excludeAccountFromReconciliationSuccess)({
33
- account: response.data?.excluded_account ?? undefined,
34
- selectedPeriod,
35
- }), (0, accountReducer_1.changeAccountKey)({
36
- oldKey: oldAccountKey,
37
- newKey: newAccountKey,
38
- }), (0, snackbarReducer_1.openSnackbar)({
39
- messageSection: 'account_excluded_from_reconciliation',
40
- messageText: 'success',
41
- type: 'success',
42
- variables: [
43
- {
44
- variableName: '_account-name_',
45
- variableValue: reconciliationData?.account.accountName ?? '',
46
- },
47
- ],
48
- }));
49
- }
50
- else {
51
- return (0, rxjs_1.of)((0, reconciliationViewReducer_1.excludeAccountFromReconciliationFailure)({
52
- error: response.status,
53
- }), (0, snackbarReducer_1.openSnackbar)({
54
- messageSection: 'account_excluded_from_reconciliation',
55
- messageText: 'failed',
56
- type: 'error',
57
- }));
58
- }
59
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, reconciliationViewReducer_1.excludeAccountFromReconciliationFailure)({
60
- error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', `Exclude account from reconciliation REST API call errored out ${JSON.stringify(error)}`),
61
- }), (0, snackbarReducer_1.openSnackbar)({
62
- messageSection: 'account_excluded_from_reconciliation',
63
- messageText: 'failed',
64
- type: 'error',
65
- }))));
66
- }));
67
- exports.excludeAccountFromReconciliationEpic = excludeAccountFromReconciliationEpic;
@@ -1,10 +0,0 @@
1
- import { ActionsObservable, StateObservable } from 'redux-observable';
2
- import { Observable } from 'rxjs';
3
- import { changeAccountKey } from '../../../../entity/account/accountReducer';
4
- import { updateAccountRecon } from '../../../../entity/accountRecon/accountReconReducer';
5
- import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
6
- import { RootState } from '../../../../reducer';
7
- import { ZeniAPI } from '../../../../zeniAPI';
8
- import { includeAccountInReconciliation, includeAccountInReconciliationFailure, includeAccountInReconciliationSuccess } from '../../reducers/reconciliationViewReducer';
9
- export type ActionType = ReturnType<typeof includeAccountInReconciliation> | ReturnType<typeof includeAccountInReconciliationSuccess> | ReturnType<typeof includeAccountInReconciliationFailure> | ReturnType<typeof changeAccountKey> | ReturnType<typeof openSnackbar> | ReturnType<typeof updateAccountRecon>;
10
- export declare const includeAccountInReconciliationEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -1,69 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.includeAccountInReconciliationEpic = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
7
- const accountReducer_1 = require("../../../../entity/account/accountReducer");
8
- const accountSelector_1 = require("../../../../entity/account/accountSelector");
9
- const accountState_1 = require("../../../../entity/account/accountState");
10
- const accountReconReducer_1 = require("../../../../entity/accountRecon/accountReconReducer");
11
- const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
12
- const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
13
- const responsePayload_1 = require("../../../../responsePayload");
14
- const reconciliationViewReducer_1 = require("../../reducers/reconciliationViewReducer");
15
- const includeAccountInReconciliationEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(reconciliationViewReducer_1.includeAccountInReconciliation.match), (0, operators_1.mergeMap)((action) => {
16
- const { accountId } = action.payload;
17
- const state = state$.value;
18
- const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
19
- const selectedPeriod = state.expenseAutomationViewState.selectedPeriodByTenantId[currentTenant.tenantId];
20
- const account = (0, accountSelector_1.getAccountBase)(state.accountState, accountId, 'excluded_account_reconciliation');
21
- const period = (0, timePeriod_1.convertToPeriod)(selectedPeriod, true);
22
- const query = JSON.stringify({
23
- start_date: period.start,
24
- end_date: period.end,
25
- });
26
- const apiUrl = `${zeniAPI.apiEndPoints.reconciliationMicroServiceBaseUrl}/1.0/reconciliation/excluded-accounts/${accountId}?query=${encodeURIComponent(query)}`;
27
- return zeniAPI
28
- .deleteAndGetJSON(apiUrl)
29
- .pipe((0, operators_1.mergeMap)((response) => {
30
- if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
31
- const reconciliation = response.data.reconciliation;
32
- const oldAccountKey = (0, accountState_1.getAccountKey)('excluded_account_reconciliation', reconciliation.account_id);
33
- const newAccountKey = (0, accountState_1.getAccountKey)('account_reconciliation', reconciliation.account_id);
34
- return (0, rxjs_1.of)((0, accountReconReducer_1.updateAccountRecon)(selectedPeriod, [reconciliation]), (0, reconciliationViewReducer_1.includeAccountInReconciliationSuccess)({
35
- reconciliation,
36
- selectedPeriod,
37
- }), (0, accountReducer_1.changeAccountKey)({
38
- oldKey: oldAccountKey,
39
- newKey: newAccountKey,
40
- }), (0, snackbarReducer_1.openSnackbar)({
41
- messageSection: 'account_included_in_reconciliation',
42
- messageText: 'success',
43
- type: 'success',
44
- variables: [
45
- {
46
- variableName: '_account-name_',
47
- variableValue: account?.accountName ?? '',
48
- },
49
- ],
50
- }));
51
- }
52
- else {
53
- return (0, rxjs_1.of)((0, reconciliationViewReducer_1.includeAccountInReconciliationFailure)({
54
- error: response.status,
55
- }), (0, snackbarReducer_1.openSnackbar)({
56
- messageSection: 'account_included_in_reconciliation',
57
- messageText: 'failed',
58
- type: 'error',
59
- }));
60
- }
61
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, reconciliationViewReducer_1.includeAccountInReconciliationFailure)({
62
- error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', `Include account in reconciliation REST API call errored out ${JSON.stringify(error)}`),
63
- }), (0, snackbarReducer_1.openSnackbar)({
64
- messageSection: 'account_included_in_reconciliation',
65
- messageText: 'failed',
66
- type: 'error',
67
- }))));
68
- }));
69
- exports.includeAccountInReconciliationEpic = includeAccountInReconciliationEpic;