@zeniai/client-epic-state 4.16.99 → 4.17.0

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.
@@ -19,10 +19,11 @@ export declare const fetchImproveUsingZeniGPT: import("@reduxjs/toolkit").Action
19
19
  }, "reviewCompanyView/updateImproveUsingZeniGPTSuccess", never, never>, updateImproveUsingZeniGPTFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[status: ZeniAPIStatus<Record<string, unknown>>, companyId: string], {
20
20
  status: ZeniAPIStatus<Record<string, unknown>>;
21
21
  companyId: string;
22
- }, "reviewCompanyView/updateImproveUsingZeniGPTFailure", never, never>, fetchCompanyMonthEndReportView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride: any, companyId: string, tenantId?: string | undefined], {
22
+ }, "reviewCompanyView/updateImproveUsingZeniGPTFailure", never, never>, fetchCompanyMonthEndReportView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride: any, companyId: string, tenantId?: string | undefined, insightDate?: string | undefined], {
23
23
  cacheOverride: any;
24
24
  companyId: string;
25
25
  tenantId: string | undefined;
26
+ insightDate: string | undefined;
26
27
  }, "reviewCompanyView/fetchCompanyMonthEndReportView", never, never>, updateCompanyMonthEndReportViewOnSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string, data: CompanyMonthEndReportViewPayload], {
27
28
  companyId: string;
28
29
  data: CompanyMonthEndReportViewPayload;
@@ -48,8 +48,8 @@ const companyMonthEndReportView = (0, toolkit_1.createSlice)({
48
48
  initialState: exports.initialState,
49
49
  reducers: {
50
50
  fetchCompanyMonthEndReportView: {
51
- prepare(cacheOverride = true, companyId, tenantId) {
52
- return { payload: { cacheOverride, companyId, tenantId } };
51
+ prepare(cacheOverride = true, companyId, tenantId, insightDate) {
52
+ return { payload: { cacheOverride, companyId, tenantId, insightDate } };
53
53
  },
54
54
  reducer(draft, action) {
55
55
  const companyId = action.payload.companyId;
@@ -7,14 +7,18 @@ const fileReducer_1 = require("../../../entity/file/fileReducer");
7
7
  const responsePayload_1 = require("../../../responsePayload");
8
8
  const companyMonthEndReportViewReducer_1 = require("../companyMonthEndReportViewReducer");
9
9
  const fetchCompanyMonthEndReportViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(companyMonthEndReportViewReducer_1.fetchCompanyMonthEndReportView.match), (0, operators_1.switchMap)((action) => {
10
- const { cacheOverride, companyId, tenantId } = action.payload;
10
+ const { cacheOverride, companyId, tenantId, insightDate } = action.payload;
11
11
  const state = state$.value;
12
12
  const fetchState = state.companyMonthEndReportViewState.monthEndReportDataByCompanyId[companyId].fetchState;
13
13
  const zeniTenantId = tenantId !== null && tenantId !== void 0 ? tenantId : state.companyState.companiesById[companyId].companyInfo.tenantId;
14
14
  if (zeniTenantId != null &&
15
15
  (cacheOverride === true || fetchState !== 'Completed')) {
16
+ const queryParam = {
17
+ insight_date: insightDate !== null && insightDate !== void 0 ? insightDate : null,
18
+ };
19
+ const apiUrl = `${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/companies/${companyId}/emails/month-end?query=${encodeURIComponent(JSON.stringify(queryParam))}`;
16
20
  return zeniAPI
17
- .getJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/companies/${companyId}/emails/month-end`, {
21
+ .getJSON(apiUrl, {
18
22
  'zeni-tenant-id': zeniTenantId,
19
23
  })
20
24
  .pipe((0, operators_1.mergeMap)((response) => {
@@ -47,7 +47,7 @@ const refreshExpenseAutomationCurrentTabEpic = (actions$, state$) => actions$.pi
47
47
  ]);
48
48
  case 'month_end_insights':
49
49
  return (0, rxjs_1.from)([
50
- (0, companyMonthEndReportViewReducer_1.fetchCompanyMonthEndReportView)(true, companyId, currentTenant.tenantId),
50
+ (0, companyMonthEndReportViewReducer_1.fetchCompanyMonthEndReportView)(true, companyId, currentTenant.tenantId, undefined),
51
51
  (0, companyMonthEndReportViewReducer_1.fetchCompanyMonthEndReportTemplates)(companyId, currentTenant.tenantId),
52
52
  ]);
53
53
  case 'reconciliation': {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.16.99",
3
+ "version": "4.17.0",
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",