@zeniai/client-epic-state 5.1.54-betaDI0 → 5.1.54-betaRD2
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.
- package/lib/coreEpics.js +2 -3
- package/lib/entity/chargeCard/chargeCard.d.ts +1 -1
- package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +2 -0
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +2 -0
- package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +4 -0
- package/lib/entity/jeSchedules/jeSchedulesSelector.js +11 -1
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +2 -0
- package/lib/entity/tenant/clearAllEpic.d.ts +1 -3
- package/lib/entity/tenant/clearAllEpic.js +0 -4
- package/lib/epic.d.ts +2 -2
- package/lib/epic.js +2 -2
- package/lib/esm/coreEpics.js +2 -3
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +2 -0
- package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +11 -1
- package/lib/esm/entity/tenant/clearAllEpic.js +0 -4
- package/lib/esm/epic.js +2 -2
- package/lib/esm/index.js +3 -8
- package/lib/esm/reducer.js +0 -6
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +15 -2
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +22 -0
- package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +20 -6
- package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +58 -10
- package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +2 -6
- package/lib/esm/view/settingsView/epic/fetchNotificationSettingsEpic.js +2 -12
- package/lib/esm/view/settingsView/settingsViewHelpers.js +2 -3
- package/lib/index.d.ts +5 -11
- package/lib/index.js +44 -53
- package/lib/reducer.d.ts +0 -6
- package/lib/reducer.js +0 -6
- package/lib/view/common/recurringViewHelper.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +14 -1
- package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.d.ts +6 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +26 -0
- package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +1 -0
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +21 -7
- package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +27 -4
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +58 -10
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +6 -3
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +4 -8
- package/lib/view/settingsView/epic/fetchNotificationSettingsEpic.d.ts +1 -9
- package/lib/view/settingsView/epic/fetchNotificationSettingsEpic.js +2 -12
- package/lib/view/settingsView/settingsViewHelpers.d.ts +1 -1
- package/lib/view/settingsView/settingsViewHelpers.js +2 -3
- package/lib/view/settingsView/settingsViewPayload.d.ts +0 -4
- package/lib/view/settingsView/settingsViewState.d.ts +1 -1
- package/package.json +1 -1
- package/lib/entity/notificationRegistry/notificationRegistryPayload.d.ts +0 -18
- package/lib/entity/notificationRegistry/notificationRegistryPayload.js +0 -28
- package/lib/entity/notificationRegistry/notificationRegistryReducer.d.ts +0 -6
- package/lib/entity/notificationRegistry/notificationRegistryReducer.js +0 -26
- package/lib/entity/notificationRegistry/notificationRegistrySelector.d.ts +0 -2
- package/lib/entity/notificationRegistry/notificationRegistrySelector.js +0 -10
- package/lib/entity/notificationRegistry/notificationRegistryState.d.ts +0 -31
- package/lib/entity/notificationRegistry/notificationRegistryState.js +0 -10
- package/lib/esm/entity/notificationRegistry/notificationRegistryPayload.js +0 -24
- package/lib/esm/entity/notificationRegistry/notificationRegistryReducer.js +0 -22
- package/lib/esm/entity/notificationRegistry/notificationRegistrySelector.js +0 -6
- package/lib/esm/entity/notificationRegistry/notificationRegistryState.js +0 -5
- package/lib/esm/view/notificationPreferencesView/epics/saveNotificationPreferencesEpic.js +0 -58
- package/lib/esm/view/notificationPreferencesView/notificationPreferencesEndpoint.js +0 -5
- package/lib/esm/view/notificationPreferencesView/notificationPreferencesViewPayload.js +0 -36
- package/lib/esm/view/notificationPreferencesView/notificationPreferencesViewReducer.js +0 -124
- package/lib/esm/view/notificationPreferencesView/notificationPreferencesViewSelector.js +0 -25
- package/lib/esm/view/notificationPreferencesView/notificationPreferencesViewState.js +0 -4
- package/lib/view/notificationPreferencesView/epics/saveNotificationPreferencesEpic.d.ts +0 -30
- package/lib/view/notificationPreferencesView/epics/saveNotificationPreferencesEpic.js +0 -62
- package/lib/view/notificationPreferencesView/notificationPreferencesEndpoint.d.ts +0 -2
- package/lib/view/notificationPreferencesView/notificationPreferencesEndpoint.js +0 -9
- package/lib/view/notificationPreferencesView/notificationPreferencesViewPayload.d.ts +0 -7
- package/lib/view/notificationPreferencesView/notificationPreferencesViewPayload.js +0 -41
- package/lib/view/notificationPreferencesView/notificationPreferencesViewReducer.d.ts +0 -23
- package/lib/view/notificationPreferencesView/notificationPreferencesViewReducer.js +0 -128
- package/lib/view/notificationPreferencesView/notificationPreferencesViewSelector.d.ts +0 -7
- package/lib/view/notificationPreferencesView/notificationPreferencesViewSelector.js +0 -32
- package/lib/view/notificationPreferencesView/notificationPreferencesViewState.d.ts +0 -12
- package/lib/view/notificationPreferencesView/notificationPreferencesViewState.js +0 -8
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.switchJESchedulesTabEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
|
|
7
|
+
const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
|
|
8
|
+
const jeSchedulesViewReducer_1 = require("../../reducers/jeSchedulesViewReducer");
|
|
9
|
+
const switchJESchedulesTabEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(jeSchedulesViewReducer_1.updateJESchedulesUIState.match), (0, operators_1.filter)((action) => action.payload.selectedPageTab != null), (0, operators_1.mergeMap)(() => {
|
|
10
|
+
const state = state$.value;
|
|
11
|
+
const { fetchState, refreshStatus } = state.expenseAutomationJESchedulesViewState;
|
|
12
|
+
if (fetchState === 'In-Progress' ||
|
|
13
|
+
refreshStatus.fetchState === 'In-Progress') {
|
|
14
|
+
return rxjs_1.EMPTY;
|
|
15
|
+
}
|
|
16
|
+
const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
|
|
17
|
+
const selectedPeriod = state.expenseAutomationViewState.selectedPeriodByTenantId[currentTenant.tenantId];
|
|
18
|
+
const period = (0, timePeriod_1.convertToPeriod)(selectedPeriod);
|
|
19
|
+
const timePeriodStart = (0, timePeriod_1.toAbsoluteDay)(period.start);
|
|
20
|
+
const timePeriodEnd = (0, timePeriod_1.toAbsoluteDay)(period.end);
|
|
21
|
+
if (timePeriodStart == null || timePeriodEnd == null) {
|
|
22
|
+
return rxjs_1.EMPTY;
|
|
23
|
+
}
|
|
24
|
+
return (0, rxjs_1.of)((0, jeSchedulesViewReducer_1.fetchJeSchedulesPage)({ start: timePeriodStart, end: timePeriodEnd }, true));
|
|
25
|
+
}));
|
|
26
|
+
exports.switchJESchedulesTabEpic = switchJESchedulesTabEpic;
|
|
@@ -8,6 +8,7 @@ import { JEScheduleLocalData } from '../types/jeSchedulesViewState';
|
|
|
8
8
|
export interface ExpenseAutomationJESchedulesQueryPayload {
|
|
9
9
|
end_date: string;
|
|
10
10
|
start_date: string;
|
|
11
|
+
close_period_start_date?: string;
|
|
11
12
|
}
|
|
12
13
|
interface ExpenseAutomationJESchedulesPayload {
|
|
13
14
|
failed_je_postings: {
|
|
@@ -52,11 +52,11 @@ export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/too
|
|
|
52
52
|
status: ZeniAPIStatus;
|
|
53
53
|
}, "expenseAutomationJESchedulesView/saveAccountSettingsFailure">, saveAccountSettingsLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
54
54
|
data: Partial<AccountSettingsLocalData>;
|
|
55
|
-
}, "expenseAutomationJESchedulesView/saveAccountSettingsLocalData">, saveAccountSettingsSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/saveAccountSettingsSuccess">, updateAccountSettingsListForAccountTypes: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
55
|
+
}, "expenseAutomationJESchedulesView/saveAccountSettingsLocalData">, saveAccountSettingsSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/saveAccountSettingsSuccess">, toggleJECreatedGroupCollapsed: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/toggleJECreatedGroupCollapsed">, toggleJEPendingGroupCollapsed: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/toggleJEPendingGroupCollapsed">, updateAccountSettingsListForAccountTypes: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
56
56
|
accountPayload: AccountMetadataPayload[];
|
|
57
57
|
}, "expenseAutomationJESchedulesView/updateAccountSettingsListForAccountTypes">, updateAccountSettingsListForAccountTypesFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
58
58
|
status: ZeniAPIStatus;
|
|
59
|
-
}, "expenseAutomationJESchedulesView/updateAccountSettingsListForAccountTypesFailure">, updateJESchedulesUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<JESchedulesViewUIState>, "expenseAutomationJESchedulesView/updateJESchedulesUIState">, updateJeScheduleLocalDataById: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
59
|
+
}, "expenseAutomationJESchedulesView/updateAccountSettingsListForAccountTypesFailure">, updateJESchedulesUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<JESchedulesViewUIState>, "expenseAutomationJESchedulesView/updateJESchedulesUIState">, updateJEScheduleTypeFilter: import("@reduxjs/toolkit").ActionCreatorWithPayload<"prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue" | null, "expenseAutomationJESchedulesView/updateJEScheduleTypeFilter">, updateJeScheduleLocalDataById: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
60
60
|
localData: Partial<JEScheduleLocalData>;
|
|
61
61
|
scheduledJournalEntryID: ID;
|
|
62
62
|
}, "expenseAutomationJESchedulesView/updateJeScheduleLocalDataById">, updateJeScheduleTransactionKeys: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeScheduleKeys: (`${string}_bill_${string}` | `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_refund_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_bill_payment_${string}` | `${string}_bill_payment_check_${string}` | `${string}_bill_payment_credit_card_${string}` | `${string}_vendor_credit_${string}` | `${string}_credit_card_credit_${string}` | `${string}_transfer_${string}` | `${string}_credit_card_payment_${string}` | `${string}_deposit_${string}` | `${string}_journal_entry_${string}`)[], selectedPeriod: MonthYearPeriod], {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.updateRecommendationForAccountSettingsFailure = exports.updateRecommendationForAccountSettings = exports.updateJeScheduleTransactionKeys = exports.updateJeScheduleLocalDataById = exports.updateJESchedulesUIState = exports.updateAccountSettingsListForAccountTypesFailure = exports.updateAccountSettingsListForAccountTypes = exports.saveAccountSettingsSuccess = exports.saveAccountSettingsLocalData = exports.saveAccountSettingsFailure = exports.saveAccountSettings = exports.retryJeScheduleSuccess = exports.retryJeScheduleFailure = exports.retryJeSchedule = exports.removeJeScheduleTransactionKey = exports.removeJeScheduleLocalDataById = exports.removeFailedJeScheduleTransactionKey = exports.initializeJeScheduleLocalData = exports.initializeAccountSettingsView = exports.ignoreRecommendedJeScheduleSuccess = exports.ignoreRecommendedJeScheduleFailure = exports.ignoreRecommendedJeSchedule = exports.fetchRecommendationForAccountSettings = exports.fetchJeSchedulesSuccess = exports.fetchJeSchedulesPage = exports.fetchJeSchedulesFailure = exports.fetchJeSchedules = exports.fetchAccountSettingsListForAccountTypes = exports.clearJeScheduleLocalData = exports.clearJeAccountSettingsLocalData = exports.clearExpenseAutomationJESchedulesView = exports.initialState = exports.accountSettingsInitialState = void 0;
|
|
4
|
+
exports.updateRecommendationForAccountSettingsFailure = exports.updateRecommendationForAccountSettings = exports.updateJeScheduleTransactionKeys = exports.updateJeScheduleLocalDataById = exports.updateJEScheduleTypeFilter = exports.updateJESchedulesUIState = exports.updateAccountSettingsListForAccountTypesFailure = exports.updateAccountSettingsListForAccountTypes = exports.toggleJEPendingGroupCollapsed = exports.toggleJECreatedGroupCollapsed = exports.saveAccountSettingsSuccess = exports.saveAccountSettingsLocalData = exports.saveAccountSettingsFailure = exports.saveAccountSettings = exports.retryJeScheduleSuccess = exports.retryJeScheduleFailure = exports.retryJeSchedule = exports.removeJeScheduleTransactionKey = exports.removeJeScheduleLocalDataById = exports.removeFailedJeScheduleTransactionKey = exports.initializeJeScheduleLocalData = exports.initializeAccountSettingsView = exports.ignoreRecommendedJeScheduleSuccess = exports.ignoreRecommendedJeScheduleFailure = exports.ignoreRecommendedJeSchedule = exports.fetchRecommendationForAccountSettings = exports.fetchJeSchedulesSuccess = exports.fetchJeSchedulesPage = exports.fetchJeSchedulesFailure = exports.fetchJeSchedules = exports.fetchAccountSettingsListForAccountTypes = exports.clearJeScheduleLocalData = exports.clearJeAccountSettingsLocalData = exports.clearExpenseAutomationJESchedulesView = exports.initialState = exports.accountSettingsInitialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const getNestedAccountIDHierarchyForReport_1 = require("../../../commonStateTypes/accountView/getNestedAccountIDHierarchyForReport");
|
|
7
7
|
const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
|
|
@@ -46,9 +46,12 @@ exports.initialState = {
|
|
|
46
46
|
ignoreStatusById: {},
|
|
47
47
|
jeScheduleLocalDataById: {},
|
|
48
48
|
uiState: {
|
|
49
|
-
|
|
49
|
+
createdGroupCollapsed: false,
|
|
50
|
+
pendingGroupCollapsed: false,
|
|
50
51
|
scrollPosition: { scrollTop: 0, scrollLeft: undefined },
|
|
51
|
-
|
|
52
|
+
searchString: '',
|
|
53
|
+
selectedJETypeFilter: null,
|
|
54
|
+
selectedPageTab: 'schedules',
|
|
52
55
|
sortKey: 'transactionDate',
|
|
53
56
|
sortOrder: 'descending',
|
|
54
57
|
totalCount: 0,
|
|
@@ -125,8 +128,8 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
125
128
|
else {
|
|
126
129
|
draft.fetchState = 'Error';
|
|
127
130
|
draft.error = status;
|
|
131
|
+
draft.jeScheduleTransactionKeysByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = [];
|
|
128
132
|
}
|
|
129
|
-
draft.jeScheduleTransactionKeysByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = [];
|
|
130
133
|
},
|
|
131
134
|
retryJeSchedule(draft, action) {
|
|
132
135
|
const { scheduledJournalEntryID } = action.payload;
|
|
@@ -385,16 +388,27 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
385
388
|
if (action.payload.scrollPosition != null) {
|
|
386
389
|
draft.uiState.scrollPosition = action.payload.scrollPosition;
|
|
387
390
|
}
|
|
388
|
-
if (action.payload.
|
|
389
|
-
draft.uiState.
|
|
391
|
+
if (action.payload.selectedPageTab != null) {
|
|
392
|
+
draft.uiState.selectedPageTab = action.payload.selectedPageTab;
|
|
390
393
|
}
|
|
391
394
|
},
|
|
395
|
+
updateJEScheduleTypeFilter(draft, action) {
|
|
396
|
+
draft.uiState.selectedJETypeFilter = action.payload;
|
|
397
|
+
},
|
|
398
|
+
toggleJEPendingGroupCollapsed(draft) {
|
|
399
|
+
draft.uiState.pendingGroupCollapsed =
|
|
400
|
+
!draft.uiState.pendingGroupCollapsed;
|
|
401
|
+
},
|
|
402
|
+
toggleJECreatedGroupCollapsed(draft) {
|
|
403
|
+
draft.uiState.createdGroupCollapsed =
|
|
404
|
+
!draft.uiState.createdGroupCollapsed;
|
|
405
|
+
},
|
|
392
406
|
clearExpenseAutomationJESchedulesView(draft) {
|
|
393
407
|
Object.assign(draft, exports.initialState);
|
|
394
408
|
},
|
|
395
409
|
},
|
|
396
410
|
});
|
|
397
|
-
_a = expenseAutomationJESchedulesView.actions, exports.clearExpenseAutomationJESchedulesView = _a.clearExpenseAutomationJESchedulesView, exports.clearJeAccountSettingsLocalData = _a.clearJeAccountSettingsLocalData, exports.clearJeScheduleLocalData = _a.clearJeScheduleLocalData, exports.fetchAccountSettingsListForAccountTypes = _a.fetchAccountSettingsListForAccountTypes, exports.fetchJeSchedules = _a.fetchJeSchedules, exports.fetchJeSchedulesFailure = _a.fetchJeSchedulesFailure, exports.fetchJeSchedulesPage = _a.fetchJeSchedulesPage, exports.fetchJeSchedulesSuccess = _a.fetchJeSchedulesSuccess, exports.fetchRecommendationForAccountSettings = _a.fetchRecommendationForAccountSettings, exports.ignoreRecommendedJeSchedule = _a.ignoreRecommendedJeSchedule, exports.ignoreRecommendedJeScheduleFailure = _a.ignoreRecommendedJeScheduleFailure, exports.ignoreRecommendedJeScheduleSuccess = _a.ignoreRecommendedJeScheduleSuccess, exports.initializeAccountSettingsView = _a.initializeAccountSettingsView, exports.initializeJeScheduleLocalData = _a.initializeJeScheduleLocalData, exports.removeFailedJeScheduleTransactionKey = _a.removeFailedJeScheduleTransactionKey, exports.removeJeScheduleLocalDataById = _a.removeJeScheduleLocalDataById, exports.removeJeScheduleTransactionKey = _a.removeJeScheduleTransactionKey, exports.retryJeSchedule = _a.retryJeSchedule, exports.retryJeScheduleFailure = _a.retryJeScheduleFailure, exports.retryJeScheduleSuccess = _a.retryJeScheduleSuccess, exports.saveAccountSettings = _a.saveAccountSettings, exports.saveAccountSettingsFailure = _a.saveAccountSettingsFailure, exports.saveAccountSettingsLocalData = _a.saveAccountSettingsLocalData, exports.saveAccountSettingsSuccess = _a.saveAccountSettingsSuccess, exports.updateAccountSettingsListForAccountTypes = _a.updateAccountSettingsListForAccountTypes, exports.updateAccountSettingsListForAccountTypesFailure = _a.updateAccountSettingsListForAccountTypesFailure, exports.updateJESchedulesUIState = _a.updateJESchedulesUIState, exports.updateJeScheduleLocalDataById = _a.updateJeScheduleLocalDataById, exports.updateJeScheduleTransactionKeys = _a.updateJeScheduleTransactionKeys, exports.updateRecommendationForAccountSettings = _a.updateRecommendationForAccountSettings, exports.updateRecommendationForAccountSettingsFailure = _a.updateRecommendationForAccountSettingsFailure;
|
|
411
|
+
_a = expenseAutomationJESchedulesView.actions, exports.clearExpenseAutomationJESchedulesView = _a.clearExpenseAutomationJESchedulesView, exports.clearJeAccountSettingsLocalData = _a.clearJeAccountSettingsLocalData, exports.clearJeScheduleLocalData = _a.clearJeScheduleLocalData, exports.fetchAccountSettingsListForAccountTypes = _a.fetchAccountSettingsListForAccountTypes, exports.fetchJeSchedules = _a.fetchJeSchedules, exports.fetchJeSchedulesFailure = _a.fetchJeSchedulesFailure, exports.fetchJeSchedulesPage = _a.fetchJeSchedulesPage, exports.fetchJeSchedulesSuccess = _a.fetchJeSchedulesSuccess, exports.fetchRecommendationForAccountSettings = _a.fetchRecommendationForAccountSettings, exports.ignoreRecommendedJeSchedule = _a.ignoreRecommendedJeSchedule, exports.ignoreRecommendedJeScheduleFailure = _a.ignoreRecommendedJeScheduleFailure, exports.ignoreRecommendedJeScheduleSuccess = _a.ignoreRecommendedJeScheduleSuccess, exports.initializeAccountSettingsView = _a.initializeAccountSettingsView, exports.initializeJeScheduleLocalData = _a.initializeJeScheduleLocalData, exports.removeFailedJeScheduleTransactionKey = _a.removeFailedJeScheduleTransactionKey, exports.removeJeScheduleLocalDataById = _a.removeJeScheduleLocalDataById, exports.removeJeScheduleTransactionKey = _a.removeJeScheduleTransactionKey, exports.retryJeSchedule = _a.retryJeSchedule, exports.retryJeScheduleFailure = _a.retryJeScheduleFailure, exports.retryJeScheduleSuccess = _a.retryJeScheduleSuccess, exports.saveAccountSettings = _a.saveAccountSettings, exports.saveAccountSettingsFailure = _a.saveAccountSettingsFailure, exports.saveAccountSettingsLocalData = _a.saveAccountSettingsLocalData, exports.saveAccountSettingsSuccess = _a.saveAccountSettingsSuccess, exports.toggleJECreatedGroupCollapsed = _a.toggleJECreatedGroupCollapsed, exports.toggleJEPendingGroupCollapsed = _a.toggleJEPendingGroupCollapsed, exports.updateAccountSettingsListForAccountTypes = _a.updateAccountSettingsListForAccountTypes, exports.updateAccountSettingsListForAccountTypesFailure = _a.updateAccountSettingsListForAccountTypesFailure, exports.updateJESchedulesUIState = _a.updateJESchedulesUIState, exports.updateJEScheduleTypeFilter = _a.updateJEScheduleTypeFilter, exports.updateJeScheduleLocalDataById = _a.updateJeScheduleLocalDataById, exports.updateJeScheduleTransactionKeys = _a.updateJeScheduleTransactionKeys, exports.updateRecommendationForAccountSettings = _a.updateRecommendationForAccountSettings, exports.updateRecommendationForAccountSettingsFailure = _a.updateRecommendationForAccountSettingsFailure;
|
|
398
412
|
exports.default = expenseAutomationJESchedulesView.reducer;
|
|
399
413
|
const doUpdateRecommendationForAccountSettings = (draft, payload) => {
|
|
400
414
|
const { prepaidExpensesRecommendations, fixedAssetsRecommendations, accruedExpensesRecommendations, } = (0, accountTypeRecommendationPayload_1.mapAccountTypeRecommendationPayloadToAccountRecommendationByType)(payload);
|
|
@@ -5,11 +5,29 @@ import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndRep
|
|
|
5
5
|
import { AccountBase } from '../../../entity/account/accountState';
|
|
6
6
|
import { ClassBase } from '../../../entity/class/classState';
|
|
7
7
|
import { JEScheduledTransaction } from '../../../entity/jeSchedules/jeSchedulesSelector';
|
|
8
|
-
import { JEScheduleTransactionKey } from '../../../entity/jeSchedules/jeSchedulesTypes';
|
|
8
|
+
import { JEScheduleTransactionKey, ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
|
|
9
9
|
import { UncategorizedAccounts } from '../../accountList/accountListSelector';
|
|
10
10
|
import { JEAccountSettingsView } from '../selectorTypes/jeAccountSettingsViewSelectorTypes';
|
|
11
11
|
import { JEScheduledTransactionWithFailedEntries } from '../selectors/jeSchedulesViewSelector';
|
|
12
12
|
import { JEScheduleLocalData, JESchedulesViewUIState } from '../types/jeSchedulesViewState';
|
|
13
|
+
export interface JEKpiSummary {
|
|
14
|
+
aiAccountant: {
|
|
15
|
+
amount: number;
|
|
16
|
+
count: number;
|
|
17
|
+
};
|
|
18
|
+
manual: {
|
|
19
|
+
amount: number;
|
|
20
|
+
count: number;
|
|
21
|
+
};
|
|
22
|
+
needsReview: {
|
|
23
|
+
amount: number;
|
|
24
|
+
count: number;
|
|
25
|
+
};
|
|
26
|
+
total: {
|
|
27
|
+
amount: number;
|
|
28
|
+
count: number;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
13
31
|
export interface ExpenseAutomationJESchedulesViewSelector extends SelectorView {
|
|
14
32
|
accountListNestedAccountHierarchy: NestedAccountHierarchyForReport[];
|
|
15
33
|
accountSettingsView: JEAccountSettingsView;
|
|
@@ -18,13 +36,18 @@ export interface ExpenseAutomationJESchedulesViewSelector extends SelectorView {
|
|
|
18
36
|
allDepreciationAccountList: AccountBase[];
|
|
19
37
|
allDepreciationAccountListNestedAccountHierarchy: NestedAccountHierarchyForReport[];
|
|
20
38
|
classListNestedAccountHierarchy: NestedClassHierarchyForReport[];
|
|
21
|
-
completedSchedules: JEScheduledTransaction[];
|
|
22
39
|
completionStatus: CompletionStatusType;
|
|
23
|
-
|
|
40
|
+
createdSchedules: JEScheduledTransaction[];
|
|
41
|
+
createdTotal: number;
|
|
24
42
|
ignoreStatusById: Record<JEScheduleTransactionKey, FetchStateAndError>;
|
|
25
43
|
jeScheduleLocalDataById: Record<ID, JEScheduleLocalData>;
|
|
26
|
-
|
|
44
|
+
jeScheduleTypeCounts: {
|
|
45
|
+
active: Record<ScheduleTypes, number>;
|
|
46
|
+
ongoing: Record<ScheduleTypes, number>;
|
|
47
|
+
};
|
|
48
|
+
kpiSummary: JEKpiSummary;
|
|
27
49
|
pendingReviewSchedules: (JEScheduledTransaction | JEScheduledTransactionWithFailedEntries)[];
|
|
50
|
+
pendingReviewTotal: number;
|
|
28
51
|
postStatusById: Record<ID, FetchStateAndError>;
|
|
29
52
|
refreshStatus: FetchStateAndError;
|
|
30
53
|
resolveSchedules: JEScheduledTransactionWithFailedEntries[];
|
|
@@ -10,6 +10,7 @@ const reduceFetchState_1 = require("../../../commonStateTypes/reduceFetchState")
|
|
|
10
10
|
const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
|
|
11
11
|
const accountSelector_1 = require("../../../entity/account/accountSelector");
|
|
12
12
|
const jeSchedulesSelector_1 = require("../../../entity/jeSchedules/jeSchedulesSelector");
|
|
13
|
+
const jeSchedulesTypes_1 = require("../../../entity/jeSchedules/jeSchedulesTypes");
|
|
13
14
|
const tenantSelector_1 = require("../../../entity/tenant/tenantSelector");
|
|
14
15
|
const accountListSelector_1 = require("../../accountList/accountListSelector");
|
|
15
16
|
const classListSelector_1 = require("../../classList/classListSelector");
|
|
@@ -59,7 +60,7 @@ function getJEScheduleSortAccessor(sortKey) {
|
|
|
59
60
|
case 'totalAmount':
|
|
60
61
|
return (s) => s.baseTransaction.amount.amount;
|
|
61
62
|
case 'transactionDate':
|
|
62
|
-
return (s) => s.
|
|
63
|
+
return (s) => s.createTime?.valueOf();
|
|
63
64
|
case 'memo':
|
|
64
65
|
return (s) => s.baseTransaction.memo?.toLowerCase();
|
|
65
66
|
default:
|
|
@@ -119,11 +120,7 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
119
120
|
const jeScheduleDetails = (0, jeSchedulesSelector_1.getJEScheduledTransactionByJEScheduleTransactionKey)(jeScheduleKey, state);
|
|
120
121
|
failedJeScheduledTransaction.push(jeScheduleDetails);
|
|
121
122
|
});
|
|
122
|
-
const { sortKey, sortOrder } = uiState;
|
|
123
|
-
const draftSchedules = sortJEScheduledTransactions(jeScheduledTransaction.filter((schedule) => schedule.status.code === 'draft'), sortKey, sortOrder);
|
|
124
|
-
const ongoingSchedules = sortJEScheduledTransactions(jeScheduledTransaction.filter((schedule) => schedule.status.code === 'ongoing'), sortKey, sortOrder);
|
|
125
|
-
const completedSchedules = sortJEScheduledTransactions(jeScheduledTransaction.filter((schedule) => schedule.status.code === 'completed' ||
|
|
126
|
-
schedule.status.code === 'marked_as_completed'), sortKey, sortOrder);
|
|
123
|
+
const { sortKey, sortOrder, selectedJETypeFilter } = uiState;
|
|
127
124
|
const unsortedResolveSchedules = [];
|
|
128
125
|
failedJeScheduledTransaction.forEach((schedule) => {
|
|
129
126
|
schedule.scheduledJournalEntry.forEach((journalEntry) => {
|
|
@@ -136,9 +133,42 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
136
133
|
const resolveSchedules = sortJEScheduledTransactions(unsortedResolveSchedules, sortKey, sortOrder);
|
|
137
134
|
const validResolveForPending = unsortedResolveSchedules.filter((r) => jeScheduleLocalDataById[r.scheduledJournalEntry.scheduledJournalEntryID] != null);
|
|
138
135
|
const pendingReviewSchedules = sortJEScheduledTransactions([
|
|
139
|
-
...jeScheduledTransaction.filter((schedule) => schedule.status.code === 'draft'
|
|
136
|
+
...jeScheduledTransaction.filter((schedule) => schedule.status.code === 'draft' &&
|
|
137
|
+
(selectedJETypeFilter == null ||
|
|
138
|
+
schedule.jeScheduleType === selectedJETypeFilter)),
|
|
140
139
|
...validResolveForPending,
|
|
141
140
|
], sortKey, sortOrder);
|
|
141
|
+
const createdSchedules = sortJEScheduledTransactions(jeScheduledTransaction.filter((schedule) => (schedule.status.code === 'ongoing' ||
|
|
142
|
+
schedule.status.code === 'completed' ||
|
|
143
|
+
schedule.status.code === 'marked_as_completed') &&
|
|
144
|
+
(selectedJETypeFilter == null ||
|
|
145
|
+
schedule.jeScheduleType === selectedJETypeFilter)), sortKey, sortOrder);
|
|
146
|
+
// KPI summary — derived from unfiltered schedules so counts are always accurate
|
|
147
|
+
const allSchedules = jeScheduledTransaction;
|
|
148
|
+
const sumAmount = (schedules) => schedules.reduce((total, schedule) => total + (schedule.baseTransaction.amount.amount ?? 0), 0);
|
|
149
|
+
const pendingReviewTotal = sumAmount(pendingReviewSchedules);
|
|
150
|
+
const createdTotal = sumAmount(createdSchedules);
|
|
151
|
+
const aiAccountantSchedules = allSchedules.filter((schedule) => schedule.confidenceScore != null);
|
|
152
|
+
const pendingUnfiltered = allSchedules.filter((schedule) => schedule.status.code === 'draft');
|
|
153
|
+
const kpiSummary = {
|
|
154
|
+
aiAccountant: {
|
|
155
|
+
count: aiAccountantSchedules.length,
|
|
156
|
+
amount: sumAmount(aiAccountantSchedules),
|
|
157
|
+
},
|
|
158
|
+
manual: {
|
|
159
|
+
count: allSchedules.filter((schedule) => schedule.confidenceScore == null)
|
|
160
|
+
.length,
|
|
161
|
+
amount: sumAmount(allSchedules.filter((schedule) => schedule.confidenceScore == null)),
|
|
162
|
+
},
|
|
163
|
+
needsReview: {
|
|
164
|
+
count: pendingUnfiltered.length,
|
|
165
|
+
amount: sumAmount(pendingUnfiltered),
|
|
166
|
+
},
|
|
167
|
+
total: {
|
|
168
|
+
count: allSchedules.length,
|
|
169
|
+
amount: sumAmount(allSchedules),
|
|
170
|
+
},
|
|
171
|
+
};
|
|
142
172
|
const allSteps = monthYearPeriodId != null
|
|
143
173
|
? (0, expenseAutomationViewSelectorTypes_1.getAllSteps)(monthEndCloseChecksState, monthYearPeriodId, currentTenant.tenantId)
|
|
144
174
|
: [];
|
|
@@ -151,6 +181,22 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
151
181
|
{ fetchState, error },
|
|
152
182
|
monthEndFetchState,
|
|
153
183
|
]);
|
|
184
|
+
const countByType = (schedules) => {
|
|
185
|
+
const counts = jeSchedulesTypes_1.ALL_SCHEDULES_TYPES.reduce((acc, type) => ({ ...acc, [type]: 0 }), {});
|
|
186
|
+
schedules.forEach((schedule) => {
|
|
187
|
+
if (schedule.jeScheduleType != null) {
|
|
188
|
+
counts[schedule.jeScheduleType] += 1;
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
return counts;
|
|
192
|
+
};
|
|
193
|
+
const jeScheduleTypeCounts = {
|
|
194
|
+
active: countByType(allSchedules.filter((schedule) => schedule.status.code === 'draft' ||
|
|
195
|
+
schedule.status.code === 'ongoing' ||
|
|
196
|
+
schedule.status.code === 'completed' ||
|
|
197
|
+
schedule.status.code === 'marked_as_completed')),
|
|
198
|
+
ongoing: countByType(allSchedules.filter((schedule) => schedule.status.code === 'ongoing')),
|
|
199
|
+
};
|
|
154
200
|
return {
|
|
155
201
|
uncategorizedAccounts,
|
|
156
202
|
allDepreciationAccountList: filteredDepAccounts,
|
|
@@ -159,10 +205,12 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
159
205
|
allAccountList: filteredAccounts,
|
|
160
206
|
accountListNestedAccountHierarchy,
|
|
161
207
|
allClassList: allClasses,
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
208
|
+
createdSchedules,
|
|
209
|
+
createdTotal,
|
|
210
|
+
jeScheduleTypeCounts,
|
|
211
|
+
kpiSummary,
|
|
165
212
|
pendingReviewSchedules,
|
|
213
|
+
pendingReviewTotal,
|
|
166
214
|
resolveSchedules: resolveSchedules,
|
|
167
215
|
accountSettingsView,
|
|
168
216
|
postStatusById: postStatusById,
|
|
@@ -8,15 +8,18 @@ import { JEScheduleTransactionKey, ScheduleTypes } from '../../../entity/jeSched
|
|
|
8
8
|
import { VendorBase } from '../../../entity/vendor/vendorState';
|
|
9
9
|
export declare const toJEScheduleSortKey: (v: string) => "vendor" | "type" | "category" | "class" | "memo" | "transactionDate" | "totalAmount" | "runningBalance" | "depCategory" | "scheduleCategory" | "startMonth" | "amortizationPeriod" | "jePostingDate" | "remainingMonths";
|
|
10
10
|
export type JEScheduleSortKey = ReturnType<typeof toJEScheduleSortKey>;
|
|
11
|
-
export declare const
|
|
12
|
-
export type
|
|
11
|
+
export declare const toJEPageTab: (v: string) => "schedules" | "existing_schedules";
|
|
12
|
+
export type JEPageTab = ReturnType<typeof toJEPageTab>;
|
|
13
13
|
export interface JESchedulesViewUIState {
|
|
14
|
+
createdGroupCollapsed: boolean;
|
|
15
|
+
pendingGroupCollapsed: boolean;
|
|
14
16
|
scrollPosition: {
|
|
15
17
|
scrollTop: number;
|
|
16
18
|
scrollLeft?: number;
|
|
17
19
|
} | undefined;
|
|
18
20
|
searchString: string;
|
|
19
|
-
|
|
21
|
+
selectedJETypeFilter: ScheduleTypes | null;
|
|
22
|
+
selectedPageTab: JEPageTab;
|
|
20
23
|
sortKey: JEScheduleSortKey;
|
|
21
24
|
sortOrder: SortOrder;
|
|
22
25
|
totalCount: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.toJEPageTab = exports.toJEScheduleSortKey = void 0;
|
|
4
4
|
const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
|
|
5
5
|
const JE_SCHEDULE_SORT_KEYS = [
|
|
6
6
|
'vendor',
|
|
@@ -20,10 +20,6 @@ const JE_SCHEDULE_SORT_KEYS = [
|
|
|
20
20
|
];
|
|
21
21
|
const toJEScheduleSortKey = (v) => (0, stringToUnion_1.stringToUnion)(v, JE_SCHEDULE_SORT_KEYS);
|
|
22
22
|
exports.toJEScheduleSortKey = toJEScheduleSortKey;
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
'completed',
|
|
27
|
-
];
|
|
28
|
-
const toJEScheduleMainTab = (v) => (0, stringToUnion_1.stringToUnion)(v, JE_SCHEDULE_MAIN_TABS);
|
|
29
|
-
exports.toJEScheduleMainTab = toJEScheduleMainTab;
|
|
23
|
+
const JE_PAGE_TABS = ['schedules', 'existing_schedules'];
|
|
24
|
+
const toJEPageTab = (v) => (0, stringToUnion_1.stringToUnion)(v, JE_PAGE_TABS);
|
|
25
|
+
exports.toJEPageTab = toJEPageTab;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { updateNotificationRegistry } from '../../../entity/notificationRegistry/notificationRegistryReducer';
|
|
3
2
|
import { RootState } from '../../../reducer';
|
|
4
3
|
import { ZeniAPI } from '../../../zeniAPI';
|
|
5
|
-
import { fetchNotificationPreferencesSuccess } from '../../notificationPreferencesView/notificationPreferencesViewReducer';
|
|
6
4
|
import { fetchNotificationSettings, updateNotificationSettingsOnFailure, updateNotificationSettingsOnSuccess } from '../settingsViewReducer';
|
|
7
|
-
export type ActionType = ReturnType<typeof fetchNotificationSettings> | ReturnType<typeof updateNotificationSettingsOnSuccess> | ReturnType<typeof updateNotificationSettingsOnFailure
|
|
5
|
+
export type ActionType = ReturnType<typeof fetchNotificationSettings> | ReturnType<typeof updateNotificationSettingsOnSuccess> | ReturnType<typeof updateNotificationSettingsOnFailure>;
|
|
8
6
|
export declare const fetchNotificationSettingsEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
|
|
9
7
|
payload: undefined;
|
|
10
8
|
type: "settings/fetchNotificationSettings";
|
|
@@ -17,10 +15,4 @@ export declare const fetchNotificationSettingsEpic: (actions$: ActionsObservable
|
|
|
17
15
|
} | {
|
|
18
16
|
payload: import("../../../responsePayload").ZeniAPIStatus<Record<string, unknown>>;
|
|
19
17
|
type: "settings/updateNotificationSettingsOnFailure";
|
|
20
|
-
} | {
|
|
21
|
-
payload: import("../../../entity/notificationRegistry/notificationRegistryPayload").NotificationRegistryPayload;
|
|
22
|
-
type: "notificationRegistry/updateNotificationRegistry";
|
|
23
|
-
} | {
|
|
24
|
-
payload: import("../../notificationPreferencesView/notificationPreferencesViewPayload").NotificationPreferencesPayload | undefined;
|
|
25
|
-
type: "notificationPreferencesView/fetchNotificationPreferencesSuccess";
|
|
26
18
|
}>;
|
|
@@ -3,30 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.fetchNotificationSettingsEpic = void 0;
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const notificationRegistryReducer_1 = require("../../../entity/notificationRegistry/notificationRegistryReducer");
|
|
7
6
|
const responsePayload_1 = require("../../../responsePayload");
|
|
8
|
-
const notificationPreferencesEndpoint_1 = require("../../notificationPreferencesView/notificationPreferencesEndpoint");
|
|
9
|
-
const notificationPreferencesViewReducer_1 = require("../../notificationPreferencesView/notificationPreferencesViewReducer");
|
|
10
7
|
const settingsViewReducer_1 = require("../settingsViewReducer");
|
|
11
8
|
const fetchNotificationSettingsEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(settingsViewReducer_1.fetchNotificationSettings.match), (0, operators_1.switchMap)(() => {
|
|
12
9
|
const state = state$.value;
|
|
10
|
+
const URL = `${zeniAPI.apiEndPoints.notificationMicroServiceBaseUrl}/1.0/notification-preferences`;
|
|
13
11
|
const userEmail = state.tenantState.loggedInUser?.userEmail;
|
|
14
12
|
if (userEmail == null) {
|
|
15
13
|
return (0, rxjs_1.from)([]);
|
|
16
14
|
}
|
|
17
|
-
return zeniAPI
|
|
18
|
-
.getJSON((0, notificationPreferencesEndpoint_1.notificationPreferencesUrl)(zeniAPI))
|
|
19
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
15
|
+
return zeniAPI.getJSON(URL).pipe((0, operators_1.mergeMap)((response) => {
|
|
20
16
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
21
17
|
const updateActions = [
|
|
22
18
|
(0, settingsViewReducer_1.updateNotificationSettingsOnSuccess)(response.data, userEmail),
|
|
23
19
|
];
|
|
24
|
-
if (response.data.task_checklist_registry != null) {
|
|
25
|
-
updateActions.push((0, notificationRegistryReducer_1.updateNotificationRegistry)(response.data.task_checklist_registry));
|
|
26
|
-
}
|
|
27
|
-
if (response.data.task_checklist_preferences != null) {
|
|
28
|
-
updateActions.push((0, notificationPreferencesViewReducer_1.fetchNotificationPreferencesSuccess)(response.data.task_checklist_preferences));
|
|
29
|
-
}
|
|
30
20
|
return (0, rxjs_1.of)(...updateActions);
|
|
31
21
|
}
|
|
32
22
|
else {
|
|
@@ -14,4 +14,4 @@ export declare const isMyBankConnectionsTabVisible: (currentTenant: CurrentTenan
|
|
|
14
14
|
export declare const isPerformanceTabVisible: (userRole: UserRoleType[], loggedInUser?: LoggedInUser) => boolean;
|
|
15
15
|
export declare const isRemindersSectionVisibleOnSettingsPage: (reminderNotificationSettings: ReminderNotificationSettingsData) => boolean;
|
|
16
16
|
export declare const isMonthEndNotificationsSectionVisibleOnSettingsPage: (monthEndInsightsNotificationSettings: MonthEndInsightsNotificationSettingsData, signedInUseEmail: string) => boolean;
|
|
17
|
-
export declare const isNotificationsTabVisible: (notificationSettings: NotificationSettingsData, signedInUseEmail: string, isDebitCardFlagEnabled: boolean, currentTenant: CurrentTenant | undefined
|
|
17
|
+
export declare const isNotificationsTabVisible: (notificationSettings: NotificationSettingsData, signedInUseEmail: string, isDebitCardFlagEnabled: boolean, currentTenant: CurrentTenant | undefined) => boolean;
|
|
@@ -160,14 +160,13 @@ const isMonthEndNotificationsSectionVisibleOnSettingsPage = (monthEndInsightsNot
|
|
|
160
160
|
monthEndInsightsNotificationSettings.recipientEmailIds.includes(signedInUseEmail));
|
|
161
161
|
};
|
|
162
162
|
exports.isMonthEndNotificationsSectionVisibleOnSettingsPage = isMonthEndNotificationsSectionVisibleOnSettingsPage;
|
|
163
|
-
const isNotificationsTabVisible = (notificationSettings, signedInUseEmail, isDebitCardFlagEnabled, currentTenant
|
|
163
|
+
const isNotificationsTabVisible = (notificationSettings, signedInUseEmail, isDebitCardFlagEnabled, currentTenant) => {
|
|
164
164
|
if (currentTenant == null) {
|
|
165
165
|
return false;
|
|
166
166
|
}
|
|
167
167
|
const { reminderNotificationSettings, monthEndInsightsNotificationSettings } = notificationSettings;
|
|
168
168
|
return (((0, exports.isRemindersSectionVisibleOnSettingsPage)(reminderNotificationSettings) ||
|
|
169
|
-
(0, exports.isMonthEndNotificationsSectionVisibleOnSettingsPage)(monthEndInsightsNotificationSettings, signedInUseEmail)
|
|
170
|
-
hasTaskChecklistAccess) &&
|
|
169
|
+
(0, exports.isMonthEndNotificationsSectionVisibleOnSettingsPage)(monthEndInsightsNotificationSettings, signedInUseEmail)) &&
|
|
171
170
|
((0, tenantSelector_1.isTenantAccountingServicesEnabled)(currentTenant) ||
|
|
172
171
|
((0, tenantSelector_1.isTenantBankingOnly)(isDebitCardFlagEnabled, currentTenant) === false &&
|
|
173
172
|
(0, tenantSelector_1.isTenantCardsOnly)(currentTenant) === false)));
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { AddressPayload } from '../../entity/address/addressPayload';
|
|
2
2
|
import { CompanyPayload } from '../../entity/company/companyPayload';
|
|
3
|
-
import { NotificationRegistryPayload } from '../../entity/notificationRegistry/notificationRegistryPayload';
|
|
4
3
|
import { UserPayload } from '../../entity/user/userPayload';
|
|
5
4
|
import { UserRolePayload } from '../../entity/userRole/userRolePayload';
|
|
6
5
|
import { ZeniAPIResponse } from '../../responsePayload';
|
|
7
6
|
import { AddressUpdatableInfoPayload } from '../addressView/addressViewPayload';
|
|
8
|
-
import { NotificationPreferencesPayload } from '../notificationPreferencesView/notificationPreferencesViewPayload';
|
|
9
7
|
interface MyProfilePeoplePayload {
|
|
10
8
|
user_roles: UserRolePayload[];
|
|
11
9
|
users: UserPayload[];
|
|
@@ -38,8 +36,6 @@ export interface NotificationSettingsPayload {
|
|
|
38
36
|
pending_reimbursement_approval_notification: RemindersPayload | null;
|
|
39
37
|
uncategorized_transaction_notification: RemindersPayload | null;
|
|
40
38
|
month_end_email_recipient_email_ids?: string[];
|
|
41
|
-
task_checklist_preferences?: NotificationPreferencesPayload;
|
|
42
|
-
task_checklist_registry?: NotificationRegistryPayload;
|
|
43
39
|
}
|
|
44
40
|
export type NotificationSettingsResponse = ZeniAPIResponse<NotificationSettingsPayload>;
|
|
45
41
|
interface RefreshQBOPayload {
|
|
@@ -12,7 +12,7 @@ export interface IntegrationsSettings {
|
|
|
12
12
|
export declare const REMINDER_NOTIFICATION_TYPES: readonly ["missingReceiptNotification", "uncategorizedTransactionNotification", "pendingBillApprovalNotification", "pendingReimbursementApprovalNotification"];
|
|
13
13
|
declare const toReminderTypeKey: (v: string) => "missingReceiptNotification" | "uncategorizedTransactionNotification" | "pendingBillApprovalNotification" | "pendingReimbursementApprovalNotification";
|
|
14
14
|
export type ReminderTypeKey = ReturnType<typeof toReminderTypeKey>;
|
|
15
|
-
export declare const toRemindersFrequencyType: (v: string) => "
|
|
15
|
+
export declare const toRemindersFrequencyType: (v: string) => "weekly" | "monthly" | "daily" | "bi-weekly";
|
|
16
16
|
export type FrequencyTypeKey = ReturnType<typeof toRemindersFrequencyType>;
|
|
17
17
|
export declare const NOTIFICATION_MODES: readonly ["email", "dashboard"];
|
|
18
18
|
export declare const toNotificationMode: (v: string) => "dashboard" | "email";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.1.54-
|
|
3
|
+
"version": "5.1.54-betaRD2",
|
|
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,18 +0,0 @@
|
|
|
1
|
-
import { NotificationRegistry } from './notificationRegistryState';
|
|
2
|
-
export interface NotificationEventPayload {
|
|
3
|
-
channels: string[];
|
|
4
|
-
default_enabled: Record<string, boolean>;
|
|
5
|
-
display_name: string;
|
|
6
|
-
event_id: string;
|
|
7
|
-
suppressible: boolean;
|
|
8
|
-
}
|
|
9
|
-
export interface NotificationGroupPayload {
|
|
10
|
-
display_name: string;
|
|
11
|
-
events: NotificationEventPayload[];
|
|
12
|
-
group_id: string;
|
|
13
|
-
}
|
|
14
|
-
export interface NotificationRegistryPayload {
|
|
15
|
-
frequency_options: string[];
|
|
16
|
-
groups: NotificationGroupPayload[];
|
|
17
|
-
}
|
|
18
|
-
export declare const mapNotificationRegistryPayloadToRegistry: (payload: NotificationRegistryPayload) => NotificationRegistry;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mapNotificationRegistryPayloadToRegistry = void 0;
|
|
4
|
-
const notificationRegistryState_1 = require("./notificationRegistryState");
|
|
5
|
-
const mapDefaultEnabled = (raw) => {
|
|
6
|
-
const out = {};
|
|
7
|
-
Object.entries(raw).forEach(([channel, enabled]) => {
|
|
8
|
-
out[(0, notificationRegistryState_1.toNotificationChannel)(channel)] = enabled;
|
|
9
|
-
});
|
|
10
|
-
return out;
|
|
11
|
-
};
|
|
12
|
-
const mapEvent = (payload) => ({
|
|
13
|
-
channels: payload.channels.map(notificationRegistryState_1.toNotificationChannel),
|
|
14
|
-
defaultEnabled: mapDefaultEnabled(payload.default_enabled),
|
|
15
|
-
displayName: payload.display_name,
|
|
16
|
-
eventId: payload.event_id,
|
|
17
|
-
suppressible: payload.suppressible,
|
|
18
|
-
});
|
|
19
|
-
const mapGroup = (payload) => ({
|
|
20
|
-
displayName: payload.display_name,
|
|
21
|
-
events: payload.events.map(mapEvent),
|
|
22
|
-
groupId: payload.group_id,
|
|
23
|
-
});
|
|
24
|
-
const mapNotificationRegistryPayloadToRegistry = (payload) => ({
|
|
25
|
-
frequencyOptions: payload.frequency_options.map(notificationRegistryState_1.toNotificationFrequency),
|
|
26
|
-
groups: payload.groups.map(mapGroup),
|
|
27
|
-
});
|
|
28
|
-
exports.mapNotificationRegistryPayloadToRegistry = mapNotificationRegistryPayloadToRegistry;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { NotificationRegistryPayload } from './notificationRegistryPayload';
|
|
2
|
-
import { NotificationRegistryState } from './notificationRegistryState';
|
|
3
|
-
export declare const initialState: NotificationRegistryState;
|
|
4
|
-
export declare const clearAllNotificationRegistry: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"notificationRegistry/clearAllNotificationRegistry">, updateNotificationRegistry: import("@reduxjs/toolkit").ActionCreatorWithPayload<NotificationRegistryPayload, "notificationRegistry/updateNotificationRegistry">;
|
|
5
|
-
declare const _default: import("redux").Reducer<NotificationRegistryState>;
|
|
6
|
-
export default _default;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var _a;
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.updateNotificationRegistry = exports.clearAllNotificationRegistry = exports.initialState = void 0;
|
|
5
|
-
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
-
const notificationRegistryPayload_1 = require("./notificationRegistryPayload");
|
|
7
|
-
exports.initialState = {};
|
|
8
|
-
const notificationRegistry = (0, toolkit_1.createSlice)({
|
|
9
|
-
name: 'notificationRegistry',
|
|
10
|
-
initialState: exports.initialState,
|
|
11
|
-
reducers: {
|
|
12
|
-
clearAllNotificationRegistry() {
|
|
13
|
-
return exports.initialState;
|
|
14
|
-
},
|
|
15
|
-
updateNotificationRegistry(draft, action) {
|
|
16
|
-
// Full-replace contract: the registry payload is atomic — every fetch
|
|
17
|
-
// returns the complete group/event tree. If the backend ever ships a
|
|
18
|
-
// partial registry response, this write MUST switch to a merge (mirror
|
|
19
|
-
// the preferences slice's `mergePreferences`). Do not assume the
|
|
20
|
-
// current payload is partial without also updating this reducer.
|
|
21
|
-
draft.registry = (0, notificationRegistryPayload_1.mapNotificationRegistryPayloadToRegistry)(action.payload);
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
});
|
|
25
|
-
_a = notificationRegistry.actions, exports.clearAllNotificationRegistry = _a.clearAllNotificationRegistry, exports.updateNotificationRegistry = _a.updateNotificationRegistry;
|
|
26
|
-
exports.default = notificationRegistry.reducer;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getNotificationRegistry = void 0;
|
|
4
|
-
// Current behavior: a null / undefined registry means the whole notification
|
|
5
|
-
// section is hidden by consumers. This conflates two distinct states —
|
|
6
|
-
// "user has no saved preferences yet" vs "the Task Checklist feature gate is
|
|
7
|
-
// off for this tenant". Both currently surface as `undefined`. Distinguishing
|
|
8
|
-
// them (e.g. an explicit `gate_off` signal from the server) is a follow-up.
|
|
9
|
-
const getNotificationRegistry = (slice) => slice.registry;
|
|
10
|
-
exports.getNotificationRegistry = getNotificationRegistry;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export declare const NOTIFICATION_CHANNELS: readonly ["email", "slack", "in_app"];
|
|
2
|
-
export type NotificationChannel = (typeof NOTIFICATION_CHANNELS)[number];
|
|
3
|
-
export declare const toNotificationChannel: (raw: string) => NotificationChannel;
|
|
4
|
-
export declare const NOTIFICATION_FREQUENCIES: readonly ["instant", "daily"];
|
|
5
|
-
export type NotificationFrequency = (typeof NOTIFICATION_FREQUENCIES)[number];
|
|
6
|
-
export declare const toNotificationFrequency: (raw: string) => NotificationFrequency;
|
|
7
|
-
export interface RegistryNotificationEvent {
|
|
8
|
-
channels: NotificationChannel[];
|
|
9
|
-
defaultEnabled: Partial<Record<NotificationChannel, boolean>>;
|
|
10
|
-
displayName: string;
|
|
11
|
-
eventId: string;
|
|
12
|
-
suppressible: boolean;
|
|
13
|
-
}
|
|
14
|
-
export interface RegistryNotificationGroup {
|
|
15
|
-
displayName: string;
|
|
16
|
-
events: RegistryNotificationEvent[];
|
|
17
|
-
groupId: string;
|
|
18
|
-
}
|
|
19
|
-
export interface NotificationRegistry {
|
|
20
|
-
frequencyOptions: NotificationFrequency[];
|
|
21
|
-
groups: RegistryNotificationGroup[];
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* The registry is a singleton (not per-tenant). We keep the wrapper so
|
|
25
|
-
* Immer/RTK can safely represent "cleared" as `registry: undefined` — a bare
|
|
26
|
-
* top-level `undefined` state is not observable by Immer, which prevents
|
|
27
|
-
* `clearAllNotificationRegistry` from taking effect.
|
|
28
|
-
*/
|
|
29
|
-
export interface NotificationRegistryState {
|
|
30
|
-
registry?: NotificationRegistry;
|
|
31
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toNotificationFrequency = exports.NOTIFICATION_FREQUENCIES = exports.toNotificationChannel = exports.NOTIFICATION_CHANNELS = void 0;
|
|
4
|
-
const stringToUnion_1 = require("../../commonStateTypes/stringToUnion");
|
|
5
|
-
exports.NOTIFICATION_CHANNELS = ['email', 'slack', 'in_app'];
|
|
6
|
-
const toNotificationChannel = (raw) => (0, stringToUnion_1.stringToUnion)(raw, exports.NOTIFICATION_CHANNELS);
|
|
7
|
-
exports.toNotificationChannel = toNotificationChannel;
|
|
8
|
-
exports.NOTIFICATION_FREQUENCIES = ['instant', 'daily'];
|
|
9
|
-
const toNotificationFrequency = (raw) => (0, stringToUnion_1.stringToUnion)(raw, exports.NOTIFICATION_FREQUENCIES);
|
|
10
|
-
exports.toNotificationFrequency = toNotificationFrequency;
|