@zeniai/client-epic-state 4.12.59 → 4.12.61

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.
@@ -3,9 +3,10 @@ import { BillDetailViewState, BillApprovalType, BillAssistActionType } from './b
3
3
  import { FetchState, ID } from '../../../../commonStateTypes/common';
4
4
  import { BillDetailViewPayload } from './billDetailViewPayload';
5
5
  export declare const initialState: BillDetailViewState;
6
- export declare const fetchBillDetail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[billId: string, isShowDeletedBillsEnabled: boolean, cacheOverride?: any], {
6
+ export declare const fetchBillDetail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[billId: string, isShowDeletedBillsEnabled: boolean, hasZeniAssistAccess: boolean, cacheOverride?: any], {
7
7
  billId: string;
8
8
  isShowDeletedBillsEnabled: boolean;
9
+ hasZeniAssistAccess: boolean;
9
10
  cacheOverride: any;
10
11
  }, string, never, never>, updateBillDetail: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
11
12
  billId: ID;
@@ -25,11 +25,12 @@ const billDetailView = (0, toolkit_1.createSlice)({
25
25
  draft.billDetailById[key] = Object.assign({}, billDetailViewState_1.initialBillDetailView);
26
26
  }
27
27
  },
28
- prepare(billId, isShowDeletedBillsEnabled, cacheOverride = false) {
28
+ prepare(billId, isShowDeletedBillsEnabled, hasZeniAssistAccess, cacheOverride = false) {
29
29
  return {
30
30
  payload: {
31
31
  billId,
32
32
  isShowDeletedBillsEnabled,
33
+ hasZeniAssistAccess,
33
34
  cacheOverride,
34
35
  },
35
36
  };
@@ -116,7 +116,8 @@ const fetchBillDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, ope
116
116
  'returned',
117
117
  ].includes((_q = transactionInResponse.bill_pay_info.bill_payment_status
118
118
  .code) !== null && _q !== void 0 ? _q : '');
119
- if (billHasPaymentError) {
119
+ if (billHasPaymentError &&
120
+ action.payload.hasZeniAssistAccess) {
120
121
  fetchActions.push((0, billDetailViewReducer_1.fetchEligibleActionsForBill)(billId, true));
121
122
  }
122
123
  }
@@ -5,14 +5,16 @@ import { InvoiceProcessingPayload } from './editBillViewPayload';
5
5
  import { AmountPayload } from '../../../../entity/reimbursement/reimbursementPayload';
6
6
  import { Amount } from '../../../../commonStateTypes/amount';
7
7
  export declare const initialState: EditBillDetailViewState;
8
- export declare const fetchEditBillDetailPage: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride: boolean, isShowDeletedBillsEnabled: boolean, billId?: string | undefined], {
8
+ export declare const fetchEditBillDetailPage: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride: boolean, isShowDeletedBillsEnabled: boolean, hasZeniAssistAccess: boolean, billId?: string | undefined], {
9
9
  cacheOverride: boolean;
10
10
  isShowDeletedBillsEnabled: boolean;
11
+ hasZeniAssistAccess: boolean;
11
12
  billId: string | undefined;
12
- }, string, never, never>, fetchBillAndInitializeLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[billId: string, cacheOverride: boolean, isShowDeletedBillsEnabled: boolean], {
13
+ }, string, never, never>, fetchBillAndInitializeLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[billId: string, cacheOverride: boolean, isShowDeletedBillsEnabled: boolean, hasZeniAssistAccess: boolean], {
13
14
  billId: string;
14
15
  cacheOverride: boolean;
15
16
  isShowDeletedBillsEnabled: boolean;
17
+ hasZeniAssistAccess: boolean;
16
18
  }, string, never, never>, fetchVendorByNameAndParseInvoice: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[invoiceProcessingPayload: InvoiceProcessingPayload, isVendorRecommendationFeatureEnabled: boolean], {
17
19
  invoiceProcessingPayload: InvoiceProcessingPayload;
18
20
  isVendorRecommendationFeatureEnabled: boolean;
@@ -23,8 +23,15 @@ const editBillView = (0, toolkit_1.createSlice)({
23
23
  reducer() {
24
24
  //do nothing
25
25
  },
26
- prepare(cacheOverride, isShowDeletedBillsEnabled, billId) {
27
- return { payload: { cacheOverride, isShowDeletedBillsEnabled, billId } };
26
+ prepare(cacheOverride, isShowDeletedBillsEnabled, hasZeniAssistAccess, billId) {
27
+ return {
28
+ payload: {
29
+ cacheOverride,
30
+ isShowDeletedBillsEnabled,
31
+ hasZeniAssistAccess,
32
+ billId,
33
+ },
34
+ };
28
35
  },
29
36
  },
30
37
  fetchBillAndInitializeLocalStore: {
@@ -41,8 +48,15 @@ const editBillView = (0, toolkit_1.createSlice)({
41
48
  error: undefined,
42
49
  }, showSkipAutofill: false });
43
50
  },
44
- prepare(billId, cacheOverride, isShowDeletedBillsEnabled) {
45
- return { payload: { billId, cacheOverride, isShowDeletedBillsEnabled } };
51
+ prepare(billId, cacheOverride, isShowDeletedBillsEnabled, hasZeniAssistAccess) {
52
+ return {
53
+ payload: {
54
+ billId,
55
+ cacheOverride,
56
+ isShowDeletedBillsEnabled,
57
+ hasZeniAssistAccess,
58
+ },
59
+ };
46
60
  },
47
61
  },
48
62
  fetchVendorByNameAndParseInvoice: {
@@ -13,11 +13,11 @@ const editBillViewReducer_1 = require("../editBillViewReducer");
13
13
  const fetchBillAndInitializeLocalStoreEpic = (actions$,
14
14
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
15
15
  state$) => actions$.pipe((0, operators_1.filter)(editBillViewReducer_1.fetchBillAndInitializeLocalStore.match), (0, operators_1.mergeMap)((action) => {
16
- const { billId, cacheOverride, isShowDeletedBillsEnabled } = action.payload;
16
+ const { billId, cacheOverride, isShowDeletedBillsEnabled, hasZeniAssistAccess, } = action.payload;
17
17
  const state = state$.value;
18
18
  const billDetailActions = [];
19
19
  if (cacheOverride) {
20
- billDetailActions.push((0, billDetailViewReducer_1.fetchBillDetail)(billId, isShowDeletedBillsEnabled, true));
20
+ billDetailActions.push((0, billDetailViewReducer_1.fetchBillDetail)(billId, isShowDeletedBillsEnabled, hasZeniAssistAccess, true));
21
21
  billDetailActions.push(
22
22
  //https://stackoverflow.com/questions/42276419/invoking-epics-from-within-other-epics
23
23
  (0, editBillViewReducer_1.waitForBillDetailThenInitializeLocalStore)(billId));
@@ -15,7 +15,7 @@ const companySelector_1 = require("../../../../../entity/company/companySelector
15
15
  const paymentAccountListReducer_1 = require("../../../zeniAccounts/paymentAccountList/paymentAccountListReducer");
16
16
  const fetchEditBillDetailPageEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(editBillViewReducer_1.fetchEditBillDetailPage.match), (0, operators_1.mergeMap)((action) => {
17
17
  var _a, _b, _c;
18
- const { cacheOverride, billId, isShowDeletedBillsEnabled } = action.payload;
18
+ const { cacheOverride, billId, isShowDeletedBillsEnabled, hasZeniAssistAccess, } = action.payload;
19
19
  const billDetailActions = [];
20
20
  const state = state$.value;
21
21
  const { tenantState, companyState } = state;
@@ -36,7 +36,7 @@ const fetchEditBillDetailPageEpic = (actions$, state$) => actions$.pipe((0, oper
36
36
  }
37
37
  billDetailActions.push((0, paymentAccountListReducer_1.fetchPaymentAccountList)());
38
38
  if (billId != null) {
39
- billDetailActions.push((0, editBillViewReducer_1.fetchBillAndInitializeLocalStore)(billId, true, isShowDeletedBillsEnabled));
39
+ billDetailActions.push((0, editBillViewReducer_1.fetchBillAndInitializeLocalStore)(billId, true, isShowDeletedBillsEnabled, hasZeniAssistAccess));
40
40
  }
41
41
  else {
42
42
  billDetailActions.push((0, editBillViewReducer_1.updateShowAutofill)(true));
@@ -79,7 +79,7 @@ const fetchEditBillDetailPageEpic = (actions$, state$) => actions$.pipe((0, oper
79
79
  billDetailActions.push((0, paymentAccountListReducer_1.fetchPaymentAccountList)());
80
80
  }
81
81
  if (billId != null) {
82
- billDetailActions.push((0, editBillViewReducer_1.fetchBillAndInitializeLocalStore)(billId, false, isShowDeletedBillsEnabled));
82
+ billDetailActions.push((0, editBillViewReducer_1.fetchBillAndInitializeLocalStore)(billId, false, isShowDeletedBillsEnabled, hasZeniAssistAccess));
83
83
  }
84
84
  else {
85
85
  const approvalViewFetchState = state.billPaySetupApproverViewState.fetchState;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.12.59",
3
+ "version": "4.12.61",
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",