@zeniai/client-epic-state 4.19.99-betaRD7 → 4.19.99-betaRD8

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.
@@ -73,8 +73,8 @@ const aiAccountantView = createSlice({
73
73
  _action) {
74
74
  draft.triggerJobStatus = { fetchState: 'In-Progress' };
75
75
  },
76
- prepare(operationType, params, triggeredBy) {
77
- return { payload: { operationType, params, triggeredBy } };
76
+ prepare(operationType, startDate, endDate, triggeredBy) {
77
+ return { payload: { operationType, startDate, endDate, triggeredBy } };
78
78
  },
79
79
  },
80
80
  triggerAiAccountantJobSuccess(draft) {
@@ -4,25 +4,19 @@ import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
4
4
  import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
5
5
  import { fetchAiAccountantCustomers, triggerAiAccountantJob, triggerAiAccountantJobFailure, triggerAiAccountantJobSuccess, } from '../aiAccountantViewReducer';
6
6
  export const triggerAiAccountantJobEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(triggerAiAccountantJob.match), mergeMap((action) => {
7
- const { operationType, params, triggeredBy } = action.payload;
7
+ const { operationType, startDate, endDate, triggeredBy } = action.payload;
8
8
  const rootState = state$.value;
9
9
  const selectedTenantIds = rootState.aiAccountantViewState.selectedTenantIdsForJobTrigger;
10
- const entityState = rootState.aiAccountantCustomerState;
11
- const customers = selectedTenantIds
12
- .map((tenantId) => {
13
- const customer = entityState.customerByTenantId[tenantId];
14
- return customer != null
15
- ? { company_id: customer.companyId, tenant_id: customer.tenantId }
16
- : undefined;
17
- })
18
- .filter((entry) => entry != null);
19
10
  const base = `${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/cockpit-panels`;
20
11
  const url = `${base}/ai-accountant/jobs`;
21
12
  return zeniAPI
22
13
  .postAndGetJSON(url, {
23
- customers,
14
+ tenant_ids: selectedTenantIds,
24
15
  operation_type: operationType,
25
- params: params ?? {},
16
+ params: {
17
+ start_date: startDate,
18
+ end_date: endDate,
19
+ },
26
20
  triggered_by: triggeredBy ?? 'cockpit-ui',
27
21
  })
28
22
  .pipe(mergeMap((response) => {