@zeniai/client-epic-state 5.1.76 → 5.1.77

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.
@@ -14,5 +14,6 @@ export interface NotificationGroupPayload {
14
14
  export interface NotificationRegistryPayload {
15
15
  frequency_options: string[];
16
16
  groups: NotificationGroupPayload[];
17
+ default_frequency?: string;
17
18
  }
18
19
  export declare const mapNotificationRegistryPayloadToRegistry: (payload: NotificationRegistryPayload) => NotificationRegistry;
@@ -22,6 +22,9 @@ const mapGroup = (payload) => ({
22
22
  groupId: payload.group_id,
23
23
  });
24
24
  const mapNotificationRegistryPayloadToRegistry = (payload) => ({
25
+ defaultFrequency: payload.default_frequency != null
26
+ ? (0, notificationRegistryState_1.toNotificationFrequency)(payload.default_frequency)
27
+ : undefined,
25
28
  frequencyOptions: payload.frequency_options.map(notificationRegistryState_1.toNotificationFrequency),
26
29
  groups: payload.groups.map(mapGroup),
27
30
  });
@@ -19,6 +19,7 @@ export interface RegistryNotificationGroup {
19
19
  export interface NotificationRegistry {
20
20
  frequencyOptions: NotificationFrequency[];
21
21
  groups: RegistryNotificationGroup[];
22
+ defaultFrequency?: NotificationFrequency;
22
23
  }
23
24
  /**
24
25
  * The registry is a singleton (not per-tenant). We keep the wrapper so
@@ -19,6 +19,9 @@ const mapGroup = (payload) => ({
19
19
  groupId: payload.group_id,
20
20
  });
21
21
  export const mapNotificationRegistryPayloadToRegistry = (payload) => ({
22
+ defaultFrequency: payload.default_frequency != null
23
+ ? toNotificationFrequency(payload.default_frequency)
24
+ : undefined,
22
25
  frequencyOptions: payload.frequency_options.map(toNotificationFrequency),
23
26
  groups: payload.groups.map(mapGroup),
24
27
  });
@@ -1,8 +1,7 @@
1
1
  import { createSelector } from '@reduxjs/toolkit';
2
2
  import omit from 'lodash/omit';
3
- import { reduceAllFetchState, reduceAnyFetchState, } from '../../../commonStateTypes/reduceFetchState';
4
3
  import { toMonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
5
- import { getCurrentTenant, getIsAccountingClassesEnabled, getIsAccountingProjectsEnabled, } from '../../../entity/tenant/tenantSelector';
4
+ import { getCurrentTenant, getIsAccountingProjectsEnabled, } from '../../../entity/tenant/tenantSelector';
6
5
  import { getTransactionWithCOT } from '../../../entity/transaction/transactionHelper';
7
6
  import { getSupportedTransactionsByIds } from '../../../entity/transaction/transactionSelector';
8
7
  import { getAccountList, getNestedAccountListHierarchy, getUncategorizedAccounts, } from '../../accountList/accountListSelector';
@@ -86,7 +85,7 @@ export const toTransactionView = (transaction, transactionLocalData) => {
86
85
  // `view/createTransferEntry/createTransferEntrySelector`.
87
86
  export { getLastTransferEntryReplacement } from '../../createTransferEntry/createTransferEntrySelector';
88
87
  export function getExpenseAutomationTransactionView(state) {
89
- const { accountState, classState, classListState, accountListState, createTransferEntryState, expenseAutomationTransactionsViewState, expenseAutomationViewState, projectState, projectListState, transactionState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
88
+ const { accountState, classState, classListState, accountListState, createTransferEntryState, expenseAutomationTransactionsViewState, expenseAutomationViewState, projectState, projectListState, transactionState, monthEndCloseChecksState, } = state;
90
89
  const { selectedTransactionCategorizationCompletedSubTab, selectedTransactionCategorizationTab, } = expenseAutomationTransactionsViewState;
91
90
  const { uiState, refreshStatus, saveStatus, markAsNotMiscategorizedStatus, transactionIdsBySelectedPeriod, transactionReviewLocalDataById, selectedCheckBoxTransactionIds, transactionIdsWithUnsavedData, uploadReceiptStatusById, selectedTransactionId, selectedTransactionLineId, filters, } = expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab];
92
91
  const uncategorizedIncomeExpense = getUncategorizedAccounts(accountState, accountListState, 'accountList');
@@ -159,21 +158,8 @@ export function getExpenseAutomationTransactionView(state) {
159
158
  }
160
159
  return [];
161
160
  });
162
- const monthEndFetchState = monthYearPeriodId != null
163
- ? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? { fetchState: 'Not-Started', error: undefined })
164
- : { fetchState: 'Not-Started', error: undefined };
165
- const isAccountingClassesEnabled = getIsAccountingClassesEnabled(state);
166
- const allFetchStateList = [
167
- accountList,
168
- expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab],
169
- ];
170
- if (isAccountingClassesEnabled) {
171
- allFetchStateList.push(classList);
172
- }
173
- const fetchStatus = reduceAnyFetchState([
174
- reduceAllFetchState(allFetchStateList),
175
- monthEndFetchState,
176
- ]);
161
+ const { fetchState, error } = expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab];
162
+ const fetchStatus = { fetchState, error };
177
163
  const totalCountByReview = expenseAutomationTransactionsViewState.transactionCategorizationView.review
178
164
  .uiState.totalCount;
179
165
  const totalCountByAutoCat = expenseAutomationTransactionsViewState.transactionCategorizationView
@@ -7,7 +7,6 @@ exports.getLastTransferEntryReplacement = exports.toTransactionView = exports.ge
7
7
  exports.getExpenseAutomationTransactionView = getExpenseAutomationTransactionView;
8
8
  const toolkit_1 = require("@reduxjs/toolkit");
9
9
  const omit_1 = __importDefault(require("lodash/omit"));
10
- const reduceFetchState_1 = require("../../../commonStateTypes/reduceFetchState");
11
10
  const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
12
11
  const tenantSelector_1 = require("../../../entity/tenant/tenantSelector");
13
12
  const transactionHelper_1 = require("../../../entity/transaction/transactionHelper");
@@ -96,7 +95,7 @@ exports.toTransactionView = toTransactionView;
96
95
  var createTransferEntrySelector_2 = require("../../createTransferEntry/createTransferEntrySelector");
97
96
  Object.defineProperty(exports, "getLastTransferEntryReplacement", { enumerable: true, get: function () { return createTransferEntrySelector_2.getLastTransferEntryReplacement; } });
98
97
  function getExpenseAutomationTransactionView(state) {
99
- const { accountState, classState, classListState, accountListState, createTransferEntryState, expenseAutomationTransactionsViewState, expenseAutomationViewState, projectState, projectListState, transactionState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
98
+ const { accountState, classState, classListState, accountListState, createTransferEntryState, expenseAutomationTransactionsViewState, expenseAutomationViewState, projectState, projectListState, transactionState, monthEndCloseChecksState, } = state;
100
99
  const { selectedTransactionCategorizationCompletedSubTab, selectedTransactionCategorizationTab, } = expenseAutomationTransactionsViewState;
101
100
  const { uiState, refreshStatus, saveStatus, markAsNotMiscategorizedStatus, transactionIdsBySelectedPeriod, transactionReviewLocalDataById, selectedCheckBoxTransactionIds, transactionIdsWithUnsavedData, uploadReceiptStatusById, selectedTransactionId, selectedTransactionLineId, filters, } = expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab];
102
101
  const uncategorizedIncomeExpense = (0, accountListSelector_1.getUncategorizedAccounts)(accountState, accountListState, 'accountList');
@@ -169,21 +168,8 @@ function getExpenseAutomationTransactionView(state) {
169
168
  }
170
169
  return [];
171
170
  });
172
- const monthEndFetchState = monthYearPeriodId != null
173
- ? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? { fetchState: 'Not-Started', error: undefined })
174
- : { fetchState: 'Not-Started', error: undefined };
175
- const isAccountingClassesEnabled = (0, tenantSelector_1.getIsAccountingClassesEnabled)(state);
176
- const allFetchStateList = [
177
- accountList,
178
- expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab],
179
- ];
180
- if (isAccountingClassesEnabled) {
181
- allFetchStateList.push(classList);
182
- }
183
- const fetchStatus = (0, reduceFetchState_1.reduceAnyFetchState)([
184
- (0, reduceFetchState_1.reduceAllFetchState)(allFetchStateList),
185
- monthEndFetchState,
186
- ]);
171
+ const { fetchState, error } = expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab];
172
+ const fetchStatus = { fetchState, error };
187
173
  const totalCountByReview = expenseAutomationTransactionsViewState.transactionCategorizationView.review
188
174
  .uiState.totalCount;
189
175
  const totalCountByAutoCat = expenseAutomationTransactionsViewState.transactionCategorizationView
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "5.1.76",
3
+ "version": "5.1.77",
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",