@zeniai/client-epic-state 4.19.96-betaJK4 → 4.19.96-betaJK6

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.
@@ -2,18 +2,13 @@ import { of } from 'rxjs';
2
2
  import { catchError, filter, mergeMap } from 'rxjs/operators';
3
3
  import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
4
4
  import { fetchReconExcludedAccounts, fetchReconExcludedAccountsFailure, fetchReconExcludedAccountsSuccess, } from '../../reducers/reconciliationViewReducer';
5
- export const fetchReconExcludedAccountsEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(fetchReconExcludedAccounts.match), mergeMap((action) => {
6
- const { accountId, exclusionReason } = action.payload;
7
- const requestPayload = {
8
- account_id: accountId,
9
- exclusion_reason: exclusionReason,
10
- };
5
+ export const fetchReconExcludedAccountsEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(fetchReconExcludedAccounts.match), mergeMap(() => {
11
6
  return zeniAPI
12
- .postAndGetJSON(`${zeniAPI.apiEndPoints.reconciliationMicroServiceBaseUrl}/1.0/reconciliation/excluded-accounts`, requestPayload)
7
+ .getJSON(`${zeniAPI.apiEndPoints.reconciliationMicroServiceBaseUrl}/1.0/reconciliation/excluded-accounts`)
13
8
  .pipe(mergeMap((response) => {
14
9
  if (isSuccessResponse(response) && response.data != null) {
15
10
  return of(fetchReconExcludedAccountsSuccess({
16
- excludedAccounts: response.data.excluded_account,
11
+ excludedAccounts: response.data.excluded_accounts,
17
12
  }));
18
13
  }
19
14
  else {
@@ -427,18 +427,11 @@ const expenseAutomationReconciliationView = createSlice({
427
427
  updateStatementUploadChosen: (draft, action) => {
428
428
  draft.statementUploadChosen = action.payload.statementUploadChosen;
429
429
  },
430
- fetchReconExcludedAccounts: {
431
- reducer(draft) {
432
- draft.excludedAccountsFetchState = {
433
- fetchState: 'In-Progress',
434
- error: undefined,
435
- };
436
- },
437
- prepare(accountId, exclusionReason) {
438
- return {
439
- payload: { accountId, exclusionReason },
440
- };
441
- },
430
+ fetchReconExcludedAccounts: (draft) => {
431
+ draft.excludedAccountsFetchState = {
432
+ fetchState: 'In-Progress',
433
+ error: undefined,
434
+ };
442
435
  },
443
436
  fetchReconExcludedAccountsSuccess: (draft, action) => {
444
437
  draft.excludedAccountsFetchState = {
@@ -366,8 +366,7 @@ export const getExpenseAutomationReconciliationView = createSelector((state) =>
366
366
  excludedLiabilityTotals.balanceTotal = total.balanceTotal;
367
367
  excludedLiabilityTotals.clearedTotal = total.clearedTotal;
368
368
  excludedLiabilityTotals.varianceTotal = total.varianceTotal;
369
- excludedLiabilityTotals.variancePercentage =
370
- total.variancePercentage;
369
+ excludedLiabilityTotals.variancePercentage = total.variancePercentage;
371
370
  }
372
371
  });
373
372
  const excludedAccountReconciliationBySectionID = {
@@ -421,10 +420,10 @@ export const getExpenseAutomationReconciliationView = createSelector((state) =>
421
420
  bankAccounts: uniqueBankAccounts,
422
421
  creditCards: uniqueCreditCards,
423
422
  accountReconciliationsByAccountID: reconList,
424
- fetchStatus: {
425
- fetchState: reconciliationViewState.fetchState,
426
- error: reconciliationViewState.error,
427
- },
423
+ fetchStatus: reduceAnyFetchState([
424
+ reconciliationViewState,
425
+ reconciliationViewState.excludedAccountsFetchState,
426
+ ]),
428
427
  plaidConnectionDetails: plaidAccountViewState['expense_automation_reconcile']
429
428
  .plaidConnectionDetails,
430
429
  reconciliationTabsState: reconciliationViewState.reconTabsState,
@@ -5,18 +5,13 @@ const rxjs_1 = require("rxjs");
5
5
  const operators_1 = require("rxjs/operators");
6
6
  const responsePayload_1 = require("../../../../responsePayload");
7
7
  const reconciliationViewReducer_1 = require("../../reducers/reconciliationViewReducer");
8
- const fetchReconExcludedAccountsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(reconciliationViewReducer_1.fetchReconExcludedAccounts.match), (0, operators_1.mergeMap)((action) => {
9
- const { accountId, exclusionReason } = action.payload;
10
- const requestPayload = {
11
- account_id: accountId,
12
- exclusion_reason: exclusionReason,
13
- };
8
+ const fetchReconExcludedAccountsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(reconciliationViewReducer_1.fetchReconExcludedAccounts.match), (0, operators_1.mergeMap)(() => {
14
9
  return zeniAPI
15
- .postAndGetJSON(`${zeniAPI.apiEndPoints.reconciliationMicroServiceBaseUrl}/1.0/reconciliation/excluded-accounts`, requestPayload)
10
+ .getJSON(`${zeniAPI.apiEndPoints.reconciliationMicroServiceBaseUrl}/1.0/reconciliation/excluded-accounts`)
16
11
  .pipe((0, operators_1.mergeMap)((response) => {
17
12
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
18
13
  return (0, rxjs_1.of)((0, reconciliationViewReducer_1.fetchReconExcludedAccountsSuccess)({
19
- excludedAccounts: response.data.excluded_account,
14
+ excludedAccounts: response.data.excluded_accounts,
20
15
  }));
21
16
  }
22
17
  else {
@@ -72,7 +72,7 @@ export interface ExcludedAccountPayload {
72
72
  update_time: string;
73
73
  }
74
74
  export interface ExcludedAccountsResponsePayload {
75
- excluded_account: ExcludedAccountPayload[];
75
+ excluded_accounts: ExcludedAccountPayload[];
76
76
  }
77
77
  export type ExcludedAccountsResponse = ZeniAPIResponse<ExcludedAccountsResponsePayload>;
78
78
  export declare const toExcludedAccount: (payload: ExcludedAccountPayload) => ExcludedAccount;
@@ -99,10 +99,7 @@ export declare const fetchReconciliation: import("@reduxjs/toolkit").ActionCreat
99
99
  selectedPeriod: MonthYearPeriod;
100
100
  }, "expenseAutomationReconciliationView/uploadAccountStatementFailure">, updateStatementUploadChosen: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
101
101
  statementUploadChosen: boolean;
102
- }, "expenseAutomationReconciliationView/updateStatementUploadChosen">, fetchReconExcludedAccounts: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[accountId: string, exclusionReason: string], {
103
- accountId: string;
104
- exclusionReason: string;
105
- }, "expenseAutomationReconciliationView/fetchReconExcludedAccounts", never, never>, fetchReconExcludedAccountsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
102
+ }, "expenseAutomationReconciliationView/updateStatementUploadChosen">, fetchReconExcludedAccounts: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationReconciliationView/fetchReconExcludedAccounts">, fetchReconExcludedAccountsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
106
103
  excludedAccounts: ExcludedAccountPayload[];
107
104
  }, "expenseAutomationReconciliationView/fetchReconExcludedAccountsSuccess">, fetchReconExcludedAccountsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
108
105
  error: ZeniAPIStatus;
@@ -431,18 +431,11 @@ const expenseAutomationReconciliationView = (0, toolkit_1.createSlice)({
431
431
  updateStatementUploadChosen: (draft, action) => {
432
432
  draft.statementUploadChosen = action.payload.statementUploadChosen;
433
433
  },
434
- fetchReconExcludedAccounts: {
435
- reducer(draft) {
436
- draft.excludedAccountsFetchState = {
437
- fetchState: 'In-Progress',
438
- error: undefined,
439
- };
440
- },
441
- prepare(accountId, exclusionReason) {
442
- return {
443
- payload: { accountId, exclusionReason },
444
- };
445
- },
434
+ fetchReconExcludedAccounts: (draft) => {
435
+ draft.excludedAccountsFetchState = {
436
+ fetchState: 'In-Progress',
437
+ error: undefined,
438
+ };
446
439
  },
447
440
  fetchReconExcludedAccountsSuccess: (draft, action) => {
448
441
  draft.excludedAccountsFetchState = {
@@ -372,8 +372,7 @@ exports.getExpenseAutomationReconciliationView = (0, toolkit_1.createSelector)((
372
372
  excludedLiabilityTotals.balanceTotal = total.balanceTotal;
373
373
  excludedLiabilityTotals.clearedTotal = total.clearedTotal;
374
374
  excludedLiabilityTotals.varianceTotal = total.varianceTotal;
375
- excludedLiabilityTotals.variancePercentage =
376
- total.variancePercentage;
375
+ excludedLiabilityTotals.variancePercentage = total.variancePercentage;
377
376
  }
378
377
  });
379
378
  const excludedAccountReconciliationBySectionID = {
@@ -427,10 +426,10 @@ exports.getExpenseAutomationReconciliationView = (0, toolkit_1.createSelector)((
427
426
  bankAccounts: uniqueBankAccounts,
428
427
  creditCards: uniqueCreditCards,
429
428
  accountReconciliationsByAccountID: reconList,
430
- fetchStatus: {
431
- fetchState: reconciliationViewState.fetchState,
432
- error: reconciliationViewState.error,
433
- },
429
+ fetchStatus: (0, reduceFetchState_1.reduceAnyFetchState)([
430
+ reconciliationViewState,
431
+ reconciliationViewState.excludedAccountsFetchState,
432
+ ]),
434
433
  plaidConnectionDetails: plaidAccountViewState['expense_automation_reconcile']
435
434
  .plaidConnectionDetails,
436
435
  reconciliationTabsState: reconciliationViewState.reconTabsState,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.19.96-betaJK4",
3
+ "version": "4.19.96-betaJK6",
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",