@zeniai/client-epic-state 4.19.1 → 4.19.2-betaAS10

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.
@@ -23,8 +23,15 @@ const fetchEntityRecommendationsByTransactionIdEpic = (actions$, state$, zeniAPI
23
23
  if (isFetchCOT === true) {
24
24
  query.include_cot = true;
25
25
  }
26
+ const entityQuery = {
27
+ entity_name: entity.name,
28
+ entity_type: entity.type,
29
+ };
30
+ const recommendationUrl = entity.qboId === entity.name // eneity id null case handle here
31
+ ? `${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/recommendations?query=${encodeURIComponent(JSON.stringify(entityQuery))}`
32
+ : `${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/${(0, exports.toEntityTypeURL)(entity.type)}/${entity.qboId}/recommendations?query=${encodeURIComponent(JSON.stringify(query))}`;
26
33
  return zeniAPI
27
- .getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/${(0, exports.toEntityTypeURL)(entity.type)}/${entity.qboId}/recommendations?query=${encodeURIComponent(JSON.stringify(query))}`)
34
+ .getJSON(recommendationUrl)
28
35
  .pipe((0, operators_1.mergeMap)((response) => {
29
36
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
30
37
  const actions = [];
@@ -13,7 +13,7 @@ const remiListState_1 = require("./remiListState");
13
13
  const fetchRemiListEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(remiListReducer_1.fetchRemiList.match), (0, operators_1.mergeMap)((action) => {
14
14
  const fetchRemiListActions = [];
15
15
  const state = state$.value;
16
- const { period, cacheOverride, isShowDeletedReimbursementEnabled, isIncludeLineItems, } = action.payload;
16
+ const { period, cacheOverride, isShowDeletedReimbursementEnabled, isIncludeLineItems, isRefreshAccountAndAccountingClass, } = action.payload;
17
17
  const tabIds = [
18
18
  'draft',
19
19
  'pending_approval',
@@ -22,7 +22,7 @@ const fetchRemiListEpic = (actions$, state$) => actions$.pipe((0, operators_1.fi
22
22
  ];
23
23
  if (cacheOverride === true) {
24
24
  fetchRemiListActions.push((0, reimbursementConfigReducer_1.fetchReimbursementConfig)());
25
- tabIds.forEach((tab) => fetchRemiListActions.push((0, remiListReducer_1.fetchRemiListPerTab)(period, tab, isShowDeletedReimbursementEnabled, isIncludeLineItems)));
25
+ tabIds.forEach((tab) => fetchRemiListActions.push((0, remiListReducer_1.fetchRemiListPerTab)(period, tab, isShowDeletedReimbursementEnabled, isIncludeLineItems, isRefreshAccountAndAccountingClass)));
26
26
  }
27
27
  else {
28
28
  if (state.reimbursementConfigState.fetchState !== 'Completed' &&
@@ -33,7 +33,7 @@ const fetchRemiListEpic = (actions$, state$) => actions$.pipe((0, operators_1.fi
33
33
  const key = (0, remiListState_1.getRemiListKey)(period, tab);
34
34
  const remis = (0, get_1.default)(state.remiListState.byRemiListKey, key, undefined);
35
35
  if (remis == null || remis.hasValidState() === false) {
36
- fetchRemiListActions.push((0, remiListReducer_1.fetchRemiListPerTab)(period, tab, isShowDeletedReimbursementEnabled, isIncludeLineItems));
36
+ fetchRemiListActions.push((0, remiListReducer_1.fetchRemiListPerTab)(period, tab, isShowDeletedReimbursementEnabled, isIncludeLineItems, isRefreshAccountAndAccountingClass));
37
37
  }
38
38
  });
39
39
  }
@@ -10,23 +10,13 @@ const userReducer_1 = require("../../../../entity/user/userReducer");
10
10
  const responsePayload_1 = require("../../../../responsePayload");
11
11
  const remiListReducer_1 = require("./remiListReducer");
12
12
  const fetchRemiListPerTabEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(remiListReducer_1.fetchRemiListPerTab.match), (0, operators_1.mergeMap)((action) => {
13
- const { period, tab, isShowDeletedReimbursementEnabled, isIncludeLineItems, } = action.payload;
14
- const queryParam = {
15
- start_date: (0, timePeriod_1.toString)(period.start),
16
- end_date: (0, timePeriod_1.toString)(period.end),
17
- sort_by: 'reimbursement_date',
18
- sort_order: 'desc',
19
- reimbursement_provider: 'zeni',
20
- reimbursement_stage_code: tab,
21
- is_include_reimbursee_users_info: true,
22
- is_include_approval_info: tab === 'pending_approval',
23
- is_include_pending_approval_transaction_ids_for_user: tab === 'pending_approval',
24
- transaction_type: 'reimbursement',
25
- is_include_deleted: isShowDeletedReimbursementEnabled
13
+ const { period, tab, isShowDeletedReimbursementEnabled, isIncludeLineItems, isRefreshAccountAndAccountingClass, } = action.payload;
14
+ console.log('*************** from epic isRefreshAccountAndAccountingClass *****************', isRefreshAccountAndAccountingClass);
15
+ const queryParam = Object.assign({ start_date: (0, timePeriod_1.toString)(period.start), end_date: (0, timePeriod_1.toString)(period.end), sort_by: 'reimbursement_date', sort_order: 'desc', reimbursement_provider: 'zeni', reimbursement_stage_code: tab, is_include_reimbursee_users_info: true, is_include_approval_info: tab === 'pending_approval', is_include_pending_approval_transaction_ids_for_user: tab === 'pending_approval', transaction_type: 'reimbursement', is_include_deleted: isShowDeletedReimbursementEnabled
26
16
  ? tab !== 'draft'
27
- : false,
28
- is_include_line_items: isIncludeLineItems ? tab !== 'draft' : false,
29
- };
17
+ : false, is_include_line_items: isIncludeLineItems ? tab !== 'draft' : false }, (isRefreshAccountAndAccountingClass === false && {
18
+ is_refresh_account_and_accounting_class: false,
19
+ }));
30
20
  return zeniAPI
31
21
  .getJSON(`${zeniAPI.apiEndPoints.spendManagementMicroServiceBaseUrl}/1.0/reimbursements/transactions?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
32
22
  .pipe((0, operators_1.mergeMap)((response) => {
@@ -4,17 +4,19 @@ import { ZeniAPIStatus } from '../../../../responsePayload';
4
4
  import { RemiListPayload } from './remiListPayload';
5
5
  import { ReimbursementFilters, RemiListDownloadUIState, RemiListState, RemiListUIState, RemiTabType, SaveRemiStageCode } from './remiListState';
6
6
  export declare const initialState: RemiListState;
7
- export declare const fetchRemiList: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, cacheOverride: any, isShowDeletedReimbursementEnabled: boolean, isIncludeLineItems: boolean, isBulkActionCompleteRefresh?: any], {
7
+ export declare const fetchRemiList: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, cacheOverride: any, isShowDeletedReimbursementEnabled: boolean, isIncludeLineItems: boolean, isBulkActionCompleteRefresh: any, isRefreshAccountAndAccountingClass: boolean], {
8
8
  period: TimePeriod;
9
9
  cacheOverride: any;
10
10
  isShowDeletedReimbursementEnabled: boolean;
11
11
  isIncludeLineItems: boolean;
12
12
  isBulkActionCompleteRefresh: any;
13
- }, "remiList/fetchRemiList", never, never>, fetchRemiListPerTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, tab: "paid" | "pending_approval" | "scheduled" | "draft", isShowDeletedReimbursementEnabled: boolean, isIncludeLineItems: boolean], {
13
+ isRefreshAccountAndAccountingClass: boolean;
14
+ }, "remiList/fetchRemiList", never, never>, fetchRemiListPerTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, tab: "paid" | "pending_approval" | "scheduled" | "draft", isShowDeletedReimbursementEnabled: boolean, isIncludeLineItems: boolean, isRefreshAccountAndAccountingClass: boolean], {
14
15
  period: TimePeriod;
15
16
  tab: "paid" | "pending_approval" | "scheduled" | "draft";
16
17
  isShowDeletedReimbursementEnabled: boolean;
17
18
  isIncludeLineItems: boolean;
19
+ isRefreshAccountAndAccountingClass: boolean;
18
20
  }, "remiList/fetchRemiListPerTab", never, never>, updateRemiListByStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
19
21
  remiList: RemiListPayload;
20
22
  tab: RemiTabType;
@@ -34,13 +34,15 @@ const remiList = (0, toolkit_1.createSlice)({
34
34
  reducer() {
35
35
  //do nothing
36
36
  },
37
- prepare(period, tab, isShowDeletedReimbursementEnabled, isIncludeLineItems) {
37
+ prepare(period, tab, isShowDeletedReimbursementEnabled, isIncludeLineItems, isRefreshAccountAndAccountingClass) {
38
+ console.log('*************** called fetchRemiListPerTab prepare isRefreshAccountAndAccountingClass *****************', isRefreshAccountAndAccountingClass);
38
39
  return {
39
40
  payload: {
40
41
  period,
41
42
  tab,
42
43
  isShowDeletedReimbursementEnabled,
43
44
  isIncludeLineItems,
45
+ isRefreshAccountAndAccountingClass,
44
46
  },
45
47
  };
46
48
  },
@@ -69,7 +71,15 @@ const remiList = (0, toolkit_1.createSlice)({
69
71
  : 'In-Progress', error: undefined });
70
72
  });
71
73
  },
72
- prepare(period, cacheOverride = false, isShowDeletedReimbursementEnabled, isIncludeLineItems, isBulkActionCompleteRefresh = false) {
74
+ prepare(period, cacheOverride = false, isShowDeletedReimbursementEnabled, isIncludeLineItems, isBulkActionCompleteRefresh = false, isRefreshAccountAndAccountingClass) {
75
+ console.log('*************** called fetchRemiList prepare isRefreshAccountAndAccountingClass *****************', {
76
+ cacheOverride,
77
+ isBulkActionCompleteRefresh,
78
+ isIncludeLineItems,
79
+ isShowDeletedReimbursementEnabled,
80
+ period,
81
+ isRefreshAccountAndAccountingClass,
82
+ });
73
83
  return {
74
84
  payload: {
75
85
  period,
@@ -77,6 +87,7 @@ const remiList = (0, toolkit_1.createSlice)({
77
87
  isShowDeletedReimbursementEnabled,
78
88
  isIncludeLineItems,
79
89
  isBulkActionCompleteRefresh,
90
+ isRefreshAccountAndAccountingClass,
80
91
  },
81
92
  };
82
93
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.19.1",
3
+ "version": "4.19.2-betaAS10",
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",