@zeniai/client-epic-state 4.19.37-betaVR10 → 4.19.37-betaVR11

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.
@@ -12,7 +12,7 @@ export const fetchBulkUploadBatchDetailsEpic = (actions$, state$, zeniAPI) => ac
12
12
  }));
13
13
  }
14
14
  return zeniAPI
15
- .getJSON(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/receipts/batches/${currentBatchId}`)
15
+ .getJSON(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/batches/${currentBatchId}`)
16
16
  .pipe(mergeMap((response) => {
17
17
  if (isSuccessResponse(response) && response.data != null) {
18
18
  const actions = [];
@@ -20,8 +20,13 @@ export const fetchBulkUploadBatchesEpic = (actions$, state$, zeniAPI) => actions
20
20
  }));
21
21
  }
22
22
  const period = convertToPeriod(selectedPeriod);
23
+ const queryParam = {
24
+ start_date: period.start,
25
+ end_date: period.end,
26
+ sort_order: 'desc',
27
+ };
23
28
  return zeniAPI
24
- .getJSON(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/receipts/batches?start_date=${period.start}&end_date=${period.end}`)
29
+ .getJSON(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/batches?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
25
30
  .pipe(mergeMap((response) => {
26
31
  if (isSuccessResponse(response) && response.data != null) {
27
32
  return of(fetchBulkUploadBatchesSuccess({
@@ -10,7 +10,7 @@ export function fetchBatchDetailsByIds(batchIds, zeniAPI) {
10
10
  return EMPTY;
11
11
  }
12
12
  return from(batchIds).pipe(mergeMap((batchId) => zeniAPI
13
- .getJSON(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/receipts/batches/${batchId}`)
13
+ .getJSON(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/batches/${batchId}`)
14
14
  .pipe(mergeMap((response) => {
15
15
  if (isSuccessResponse(response) && response.data != null) {
16
16
  const actions = [];
@@ -17,8 +17,13 @@ export const pollBulkUploadBatchStatusEpic = (actions$, state$, zeniAPI) => acti
17
17
  const currentTenant = getCurrentTenant(state);
18
18
  const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
19
19
  const period = convertToPeriod(selectedPeriod);
20
+ const queryParam = {
21
+ start_date: period.start,
22
+ end_date: period.end,
23
+ sort_order: 'desc',
24
+ };
20
25
  return zeniAPI
21
- .getJSON(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/receipts/batches?start_date=${period.start}&end_date=${period.end}`)
26
+ .getJSON(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/batches?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
22
27
  .pipe(mergeMap((response) => {
23
28
  if (isSuccessResponse(response) && response.data != null) {
24
29
  const batchList = response.data.batches.map(toBatchListItem);
@@ -15,7 +15,7 @@ const fetchBulkUploadBatchDetailsEpic = (actions$, state$, zeniAPI) => actions$.
15
15
  }));
16
16
  }
17
17
  return zeniAPI
18
- .getJSON(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/receipts/batches/${currentBatchId}`)
18
+ .getJSON(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/batches/${currentBatchId}`)
19
19
  .pipe((0, operators_1.mergeMap)((response) => {
20
20
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
21
21
  const actions = [];
@@ -23,8 +23,13 @@ const fetchBulkUploadBatchesEpic = (actions$, state$, zeniAPI) => actions$.pipe(
23
23
  }));
24
24
  }
25
25
  const period = (0, timePeriod_1.convertToPeriod)(selectedPeriod);
26
+ const queryParam = {
27
+ start_date: period.start,
28
+ end_date: period.end,
29
+ sort_order: 'desc',
30
+ };
26
31
  return zeniAPI
27
- .getJSON(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/receipts/batches?start_date=${period.start}&end_date=${period.end}`)
32
+ .getJSON(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/batches?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
28
33
  .pipe((0, operators_1.mergeMap)((response) => {
29
34
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
30
35
  return (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.fetchBulkUploadBatchesSuccess)({
@@ -14,7 +14,7 @@ function fetchBatchDetailsByIds(batchIds, zeniAPI) {
14
14
  return rxjs_1.EMPTY;
15
15
  }
16
16
  return (0, rxjs_1.from)(batchIds).pipe((0, operators_1.mergeMap)((batchId) => zeniAPI
17
- .getJSON(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/receipts/batches/${batchId}`)
17
+ .getJSON(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/batches/${batchId}`)
18
18
  .pipe((0, operators_1.mergeMap)((response) => {
19
19
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
20
20
  const actions = [];
@@ -21,8 +21,13 @@ const pollBulkUploadBatchStatusEpic = (actions$, state$, zeniAPI) => actions$.pi
21
21
  const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
22
22
  const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
23
23
  const period = (0, timePeriod_1.convertToPeriod)(selectedPeriod);
24
+ const queryParam = {
25
+ start_date: period.start,
26
+ end_date: period.end,
27
+ sort_order: 'desc',
28
+ };
24
29
  return zeniAPI
25
- .getJSON(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/receipts/batches?start_date=${period.start}&end_date=${period.end}`)
30
+ .getJSON(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/batches?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
26
31
  .pipe((0, operators_1.mergeMap)((response) => {
27
32
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
28
33
  const batchList = response.data.batches.map(missingReceiptsPayload_1.toBatchListItem);
@@ -16,6 +16,11 @@ interface MissingReceiptsPayload {
16
16
  transactions: TransactionPayload[];
17
17
  }
18
18
  export type MissingReceiptsResponse = ZeniAPIResponse<MissingReceiptsPayload>;
19
+ export interface BatchListQueryPayload {
20
+ end_date: string;
21
+ sort_order: string;
22
+ start_date: string;
23
+ }
19
24
  export interface BulkUploadResponsePayload {
20
25
  batch_id: string;
21
26
  status: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.19.37-betaVR10",
3
+ "version": "4.19.37-betaVR11",
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
  "module": "lib/esm/index.js",