@zeniai/client-epic-state 4.8.53 → 4.8.55

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 (76) hide show
  1. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  2. package/lib/entity/snackbar/snackbarTypes.js +0 -2
  3. package/lib/entity/tenant/tenantPayload.d.ts +0 -5
  4. package/lib/entity/userRole/userRolePayload.d.ts +0 -5
  5. package/lib/entity/userRole/userRolePayload.js +0 -15
  6. package/lib/entity/userRole/userRoleType.d.ts +3 -16
  7. package/lib/entity/userRole/userRoleType.js +6 -198
  8. package/lib/epic.d.ts +1 -3
  9. package/lib/epic.js +1 -3
  10. package/lib/index.d.ts +12 -14
  11. package/lib/index.js +18 -50
  12. package/lib/view/accountList/accountListSelector.d.ts +2 -1
  13. package/lib/view/accountList/accountListSelector.js +8 -1
  14. package/lib/view/commonVendorView/vendorView/epics/saveVendorEpic.js +4 -31
  15. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewReducer.d.ts +1 -5
  16. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewReducer.js +2 -18
  17. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.d.ts +0 -14
  18. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +4 -36
  19. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewState.d.ts +0 -7
  20. package/lib/view/people/changeZeniPersonRolesEpic.d.ts +1 -1
  21. package/lib/view/people/deletePersonEpic.d.ts +1 -1
  22. package/lib/view/people/invitePeopleEpic.d.ts +1 -1
  23. package/lib/view/people/inviteZeniPeopleEpic.d.ts +1 -1
  24. package/lib/view/people/resendInviteEpic.d.ts +1 -1
  25. package/lib/view/scheduleView/scheduleDetailView/epics/updateAmountsInScheduleDetailEpic.js +10 -5
  26. package/lib/view/scheduleView/scheduleDetailView/scheduleDetailReducer.d.ts +2 -2
  27. package/lib/view/scheduleView/scheduleListView/epics/fetchScheduleListEpic.js +7 -4
  28. package/lib/view/scheduleView/scheduleListView/scheduleListHelper.d.ts +2 -1
  29. package/lib/view/scheduleView/scheduleListView/scheduleListHelper.js +10 -1
  30. package/lib/view/scheduleView/scheduleListView/scheduleListSelector.js +7 -5
  31. package/lib/view/settingsView/settingsViewPayload.d.ts +0 -7
  32. package/lib/view/settingsView/settingsViewReducer.d.ts +2 -7
  33. package/lib/view/settingsView/settingsViewReducer.js +2 -115
  34. package/lib/view/settingsView/settingsViewSelector.d.ts +0 -2
  35. package/lib/view/settingsView/settingsViewSelector.js +1 -4
  36. package/lib/view/settingsView/settingsViewState.d.ts +0 -18
  37. package/lib/view/settingsView/settingsViewState.js +0 -15
  38. package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.d.ts +0 -1
  39. package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +1 -2
  40. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +0 -3
  41. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +24 -49
  42. package/lib/view/spendManagement/billPay/editBillView/editBillViewState.d.ts +0 -2
  43. package/lib/view/spendManagement/billPay/editBillView/editBillViewState.js +0 -2
  44. package/lib/view/spendManagement/billPay/editBillView/epics/initializeBillToLocalStoreEpic.js +9 -16
  45. package/lib/view/spendManagement/billPay/editBillView/epics/parseInvoiceToBillEpic.d.ts +1 -1
  46. package/lib/view/spendManagement/billPay/editBillView/epics/parseInvoiceToBillEpic.js +9 -21
  47. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListPayload.d.ts +1 -1
  48. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.d.ts +1 -2
  49. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +3 -6
  50. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.d.ts +1 -1
  51. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +6 -9
  52. package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.js +3 -6
  53. package/lib/view/spendManagement/helpers.js +4 -11
  54. package/lib/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +1 -5
  55. package/lib/view/taskManager/taskDetailView/taskDetailReducer.d.ts +0 -1
  56. package/lib/view/taskManager/taskDetailView/taskDetailReducer.js +6 -8
  57. package/lib/view/taskManager/taskDetailView/taskDetailSelector.d.ts +0 -2
  58. package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +1 -7
  59. package/lib/view/taskManager/taskListView/taskListSelector.js +1 -1
  60. package/lib/view/transactionList/fetchTransactionListByEntityEpic.js +0 -3
  61. package/lib/view/transactionList/transactionListByEntitySelector.d.ts +0 -4
  62. package/lib/view/transactionList/transactionListByEntitySelector.js +1 -62
  63. package/lib/view/transactionList/transactionListReducer.d.ts +1 -2
  64. package/lib/view/transactionList/transactionListReducer.js +2 -2
  65. package/lib/view/vendorReviewView/vendorFirstReviewView/epics/saveVendorFirstReviewViewEpic.js +6 -9
  66. package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewPayload.d.ts +0 -1
  67. package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewReducer.d.ts +2 -2
  68. package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewReducer.js +2 -2
  69. package/lib/zeniAPI.d.ts +0 -1
  70. package/package.json +1 -1
  71. package/lib/view/settingsView/epic/fetchNotificationSettingsEpic.d.ts +0 -17
  72. package/lib/view/settingsView/epic/fetchNotificationSettingsEpic.js +0 -23
  73. package/lib/view/settingsView/epic/saveNotificationSettingsEpic.d.ts +0 -31
  74. package/lib/view/settingsView/epic/saveNotificationSettingsEpic.js +0 -70
  75. package/lib/view/settingsView/settingsViewHelpers.d.ts +0 -2
  76. package/lib/view/settingsView/settingsViewHelpers.js +0 -11
@@ -113,16 +113,14 @@ const taskDetailView = (0, toolkit_1.createSlice)({
113
113
  },
114
114
  },
115
115
  saveTaskSuccessOrFailure(draft, action) {
116
- const { taskId, fetchState, error, newTaskId } = action.payload;
117
- if (taskId != null) {
118
- draft.editTaskStateById[taskId].saveStatus.fetchState = fetchState;
119
- draft.editTaskStateById[taskId].saveStatus.error = error;
116
+ if (action.payload.taskId != null) {
117
+ const { taskId } = action.payload;
118
+ draft.editTaskStateById[taskId].saveStatus.fetchState =
119
+ action.payload.fetchState;
120
+ draft.editTaskStateById[taskId].saveStatus.error = action.payload.error;
120
121
  }
121
122
  else {
122
- if (newTaskId != null) {
123
- draft.newTaskState.taskId = newTaskId;
124
- }
125
- draft.newTaskState.saveStatus.fetchState = fetchState;
123
+ draft.newTaskState.saveStatus.fetchState = action.payload.fetchState;
126
124
  draft.newTaskState.saveStatus.error = action.payload.error;
127
125
  }
128
126
  },
@@ -7,7 +7,6 @@ import { File } from '../../../entity/file/fileState';
7
7
  import { UserListSelectorView } from '../../userListView/userListViewSelector';
8
8
  import { EditTaskDetail } from './taskDetail';
9
9
  import { HistoricEvent } from '../../spendManagement/commonHistoryView/commonHistory';
10
- import { UserAndRole } from '../../companyView/types/userAndRole';
11
10
  export interface TaskDetailSelectorView extends SelectorView {
12
11
  taskDetailView: EditTaskDetail;
13
12
  userList: UserListSelectorView;
@@ -17,7 +16,6 @@ export interface TaskDetailSelectorView extends SelectorView {
17
16
  files: File[];
18
17
  taskHistory: HistoricEvent[];
19
18
  showTaskDetailFormFooter: boolean;
20
- createdByUser?: UserAndRole;
21
19
  }
22
20
  export declare const getTaskDetail: (state: RootState, taskId?: string | undefined) => TaskDetailSelectorView;
23
21
  export declare const allTaskTags: TaskTag[];
@@ -11,10 +11,9 @@ const fileViewSelector_1 = require("../../fileView/fileViewSelector");
11
11
  const userListViewSelector_1 = require("../../userListView/userListViewSelector");
12
12
  const fileSelector_1 = require("../../../entity/file/fileSelector");
13
13
  const taskSelector_1 = require("../../../entity/task/taskSelector");
14
- const userAndRole_1 = require("../../companyView/types/userAndRole");
15
14
  const getTaskDetail = (state, taskId) => {
16
15
  var _a;
17
- const { taskDetailState, classListState, classState, fileState, fileViewState, userState, userRoleState, addressState, taskState, } = state;
16
+ const { taskDetailState, classListState, classState, fileState, fileViewState, taskState, } = state;
18
17
  const deleteFileStatusById = {};
19
18
  const updateFileStatusById = {};
20
19
  let showTaskDetailFormFooter = false;
@@ -27,13 +26,9 @@ const getTaskDetail = (state, taskId) => {
27
26
  error: undefined,
28
27
  };
29
28
  let taskHistory = [];
30
- let createdByUser = undefined;
31
29
  if (taskId != null && sourceTaskDetail != null) {
32
30
  const taskEntity = (0, taskSelector_1.getTaskById)(taskState, taskId);
33
31
  const fileIdsInEntity = (_a = taskEntity === null || taskEntity === void 0 ? void 0 : taskEntity.fileIds) !== null && _a !== void 0 ? _a : [];
34
- if (taskEntity != null) {
35
- createdByUser = (0, userAndRole_1.getUserAndUserRole)(userState, userRoleState, addressState, taskEntity.createdBy);
36
- }
37
32
  if (fileIdsInEntity.length > 0) {
38
33
  fetchStatus = (0, reduceFetchState_1.reduceFetchState)([
39
34
  fileViewState.fetchFilesStatus,
@@ -79,7 +74,6 @@ const getTaskDetail = (state, taskId) => {
79
74
  fetchState: fetchStatus.fetchState,
80
75
  error: fetchStatus.error,
81
76
  version: 0,
82
- createdByUser,
83
77
  showTaskDetailFormFooter,
84
78
  };
85
79
  };
@@ -46,7 +46,7 @@ const getAllTasks = (state) => {
46
46
  return (_c = task.createdByUser) === null || _c === void 0 ? void 0 : _c.user.firstName;
47
47
  case 'name':
48
48
  default:
49
- return task.name.toLowerCase();
49
+ return task.name;
50
50
  }
51
51
  }, sortOrder);
52
52
  return {
@@ -27,9 +27,6 @@ const fetchTransactionListByEntityEpic = (actions$, state$, zeniAPI) => actions$
27
27
  entity_id: action.payload.entity.id,
28
28
  entity_name: action.payload.entity.name,
29
29
  entity_type: action.payload.entity.type,
30
- is_fetch_all_transactions: action.payload.isFetchAllTransactions === true
31
- ? action.payload.isFetchAllTransactions
32
- : null,
33
30
  };
34
31
  return zeniAPI
35
32
  .getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/transactions?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
@@ -4,13 +4,9 @@ import { SelectorView } from '../../commonStateTypes/viewAndReport/viewAndReport
4
4
  import { Entity } from '../../entity/genericEntity/entity';
5
5
  import { SupportedTransaction, TransactionState } from '../../entity/transaction/transactionState';
6
6
  import { TransactionListSelectorView, TransactionListState } from './transactionListState';
7
- import { Month, TimePeriod } from '../../commonStateTypes/timePeriod';
8
- import { RootState } from '../../reducer';
9
7
  export interface TransactionListByEntityView extends SelectorView, TransactionListSelectorView {
10
8
  transactionOrder: EntityOrder;
11
9
  transactions: SupportedTransaction[];
12
10
  entity: Entity;
13
11
  }
14
12
  export declare const getTransactionListByEntity: (transactionState: TransactionState, transactionListState: TransactionListState, filterByTimePeriod: TimeframeTick, entity: Entity) => TransactionListByEntityView;
15
- export declare const getTransactionListByEntityForSinglePeriod: (state: RootState, entity: Entity, numberOfQuartersFetched: number) => TransactionListByEntityView;
16
- export declare function splitPeriodIntoQuarters(numberOfQuartersFetched: number, firstMonthOfFY: Month): TimePeriod[];
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.splitPeriodIntoQuarters = exports.getTransactionListByEntityForSinglePeriod = exports.getTransactionListByEntity = void 0;
6
+ exports.getTransactionListByEntity = void 0;
7
7
  const flatMap_1 = __importDefault(require("lodash/flatMap"));
8
8
  const get_1 = __importDefault(require("lodash/get"));
9
9
  const orderBy_1 = __importDefault(require("lodash/orderBy"));
@@ -12,9 +12,6 @@ const parallelFetchAccountTransactionListEpic_1 = require("./parallelFetchAccoun
12
12
  const reduceTransactionListFetchState_1 = require("./reduceTransactionListFetchState");
13
13
  const transactionListState_1 = require("./transactionListState");
14
14
  const transactionSelector_1 = require("../../entity/transaction/transactionSelector");
15
- const tenantSelector_1 = require("../../entity/tenant/tenantSelector");
16
- const vendorsTabVendorViewSelector_1 = require("../commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector");
17
- const zeniDayJS_1 = require("../../zeniDayJS");
18
15
  const getTransactionListByEntity = (transactionState, transactionListState, filterByTimePeriod, entity) => {
19
16
  const timePeriods = (0, parallelFetchAccountTransactionListEpic_1.splitPeriod)((0, timeframeTick_1.toTimePeriod)(filterByTimePeriod)); // Note: Split by months.
20
17
  const entityTransactions = timePeriods
@@ -49,61 +46,3 @@ const getTransactionListByEntity = (transactionState, transactionListState, filt
49
46
  };
50
47
  };
51
48
  exports.getTransactionListByEntity = getTransactionListByEntity;
52
- /*
53
- NOTE: getTransactionListByEntityForSinglePeriod - this selector is to be used when we are not making parallel fetch
54
- and thus, do not want to split period month wise - as done in above selector getTransactionListByEntity
55
- This usecase is on vendors tab detail page, to fetch all transactions tab data
56
- */
57
- const getTransactionListByEntityForSinglePeriod = (state, entity, numberOfQuartersFetched) => {
58
- var _a, _b;
59
- const { transactionListState, transactionState } = state;
60
- const firstMonthOfFY = (_b = (_a = (0, tenantSelector_1.getCurrentTenant)(state).company) === null || _a === void 0 ? void 0 : _a.companyInfo.firstMonthOfFY) !== null && _b !== void 0 ? _b : 1;
61
- const initialFetchPeriod = (0, timeframeTick_1.toTimePeriod)({
62
- startDate: (0, vendorsTabVendorViewSelector_1.getVendorAllTransactionsDefaultTimePeriod)(firstMonthOfFY, 2)
63
- .startDate,
64
- endDate: (0, zeniDayJS_1.dateNow)(),
65
- });
66
- const timePeriods = [
67
- initialFetchPeriod,
68
- ...splitPeriodIntoQuarters(numberOfQuartersFetched, firstMonthOfFY),
69
- ];
70
- const entityTransactions = timePeriods
71
- .map((thisTimePeriod) => {
72
- const key = (0, transactionListState_1.getEntityTranKey)(entity, thisTimePeriod);
73
- return (0, get_1.default)(transactionListState.byEntity.transactionListByEntityKey, key, undefined);
74
- })
75
- .filter((eTransaction) => eTransaction != null);
76
- const fetchState = (0, reduceTransactionListFetchState_1.reduceFetchState)(entityTransactions);
77
- let transactions = [];
78
- // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
79
- if ((0, reduceTransactionListFetchState_1.isAnyFetchCompleted)(entityTransactions)) {
80
- const allTransactionIDs = (0, flatMap_1.default)(entityTransactions, (value) => value.transactionIDs);
81
- const transactionsUnsorted = allTransactionIDs
82
- .map((transactionId) => (0, transactionSelector_1.getSupportedTransactionById)(transactionState, transactionId))
83
- .filter((value) => {
84
- if (value == null) {
85
- console.error("Can't have null transaction at this stage!");
86
- }
87
- return value != null;
88
- });
89
- transactions = (0, orderBy_1.default)(transactionsUnsorted, (value) => value.date.valueOf(), 'desc');
90
- }
91
- return {
92
- version: '1.0',
93
- fetchState: fetchState.fetchState,
94
- error: fetchState.error,
95
- entity: entity,
96
- transactionOrder: 'descending_transaction_date',
97
- transactions,
98
- latestTransactionId: transactionListState.latestTransactionId,
99
- };
100
- };
101
- exports.getTransactionListByEntityForSinglePeriod = getTransactionListByEntityForSinglePeriod;
102
- function splitPeriodIntoQuarters(numberOfQuartersFetched, firstMonthOfFY) {
103
- const result = [];
104
- for (let index = 0; index <= numberOfQuartersFetched - 1; index++) {
105
- result.push((0, timeframeTick_1.toTimePeriod)((0, vendorsTabVendorViewSelector_1.getVendorAllTransactionsDefaultTimePeriod)(firstMonthOfFY, index)));
106
- }
107
- return result;
108
- }
109
- exports.splitPeriodIntoQuarters = splitPeriodIntoQuarters;
@@ -32,11 +32,10 @@ export declare const parallelFetchAccountTransactionList: import("@reduxjs/toolk
32
32
  entity: Entity;
33
33
  period: TimePeriod;
34
34
  cacheOverride: any;
35
- }, string, never, never>, fetchEntityTransactionList: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[entity: Entity, period: TimePeriod, cacheOverride?: any, isFetchAllTransactions?: any], {
35
+ }, string, never, never>, fetchEntityTransactionList: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[entity: Entity, period: TimePeriod, cacheOverride?: any], {
36
36
  entity: Entity;
37
37
  period: TimePeriod;
38
38
  cacheOverride: any;
39
- isFetchAllTransactions: any;
40
39
  }, string, never, never>, updateTransactionListByEntity: import("@reduxjs/toolkit").ActionCreatorWithPayload<TransactionListByEntityPayload, string>, updateTransactionListByEntityFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[entity: Entity, period: TimePeriod, error: ZeniAPIStatus<Record<string, unknown>>], {
41
40
  entity: Entity;
42
41
  period: TimePeriod;
@@ -143,9 +143,9 @@ const transactionList = (0, toolkit_1.createSlice)({
143
143
  draft.byEntity.transactionListByEntityKey[key] = Object.assign(Object.assign({}, transactionListState_1.initialEntityTransactionState), { fetchState: 'In-Progress', error: undefined });
144
144
  }
145
145
  },
146
- prepare(entity, period, cacheOverride = false, isFetchAllTransactions = false) {
146
+ prepare(entity, period, cacheOverride = false) {
147
147
  return {
148
- payload: { entity, period, cacheOverride, isFetchAllTransactions },
148
+ payload: { entity, period, cacheOverride },
149
149
  };
150
150
  },
151
151
  },
@@ -21,12 +21,12 @@ const fetchVendorFirstReviewViewEpic_1 = require("./fetchVendorFirstReviewViewEp
21
21
  const globalMerchantSelector_1 = require("../../../../entity/globalMerchant/globalMerchantSelector");
22
22
  const saveVendorFirstReviewViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(vendorFirstReviewViewReducer_1.saveVendorFirstReviewView.match), (0, operators_1.mergeMap)((action) => {
23
23
  const { vendorFirstReviewViewState, globalMerchantState, vendorState } = state$.value;
24
- const { vendorId, markAsEmployee } = action.payload;
24
+ const { vendorId } = action.payload;
25
25
  const currentVendorLocalData = vendorFirstReviewViewState.vendorFirstReviewViewLocalDataById[vendorId]
26
26
  .vendorFirstReviewViewLocalData;
27
27
  const currentVendor = (0, vendorSelector_1.getVendorByVendorId)(state$.value.vendorState, vendorId);
28
28
  const { vendorName, selectedGlobalMerchant, recommendations, nonExistingRecommendations, } = getSaveVendorFirstReviewViewPayloadDetails(currentVendorLocalData, globalMerchantState, vendorState);
29
- const payload = Object.assign({}, prepareSaveVendorFirstReviewViewPayload(vendorName, recommendations, nonExistingRecommendations, markAsEmployee, currentVendor === null || currentVendor === void 0 ? void 0 : currentVendor.qboId, selectedGlobalMerchant));
29
+ const payload = Object.assign({}, prepareSaveVendorFirstReviewViewPayload(vendorName, recommendations, nonExistingRecommendations, currentVendor === null || currentVendor === void 0 ? void 0 : currentVendor.qboId, selectedGlobalMerchant));
30
30
  const queryParam = {
31
31
  view: 'merchant_review_list',
32
32
  };
@@ -66,11 +66,9 @@ const saveVendorFirstReviewViewEpic = (actions$, state$, zeniAPI) => actions$.pi
66
66
  }
67
67
  else {
68
68
  actions.push((0, snackbarReducer_1.openSnackbar)({
69
- messageSection: payload.is_employee === true
70
- ? 'save_vendor_marked_as_employee'
71
- : 'save_vendor_sent_for_review',
69
+ messageSection: 'save_vendor_sent_for_review',
72
70
  messageText: 'success',
73
- type: payload.is_employee === true ? 'success' : 'info',
71
+ type: 'info',
74
72
  variables: [
75
73
  {
76
74
  variableName: '_vendor_name_',
@@ -143,7 +141,7 @@ exports.saveVendorFirstReviewViewEpic = saveVendorFirstReviewViewEpic;
143
141
  /**
144
142
  * Helpers
145
143
  */
146
- const prepareSaveVendorFirstReviewViewPayload = (vendorName, recommendations, nonExistingRecommendations, markAsEmployee, vendorQboId, selectedGlobalMerchant) => {
144
+ const prepareSaveVendorFirstReviewViewPayload = (vendorName, recommendations, nonExistingRecommendations, vendorQboId, selectedGlobalMerchant) => {
147
145
  const selectedGlobalMerchantBase = (selectedGlobalMerchant === null || selectedGlobalMerchant === void 0 ? void 0 : selectedGlobalMerchant.globalMerchantId) != null
148
146
  ? (0, omit_1.default)((0, globalMerchantPayload_1.toGlobalMerchantBasePayload)(selectedGlobalMerchant), ['create_time', 'update_time'])
149
147
  : selectedGlobalMerchant != null
@@ -152,9 +150,8 @@ const prepareSaveVendorFirstReviewViewPayload = (vendorName, recommendations, no
152
150
  const payload = {
153
151
  vendor_name: vendorName,
154
152
  qbo_id: vendorQboId !== null && vendorQboId !== void 0 ? vendorQboId : null,
155
- selected_global_merchant: markAsEmployee === true ? null : selectedGlobalMerchantBase,
153
+ selected_global_merchant: selectedGlobalMerchantBase,
156
154
  recommendations: (0, commonTypes_2.toVendorReviewViewRecommendationPayload)(recommendations, nonExistingRecommendations),
157
- is_employee: markAsEmployee,
158
155
  };
159
156
  return payload;
160
157
  };
@@ -47,7 +47,6 @@ export interface SaveVendorFirstReviewViewQueryPayload {
47
47
  vendor_name: string;
48
48
  qbo_id: string | null;
49
49
  selected_global_merchant: AllGlobalMerchantBasePayload | null;
50
- is_employee: boolean;
51
50
  recommendations: VendorReviewViewAllRecommendationsPayload;
52
51
  }
53
52
  export declare type SaveVendorFirstReviewResponse = ZeniAPIResponse<SaveVendorFirstReviewView>;
@@ -18,9 +18,9 @@ export declare const fetchVendorFirstReviewView: import("@reduxjs/toolkit").Acti
18
18
  scrollYOffset: number;
19
19
  }, string>, updateVendorFirstReviewViewPageToken: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
20
20
  pageToken: PageToken;
21
- }, string>, saveVendorFirstReviewView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[vendorId: string, markAsEmployee?: any], {
21
+ }, string>, saveVendorFirstReviewView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[vendorId: string, vendorName?: string | undefined], {
22
22
  vendorId: string;
23
- markAsEmployee: any;
23
+ vendorName: string | undefined;
24
24
  }, string, never, never>, updateVendorFirstReviewSortUiState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
25
25
  sortOrder: SortOrder;
26
26
  sortkey: VendorFirstReviewViewColumnKey;
@@ -141,11 +141,11 @@ const vendorFirstReviewView = (0, toolkit_1.createSlice)({
141
141
  error: undefined,
142
142
  } });
143
143
  },
144
- prepare(vendorId, markAsEmployee = false) {
144
+ prepare(vendorId, vendorName) {
145
145
  return {
146
146
  payload: {
147
147
  vendorId,
148
- markAsEmployee,
148
+ vendorName,
149
149
  },
150
150
  };
151
151
  },
package/lib/zeniAPI.d.ts CHANGED
@@ -15,7 +15,6 @@ export interface RESTAPIEndpoints {
15
15
  readonly approvalMicroServiceBaseUrl: string;
16
16
  readonly cardMicroServiceBaseUrl: string;
17
17
  readonly taskMicroServiceBaseUrl: string;
18
- readonly notificationMicroServiceBaseUrl: string;
19
18
  }
20
19
  export interface ZeniAPI<ResponseType = FetchResponse> {
21
20
  readonly apiEndPoints: RESTAPIEndpoints;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.8.53",
3
+ "version": "4.8.55",
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
  "types": "lib/index.d.ts",
@@ -1,17 +0,0 @@
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
- }>;
@@ -1,23 +0,0 @@
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;
@@ -1,31 +0,0 @@
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" | "save_vendor_marked_as_employee" | "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
- }>;
@@ -1,70 +0,0 @@
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
- }
@@ -1,2 +0,0 @@
1
- import { NotificationSettings } from './settingsViewState';
2
- export declare const isNotificationsTabVisible: (notificationSettingsView: NotificationSettings) => boolean;
@@ -1,11 +0,0 @@
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;