@zeniai/client-epic-state 5.2.32 → 5.2.34

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 (57) hide show
  1. package/lib/commonPayloadTypes/classesView/reportByClassPayloadV2.d.ts +13 -1
  2. package/lib/entity/sectionClassesViewV2/sectionClassesViewEpic.js +10 -7
  3. package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +3 -3
  4. package/lib/entity/sectionProjectView/sectionProjectViewEpic.js +6 -2
  5. package/lib/entity/sectionProjectView/sectionProjectViewReducer.d.ts +3 -3
  6. package/lib/entity/sectionProjectView/sectionProjectViewReducer.js +4 -3
  7. package/lib/epic.js +12 -0
  8. package/lib/esm/entity/class/classReducer.js +1 -1
  9. package/lib/esm/entity/sectionClassesViewV2/sectionClassesViewEpic.js +10 -7
  10. package/lib/esm/entity/sectionProjectView/sectionProjectViewEpic.js +6 -2
  11. package/lib/esm/entity/sectionProjectView/sectionProjectViewReducer.js +5 -4
  12. package/lib/esm/epic.js +12 -0
  13. package/lib/esm/index.js +2 -2
  14. package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +266 -1
  15. package/lib/esm/view/aiCfoView/aiCfoViewSelector.js +50 -0
  16. package/lib/esm/view/aiCfoView/epics/deleteRoutineEpic.js +35 -0
  17. package/lib/esm/view/aiCfoView/epics/fetchRoutineRunsEpic.js +35 -0
  18. package/lib/esm/view/aiCfoView/epics/fetchRoutinesEpic.js +37 -0
  19. package/lib/esm/view/aiCfoView/epics/runRoutineEpic.js +34 -0
  20. package/lib/esm/view/aiCfoView/epics/saveRoutineEpic.js +65 -0
  21. package/lib/esm/view/aiCfoView/epics/setRoutineEnabledEpic.js +28 -0
  22. package/lib/esm/view/aiCfoView/epics/toRoutine.js +64 -0
  23. package/lib/esm/view/aiCfoView/epics/toRoutineRun.js +42 -0
  24. package/lib/esm/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +12 -10
  25. package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +3 -11
  26. package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +10 -11
  27. package/lib/index.d.ts +3 -3
  28. package/lib/index.js +55 -40
  29. package/lib/view/aiCfoView/aiCfoViewPayload.d.ts +90 -0
  30. package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +164 -123
  31. package/lib/view/aiCfoView/aiCfoViewReducer.js +268 -3
  32. package/lib/view/aiCfoView/aiCfoViewSelector.d.ts +13 -1
  33. package/lib/view/aiCfoView/aiCfoViewSelector.js +55 -0
  34. package/lib/view/aiCfoView/aiCfoViewState.d.ts +157 -0
  35. package/lib/view/aiCfoView/epics/deleteRoutineEpic.d.ts +18 -0
  36. package/lib/view/aiCfoView/epics/deleteRoutineEpic.js +39 -0
  37. package/lib/view/aiCfoView/epics/fetchRoutineRunsEpic.d.ts +13 -0
  38. package/lib/view/aiCfoView/epics/fetchRoutineRunsEpic.js +39 -0
  39. package/lib/view/aiCfoView/epics/fetchRoutinesEpic.d.ts +7 -0
  40. package/lib/view/aiCfoView/epics/fetchRoutinesEpic.js +41 -0
  41. package/lib/view/aiCfoView/epics/runRoutineEpic.d.ts +14 -0
  42. package/lib/view/aiCfoView/epics/runRoutineEpic.js +38 -0
  43. package/lib/view/aiCfoView/epics/saveRoutineEpic.d.ts +13 -0
  44. package/lib/view/aiCfoView/epics/saveRoutineEpic.js +69 -0
  45. package/lib/view/aiCfoView/epics/setRoutineEnabledEpic.d.ts +15 -0
  46. package/lib/view/aiCfoView/epics/setRoutineEnabledEpic.js +32 -0
  47. package/lib/view/aiCfoView/epics/toRoutine.d.ts +17 -0
  48. package/lib/view/aiCfoView/epics/toRoutine.js +69 -0
  49. package/lib/view/aiCfoView/epics/toRoutineRun.d.ts +12 -0
  50. package/lib/view/aiCfoView/epics/toRoutineRun.js +47 -0
  51. package/lib/view/cashFlowClassesView/cashFlowClassesViewPayload.d.ts +4 -4
  52. package/lib/view/cashFlowProjectView/cashFlowProjectViewPayload.d.ts +4 -4
  53. package/lib/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +12 -10
  54. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +3 -11
  55. package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +10 -11
  56. package/lib/view/profitAndLossProjectView/profitAndLossProjectViewPayload.d.ts +12 -0
  57. package/package.json +1 -1
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getExpenseAutomationMissingReceiptsView = getExpenseAutomationMissingReceiptsView;
7
7
  const orderBy_1 = __importDefault(require("lodash/orderBy"));
8
- const reduceFetchState_1 = require("../../../commonStateTypes/reduceFetchState");
9
8
  const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
10
9
  const tenantSelector_1 = require("../../../entity/tenant/tenantSelector");
11
10
  const transactionSelector_1 = require("../../../entity/transaction/transactionSelector");
@@ -14,7 +13,7 @@ const missingReceiptsViewReducer_1 = require("../reducers/missingReceiptsViewRed
14
13
  const missingReceiptsViewState_1 = require("../types/missingReceiptsViewState");
15
14
  const getAllStepsHelper_1 = require("./getAllStepsHelper");
16
15
  function getExpenseAutomationMissingReceiptsView(state) {
17
- const { expenseAutomationMissingReceiptsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
16
+ const { expenseAutomationMissingReceiptsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, } = state;
18
17
  const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
19
18
  const { selectedPeriodByTenantId } = expenseAutomationViewState;
20
19
  const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
@@ -182,16 +181,16 @@ function getExpenseAutomationMissingReceiptsView(state) {
182
181
  vendorLogo: result.vendorLogo ?? transaction?.logo?.href,
183
182
  };
184
183
  });
185
- const monthEndFetchState = monthYearPeriodId != null
186
- ? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? { fetchState: 'Not-Started', error: undefined })
187
- : { fetchState: 'Not-Started', error: undefined };
188
- const reducedFetchStatus = (0, reduceFetchState_1.reduceAnyFetchState)([
189
- { fetchState, error },
190
- monthEndFetchState,
191
- ]);
184
+ // `fetchState` is a flat slice field that survives a period switch, so it still reads
185
+ // 'Completed' before the newly selected period's ids land. Reporting 'Not-Started' until they
186
+ // do keeps the skeleton up instead of flashing the "all done" empty state over the previous
187
+ // period's rows.
188
+ const fetchStatus = fetchState === 'Completed' && transactionIdsForSelectedPeriod == null
189
+ ? { fetchState: 'Not-Started', error: undefined }
190
+ : { fetchState, error };
192
191
  return {
193
- fetchState: reducedFetchStatus.fetchState,
194
- error: reducedFetchStatus.error,
192
+ fetchState: fetchStatus.fetchState,
193
+ error: fetchStatus.error,
195
194
  uploadReceiptStatusById,
196
195
  uiState,
197
196
  refreshStatus,
@@ -17,6 +17,18 @@ interface ProjectCOABalanceGroupedPayloadByProjectIdV2 {
17
17
  export interface SectionByProjectCOABalanceGroupedPayloadV2 extends COABalanceGroupedPayloadV2 {
18
18
  projects: ProjectCOABalanceGroupedPayloadByProjectIdV2;
19
19
  }
20
+ interface CalculatedProjectCOABalanceGroupedPayloadByProjectIdV2 {
21
+ [project_Id: string]: COABalanceGroupedPayloadV2;
22
+ }
23
+ /**
24
+ * A section whose per-project entries carry a time series and nothing else: the
25
+ * backend fills the account-wise map only for the account sections, so the
26
+ * calculated sections (net income, the operating total, change in cash) are
27
+ * grouped by project with no accounts underneath.
28
+ */
29
+ export interface CalculatedSectionByProjectCOABalanceGroupedPayloadV2 extends COABalanceGroupedPayloadV2 {
30
+ projects: CalculatedProjectCOABalanceGroupedPayloadByProjectIdV2;
31
+ }
20
32
  export interface ProfitAndLossProjectViewPayload extends ReportByProjectMetadataPayloadV2 {
21
33
  cogs: SectionByProjectCOABalanceGroupedPayloadV2;
22
34
  earnings_before_interest_and_tax: COABalanceGroupedPayloadV2;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "5.2.32",
3
+ "version": "5.2.34",
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",