@zeniai/client-epic-state 5.2.30-betaRD0 → 5.2.31

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 (93) hide show
  1. package/lib/commonStateTypes/coaBalance/classBalances/getSumOfBalancesGroupedByPeriod.js +16 -3
  2. package/lib/commonStateTypes/viewAndReport/reportIDHelper.d.ts +6 -0
  3. package/lib/commonStateTypes/viewAndReport/reportIDHelper.js +12 -1
  4. package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
  5. package/lib/commonStateTypes/viewAndReport/viewAndReport.js +2 -0
  6. package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
  7. package/lib/entity/class/classReducer.d.ts +4 -4
  8. package/lib/entity/class/classState.d.ts +1 -1
  9. package/lib/entity/forecast/forecastState.d.ts +1 -1
  10. package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
  11. package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
  12. package/lib/entity/sectionClassesViewV2/sectionClassesViewEpic.js +2 -1
  13. package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
  14. package/lib/entity/sectionProjectView/sectionProjectView.d.ts +1 -1
  15. package/lib/entity/sectionProjectView/sectionProjectViewReducer.d.ts +2 -2
  16. package/lib/epic.d.ts +5 -1
  17. package/lib/epic.js +8 -0
  18. package/lib/esm/commonStateTypes/coaBalance/classBalances/getSumOfBalancesGroupedByPeriod.js +16 -3
  19. package/lib/esm/commonStateTypes/viewAndReport/reportIDHelper.js +7 -0
  20. package/lib/esm/commonStateTypes/viewAndReport/viewAndReport.js +2 -0
  21. package/lib/esm/entity/sectionClassesViewV2/sectionClassesViewEpic.js +2 -1
  22. package/lib/esm/epic.js +8 -0
  23. package/lib/esm/index.js +7 -3
  24. package/lib/esm/reducer.js +6 -0
  25. package/lib/esm/view/cashFlow/cashFlowGroupedSectionOrder.js +47 -0
  26. package/lib/esm/view/cashFlowClassesView/cashFlowClassesViewEpic.js +30 -0
  27. package/lib/esm/view/cashFlowClassesView/cashFlowClassesViewPayload.js +1 -0
  28. package/lib/esm/view/cashFlowClassesView/cashFlowClassesViewReducer.js +129 -0
  29. package/lib/esm/view/cashFlowClassesView/cashFlowClassesViewSelector.js +53 -0
  30. package/lib/esm/view/cashFlowClassesView/cashFlowClassesViewSelectorTypes.js +1 -0
  31. package/lib/esm/view/cashFlowClassesView/cashFlowClassesViewState.js +1 -0
  32. package/lib/esm/view/cashFlowClassesView/cashFlowForTimeframeClassesViewEpic.js +55 -0
  33. package/lib/esm/view/cashFlowProjectView/cashFlowForTimeframeProjectViewEpic.js +57 -0
  34. package/lib/esm/view/cashFlowProjectView/cashFlowProjectViewEpic.js +30 -0
  35. package/lib/esm/view/cashFlowProjectView/cashFlowProjectViewPayload.js +1 -0
  36. package/lib/esm/view/cashFlowProjectView/cashFlowProjectViewReducer.js +125 -0
  37. package/lib/esm/view/cashFlowProjectView/cashFlowProjectViewSelector.js +54 -0
  38. package/lib/esm/view/cashFlowProjectView/cashFlowProjectViewSelectorTypes.js +1 -0
  39. package/lib/esm/view/cashFlowProjectView/cashFlowProjectViewState.js +1 -0
  40. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +11 -29
  41. package/lib/esm/view/financeStatement/financeStatementSelector.js +21 -1
  42. package/lib/index.d.ts +11 -3
  43. package/lib/index.js +71 -48
  44. package/lib/reducer.d.ts +2 -0
  45. package/lib/reducer.js +6 -0
  46. package/lib/rootStateTypes.d.ts +4 -0
  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/cashFlow/cashFlowGroupedSectionOrder.d.ts +15 -0
  52. package/lib/view/cashFlow/cashFlowGroupedSectionOrder.js +50 -0
  53. package/lib/view/cashFlowClassesView/cashFlowClassesViewEpic.d.ts +6 -0
  54. package/lib/view/cashFlowClassesView/cashFlowClassesViewEpic.js +34 -0
  55. package/lib/view/cashFlowClassesView/cashFlowClassesViewPayload.d.ts +14 -0
  56. package/lib/view/cashFlowClassesView/cashFlowClassesViewPayload.js +2 -0
  57. package/lib/view/cashFlowClassesView/cashFlowClassesViewReducer.d.ts +34 -0
  58. package/lib/view/cashFlowClassesView/cashFlowClassesViewReducer.js +133 -0
  59. package/lib/view/cashFlowClassesView/cashFlowClassesViewSelector.d.ts +7 -0
  60. package/lib/view/cashFlowClassesView/cashFlowClassesViewSelector.js +57 -0
  61. package/lib/view/cashFlowClassesView/cashFlowClassesViewSelectorTypes.d.ts +15 -0
  62. package/lib/view/cashFlowClassesView/cashFlowClassesViewSelectorTypes.js +2 -0
  63. package/lib/view/cashFlowClassesView/cashFlowClassesViewState.d.ts +23 -0
  64. package/lib/view/cashFlowClassesView/cashFlowClassesViewState.js +2 -0
  65. package/lib/view/cashFlowClassesView/cashFlowForTimeframeClassesViewEpic.d.ts +9 -0
  66. package/lib/view/cashFlowClassesView/cashFlowForTimeframeClassesViewEpic.js +60 -0
  67. package/lib/view/cashFlowProjectView/cashFlowForTimeframeProjectViewEpic.d.ts +10 -0
  68. package/lib/view/cashFlowProjectView/cashFlowForTimeframeProjectViewEpic.js +62 -0
  69. package/lib/view/cashFlowProjectView/cashFlowProjectViewEpic.d.ts +6 -0
  70. package/lib/view/cashFlowProjectView/cashFlowProjectViewEpic.js +34 -0
  71. package/lib/view/cashFlowProjectView/cashFlowProjectViewPayload.d.ts +14 -0
  72. package/lib/view/cashFlowProjectView/cashFlowProjectViewPayload.js +2 -0
  73. package/lib/view/cashFlowProjectView/cashFlowProjectViewReducer.d.ts +33 -0
  74. package/lib/view/cashFlowProjectView/cashFlowProjectViewReducer.js +129 -0
  75. package/lib/view/cashFlowProjectView/cashFlowProjectViewSelector.d.ts +7 -0
  76. package/lib/view/cashFlowProjectView/cashFlowProjectViewSelector.js +58 -0
  77. package/lib/view/cashFlowProjectView/cashFlowProjectViewSelectorTypes.d.ts +19 -0
  78. package/lib/view/cashFlowProjectView/cashFlowProjectViewSelectorTypes.js +2 -0
  79. package/lib/view/cashFlowProjectView/cashFlowProjectViewState.d.ts +22 -0
  80. package/lib/view/cashFlowProjectView/cashFlowProjectViewState.js +2 -0
  81. package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
  82. package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
  83. package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
  84. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +11 -29
  85. package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
  86. package/lib/view/financeStatement/financeStatementSelector.d.ts +4 -0
  87. package/lib/view/financeStatement/financeStatementSelector.js +21 -1
  88. package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
  89. package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
  90. package/lib/view/reportsResync/reportsResyncReducer.d.ts +2 -2
  91. package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
  92. package/lib/view/topEx/topExSelector.d.ts +1 -1
  93. package/package.json +1 -1
package/lib/reducer.d.ts CHANGED
@@ -33,6 +33,8 @@ declare const reducers: import("redux").Reducer<import("redux").CombinedState<{
33
33
  cardUserOnboardingState: import("./view/spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingState").CardUserOnboardingState;
34
34
  cashbackDetailState: import("./view/spendManagement/chargeCards/cashbackDetail/cashbackDetailState").CashbackDetailState;
35
35
  cashBalanceState: import(".").CashBalanceState;
36
+ cashFlowClassesViewState: import("./view/cashFlowClassesView/cashFlowClassesViewState").CashFlowClassesViewState;
37
+ cashFlowProjectViewState: import("./view/cashFlowProjectView/cashFlowProjectViewState").CashFlowProjectViewState;
36
38
  cashFlowState: import("./view/cashFlow/cashFlowState").CashFlowState;
37
39
  cashInCashOutState: import("./view/cashInCashOut/cashInCashOutState").CashInCashOutState;
38
40
  cashPositionState: import("./view/cashPosition/cashPositionState").CashPositionState;
package/lib/reducer.js CHANGED
@@ -138,6 +138,8 @@ const cardBalanceReducer_1 = __importStar(require("./view/cardBalance/cardBalanc
138
138
  const cardPaymentViewReducer_1 = __importStar(require("./view/cardPayment/cardPaymentViewReducer"));
139
139
  const cashBalanceReducer_1 = __importStar(require("./view/cashBalance/cashBalanceReducer"));
140
140
  const cashFlowReducer_1 = __importStar(require("./view/cashFlow/cashFlowReducer"));
141
+ const cashFlowClassesViewReducer_1 = __importStar(require("./view/cashFlowClassesView/cashFlowClassesViewReducer"));
142
+ const cashFlowProjectViewReducer_1 = __importStar(require("./view/cashFlowProjectView/cashFlowProjectViewReducer"));
141
143
  const cashInCashOutReducer_1 = __importStar(require("./view/cashInCashOut/cashInCashOutReducer"));
142
144
  const cashPositionReducer_1 = __importStar(require("./view/cashPosition/cashPositionReducer"));
143
145
  const classListReducer_1 = __importStar(require("./view/classList/classListReducer"));
@@ -436,6 +438,8 @@ const initialViewsState = {
436
438
  cardUserOnboardingState: cardUserOnboardingReducer_1.initialState,
437
439
  cashbackDetailState: cashbackDetailReducer_1.initialState,
438
440
  cashBalanceState: cashBalanceReducer_1.initialState,
441
+ cashFlowClassesViewState: cashFlowClassesViewReducer_1.initialState,
442
+ cashFlowProjectViewState: cashFlowProjectViewReducer_1.initialState,
439
443
  cashFlowState: cashFlowReducer_1.initialState,
440
444
  cashInCashOutState: cashInCashOutReducer_1.initialState,
441
445
  cashPositionState: cashPositionReducer_1.initialState,
@@ -730,6 +734,8 @@ const viewReducers = {
730
734
  cardUserOnboardingState: cardUserOnboardingReducer_1.default,
731
735
  cashbackDetailState: cashbackDetailReducer_1.default,
732
736
  cashBalanceState: cashBalanceReducer_1.default,
737
+ cashFlowClassesViewState: cashFlowClassesViewReducer_1.default,
738
+ cashFlowProjectViewState: cashFlowProjectViewReducer_1.default,
733
739
  cashFlowState: cashFlowReducer_1.default,
734
740
  cashInCashOutState: cashInCashOutReducer_1.default,
735
741
  cashPositionState: cashPositionReducer_1.default,
@@ -98,6 +98,8 @@ import { CardBalanceState } from './view/cardBalance/cardBalanceState';
98
98
  import { CardPaymentViewState } from './view/cardPayment/cardPaymentViewState';
99
99
  import { CashBalanceState } from './view/cashBalance/cashBalanceState';
100
100
  import { CashFlowState } from './view/cashFlow/cashFlowState';
101
+ import { CashFlowClassesViewState } from './view/cashFlowClassesView/cashFlowClassesViewState';
102
+ import { CashFlowProjectViewState } from './view/cashFlowProjectView/cashFlowProjectViewState';
101
103
  import { CashInCashOutState } from './view/cashInCashOut/cashInCashOutState';
102
104
  import { CashPositionState } from './view/cashPosition/cashPositionState';
103
105
  import { ClassListState } from './view/classList/classListState';
@@ -393,6 +395,8 @@ export type ViewsState = {
393
395
  cardUserOnboardingState: CardUserOnboardingState;
394
396
  cashbackDetailState: CashbackDetailState;
395
397
  cashBalanceState: CashBalanceState;
398
+ cashFlowClassesViewState: CashFlowClassesViewState;
399
+ cashFlowProjectViewState: CashFlowProjectViewState;
396
400
  cashFlowState: CashFlowState;
397
401
  cashInCashOutState: CashInCashOutState;
398
402
  cashPositionState: CashPositionState;
@@ -5,7 +5,7 @@ import { ZeniDate } from '../../zeniDayJS';
5
5
  import { AuditSummary } from '../reviewCompanyView/reviewCompanyViewState';
6
6
  export declare const toAuditRuleEntityType: (v: string) => "dashboard" | "transactions" | "reports";
7
7
  export type AuditRuleEntityType = ReturnType<typeof toAuditRuleEntityType>;
8
- declare const toAuditRuleEntityIdType: (v: string) => "vendor" | "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "operating_expenses_by_projects" | "revenue" | "revenue_by_classes" | "revenue_by_projects" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "net_burn_or_income_by_projects" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "balance_sheet_by_classes" | "balance_sheet_by_projects" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "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" | "transfer_accounts" | "credit_card_transfer_accounts" | "uncategorized-expense" | "uncategorized-income";
8
+ declare const toAuditRuleEntityIdType: (v: string) => "vendor" | "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "operating_expenses_by_projects" | "revenue" | "revenue_by_classes" | "revenue_by_projects" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "net_burn_or_income_by_projects" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "balance_sheet_by_classes" | "balance_sheet_by_projects" | "cash_flow" | "cash_flow_by_classes" | "cash_flow_by_projects" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "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" | "transfer_accounts" | "credit_card_transfer_accounts" | "uncategorized-expense" | "uncategorized-income";
9
9
  export type AuditRuleEntityIdType = ReturnType<typeof toAuditRuleEntityIdType>;
10
10
  export declare const toAuditRuleTypeIdType: (v: string) => "business" | "accounting";
11
11
  type AuditRuleTypeIdType = ReturnType<typeof toAuditRuleTypeIdType>;
@@ -1,6 +1,6 @@
1
1
  import { RootState } from '../../rootStateTypes';
2
2
  export declare const getBillPayCardReport: (state: RootState) => {
3
- reportId: "vendor" | "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "operating_expenses_by_projects" | "revenue" | "revenue_by_classes" | "revenue_by_projects" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "net_burn_or_income_by_projects" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "balance_sheet_by_classes" | "balance_sheet_by_projects" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "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" | "transfer_accounts" | "credit_card_transfer_accounts";
3
+ reportId: "vendor" | "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "operating_expenses_by_projects" | "revenue" | "revenue_by_classes" | "revenue_by_projects" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "net_burn_or_income_by_projects" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "balance_sheet_by_classes" | "balance_sheet_by_projects" | "cash_flow" | "cash_flow_by_classes" | "cash_flow_by_projects" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "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" | "transfer_accounts" | "credit_card_transfer_accounts";
4
4
  reportTitle: string;
5
5
  version: string | number | undefined;
6
6
  fetchState: import("../..").FetchState;
@@ -1,6 +1,6 @@
1
1
  import { RootState } from '../../rootStateTypes';
2
2
  export declare const getCardBalance: (state: RootState) => {
3
- reportId: "vendor" | "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "operating_expenses_by_projects" | "revenue" | "revenue_by_classes" | "revenue_by_projects" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "net_burn_or_income_by_projects" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "balance_sheet_by_classes" | "balance_sheet_by_projects" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "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" | "transfer_accounts" | "credit_card_transfer_accounts";
3
+ reportId: "vendor" | "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "operating_expenses_by_projects" | "revenue" | "revenue_by_classes" | "revenue_by_projects" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "net_burn_or_income_by_projects" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "balance_sheet_by_classes" | "balance_sheet_by_projects" | "cash_flow" | "cash_flow_by_classes" | "cash_flow_by_projects" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "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" | "transfer_accounts" | "credit_card_transfer_accounts";
4
4
  reportTitle: string;
5
5
  version: string | number | undefined;
6
6
  status: import("../..").Status | undefined;
@@ -1,6 +1,6 @@
1
1
  import { RootState } from '../../rootStateTypes';
2
2
  export declare const getCashBalance: (state: RootState) => {
3
- reportId: "vendor" | "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "operating_expenses_by_projects" | "revenue" | "revenue_by_classes" | "revenue_by_projects" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "net_burn_or_income_by_projects" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "balance_sheet_by_classes" | "balance_sheet_by_projects" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "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" | "transfer_accounts" | "credit_card_transfer_accounts";
3
+ reportId: "vendor" | "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "operating_expenses_by_projects" | "revenue" | "revenue_by_classes" | "revenue_by_projects" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "net_burn_or_income_by_projects" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "balance_sheet_by_classes" | "balance_sheet_by_projects" | "cash_flow" | "cash_flow_by_classes" | "cash_flow_by_projects" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "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" | "transfer_accounts" | "credit_card_transfer_accounts";
4
4
  reportTitle: string;
5
5
  version: string | number | undefined;
6
6
  status: import("../..").Status | undefined;
@@ -0,0 +1,15 @@
1
+ import { CashFlowReportViewCalculatedSectionID, CashFlowReportViewID, CashFlowReportViewSectionID } from './cashFlowPayload';
2
+ export declare const CASH_FLOW_GROUPED_HIDDEN_IDS: CashFlowReportViewID[];
3
+ export declare const CASH_FLOW_GROUPED_OPERATING_IDS_IN_ORDER: ("operatingActivitiesAdjustments" | "operatingActivitiesTotal" | "operatingActivitiesNetIncome")[];
4
+ export declare const CASH_FLOW_GROUPED_INVESTING_IDS_IN_ORDER: ("investingActivities" | "investingActivitiesTotal")[];
5
+ export declare const CASH_FLOW_GROUPED_FINANCING_IDS_IN_ORDER: ("financingActivities" | "cashAndEquivalentsOpeningBalance" | "cashAndEquivalentsClosingBalance" | "changeInCashAndEquivalents" | "financingActivitiesTotal")[];
6
+ export declare const CASH_FLOW_GROUPED_IDS_IN_ORDER: CashFlowReportViewID[];
7
+ export declare const CASH_FLOW_GROUPED_SECTION_IDS: CashFlowReportViewSectionID[];
8
+ export type CashFlowGroupedBreakdownID = CashFlowReportViewSectionID | CashFlowReportViewCalculatedSectionID;
9
+ export declare const CASH_FLOW_GROUPED_CALCULATED_IDS: CashFlowReportViewCalculatedSectionID[];
10
+ /**
11
+ * Rows rendered with a per-class/per-project breakdown: the account sections
12
+ * plus the aggregates the response groups. Derived from the two lists above so a
13
+ * new grouped aggregate only has to be added once.
14
+ */
15
+ export declare const CASH_FLOW_GROUPED_BREAKDOWN_IDS: CashFlowGroupedBreakdownID[];
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CASH_FLOW_GROUPED_BREAKDOWN_IDS = exports.CASH_FLOW_GROUPED_CALCULATED_IDS = exports.CASH_FLOW_GROUPED_SECTION_IDS = exports.CASH_FLOW_GROUPED_IDS_IN_ORDER = exports.CASH_FLOW_GROUPED_FINANCING_IDS_IN_ORDER = exports.CASH_FLOW_GROUPED_INVESTING_IDS_IN_ORDER = exports.CASH_FLOW_GROUPED_OPERATING_IDS_IN_ORDER = exports.CASH_FLOW_GROUPED_HIDDEN_IDS = void 0;
4
+ const cashFlowSelectorTypes_1 = require("./cashFlowSelectorTypes");
5
+ // Opening and closing cash balances are omitted from the grouped views: the
6
+ // backend cannot attribute a bank balance to a class or project (see
7
+ // cash_flow_group_by_class_report_v2), so the response does not carry them.
8
+ exports.CASH_FLOW_GROUPED_HIDDEN_IDS = [
9
+ 'cashAndEquivalentsOpeningBalance',
10
+ 'cashAndEquivalentsClosingBalance',
11
+ ];
12
+ const isShownInGroupedView = (id) => exports.CASH_FLOW_GROUPED_HIDDEN_IDS.includes(id) === false;
13
+ const byDisplayOrder = (a, b) => cashFlowSelectorTypes_1.cashFlowSectionIdsInOrder.indexOf(a) - cashFlowSelectorTypes_1.cashFlowSectionIdsInOrder.indexOf(b);
14
+ exports.CASH_FLOW_GROUPED_OPERATING_IDS_IN_ORDER = [
15
+ ...cashFlowSelectorTypes_1.ALL_CASHFLOW_OPERATING_ACTIVITIES_IDS,
16
+ ]
17
+ .filter(isShownInGroupedView)
18
+ .sort(byDisplayOrder);
19
+ exports.CASH_FLOW_GROUPED_INVESTING_IDS_IN_ORDER = [
20
+ ...cashFlowSelectorTypes_1.ALL_CASHFLOW_INVESTING_ACTIVITIES_IDS,
21
+ ]
22
+ .filter(isShownInGroupedView)
23
+ .sort(byDisplayOrder);
24
+ exports.CASH_FLOW_GROUPED_FINANCING_IDS_IN_ORDER = [
25
+ ...cashFlowSelectorTypes_1.ALL_CASHFLOW_FINANCING_ACTIVITIES_IDS,
26
+ ]
27
+ .filter(isShownInGroupedView)
28
+ .sort(byDisplayOrder);
29
+ exports.CASH_FLOW_GROUPED_IDS_IN_ORDER = cashFlowSelectorTypes_1.cashFlowSectionIdsInOrder.filter(isShownInGroupedView);
30
+ // The grouped response carries per-class/per-project balances only for these
31
+ // three; every other row on the report is a rollup computed in the selectors.
32
+ exports.CASH_FLOW_GROUPED_SECTION_IDS = [
33
+ 'operatingActivitiesAdjustments',
34
+ 'investingActivities',
35
+ 'financingActivities',
36
+ ];
37
+ exports.CASH_FLOW_GROUPED_CALCULATED_IDS = [
38
+ 'operatingActivitiesNetIncome',
39
+ 'operatingActivitiesTotal',
40
+ 'changeInCashAndEquivalents',
41
+ ];
42
+ /**
43
+ * Rows rendered with a per-class/per-project breakdown: the account sections
44
+ * plus the aggregates the response groups. Derived from the two lists above so a
45
+ * new grouped aggregate only has to be added once.
46
+ */
47
+ exports.CASH_FLOW_GROUPED_BREAKDOWN_IDS = [
48
+ ...exports.CASH_FLOW_GROUPED_SECTION_IDS,
49
+ ...exports.CASH_FLOW_GROUPED_CALCULATED_IDS,
50
+ ];
@@ -0,0 +1,6 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { RootState } from '../../reducer';
4
+ import { fetchCashFlowClassesView, fetchCashFlowForTimeframeClassesView } from './cashFlowClassesViewReducer';
5
+ export type ActionType = ReturnType<typeof fetchCashFlowClassesView> | ReturnType<typeof fetchCashFlowForTimeframeClassesView>;
6
+ export declare const fetchCashFlowClassesViewEpic: (actions$: ActionsObservable<ActionType>, state: StateObservable<RootState>) => Observable<ActionType>;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fetchCashFlowClassesViewEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const cashFlowClassesViewReducer_1 = require("./cashFlowClassesViewReducer");
7
+ const fetchCashFlowClassesViewEpic = (actions$, state) => actions$.pipe((0, operators_1.filter)(cashFlowClassesViewReducer_1.fetchCashFlowClassesView.match), (0, operators_1.switchMap)((action) => {
8
+ const { cacheOverride } = action.payload;
9
+ if (cacheOverride === true) {
10
+ return (0, rxjs_1.from)([
11
+ (0, cashFlowClassesViewReducer_1.fetchCashFlowForTimeframeClassesView)('month', true),
12
+ (0, cashFlowClassesViewReducer_1.fetchCashFlowForTimeframeClassesView)('quarter', true),
13
+ (0, cashFlowClassesViewReducer_1.fetchCashFlowForTimeframeClassesView)('year', true),
14
+ ]);
15
+ }
16
+ else {
17
+ const fetchActions = [];
18
+ const classFetchState = state.value.cashFlowClassesViewState.fetchState;
19
+ if (classFetchState['month'].fetchState !== 'In-Progress' &&
20
+ classFetchState['month'].fetchState !== 'Completed') {
21
+ fetchActions.push((0, cashFlowClassesViewReducer_1.fetchCashFlowForTimeframeClassesView)('month'));
22
+ }
23
+ if (classFetchState['quarter'].fetchState !== 'In-Progress' &&
24
+ classFetchState['quarter'].fetchState !== 'Completed') {
25
+ fetchActions.push((0, cashFlowClassesViewReducer_1.fetchCashFlowForTimeframeClassesView)('quarter'));
26
+ }
27
+ if (classFetchState['year'].fetchState !== 'In-Progress' &&
28
+ classFetchState['year'].fetchState !== 'Completed') {
29
+ fetchActions.push((0, cashFlowClassesViewReducer_1.fetchCashFlowForTimeframeClassesView)('year'));
30
+ }
31
+ return (0, rxjs_1.from)(fetchActions);
32
+ }
33
+ }));
34
+ exports.fetchCashFlowClassesViewEpic = fetchCashFlowClassesViewEpic;
@@ -0,0 +1,14 @@
1
+ import { ReportByClassMetadataPayloadV2, SectionByClassCOABalanceGroupedPayloadV2 } from '../../commonPayloadTypes/classesView/reportByClassPayloadV2';
2
+ import { ZeniReportResponse } from '../../responsePayload';
3
+ interface OperatingActivitiesClassesView {
4
+ adjustments: SectionByClassCOABalanceGroupedPayloadV2;
5
+ net_income: SectionByClassCOABalanceGroupedPayloadV2;
6
+ }
7
+ export interface CashFlowClassesViewPayload extends ReportByClassMetadataPayloadV2 {
8
+ change_in_cash_and_equivalents: SectionByClassCOABalanceGroupedPayloadV2;
9
+ financing_activities: SectionByClassCOABalanceGroupedPayloadV2;
10
+ investing_activities: SectionByClassCOABalanceGroupedPayloadV2;
11
+ operating_activities: SectionByClassCOABalanceGroupedPayloadV2 & OperatingActivitiesClassesView;
12
+ }
13
+ export type CashFlowReportClassesViewResponse = ZeniReportResponse<CashFlowClassesViewPayload>;
14
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,34 @@
1
+ import { NestedClassID } from '../../commonStateTypes/classesView/nestedClassID';
2
+ import { AccountViewMode, ID } from '../../commonStateTypes/common';
3
+ import { ZeniAPIStatus, ZeniReportData } from '../../responsePayload';
4
+ import { CashFlowClassesViewPayload } from './cashFlowClassesViewPayload';
5
+ import { CashFlowClassesViewState } from './cashFlowClassesViewState';
6
+ export declare const initialState: CashFlowClassesViewState;
7
+ export declare const fetchCashFlowClassesView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: boolean | undefined], {
8
+ cacheOverride: boolean;
9
+ }, "cashFlowClassesView/fetchCashFlowClassesView", never, never>, fetchCashFlowForTimeframeClassesView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[timeframe: "month" | "year" | "quarter", cacheOverride?: boolean | undefined], {
10
+ timeframe: "month" | "year" | "quarter";
11
+ cacheOverride: boolean;
12
+ }, "cashFlowClassesView/fetchCashFlowForTimeframeClassesView", never, never>, updateCashFlowForTimeframeClassesView: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
13
+ report: ZeniReportData<CashFlowClassesViewPayload>;
14
+ timeframe: "month" | "quarter" | "year";
15
+ }, "cashFlowClassesView/updateCashFlowForTimeframeClassesView">, updateCashFlowForTimeframeClassesViewFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>, timeframe: "month" | "year" | "quarter"], {
16
+ error: ZeniAPIStatus<Record<string, unknown>>;
17
+ timeframe: "month" | "year" | "quarter";
18
+ }, "cashFlowClassesView/updateCashFlowForTimeframeClassesViewFailure", never, never>, updateCashFlowClassesToFilterOut: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
19
+ classesToFilterOut: NestedClassID[];
20
+ }, "cashFlowClassesView/updateCashFlowClassesToFilterOut">, updateCashFlowClassesViewUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
21
+ nodeCollapseState?: {
22
+ isCollapsed: boolean;
23
+ nodeId: ID;
24
+ };
25
+ resetLeftScroll?: boolean;
26
+ scrollPosition?: {
27
+ scrollTop: number;
28
+ scrollLeft?: number;
29
+ };
30
+ }, "cashFlowClassesView/updateCashFlowClassesViewUIState">, updateCashFlowClassesViewAccountViewMode: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
31
+ viewMode: AccountViewMode;
32
+ }, "cashFlowClassesView/updateCashFlowClassesViewAccountViewMode">, resetCashFlowClassesNodeCollapseState: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"cashFlowClassesView/resetCashFlowClassesNodeCollapseState">;
33
+ declare const _default: import("redux").Reducer<CashFlowClassesViewState>;
34
+ export default _default;
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+ var _a;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.resetCashFlowClassesNodeCollapseState = exports.updateCashFlowClassesViewAccountViewMode = exports.updateCashFlowClassesViewUIState = exports.updateCashFlowClassesToFilterOut = exports.updateCashFlowForTimeframeClassesViewFailure = exports.updateCashFlowForTimeframeClassesView = exports.fetchCashFlowForTimeframeClassesView = exports.fetchCashFlowClassesView = exports.initialState = void 0;
5
+ const toolkit_1 = require("@reduxjs/toolkit");
6
+ const viewAndReportPayloadv2_1 = require("../../commonPayloadTypes/v2/viewAndReportPayloadv2");
7
+ const getNestedClassIDHierarchyForReport_1 = require("../../commonStateTypes/classesView/getNestedClassIDHierarchyForReport");
8
+ const classPayload_1 = require("../../entity/class/classPayload");
9
+ const rootActions_1 = require("../../rootActions");
10
+ exports.initialState = {
11
+ classHierarchy: [],
12
+ bookCloseDate: undefined,
13
+ fetchState: {
14
+ month: {
15
+ fetchState: 'Not-Started',
16
+ error: undefined,
17
+ },
18
+ quarter: {
19
+ fetchState: 'Not-Started',
20
+ error: undefined,
21
+ },
22
+ year: {
23
+ fetchState: 'Not-Started',
24
+ error: undefined,
25
+ },
26
+ },
27
+ uiState: {
28
+ nodeCollapseState: {},
29
+ scrollPosition: undefined,
30
+ accountViewMode: 'account_group',
31
+ classesToFilterOut: [],
32
+ },
33
+ firstMonthOfFY: 1,
34
+ reportId: 'cash_flow_by_classes',
35
+ reportTitle: 'cash_flow_by_classes',
36
+ };
37
+ const cashFlowClassesView = (0, toolkit_1.createSlice)({
38
+ name: 'cashFlowClassesView',
39
+ initialState: exports.initialState,
40
+ reducers: {
41
+ fetchCashFlowClassesView: {
42
+ prepare(cacheOverride = false) {
43
+ return { payload: { cacheOverride } };
44
+ },
45
+ reducer(
46
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
47
+ _draft,
48
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
49
+ _action) {
50
+ // nothing to do here
51
+ },
52
+ },
53
+ fetchCashFlowForTimeframeClassesView: {
54
+ prepare(timeframe, cacheOverride = false) {
55
+ return { payload: { timeframe, cacheOverride } };
56
+ },
57
+ reducer(draft, action) {
58
+ const timeframe = action.payload.timeframe;
59
+ draft.fetchState[timeframe].fetchState = 'In-Progress';
60
+ draft.fetchState[timeframe].error = undefined;
61
+ },
62
+ },
63
+ updateCashFlowForTimeframeClassesView(draft, action) {
64
+ doUpdateCashFlowClassesView(draft, action.payload.timeframe, action.payload.report);
65
+ },
66
+ updateCashFlowForTimeframeClassesViewFailure: {
67
+ prepare(error, timeframe) {
68
+ return {
69
+ payload: {
70
+ error,
71
+ timeframe,
72
+ },
73
+ };
74
+ },
75
+ reducer(draft, action) {
76
+ draft.fetchState[action.payload.timeframe] = {
77
+ fetchState: 'Error',
78
+ error: action.payload.error,
79
+ };
80
+ },
81
+ },
82
+ updateCashFlowClassesToFilterOut(draft, action) {
83
+ draft.uiState.classesToFilterOut = action.payload.classesToFilterOut;
84
+ },
85
+ updateCashFlowClassesViewUIState(draft, action) {
86
+ const { nodeCollapseState, scrollPosition, resetLeftScroll } = action.payload;
87
+ if (nodeCollapseState != null) {
88
+ draft.uiState.nodeCollapseState = Object.assign({}, draft.uiState.nodeCollapseState, {
89
+ [nodeCollapseState.nodeId]: nodeCollapseState.isCollapsed,
90
+ });
91
+ }
92
+ // Mutually exclusive: resetLeftScroll clears only scrollLeft from the
93
+ // recorded position, scrollPosition replaces the whole record.
94
+ if (resetLeftScroll === true && draft.uiState.scrollPosition != null) {
95
+ draft.uiState.scrollPosition.scrollLeft = undefined;
96
+ }
97
+ else if (scrollPosition != null) {
98
+ draft.uiState.scrollPosition = scrollPosition;
99
+ }
100
+ },
101
+ updateCashFlowClassesViewAccountViewMode(draft, action) {
102
+ draft.uiState.accountViewMode = action.payload.viewMode;
103
+ },
104
+ resetCashFlowClassesNodeCollapseState(draft) {
105
+ draft.uiState.nodeCollapseState = {};
106
+ },
107
+ },
108
+ extraReducers: (builder) => {
109
+ builder.addCase(rootActions_1.clearAll, (draft) => {
110
+ Object.assign(draft, exports.initialState);
111
+ });
112
+ },
113
+ });
114
+ _a = cashFlowClassesView.actions, exports.fetchCashFlowClassesView = _a.fetchCashFlowClassesView, exports.fetchCashFlowForTimeframeClassesView = _a.fetchCashFlowForTimeframeClassesView, exports.updateCashFlowForTimeframeClassesView = _a.updateCashFlowForTimeframeClassesView, exports.updateCashFlowForTimeframeClassesViewFailure = _a.updateCashFlowForTimeframeClassesViewFailure, exports.updateCashFlowClassesToFilterOut = _a.updateCashFlowClassesToFilterOut, exports.updateCashFlowClassesViewUIState = _a.updateCashFlowClassesViewUIState, exports.updateCashFlowClassesViewAccountViewMode = _a.updateCashFlowClassesViewAccountViewMode, exports.resetCashFlowClassesNodeCollapseState = _a.resetCashFlowClassesNodeCollapseState;
115
+ exports.default = cashFlowClassesView.reducer;
116
+ const doUpdateCashFlowClassesView = (draft, timeframe, cashFlowReport) => {
117
+ const report = (0, viewAndReportPayloadv2_1.mapReportPayloadV2ToReportV2)(cashFlowReport.report);
118
+ draft.currency = report.currency;
119
+ draft.dataAvailable = report.dataAvailable;
120
+ draft.firstMonthOfFY = report.firstMonthOfFY;
121
+ draft.bookCloseDate = report.bookCloseDate;
122
+ draft.status = report.status;
123
+ draft.fetchState[timeframe].fetchState = 'Completed';
124
+ draft.fetchState[timeframe].error = undefined;
125
+ const classMetadata = cashFlowReport.report.classes.map((eachClass) => (0, classPayload_1.toClassMetadata)(eachClass));
126
+ // Populated once and then left alone, so a per-timeframe response cannot
127
+ // clobber a hierarchy built from a full one. A class added mid-session is
128
+ // therefore not picked up until the store is cleared, even by a hard refresh —
129
+ // the same trade-off profitAndLossClassesViewReducer makes.
130
+ if (draft.classHierarchy.length <= 0) {
131
+ draft.classHierarchy = (0, getNestedClassIDHierarchyForReport_1.geNestedClassIDHierarchyForReport)(classMetadata);
132
+ }
133
+ };
@@ -0,0 +1,7 @@
1
+ import { COABalancesFilterClassesView } from '../../commonStateTypes/coaBalance/coaBalancesFilterClassesView';
2
+ import { AccountState } from '../../entity/account/accountState';
3
+ import { ClassState } from '../../entity/class/classState';
4
+ import { SectionClassesViewStateV2 } from '../../entity/sectionClassesViewV2/sectionClassesViewState';
5
+ import { CashFlowClassesViewReport } from './cashFlowClassesViewSelectorTypes';
6
+ import { CashFlowClassesViewState } from './cashFlowClassesViewState';
7
+ export declare const getCashFlowClassesView: (filter: COABalancesFilterClassesView, accountState: AccountState, classState: ClassState, sectionsState: SectionClassesViewStateV2, cashFlowClassesViewState: CashFlowClassesViewState) => CashFlowClassesViewReport;
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getCashFlowClassesView = void 0;
4
+ const getCOABalancesSlice_1 = require("../../commonStateTypes/coaBalance/getCOABalancesSlice");
5
+ const reduceFetchState_1 = require("../../commonStateTypes/reduceFetchState");
6
+ const sectionClassesViewSelector_1 = require("../../entity/sectionClassesViewV2/sectionClassesViewSelector");
7
+ const cashFlowGroupedSectionOrder_1 = require("../cashFlow/cashFlowGroupedSectionOrder");
8
+ const getCashFlowClassesView = (filter, accountState, classState, sectionsState, cashFlowClassesViewState) => {
9
+ const fetchState = (0, reduceFetchState_1.reduceFetchStateParallelTimeframes)([
10
+ cashFlowClassesViewState.fetchState.month,
11
+ cashFlowClassesViewState.fetchState.quarter,
12
+ cashFlowClassesViewState.fetchState.year,
13
+ ]);
14
+ const reportId = 'cash_flow_by_classes';
15
+ const sections = {};
16
+ const calculatedSections = {};
17
+ if (fetchState.fetchState === 'Completed') {
18
+ cashFlowGroupedSectionOrder_1.CASH_FLOW_GROUPED_BREAKDOWN_IDS.forEach((sectionId) => {
19
+ sections[sectionId] = (0, sectionClassesViewSelector_1.getSectionClassesViewReport)(accountState, classState, sectionsState, { reportId, sectionId }, filter);
20
+ });
21
+ // These come back grouped, so each figure is read through the section layer
22
+ // and arrives already pruned by the class/project picker — the same source
23
+ // the breakdown rows above render from, so the two can never disagree.
24
+ cashFlowGroupedSectionOrder_1.CASH_FLOW_GROUPED_CALCULATED_IDS.forEach((calculatedSectionId) => {
25
+ calculatedSections[calculatedSectionId] = (0, getCOABalancesSlice_1.getCOABalances)(
26
+ // Already built by the breakdown loop above; rebuilding it would repeat
27
+ // the whole section walk on every recompute.
28
+ sections[calculatedSectionId].sectionBalancesTotalByPeriod, filter);
29
+ });
30
+ calculatedSections['investingActivitiesTotal'] = (0, getCOABalancesSlice_1.getCOABalances)(sections['investingActivities'].sectionBalancesTotalByPeriod, filter);
31
+ calculatedSections['financingActivitiesTotal'] = (0, getCOABalancesSlice_1.getCOABalances)(sections['financingActivities'].sectionBalancesTotalByPeriod, filter);
32
+ }
33
+ return {
34
+ sections,
35
+ calculatedSections,
36
+ fetchState: fetchState.fetchState,
37
+ error: fetchState.error,
38
+ filter,
39
+ uiState: cashFlowClassesViewState.uiState,
40
+ classHierarchy: cashFlowClassesViewState.classHierarchy,
41
+ classesToFilterOut: cashFlowClassesViewState.uiState.classesToFilterOut,
42
+ reportId: cashFlowClassesViewState.reportId,
43
+ reportTitle: cashFlowClassesViewState.reportTitle,
44
+ firstMonthOfFY: cashFlowClassesViewState.firstMonthOfFY,
45
+ dataAvailable: cashFlowClassesViewState.dataAvailable,
46
+ bookCloseDate: cashFlowClassesViewState.bookCloseDate,
47
+ version: cashFlowClassesViewState.version,
48
+ status: cashFlowClassesViewState.status,
49
+ idsInOrder: cashFlowGroupedSectionOrder_1.CASH_FLOW_GROUPED_IDS_IN_ORDER,
50
+ rootSectionsWithSubSectionIds: {
51
+ operatingActivities: cashFlowGroupedSectionOrder_1.CASH_FLOW_GROUPED_OPERATING_IDS_IN_ORDER,
52
+ investingActivities: cashFlowGroupedSectionOrder_1.CASH_FLOW_GROUPED_INVESTING_IDS_IN_ORDER,
53
+ financingActivities: cashFlowGroupedSectionOrder_1.CASH_FLOW_GROUPED_FINANCING_IDS_IN_ORDER,
54
+ },
55
+ };
56
+ };
57
+ exports.getCashFlowClassesView = getCashFlowClassesView;
@@ -0,0 +1,15 @@
1
+ import { ClassesViewSelectorReportV2 } from '../../commonStateTypes/selectorTypes/classesViewSelectorReport';
2
+ import { SectionClassesViewReportV2 } from '../../entity/sectionClassesViewV2/sectionClassesViewSelectorTypes';
3
+ import { CashFlowReportViewCalculatedSectionID, CashFlowReportViewSectionID } from '../cashFlow/cashFlowPayload';
4
+ import { SectionIdsWithSubSectionIds } from '../cashFlow/cashFlowSelectorTypes';
5
+ import { CashFlowClassesViewUIState } from './cashFlowClassesViewState';
6
+ export interface CashFlowClassesViewReport extends ClassesViewSelectorReportV2<CashFlowReportViewSectionID, CashFlowReportViewCalculatedSectionID> {
7
+ rootSectionsWithSubSectionIds: SectionIdsWithSubSectionIds;
8
+ /**
9
+ * Widened over the base: the response groups net income, the operating total
10
+ * and change in cash too, so those calculated ids also arrive as sections and
11
+ * their rows render with a per-class breakdown.
12
+ */
13
+ sections: Record<CashFlowReportViewSectionID, SectionClassesViewReportV2> & Partial<Record<CashFlowReportViewCalculatedSectionID, SectionClassesViewReportV2>>;
14
+ uiState: CashFlowClassesViewUIState;
15
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,23 @@
1
+ import { Currency } from '../../commonStateTypes/amount';
2
+ import { NestedClassHierarchyForReport, NestedClassID } from '../../commonStateTypes/classesView/nestedClassID';
3
+ import { AccountViewMode, FetchStateAndError, ID } from '../../commonStateTypes/common';
4
+ import { Report } from '../../commonStateTypes/viewAndReport/viewAndReport';
5
+ export interface CashFlowClassesViewUIState {
6
+ accountViewMode: AccountViewMode;
7
+ classesToFilterOut: NestedClassID[];
8
+ nodeCollapseState: Record<ID, boolean>;
9
+ scrollPosition: {
10
+ scrollTop: number;
11
+ scrollLeft?: number;
12
+ } | undefined;
13
+ }
14
+ export interface CashFlowClassesViewState extends Report {
15
+ classHierarchy: NestedClassHierarchyForReport[];
16
+ fetchState: {
17
+ month: FetchStateAndError;
18
+ quarter: FetchStateAndError;
19
+ year: FetchStateAndError;
20
+ };
21
+ uiState: CashFlowClassesViewUIState;
22
+ currency?: Currency;
23
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { Observable } from 'rxjs';
3
+ import { updateSectionClassesView } from '../../entity/sectionClassesViewV2/sectionClassesViewReducer';
4
+ import { RootState } from '../../reducer';
5
+ import { ZeniAPI } from '../../zeniAPI';
6
+ import { fetchCashFlowForTimeframeClassesView, updateCashFlowForTimeframeClassesView, updateCashFlowForTimeframeClassesViewFailure } from './cashFlowClassesViewReducer';
7
+ export type ActionType = ReturnType<typeof fetchCashFlowForTimeframeClassesView> | ReturnType<typeof updateCashFlowForTimeframeClassesView> | ReturnType<typeof updateCashFlowForTimeframeClassesViewFailure> | ReturnType<typeof updateSectionClassesView>;
8
+ export declare const reportIdUniqueKey: () => "cash_flow_by_classes";
9
+ export declare const fetchCashFlowForTimeframeClassesViewEpic: (actions$: ActionsObservable<ActionType>, _: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fetchCashFlowForTimeframeClassesViewEpic = exports.reportIdUniqueKey = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const sectionClassesViewReducer_1 = require("../../entity/sectionClassesViewV2/sectionClassesViewReducer");
7
+ const responsePayload_1 = require("../../responsePayload");
8
+ const cashFlowPayload_1 = require("../cashFlow/cashFlowPayload");
9
+ const cashFlowClassesViewReducer_1 = require("./cashFlowClassesViewReducer");
10
+ const getTimeSeriesGroup = (timeframe) => {
11
+ switch (timeframe) {
12
+ case 'month':
13
+ return 'months';
14
+ case 'quarter':
15
+ return 'quarters';
16
+ case 'year':
17
+ return 'years';
18
+ }
19
+ };
20
+ const reportIdUniqueKey = () => 'cash_flow_by_classes';
21
+ exports.reportIdUniqueKey = reportIdUniqueKey;
22
+ const fetchCashFlowForTimeframeClassesViewEpic = (actions$, _, zeniAPI) => actions$.pipe((0, operators_1.filter)(cashFlowClassesViewReducer_1.fetchCashFlowForTimeframeClassesView.match), (0, operators_1.mergeMap)((action) => {
23
+ const queryValue = {
24
+ is_full_response: true,
25
+ time_series_groups: [getTimeSeriesGroup(action.payload.timeframe)],
26
+ is_group_by_class: true,
27
+ // Only sent when refreshing: the flag makes the backend bypass its saved
28
+ // report and regenerate, so a normal lookup must not carry it.
29
+ ...(action.payload.cacheOverride === true
30
+ ? { is_hard_refresh: true }
31
+ : {}),
32
+ };
33
+ return zeniAPI
34
+ .getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/2.0/reports/cash_flow?query=${encodeURIComponent(JSON.stringify(queryValue))}`)
35
+ .pipe((0, operators_1.mergeMap)((response) => {
36
+ if (response.data != null && (0, responsePayload_1.isSuccessResponse)(response)) {
37
+ const actions = [];
38
+ const { report } = response.data;
39
+ const currency = report.currency;
40
+ actions.push((0, sectionClassesViewReducer_1.updateSectionClassesView)(action.payload.timeframe, (0, cashFlowPayload_1.toCashFlowReportViewID)('adjustments'), (0, exports.reportIdUniqueKey)(), report.operating_activities.adjustments, report.classes, report.accounts, currency));
41
+ actions.push((0, sectionClassesViewReducer_1.updateSectionClassesView)(action.payload.timeframe, (0, cashFlowPayload_1.toCashFlowReportViewID)('investing_activities'), (0, exports.reportIdUniqueKey)(), report.investing_activities, report.classes, report.accounts, currency));
42
+ actions.push((0, sectionClassesViewReducer_1.updateSectionClassesView)(action.payload.timeframe, (0, cashFlowPayload_1.toCashFlowReportViewID)('financing_activities'), (0, exports.reportIdUniqueKey)(), report.financing_activities, report.classes, report.accounts, currency));
43
+ actions.push((0, sectionClassesViewReducer_1.updateSectionClassesView)(action.payload.timeframe, (0, cashFlowPayload_1.toCashFlowReportViewID)('net_income'), (0, exports.reportIdUniqueKey)(), report.operating_activities.net_income, report.classes, report.accounts, currency));
44
+ actions.push((0, sectionClassesViewReducer_1.updateSectionClassesView)(action.payload.timeframe, (0, cashFlowPayload_1.toCashFlowReportViewID)('operating_activities'), (0, exports.reportIdUniqueKey)(), report.operating_activities, report.classes, report.accounts, currency));
45
+ actions.push((0, sectionClassesViewReducer_1.updateSectionClassesView)(action.payload.timeframe, (0, cashFlowPayload_1.toCashFlowReportViewID)('change_in_cash_and_equivalents'), (0, exports.reportIdUniqueKey)(), report.change_in_cash_and_equivalents, report.classes, report.accounts, currency));
46
+ actions.push((0, cashFlowClassesViewReducer_1.updateCashFlowForTimeframeClassesView)({
47
+ timeframe: action.payload.timeframe,
48
+ report: response.data,
49
+ }));
50
+ return (0, rxjs_1.from)(actions);
51
+ }
52
+ else {
53
+ return (0, rxjs_1.of)((0, cashFlowClassesViewReducer_1.updateCashFlowForTimeframeClassesViewFailure)(response.status, action.payload.timeframe));
54
+ }
55
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, cashFlowClassesViewReducer_1.updateCashFlowForTimeframeClassesViewFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Cash Flow by Class REST API call errored out: ' +
56
+ (error instanceof Error
57
+ ? error.message
58
+ : JSON.stringify(error))), action.payload.timeframe))));
59
+ }));
60
+ exports.fetchCashFlowForTimeframeClassesViewEpic = fetchCashFlowForTimeframeClassesViewEpic;