@zeniai/client-epic-state 4.8.46 → 4.8.48

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 (45) hide show
  1. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  2. package/lib/entity/snackbar/snackbarTypes.js +1 -0
  3. package/lib/epic.d.ts +3 -1
  4. package/lib/epic.js +3 -1
  5. package/lib/index.d.ts +11 -10
  6. package/lib/index.js +27 -15
  7. package/lib/view/commonVendorView/vendorView/epics/saveVendorEpic.js +31 -4
  8. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewReducer.d.ts +5 -1
  9. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewReducer.js +12 -2
  10. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.d.ts +14 -0
  11. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +36 -4
  12. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewState.d.ts +7 -0
  13. package/lib/view/people/changeZeniPersonRolesEpic.d.ts +1 -1
  14. package/lib/view/people/deletePersonEpic.d.ts +1 -1
  15. package/lib/view/people/invitePeopleEpic.d.ts +1 -1
  16. package/lib/view/people/inviteZeniPeopleEpic.d.ts +1 -1
  17. package/lib/view/people/resendInviteEpic.d.ts +1 -1
  18. package/lib/view/settingsView/epic/fetchNotificationSettingsEpic.d.ts +17 -0
  19. package/lib/view/settingsView/epic/fetchNotificationSettingsEpic.js +23 -0
  20. package/lib/view/settingsView/epic/saveNotificationSettingsEpic.d.ts +31 -0
  21. package/lib/view/settingsView/epic/saveNotificationSettingsEpic.js +70 -0
  22. package/lib/view/settingsView/settingsViewHelpers.d.ts +2 -0
  23. package/lib/view/settingsView/settingsViewHelpers.js +11 -0
  24. package/lib/view/settingsView/settingsViewPayload.d.ts +7 -0
  25. package/lib/view/settingsView/settingsViewReducer.d.ts +7 -2
  26. package/lib/view/settingsView/settingsViewReducer.js +115 -2
  27. package/lib/view/settingsView/settingsViewSelector.d.ts +2 -0
  28. package/lib/view/settingsView/settingsViewSelector.js +4 -1
  29. package/lib/view/settingsView/settingsViewState.d.ts +18 -0
  30. package/lib/view/settingsView/settingsViewState.js +15 -0
  31. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +1 -0
  32. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +24 -22
  33. package/lib/view/spendManagement/billPay/editBillView/editBillViewState.d.ts +1 -0
  34. package/lib/view/spendManagement/billPay/editBillView/editBillViewState.js +1 -0
  35. package/lib/view/spendManagement/billPay/editBillView/epics/initializeBillToLocalStoreEpic.js +1 -0
  36. package/lib/view/spendManagement/billPay/editBillView/epics/parseInvoiceToBillEpic.d.ts +1 -1
  37. package/lib/view/spendManagement/billPay/editBillView/epics/parseInvoiceToBillEpic.js +7 -2
  38. package/lib/view/spendManagement/helpers.js +11 -4
  39. package/lib/view/transactionList/fetchTransactionListByEntityEpic.js +3 -0
  40. package/lib/view/transactionList/transactionListByEntitySelector.d.ts +4 -0
  41. package/lib/view/transactionList/transactionListByEntitySelector.js +62 -1
  42. package/lib/view/transactionList/transactionListReducer.d.ts +2 -1
  43. package/lib/view/transactionList/transactionListReducer.js +2 -2
  44. package/lib/zeniAPI.d.ts +1 -0
  45. package/package.json +1 -1
@@ -2,6 +2,7 @@ import { FetchState, ID } from '../../../commonStateTypes/common';
2
2
  import { Entity } from '../../../entity/genericEntity/entity';
3
3
  import { ZeniAPIStatus } from '../../../responsePayload';
4
4
  import { VendorsTabVendorDetailLocalData, VendorsTabVendorViewState } from './vendorsTabVendorViewState';
5
+ import { TimePeriod } from '../../../commonStateTypes/timePeriod';
5
6
  export declare const initialVendorDetailLocalData: VendorsTabVendorDetailLocalData;
6
7
  export declare const initialState: VendorsTabVendorViewState;
7
8
  export declare const fetchVendorsTabVendorDetails: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[vendorId: string, cacheOverride?: any], {
@@ -32,6 +33,9 @@ export declare const fetchVendorsTabVendorDetails: import("@reduxjs/toolkit").Ac
32
33
  vendorId: string;
33
34
  entity: Entity;
34
35
  cacheOverride: boolean | undefined;
35
- }, string, never, never>, clearVendorsTabVendorView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
36
+ }, string, never, never>, updateVendorsTabVendorAllTransactionsTabData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
37
+ timePeriod: TimePeriod;
38
+ numberOfQuartersFetched: number;
39
+ }, string>, updateSelectedTabType: import("@reduxjs/toolkit").ActionCreatorWithPayload<"spend_transactions" | "all_transactions", string>, clearVendorsTabVendorView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
36
40
  declare const _default: import("@reduxjs/toolkit").Reducer<VendorsTabVendorViewState, import("@reduxjs/toolkit").AnyAction>;
37
41
  export default _default;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.clearVendorsTabVendorView = exports.fetchVendorsTabVendorDetailPageView = exports.vendorsTabResetVendorDetailLocalData = exports.vendorsTabUpdateVendorDetailLocalData = exports.vendorsTabSaveVendorSuccessOrFailure = exports.vendorsTabSaveVendor = exports.updateVendorsTabVendorSaveStatus = exports.updateVendorsTabVendorFetchStatus = exports.fetchVendorsTabVendor = exports.fetchVendorsTabVendorDetails = exports.initialState = exports.initialVendorDetailLocalData = void 0;
4
+ exports.clearVendorsTabVendorView = exports.updateSelectedTabType = exports.updateVendorsTabVendorAllTransactionsTabData = exports.fetchVendorsTabVendorDetailPageView = exports.vendorsTabResetVendorDetailLocalData = exports.vendorsTabUpdateVendorDetailLocalData = exports.vendorsTabSaveVendorSuccessOrFailure = exports.vendorsTabSaveVendor = exports.updateVendorsTabVendorSaveStatus = exports.updateVendorsTabVendorFetchStatus = exports.fetchVendorsTabVendor = exports.fetchVendorsTabVendorDetails = exports.initialState = exports.initialVendorDetailLocalData = void 0;
5
5
  const toolkit_1 = require("@reduxjs/toolkit");
6
6
  exports.initialVendorDetailLocalData = {
7
7
  vendorId: undefined,
@@ -12,6 +12,7 @@ exports.initialVendorDetailLocalData = {
12
12
  };
13
13
  exports.initialState = {
14
14
  vendorStateById: {},
15
+ selectedTabType: 'spend_transactions',
15
16
  };
16
17
  const vendorsTabVendorView = (0, toolkit_1.createSlice)({
17
18
  name: 'vendorsTabVendorView',
@@ -154,10 +155,19 @@ const vendorsTabVendorView = (0, toolkit_1.createSlice)({
154
155
  };
155
156
  },
156
157
  },
158
+ updateVendorsTabVendorAllTransactionsTabData(draft, action) {
159
+ draft.allTransactionsTabData = {
160
+ numberOfQuartersFetched: action.payload.numberOfQuartersFetched,
161
+ timePeriod: action.payload.timePeriod,
162
+ };
163
+ },
164
+ updateSelectedTabType(draft, action) {
165
+ draft.selectedTabType = action.payload;
166
+ },
157
167
  clearVendorsTabVendorView(draft) {
158
168
  Object.assign(draft, exports.initialState);
159
169
  },
160
170
  },
161
171
  });
162
- _a = vendorsTabVendorView.actions, exports.fetchVendorsTabVendorDetails = _a.fetchVendorsTabVendorDetails, exports.fetchVendorsTabVendor = _a.fetchVendorsTabVendor, exports.updateVendorsTabVendorFetchStatus = _a.updateVendorsTabVendorFetchStatus, exports.updateVendorsTabVendorSaveStatus = _a.updateVendorsTabVendorSaveStatus, exports.vendorsTabSaveVendor = _a.vendorsTabSaveVendor, exports.vendorsTabSaveVendorSuccessOrFailure = _a.vendorsTabSaveVendorSuccessOrFailure, exports.vendorsTabUpdateVendorDetailLocalData = _a.vendorsTabUpdateVendorDetailLocalData, exports.vendorsTabResetVendorDetailLocalData = _a.vendorsTabResetVendorDetailLocalData, exports.fetchVendorsTabVendorDetailPageView = _a.fetchVendorsTabVendorDetailPageView, exports.clearVendorsTabVendorView = _a.clearVendorsTabVendorView;
172
+ _a = vendorsTabVendorView.actions, exports.fetchVendorsTabVendorDetails = _a.fetchVendorsTabVendorDetails, exports.fetchVendorsTabVendor = _a.fetchVendorsTabVendor, exports.updateVendorsTabVendorFetchStatus = _a.updateVendorsTabVendorFetchStatus, exports.updateVendorsTabVendorSaveStatus = _a.updateVendorsTabVendorSaveStatus, exports.vendorsTabSaveVendor = _a.vendorsTabSaveVendor, exports.vendorsTabSaveVendorSuccessOrFailure = _a.vendorsTabSaveVendorSuccessOrFailure, exports.vendorsTabUpdateVendorDetailLocalData = _a.vendorsTabUpdateVendorDetailLocalData, exports.vendorsTabResetVendorDetailLocalData = _a.vendorsTabResetVendorDetailLocalData, exports.fetchVendorsTabVendorDetailPageView = _a.fetchVendorsTabVendorDetailPageView, exports.updateVendorsTabVendorAllTransactionsTabData = _a.updateVendorsTabVendorAllTransactionsTabData, exports.updateSelectedTabType = _a.updateSelectedTabType, exports.clearVendorsTabVendorView = _a.clearVendorsTabVendorView;
163
173
  exports.default = vendorsTabVendorView.reducer;
@@ -12,6 +12,13 @@ import { VendorSpend } from '../../../entity/vendorExpense/vendorExpenseState';
12
12
  import { Entity } from '../../../entity/genericEntity/entity';
13
13
  import { NestedAccountHeirarchyForReport } from '../../../commonStateTypes/accountView/nestedAccountID';
14
14
  import { NestedClassHeirarchyForReport } from '../../../commonStateTypes/classesView/nestedClassID';
15
+ import { TransactionListByEntityView } from '../../transactionList/transactionListByEntitySelector';
16
+ import { TimePeriod } from '../../../commonStateTypes/timePeriod';
17
+ import { Month } from '../../../commonStateTypes/timePeriod';
18
+ import { TimeframeTick } from '../../../commonStateTypes/timeframeTick';
19
+ export declare const toVendorDetailTabsType: (v: string) => "spend_transactions" | "all_transactions";
20
+ export declare const toVendorDetailTabsTypeStrict: (v?: string | undefined) => "spend_transactions" | "all_transactions" | undefined;
21
+ export declare type VendorDetailTabsType = ReturnType<typeof toVendorDetailTabsType>;
15
22
  export interface VendorsTabVendorDetails {
16
23
  vendorBasic: VendorsTabVendorBasic;
17
24
  saveStatus: FetchStateAndError;
@@ -36,6 +43,13 @@ export interface VendorsTabVendorDetailPageView extends SelectorView {
36
43
  vendorViewDetails: VendorsTabVendorViewSelectorView;
37
44
  trendWithTransactions: TrendWithTransactionsView;
38
45
  vendorSpend: VendorSpend;
46
+ allVendorTransactionsView?: TransactionListByEntityView;
47
+ selectedTabType: VendorDetailTabsType;
48
+ allTransactionsTabData?: {
49
+ timePeriod: TimePeriod;
50
+ numberOfQuartersFetched: number;
51
+ };
39
52
  }
40
53
  export declare const getVendorsTabVendorView: (state: RootState, vendorIdFromUrl: ID) => VendorsTabVendorViewSelectorView;
41
54
  export declare const getVendorsTabDetailPageView: (state: RootState, vendorId: ID, entity: Entity) => VendorsTabVendorDetailPageView;
55
+ export declare const getVendorAllTransactionsDefaultTimePeriod: (firstMonthOfFY: Month, numberOfQuartersToGoBack: number) => TimeframeTick;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getVendorsTabDetailPageView = exports.getVendorsTabVendorView = void 0;
3
+ exports.getVendorAllTransactionsDefaultTimePeriod = exports.getVendorsTabDetailPageView = exports.getVendorsTabVendorView = exports.toVendorDetailTabsTypeStrict = exports.toVendorDetailTabsType = void 0;
4
4
  const vendorSelector_1 = require("../../../entity/vendor/vendorSelector");
5
5
  const accountListSelector_1 = require("../../accountList/accountListSelector");
6
6
  const classListSelector_1 = require("../../classList/classListSelector");
@@ -9,6 +9,19 @@ const classSelector_1 = require("../../../entity/class/classSelector");
9
9
  const trendWithTransactionsSelector_1 = require("../../trendWithTransactions/trendWithTransactionsSelector");
10
10
  const userSelector_1 = require("../../../entity/user/userSelector");
11
11
  const reduceFetchState_1 = require("../../../commonStateTypes/reduceFetchState");
12
+ const transactionListByEntitySelector_1 = require("../../transactionList/transactionListByEntitySelector");
13
+ const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
14
+ const addSubtractPeriod_1 = require("../../../commonStateTypes/fiscalYearHelpers/addSubtractPeriod");
15
+ const getStartOfAndEndOfTimeframeFY_1 = require("../../../commonStateTypes/fiscalYearHelpers/getStartOfAndEndOfTimeframeFY");
16
+ const zeniDayJS_1 = require("../../../zeniDayJS");
17
+ const ALL_VENDOR_DETAIL_TABS_TYPES = [
18
+ 'spend_transactions',
19
+ 'all_transactions',
20
+ ];
21
+ const toVendorDetailTabsType = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_VENDOR_DETAIL_TABS_TYPES);
22
+ exports.toVendorDetailTabsType = toVendorDetailTabsType;
23
+ const toVendorDetailTabsTypeStrict = (v) => (0, stringToUnion_1.stringToUnionStrict)(v !== null && v !== void 0 ? v : '', ALL_VENDOR_DETAIL_TABS_TYPES);
24
+ exports.toVendorDetailTabsTypeStrict = toVendorDetailTabsTypeStrict;
12
25
  const getVendorsTabVendorView = (state, vendorIdFromUrl) => {
13
26
  var _a, _b, _c, _d, _e;
14
27
  const { accountListState, accountState, classListState, classState, vendorState, userState, vendorsTabVendorViewState, } = state;
@@ -73,23 +86,42 @@ const getBasicVendorDetails = (accountState, classState, userState, selectedVend
73
86
  id: selectedVendor.id,
74
87
  });
75
88
  const getVendorsTabDetailPageView = (state, vendorId, entity) => {
76
- var _a, _b;
89
+ var _a, _b, _c;
77
90
  const trendWithTransactions = (0, trendWithTransactionsSelector_1.getTrendWithTransactions)(state, entity, 'EntityDetail');
91
+ const vendorViewDetails = (0, exports.getVendorsTabVendorView)(state, vendorId);
92
+ const allVendorTransactions = ((_a = state.vendorsTabVendorViewState.allTransactionsTabData) === null || _a === void 0 ? void 0 : _a.timePeriod) != null
93
+ ? (0, transactionListByEntitySelector_1.getTransactionListByEntityForSinglePeriod)(state, entity, state.vendorsTabVendorViewState.allTransactionsTabData
94
+ .numberOfQuartersFetched)
95
+ : undefined;
78
96
  const reducedFetchState = (0, reduceFetchState_1.reduceAnyFetchState)([
79
97
  state.accountListState.byReportId.accountList,
80
98
  state.classListState,
81
99
  state.ownerListState,
82
- (_b = (_a = state.vendorsTabVendorViewState.vendorStateById[vendorId]) === null || _a === void 0 ? void 0 : _a.fetchStatus) !== null && _b !== void 0 ? _b : {
100
+ (_c = (_b = state.vendorsTabVendorViewState.vendorStateById[vendorId]) === null || _b === void 0 ? void 0 : _b.fetchStatus) !== null && _c !== void 0 ? _c : {
83
101
  fetchState: 'Not-Started',
84
102
  },
85
103
  trendWithTransactions,
86
104
  ]);
87
105
  return {
88
- vendorViewDetails: (0, exports.getVendorsTabVendorView)(state, vendorId),
106
+ vendorViewDetails,
89
107
  trendWithTransactions,
108
+ allVendorTransactionsView: allVendorTransactions,
109
+ allTransactionsTabData: state.vendorsTabVendorViewState.allTransactionsTabData,
110
+ selectedTabType: state.vendorsTabVendorViewState.selectedTabType,
90
111
  vendorSpend: state.vendorExpenseState.spend,
91
112
  fetchState: reducedFetchState.fetchState,
92
113
  error: reducedFetchState.error,
93
114
  };
94
115
  };
95
116
  exports.getVendorsTabDetailPageView = getVendorsTabDetailPageView;
117
+ const getVendorAllTransactionsDefaultTimePeriod = (firstMonthOfFY, numberOfQuartersToGoBack) => {
118
+ const currentEndDate = (0, zeniDayJS_1.dateNow)().startOf('M');
119
+ const periodToLoadStartDate = (0, addSubtractPeriod_1.subtractPeriod)(currentEndDate, firstMonthOfFY, numberOfQuartersToGoBack, 'quarter');
120
+ const { startOfTimeframeFY: startDate, endOfTimeframeFY: endDate } = (0, getStartOfAndEndOfTimeframeFY_1.getStartOfAndEndOfTimeframeForFY)(periodToLoadStartDate, firstMonthOfFY, 'quarter');
121
+ const periodToLoad = {
122
+ startDate,
123
+ endDate,
124
+ };
125
+ return periodToLoad;
126
+ };
127
+ exports.getVendorAllTransactionsDefaultTimePeriod = getVendorAllTransactionsDefaultTimePeriod;
@@ -1,9 +1,16 @@
1
1
  import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
2
2
  import { Recommendation } from '../../../commonStateTypes/recommendationBase';
3
+ import { TimePeriod } from '../../../commonStateTypes/timePeriod';
3
4
  import { RecommendedAccountBase } from '../../../entity/account/accountState';
4
5
  import { RecommendedClassBase } from '../../../entity/class/classState';
6
+ import { VendorDetailTabsType } from './vendorsTabVendorViewSelector';
5
7
  export interface VendorsTabVendorViewState {
6
8
  vendorStateById: Record<ID, VendorsTabVendorDetailState>;
9
+ selectedTabType: VendorDetailTabsType;
10
+ allTransactionsTabData?: {
11
+ timePeriod: TimePeriod;
12
+ numberOfQuartersFetched: number;
13
+ };
7
14
  }
8
15
  export interface VendorsTabVendorDetailLocalData {
9
16
  vendorName?: string;
@@ -26,7 +26,7 @@ export declare const changeZeniPersonRolesEpic: (actions$: ActionsObservable<Act
26
26
  type: string;
27
27
  } | {
28
28
  payload: {
29
- messageSection: "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_monthEndEmailSent" | "cockpit_monthEndEmailSave" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "zeni_account_accept_term" | "update_vendor" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "charge_card_setup" | "charge_card_accept_term" | "create_schedule" | "save_schedule" | "save_task_detail" | "delete_task" | "archive_task" | "update_charge_card";
29
+ messageSection: "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_monthEndEmailSent" | "cockpit_monthEndEmailSave" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "zeni_account_accept_term" | "update_vendor" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "charge_card_setup" | "charge_card_accept_term" | "create_schedule" | "save_schedule" | "save_task_detail" | "delete_task" | "archive_task" | "update_charge_card" | "notification_settings_saved";
30
30
  messageText: "failed" | "success";
31
31
  type: import("../..").SnackbarMessageType;
32
32
  showStatusIcon?: boolean | undefined;
@@ -18,7 +18,7 @@ export declare const deletePersonEpic: (actions$: ActionsObservable<ActionType>,
18
18
  type: string;
19
19
  } | {
20
20
  payload: {
21
- messageSection: "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_monthEndEmailSent" | "cockpit_monthEndEmailSave" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "zeni_account_accept_term" | "update_vendor" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "charge_card_setup" | "charge_card_accept_term" | "create_schedule" | "save_schedule" | "save_task_detail" | "delete_task" | "archive_task" | "update_charge_card";
21
+ messageSection: "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_monthEndEmailSent" | "cockpit_monthEndEmailSave" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "zeni_account_accept_term" | "update_vendor" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "charge_card_setup" | "charge_card_accept_term" | "create_schedule" | "save_schedule" | "save_task_detail" | "delete_task" | "archive_task" | "update_charge_card" | "notification_settings_saved";
22
22
  messageText: "failed" | "success";
23
23
  type: import("../..").SnackbarMessageType;
24
24
  showStatusIcon?: boolean | undefined;
@@ -35,7 +35,7 @@ export declare const invitePeopleEpic: (actions$: ActionsObservable<ActionType>,
35
35
  type: string;
36
36
  } | {
37
37
  payload: {
38
- messageSection: "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_monthEndEmailSent" | "cockpit_monthEndEmailSave" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "zeni_account_accept_term" | "update_vendor" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "charge_card_setup" | "charge_card_accept_term" | "create_schedule" | "save_schedule" | "save_task_detail" | "delete_task" | "archive_task" | "update_charge_card";
38
+ messageSection: "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_monthEndEmailSent" | "cockpit_monthEndEmailSave" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "zeni_account_accept_term" | "update_vendor" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "charge_card_setup" | "charge_card_accept_term" | "create_schedule" | "save_schedule" | "save_task_detail" | "delete_task" | "archive_task" | "update_charge_card" | "notification_settings_saved";
39
39
  messageText: "failed" | "success";
40
40
  type: import("../..").SnackbarMessageType;
41
41
  showStatusIcon?: boolean | undefined;
@@ -32,7 +32,7 @@ export declare const inviteZeniPeopleEpic: (actions$: ActionsObservable<ActionTy
32
32
  type: string;
33
33
  } | {
34
34
  payload: {
35
- messageSection: "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_monthEndEmailSent" | "cockpit_monthEndEmailSave" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "zeni_account_accept_term" | "update_vendor" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "charge_card_setup" | "charge_card_accept_term" | "create_schedule" | "save_schedule" | "save_task_detail" | "delete_task" | "archive_task" | "update_charge_card";
35
+ messageSection: "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_monthEndEmailSent" | "cockpit_monthEndEmailSave" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "zeni_account_accept_term" | "update_vendor" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "charge_card_setup" | "charge_card_accept_term" | "create_schedule" | "save_schedule" | "save_task_detail" | "delete_task" | "archive_task" | "update_charge_card" | "notification_settings_saved";
36
36
  messageText: "failed" | "success";
37
37
  type: import("../..").SnackbarMessageType;
38
38
  showStatusIcon?: boolean | undefined;
@@ -13,7 +13,7 @@ export declare const resendInviteEpic: (actions$: ActionsObservable<ActionType>,
13
13
  type: string;
14
14
  } | {
15
15
  payload: {
16
- messageSection: "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_monthEndEmailSent" | "cockpit_monthEndEmailSave" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "zeni_account_accept_term" | "update_vendor" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "charge_card_setup" | "charge_card_accept_term" | "create_schedule" | "save_schedule" | "save_task_detail" | "delete_task" | "archive_task" | "update_charge_card";
16
+ messageSection: "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_monthEndEmailSent" | "cockpit_monthEndEmailSave" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "zeni_account_accept_term" | "update_vendor" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "charge_card_setup" | "charge_card_accept_term" | "create_schedule" | "save_schedule" | "save_task_detail" | "delete_task" | "archive_task" | "update_charge_card" | "notification_settings_saved";
17
17
  messageText: "failed" | "success";
18
18
  type: import("../..").SnackbarMessageType;
19
19
  showStatusIcon?: boolean | undefined;
@@ -0,0 +1,17 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { fetchNotificationSettings, updateNotificationSettingsOnSuccess, updateNotificationSettingsOnFailure } from '../settingsViewReducer';
3
+ import { ZeniAPI } from '../../../zeniAPI';
4
+ import { RootState } from '../../../reducer';
5
+ export declare type ActionType = ReturnType<typeof fetchNotificationSettings> | ReturnType<typeof updateNotificationSettingsOnSuccess> | ReturnType<typeof updateNotificationSettingsOnFailure>;
6
+ export declare const fetchNotificationSettingsEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
7
+ payload: undefined;
8
+ type: string;
9
+ } | {
10
+ payload: import("../../../responsePayload").ZeniAPIStatus<Record<string, unknown>>;
11
+ type: string;
12
+ } | {
13
+ payload: {
14
+ data: import("../settingsViewPayload").NotificationSettingsPayload;
15
+ };
16
+ type: string;
17
+ }>;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fetchNotificationSettingsEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const settingsViewReducer_1 = require("../settingsViewReducer");
7
+ const responsePayload_1 = require("../../../responsePayload");
8
+ const fetchNotificationSettingsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(settingsViewReducer_1.fetchNotificationSettings.match), (0, operators_1.switchMap)(() => {
9
+ const URL = `${zeniAPI.apiEndPoints.notificationMicroServiceBaseUrl}/1.0/notification-preferences`;
10
+ return zeniAPI.getJSON(URL).pipe((0, operators_1.mergeMap)((response) => {
11
+ if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
12
+ const updateActions = [
13
+ (0, settingsViewReducer_1.updateNotificationSettingsOnSuccess)(response.data),
14
+ ];
15
+ return (0, rxjs_1.of)(...updateActions);
16
+ }
17
+ else {
18
+ return (0, rxjs_1.of)((0, settingsViewReducer_1.updateNotificationSettingsOnFailure)(response.status));
19
+ }
20
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, settingsViewReducer_1.updateNotificationSettingsOnFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'Fetch Notification Settings REST API call errored out' +
21
+ JSON.stringify(error))))));
22
+ }));
23
+ exports.fetchNotificationSettingsEpic = fetchNotificationSettingsEpic;
@@ -0,0 +1,31 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { saveNotificationSettings, updateNotificationSettingsOnSaveFailure, updateNotificationSettingsOnSaveSuccess } from '../settingsViewReducer';
3
+ import { ZeniAPI } from '../../../zeniAPI';
4
+ import { RootState } from '../../../reducer';
5
+ import { NotificationSettingsPayload } from '../settingsViewPayload';
6
+ import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
7
+ export declare type ActionType = ReturnType<typeof saveNotificationSettings> | ReturnType<typeof openSnackbar> | ReturnType<typeof updateNotificationSettingsOnSaveSuccess> | ReturnType<typeof updateNotificationSettingsOnSaveFailure>;
8
+ export declare const saveNotificationSettingsEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
9
+ payload: undefined;
10
+ type: string;
11
+ } | {
12
+ payload: import("../../../responsePayload").ZeniAPIStatus<Record<string, unknown>>;
13
+ type: string;
14
+ } | {
15
+ payload: {
16
+ data: NotificationSettingsPayload;
17
+ };
18
+ type: string;
19
+ } | {
20
+ payload: {
21
+ messageSection: "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_monthEndEmailSent" | "cockpit_monthEndEmailSave" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "zeni_account_accept_term" | "update_vendor" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "charge_card_setup" | "charge_card_accept_term" | "create_schedule" | "save_schedule" | "save_task_detail" | "delete_task" | "archive_task" | "update_charge_card" | "notification_settings_saved";
22
+ messageText: "failed" | "success";
23
+ type: import("../../..").SnackbarMessageType;
24
+ showStatusIcon?: boolean | undefined;
25
+ variables?: {
26
+ variableName: string;
27
+ variableValue: string;
28
+ }[] | undefined;
29
+ };
30
+ type: string;
31
+ }>;
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.saveNotificationSettingsEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const settingsViewReducer_1 = require("../settingsViewReducer");
7
+ const responsePayload_1 = require("../../../responsePayload");
8
+ const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
9
+ const saveNotificationSettingsEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(settingsViewReducer_1.saveNotificationSettings.match), (0, operators_1.switchMap)(() => {
10
+ const URL = `${zeniAPI.apiEndPoints.notificationMicroServiceBaseUrl}/1.0/notification-preferences`;
11
+ const { notificationSettings, notificationSettingsLocalData } = state$.value.settingsViewState.notification;
12
+ const payload = toSaveNotificationSettingsPayload(notificationSettingsLocalData, notificationSettings);
13
+ return zeniAPI
14
+ .putAndGetJSON(URL, payload)
15
+ .pipe((0, operators_1.mergeMap)((response) => {
16
+ if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
17
+ const updateActions = [
18
+ (0, settingsViewReducer_1.updateNotificationSettingsOnSaveSuccess)({ data: response.data }),
19
+ (0, snackbarReducer_1.openSnackbar)({
20
+ messageSection: 'notification_settings_saved',
21
+ messageText: 'success',
22
+ type: 'success',
23
+ }),
24
+ ];
25
+ return (0, rxjs_1.of)(...updateActions);
26
+ }
27
+ else {
28
+ return (0, rxjs_1.of)((0, settingsViewReducer_1.updateNotificationSettingsOnSaveFailure)(response.status));
29
+ }
30
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, settingsViewReducer_1.updateNotificationSettingsOnSaveFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'Save Notification Settings REST API call errored out' +
31
+ JSON.stringify(error))))));
32
+ }));
33
+ exports.saveNotificationSettingsEpic = saveNotificationSettingsEpic;
34
+ function toSaveNotificationSettingsPayload(localData, notificationSettingsData) {
35
+ const payload = {};
36
+ if (localData.reminders.isMissingReceiptNotificationActive != null &&
37
+ notificationSettingsData.missingReceiptNotification != null) {
38
+ payload.is_missing_receipt_notification_active =
39
+ localData.reminders.isMissingReceiptNotificationActive;
40
+ payload.missing_receipt_notification = {
41
+ preferred_mode: ['email'],
42
+ };
43
+ }
44
+ if (localData.reminders.isPendingBillApprovalNotificationActive != null &&
45
+ notificationSettingsData.pendingBillApprovalNotification != null) {
46
+ payload.is_pending_bill_approval_notification_active =
47
+ localData.reminders.isPendingBillApprovalNotificationActive;
48
+ payload.pending_bill_approval_notification = {
49
+ preferred_mode: ['email'],
50
+ };
51
+ }
52
+ if (localData.reminders.isUncategorizedTransactionNotificationActive != null &&
53
+ notificationSettingsData.uncategorizedTransactionNotification != null) {
54
+ payload.is_uncategorized_transaction_notification_active =
55
+ localData.reminders.isUncategorizedTransactionNotificationActive;
56
+ payload.uncategorized_transaction_notification = {
57
+ preferred_mode: ['email'],
58
+ };
59
+ }
60
+ if (localData.reminders.isPendingReimbursementApprovalNotificationActive !=
61
+ null &&
62
+ notificationSettingsData.pendingReimbursementApprovalNotification != null) {
63
+ payload.is_pending_reimbursement_approval_notification_active =
64
+ localData.reminders.isPendingReimbursementApprovalNotificationActive;
65
+ payload.pending_reimbursement_approval_notification = {
66
+ preferred_mode: ['email'],
67
+ };
68
+ }
69
+ return payload;
70
+ }
@@ -0,0 +1,2 @@
1
+ import { NotificationSettings } from './settingsViewState';
2
+ export declare const isNotificationsTabVisible: (notificationSettingsView: NotificationSettings) => boolean;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isNotificationsTabVisible = void 0;
4
+ const isNotificationsTabVisible = (notificationSettingsView) => {
5
+ const { notificationSettings } = notificationSettingsView;
6
+ return (notificationSettings.missingReceiptNotification != null ||
7
+ notificationSettings.pendingBillApprovalNotification != null ||
8
+ notificationSettings.pendingReimbursementApprovalNotification != null ||
9
+ notificationSettings.uncategorizedTransactionNotification != null);
10
+ };
11
+ exports.isNotificationsTabVisible = isNotificationsTabVisible;
@@ -6,3 +6,10 @@ export interface MyProfilePeoplePayload {
6
6
  users: UserPayload[];
7
7
  }
8
8
  export declare type MyProfilePeopleResponse = ZeniAPIResponse<MyProfilePeoplePayload>;
9
+ export interface NotificationSettingsPayload {
10
+ is_missing_receipt_notification_active: boolean | null;
11
+ is_pending_bill_approval_notification_active: boolean | null;
12
+ is_pending_reimbursement_approval_notification_active: boolean | null;
13
+ is_uncategorized_transaction_notification_active: boolean | null;
14
+ }
15
+ export declare type NotificationSettingsResponse = ZeniAPIResponse<NotificationSettingsPayload>;
@@ -1,5 +1,6 @@
1
+ import { SettingsViewState, NotificationSettingsLocalData } from './settingsViewState';
1
2
  import { ZeniAPIStatus } from '../../responsePayload';
2
- import { SettingsViewState } from './settingsViewState';
3
+ import { NotificationSettingsPayload } from './settingsViewPayload';
3
4
  import { ID } from '../../commonStateTypes/common';
4
5
  export declare const initialState: SettingsViewState;
5
6
  export declare const fetchMyProfileView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string], {
@@ -8,6 +9,10 @@ export declare const fetchMyProfileView: import("@reduxjs/toolkit").ActionCreato
8
9
  userId: string;
9
10
  }, string, never, never>, updateMyProfileOnFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, string>, fetchBankConnectionsView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, updateBankConnectionOnSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
10
11
  bankAccountIds: ID[];
11
- }, string>, updateBankConnectionOnFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, string>, fetchBankAccountsList: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, clearSettingsView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
12
+ }, string>, updateBankConnectionOnFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, string>, fetchBankAccountsList: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, fetchNotificationSettings: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, updateNotificationSettingsOnSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[data: NotificationSettingsPayload], {
13
+ data: NotificationSettingsPayload;
14
+ }, string, never, never>, updateNotificationSettingsOnFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, string>, updateNotificationSettingsLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<NotificationSettingsLocalData, string>, resetNotificationSettingsLocalData: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, saveNotificationSettings: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, updateNotificationSettingsOnSaveSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
15
+ data: NotificationSettingsPayload;
16
+ }, string>, updateNotificationSettingsOnSaveFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, string>, clearSettingsView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
12
17
  declare const _default: import("@reduxjs/toolkit").Reducer<SettingsViewState, import("@reduxjs/toolkit").AnyAction>;
13
18
  export default _default;