@zeniai/client-epic-state 5.0.0-betaRD2 → 5.0.0

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 (130) hide show
  1. package/lib/commonPayloadTypes/subAccountView/reportBySubAccountPayload.d.ts +0 -2
  2. package/lib/commonStateTypes/common.d.ts +1 -1
  3. package/lib/commonStateTypes/viewAndReport/reportIDHelper.d.ts +0 -1
  4. package/lib/commonStateTypes/viewAndReport/reportIDHelper.js +1 -3
  5. package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
  6. package/lib/commonStateTypes/viewAndReport/viewAndReport.js +0 -1
  7. package/lib/entity/account/accountReducer.js +3 -5
  8. package/lib/entity/account/accountSelector.d.ts +0 -7
  9. package/lib/entity/account/accountSelector.js +2 -4
  10. package/lib/entity/account/accountState.d.ts +1 -3
  11. package/lib/entity/account/accountState.js +1 -4
  12. package/lib/entity/account/pickAndMergeForecastAccountReport.d.ts +0 -1
  13. package/lib/entity/account/subAccountSelector.d.ts +0 -2
  14. package/lib/entity/account/subAccountSelector.js +0 -2
  15. package/lib/entity/accountGroup/accountGroupSelector.d.ts +0 -22
  16. package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
  17. package/lib/entity/class/classReducer.d.ts +4 -4
  18. package/lib/entity/class/classState.d.ts +1 -1
  19. package/lib/entity/forecast/forecastState.d.ts +1 -1
  20. package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
  21. package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
  22. package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
  23. package/lib/entity/tenant/clearAllEpic.d.ts +2 -5
  24. package/lib/entity/tenant/clearAllEpic.js +0 -6
  25. package/lib/entity/tenant/tenantPayload.d.ts +0 -1
  26. package/lib/entity/tenant/tenantReducer.js +0 -1
  27. package/lib/entity/tenant/tenantSelector.d.ts +0 -1
  28. package/lib/entity/tenant/tenantSelector.js +1 -9
  29. package/lib/entity/tenant/tenantState.d.ts +0 -1
  30. package/lib/epic.d.ts +1 -4
  31. package/lib/epic.js +1 -4
  32. package/lib/esm/commonStateTypes/viewAndReport/reportIDHelper.js +0 -1
  33. package/lib/esm/commonStateTypes/viewAndReport/viewAndReport.js +0 -1
  34. package/lib/esm/entity/account/accountReducer.js +3 -5
  35. package/lib/esm/entity/account/accountSelector.js +2 -4
  36. package/lib/esm/entity/account/accountState.js +1 -4
  37. package/lib/esm/entity/account/subAccountSelector.js +0 -2
  38. package/lib/esm/entity/tenant/clearAllEpic.js +0 -6
  39. package/lib/esm/entity/tenant/tenantReducer.js +0 -1
  40. package/lib/esm/entity/tenant/tenantSelector.js +0 -7
  41. package/lib/esm/epic.js +1 -4
  42. package/lib/esm/index.js +4 -7
  43. package/lib/esm/reducer.js +0 -9
  44. package/lib/esm/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +1 -1
  45. package/lib/esm/view/financeStatement/financeStatementSelector.js +1 -12
  46. package/lib/esm/view/reportsResync/reportsClassViewRefetchingEpic.js +0 -4
  47. package/lib/index.d.ts +4 -11
  48. package/lib/index.js +34 -46
  49. package/lib/reducer.d.ts +0 -9
  50. package/lib/reducer.js +0 -9
  51. package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
  52. package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +1 -1
  53. package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
  54. package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
  55. package/lib/view/cardBalance/cardBalanceSelector.d.ts +1 -2
  56. package/lib/view/cashBalance/cashBalanceSelector.d.ts +1 -2
  57. package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
  58. package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
  59. package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
  60. package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
  61. package/lib/view/financeStatement/financeStatementSelector.d.ts +0 -2
  62. package/lib/view/financeStatement/financeStatementSelector.js +1 -12
  63. package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
  64. package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
  65. package/lib/view/reportsResync/reportsClassViewRefetchingEpic.d.ts +1 -2
  66. package/lib/view/reportsResync/reportsClassViewRefetchingEpic.js +0 -4
  67. package/lib/view/reportsResync/reportsResyncReducer.d.ts +2 -2
  68. package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
  69. package/lib/view/topEx/topExSelector.d.ts +1 -1
  70. package/package.json +1 -1
  71. package/lib/commonStateTypes/coaBalance/coaBalancesFilterProjectView.d.ts +0 -13
  72. package/lib/commonStateTypes/coaBalance/coaBalancesFilterProjectView.js +0 -9
  73. package/lib/commonStateTypes/projectView/projectViewParentID.d.ts +0 -5
  74. package/lib/commonStateTypes/projectView/projectViewParentID.js +0 -2
  75. package/lib/entity/project/projectPayload.d.ts +0 -13
  76. package/lib/entity/project/projectPayload.js +0 -30
  77. package/lib/entity/project/projectReducer.d.ts +0 -10
  78. package/lib/entity/project/projectReducer.js +0 -31
  79. package/lib/entity/project/projectSelector.d.ts +0 -5
  80. package/lib/entity/project/projectSelector.js +0 -12
  81. package/lib/entity/project/projectState.d.ts +0 -13
  82. package/lib/entity/project/projectState.js +0 -2
  83. package/lib/entity/sectionProjectView/sectionProjectView.d.ts +0 -11
  84. package/lib/entity/sectionProjectView/sectionProjectView.js +0 -6
  85. package/lib/entity/sectionProjectView/sectionProjectViewEpic.d.ts +0 -6
  86. package/lib/entity/sectionProjectView/sectionProjectViewEpic.js +0 -56
  87. package/lib/entity/sectionProjectView/sectionProjectViewHelper.d.ts +0 -10
  88. package/lib/entity/sectionProjectView/sectionProjectViewHelper.js +0 -14
  89. package/lib/entity/sectionProjectView/sectionProjectViewReducer.d.ts +0 -15
  90. package/lib/entity/sectionProjectView/sectionProjectViewReducer.js +0 -56
  91. package/lib/entity/sectionProjectView/sectionProjectViewSelector.d.ts +0 -11
  92. package/lib/entity/sectionProjectView/sectionProjectViewSelector.js +0 -94
  93. package/lib/entity/sectionProjectView/sectionProjectViewSelectorTypes.d.ts +0 -16
  94. package/lib/entity/sectionProjectView/sectionProjectViewSelectorTypes.js +0 -2
  95. package/lib/entity/sectionProjectView/sectionProjectViewState.d.ts +0 -4
  96. package/lib/entity/sectionProjectView/sectionProjectViewState.js +0 -2
  97. package/lib/esm/commonStateTypes/coaBalance/coaBalancesFilterProjectView.js +0 -5
  98. package/lib/esm/commonStateTypes/projectView/projectViewParentID.js +0 -1
  99. package/lib/esm/entity/project/projectPayload.js +0 -26
  100. package/lib/esm/entity/project/projectReducer.js +0 -27
  101. package/lib/esm/entity/project/projectSelector.js +0 -8
  102. package/lib/esm/entity/project/projectState.js +0 -1
  103. package/lib/esm/entity/sectionProjectView/sectionProjectView.js +0 -3
  104. package/lib/esm/entity/sectionProjectView/sectionProjectViewEpic.js +0 -52
  105. package/lib/esm/entity/sectionProjectView/sectionProjectViewHelper.js +0 -10
  106. package/lib/esm/entity/sectionProjectView/sectionProjectViewReducer.js +0 -52
  107. package/lib/esm/entity/sectionProjectView/sectionProjectViewSelector.js +0 -87
  108. package/lib/esm/entity/sectionProjectView/sectionProjectViewSelectorTypes.js +0 -1
  109. package/lib/esm/entity/sectionProjectView/sectionProjectViewState.js +0 -1
  110. package/lib/esm/view/profitAndLossProjectView/profitAndLossForTimeframeProjectViewEpic.js +0 -47
  111. package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewEpic.js +0 -30
  112. package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewPayload.js +0 -1
  113. package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewReducer.js +0 -113
  114. package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewSelector.js +0 -67
  115. package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewSelectorTypes.js +0 -1
  116. package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewState.js +0 -1
  117. package/lib/view/profitAndLossProjectView/profitAndLossForTimeframeProjectViewEpic.d.ts +0 -9
  118. package/lib/view/profitAndLossProjectView/profitAndLossForTimeframeProjectViewEpic.js +0 -51
  119. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewEpic.d.ts +0 -6
  120. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewEpic.js +0 -34
  121. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewPayload.d.ts +0 -33
  122. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewPayload.js +0 -2
  123. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewReducer.d.ts +0 -33
  124. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewReducer.js +0 -117
  125. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelector.d.ts +0 -9
  126. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelector.js +0 -71
  127. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelectorTypes.d.ts +0 -19
  128. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelectorTypes.js +0 -2
  129. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewState.d.ts +0 -22
  130. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewState.js +0 -2
@@ -1,71 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getProfitAndLossProjectView = exports.profitAndLossProjectIdsInOrder = void 0;
4
- const getDifferenceOfBalancesGroupedByPeriod_1 = require("../../commonStateTypes/coaBalance/classBalances/getDifferenceOfBalancesGroupedByPeriod");
5
- const getSumOfBalancesGroupedByPeriod_1 = require("../../commonStateTypes/coaBalance/classBalances/getSumOfBalancesGroupedByPeriod");
6
- const coaBalance_1 = require("../../commonStateTypes/coaBalance/coaBalance");
7
- const reduceFetchState_1 = require("../../commonStateTypes/reduceFetchState");
8
- const projectSelector_1 = require("../../entity/project/projectSelector");
9
- const sectionProjectViewSelector_1 = require("../../entity/sectionProjectView/sectionProjectViewSelector");
10
- const profitAndLossClassesViewSelectorTypes_1 = require("../profitAndLossClassesView/profitAndLossClassesViewSelectorTypes");
11
- exports.profitAndLossProjectIdsInOrder = [
12
- 'income',
13
- 'cogs',
14
- 'grossProfit',
15
- 'expenses',
16
- 'earningsBeforeInterestAndTax',
17
- 'otherIncome',
18
- 'otherExpenses',
19
- 'netOtherIncome',
20
- 'netIncome',
21
- ];
22
- const getProfitAndLossProjectView = (filter, accountState, projectState, sectionsState, profitAndLossProjectViewState) => {
23
- const fetchState = (0, reduceFetchState_1.reduceFetchStateParallelTimeframes)([
24
- profitAndLossProjectViewState.fetchState.month,
25
- profitAndLossProjectViewState.fetchState.quarter,
26
- profitAndLossProjectViewState.fetchState.year,
27
- ]);
28
- const reportId = 'profit_and_loss_by_projects';
29
- const sections = {};
30
- const calculatedSections = {};
31
- if (fetchState.fetchState === 'Completed') {
32
- profitAndLossClassesViewSelectorTypes_1.ALL_PANDL_REPORT_VIEW_SECTION_IDS.forEach((sectionId) => {
33
- sections[`${sectionId}`] = (0, sectionProjectViewSelector_1.getSectionProjectViewReport)(accountState, projectState, sectionsState, profitAndLossProjectViewState.projectIds, {
34
- reportId,
35
- sectionId,
36
- }, filter);
37
- });
38
- const grossProfitBalancesByPeriod = (0, getDifferenceOfBalancesGroupedByPeriod_1.getDifferenceOfBalancesGroupedByPeriod)(sections['income'].sectionBalancesTotalByPeriod, sections['cogs'].sectionBalancesTotalByPeriod);
39
- calculatedSections['grossProfit'] = (0, coaBalance_1.getCOABalances)(grossProfitBalancesByPeriod, filter);
40
- const ebitBalancesByPeriod = (0, getDifferenceOfBalancesGroupedByPeriod_1.getDifferenceOfBalancesGroupedByPeriod)(grossProfitBalancesByPeriod, sections['expenses'].sectionBalancesTotalByPeriod);
41
- calculatedSections['earningsBeforeInterestAndTax'] = (0, coaBalance_1.getCOABalances)(ebitBalancesByPeriod, filter);
42
- const netOtherIncomeBalances = (0, getDifferenceOfBalancesGroupedByPeriod_1.getDifferenceOfBalancesGroupedByPeriod)(sections['otherIncome'].sectionBalancesTotalByPeriod, sections['otherExpenses'].sectionBalancesTotalByPeriod);
43
- calculatedSections['netOtherIncome'] = (0, coaBalance_1.getCOABalances)(netOtherIncomeBalances, filter);
44
- const netIncomeBalances = netOtherIncomeBalances != null
45
- ? (0, getSumOfBalancesGroupedByPeriod_1.getSumOfBalancesByGroupedByPeriod)([
46
- ebitBalancesByPeriod,
47
- netOtherIncomeBalances,
48
- ])
49
- : ebitBalancesByPeriod;
50
- calculatedSections['netIncome'] = (0, coaBalance_1.getCOABalances)(netIncomeBalances, filter);
51
- }
52
- return {
53
- sections,
54
- calculatedSections,
55
- reportId: profitAndLossProjectViewState.reportId,
56
- reportTitle: profitAndLossProjectViewState.reportTitle,
57
- firstMonthOfFY: profitAndLossProjectViewState.firstMonthOfFY,
58
- dataAvailable: profitAndLossProjectViewState.dataAvailable,
59
- bookCloseDate: profitAndLossProjectViewState.bookCloseDate,
60
- version: profitAndLossProjectViewState.version,
61
- status: profitAndLossProjectViewState.status,
62
- fetchState: fetchState.fetchState,
63
- error: fetchState.error,
64
- filter,
65
- uiState: profitAndLossProjectViewState.uiState,
66
- projects: (0, projectSelector_1.getProjectsByIds)(projectState, profitAndLossProjectViewState.projectIds),
67
- projectsToFilterOut: profitAndLossProjectViewState.uiState.projectsToFilterOut,
68
- idsInOrder: exports.profitAndLossProjectIdsInOrder,
69
- };
70
- };
71
- exports.getProfitAndLossProjectView = getProfitAndLossProjectView;
@@ -1,19 +0,0 @@
1
- import { SectionProjectViewReport } from '../../entity/sectionProjectView/sectionProjectViewSelectorTypes';
2
- import { COABalancesFilterProjectView } from '../../commonStateTypes/coaBalance/coaBalancesFilterProjectView';
3
- import { ID } from '../../commonStateTypes/common';
4
- import { DataAvailable } from '../../commonStateTypes/dataAvailable';
5
- import { CalculatedSection } from '../../commonStateTypes/selectorTypes/selectorTypes';
6
- import { SelectorReport } from '../../commonStateTypes/viewAndReport/viewAndReport';
7
- import { Project } from '../../entity/project/projectState';
8
- import { PandLReportViewCalculatedSectionID, PandLReportViewSectionID } from '../profitAndLossClassesView/profitAndLossClassesViewSelectorTypes';
9
- import { ProfitAndLossProjectViewUIState } from './profitAndLossProjectViewState';
10
- export interface ProfitAndLossProjectViewReport extends SelectorReport {
11
- calculatedSections: Record<PandLReportViewCalculatedSectionID, CalculatedSection>;
12
- filter: COABalancesFilterProjectView;
13
- idsInOrder: (PandLReportViewSectionID | PandLReportViewCalculatedSectionID)[];
14
- projects: Project[];
15
- projectsToFilterOut: ID[];
16
- sections: Record<PandLReportViewSectionID, SectionProjectViewReport>;
17
- uiState: ProfitAndLossProjectViewUIState;
18
- dataAvailable?: DataAvailable;
19
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,22 +0,0 @@
1
- import { Currency } from '../../commonStateTypes/amount';
2
- import { AccountViewMode, FetchStateAndError, ID } from '../../commonStateTypes/common';
3
- import { Report } from '../../commonStateTypes/viewAndReport/viewAndReport';
4
- export interface ProfitAndLossProjectViewUIState {
5
- accountViewMode: AccountViewMode;
6
- nodeCollapseState: Record<ID, boolean>;
7
- projectsToFilterOut: ID[];
8
- scrollPosition: {
9
- scrollTop: number;
10
- scrollLeft?: number;
11
- } | undefined;
12
- }
13
- export interface ProfitAndLossProjectViewState extends Report {
14
- fetchState: {
15
- month: FetchStateAndError;
16
- quarter: FetchStateAndError;
17
- year: FetchStateAndError;
18
- };
19
- projectIds: ID[];
20
- uiState: ProfitAndLossProjectViewUIState;
21
- currency?: Currency;
22
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });