@zeniai/client-epic-state 5.1.54-betaRD1 → 5.1.54

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.
@@ -63,7 +63,9 @@ export const fetchEntityRecommendationsForLineUpdateEpic = (actions$, state$, ze
63
63
  if (!isSuccessResponse(response) || response.data == null) {
64
64
  return emitWithBulkStatus(payload.flowType === 'categorization'
65
65
  ? markCategoryClassRecommendationsFailureForCategorization(payload.selectedTab, transactionId, lineIds, response.status)
66
- : markCategoryClassRecommendationsFailureForTransactionDetail(transactionId, lineIds, response.status), updateVendorBulkRecommendationsFetchStatus(transactionId, 'Error', response.status));
66
+ : markCategoryClassRecommendationsFailureForTransactionDetail(transactionId, lineIds, response.status), isBulkDetailFetch
67
+ ? updateVendorBulkRecommendationsFetchStatus(transactionId, 'Error', response.status)
68
+ : undefined);
67
69
  }
68
70
  const recommendationWithCOTByLineId = getRecommendationByLineIdWithCOTFromRecommendationPayloadWithCOT(response.data.recommendations, lineIds);
69
71
  // HTTP 200 with no per-line recommendations: NOT an error.
@@ -73,7 +75,9 @@ export const fetchEntityRecommendationsForLineUpdateEpic = (actions$, state$, ze
73
75
  if (recommendationWithCOTByLineId == null) {
74
76
  return emitWithBulkStatus(payload.flowType === 'categorization'
75
77
  ? markCategoryClassRecommendationsCompletedForCategorization(payload.selectedTab, transactionId, lineIds)
76
- : markCategoryClassRecommendationsCompletedForTransactionDetail(transactionId, lineIds), updateVendorBulkRecommendationsFetchStatus(transactionId, 'Completed'));
78
+ : markCategoryClassRecommendationsCompletedForTransactionDetail(transactionId, lineIds), isBulkDetailFetch
79
+ ? updateVendorBulkRecommendationsFetchStatus(transactionId, 'Completed')
80
+ : undefined);
77
81
  }
78
82
  const transactionWithCOT = isFetchCOT === true
79
83
  ? getTransactionWithCOTFromRecommendations(transaction, recommendationWithCOTByLineId)
@@ -82,7 +86,9 @@ export const fetchEntityRecommendationsForLineUpdateEpic = (actions$, state$, ze
82
86
  if (payload.flowType === 'categorization') {
83
87
  return of(setEntityRecommendationForLineIdsForCategorization(payload.selectedTab, transactionId, transactionWithCOT, lineIds, entity, amount, recommendationWithCOTByLineId, uncategorizedIncomeExpense, isUncategorizedExpenseCategoryEnabled, getIsAccountingClassesEnabled(state$.value)));
84
88
  }
85
- return emitWithBulkStatus(setEntityRecommendationForLineIdsForTransactionDetail(transactionId, transactionWithCOT, lineIds, entity, amount, recommendationWithCOTByLineId, uncategorizedIncomeExpense), updateVendorBulkRecommendationsFetchStatus(transactionId, 'Completed'));
89
+ return emitWithBulkStatus(setEntityRecommendationForLineIdsForTransactionDetail(transactionId, transactionWithCOT, lineIds, entity, amount, recommendationWithCOTByLineId, uncategorizedIncomeExpense), isBulkDetailFetch
90
+ ? updateVendorBulkRecommendationsFetchStatus(transactionId, 'Completed')
91
+ : undefined);
86
92
  }), catchError((error) => {
87
93
  const errorMessage = 'fetchEntityRecommendationsForLineUpdate failed: ' +
88
94
  (error instanceof Error
@@ -91,7 +97,9 @@ export const fetchEntityRecommendationsForLineUpdateEpic = (actions$, state$, ze
91
97
  const status = createZeniAPIStatus('Unexpected Error', errorMessage);
92
98
  return emitWithBulkStatus(payload.flowType === 'categorization'
93
99
  ? markCategoryClassRecommendationsFailureForCategorization(payload.selectedTab, transactionId, lineIds, status)
94
- : markCategoryClassRecommendationsFailureForTransactionDetail(transactionId, lineIds, status), updateVendorBulkRecommendationsFetchStatus(transactionId, 'Error', status));
100
+ : markCategoryClassRecommendationsFailureForTransactionDetail(transactionId, lineIds, status), isBulkDetailFetch
101
+ ? updateVendorBulkRecommendationsFetchStatus(transactionId, 'Error', status)
102
+ : undefined);
95
103
  }));
96
104
  return concat(of(startAction), httpStream$);
97
105
  }))));
@@ -66,7 +66,9 @@ const fetchEntityRecommendationsForLineUpdateEpic = (actions$, state$, zeniAPI)
66
66
  if (!(0, responsePayload_1.isSuccessResponse)(response) || response.data == null) {
67
67
  return emitWithBulkStatus(payload.flowType === 'categorization'
68
68
  ? (0, transactionsViewReducer_1.markCategoryClassRecommendationsFailureForCategorization)(payload.selectedTab, transactionId, lineIds, response.status)
69
- : (0, transactionDetailReducer_1.markCategoryClassRecommendationsFailureForTransactionDetail)(transactionId, lineIds, response.status), (0, transactionDetailReducer_1.updateVendorBulkRecommendationsFetchStatus)(transactionId, 'Error', response.status));
69
+ : (0, transactionDetailReducer_1.markCategoryClassRecommendationsFailureForTransactionDetail)(transactionId, lineIds, response.status), isBulkDetailFetch
70
+ ? (0, transactionDetailReducer_1.updateVendorBulkRecommendationsFetchStatus)(transactionId, 'Error', response.status)
71
+ : undefined);
70
72
  }
71
73
  const recommendationWithCOTByLineId = (0, recommendationHelper_1.getRecommendationByLineIdWithCOTFromRecommendationPayloadWithCOT)(response.data.recommendations, lineIds);
72
74
  // HTTP 200 with no per-line recommendations: NOT an error.
@@ -76,7 +78,9 @@ const fetchEntityRecommendationsForLineUpdateEpic = (actions$, state$, zeniAPI)
76
78
  if (recommendationWithCOTByLineId == null) {
77
79
  return emitWithBulkStatus(payload.flowType === 'categorization'
78
80
  ? (0, transactionsViewReducer_1.markCategoryClassRecommendationsCompletedForCategorization)(payload.selectedTab, transactionId, lineIds)
79
- : (0, transactionDetailReducer_1.markCategoryClassRecommendationsCompletedForTransactionDetail)(transactionId, lineIds), (0, transactionDetailReducer_1.updateVendorBulkRecommendationsFetchStatus)(transactionId, 'Completed'));
81
+ : (0, transactionDetailReducer_1.markCategoryClassRecommendationsCompletedForTransactionDetail)(transactionId, lineIds), isBulkDetailFetch
82
+ ? (0, transactionDetailReducer_1.updateVendorBulkRecommendationsFetchStatus)(transactionId, 'Completed')
83
+ : undefined);
80
84
  }
81
85
  const transactionWithCOT = isFetchCOT === true
82
86
  ? (0, transactionHelper_1.getTransactionWithCOTFromRecommendations)(transaction, recommendationWithCOTByLineId)
@@ -85,7 +89,9 @@ const fetchEntityRecommendationsForLineUpdateEpic = (actions$, state$, zeniAPI)
85
89
  if (payload.flowType === 'categorization') {
86
90
  return (0, rxjs_1.of)((0, transactionsViewReducer_1.setEntityRecommendationForLineIdsForCategorization)(payload.selectedTab, transactionId, transactionWithCOT, lineIds, entity, amount, recommendationWithCOTByLineId, uncategorizedIncomeExpense, isUncategorizedExpenseCategoryEnabled, (0, tenantSelector_1.getIsAccountingClassesEnabled)(state$.value)));
87
91
  }
88
- return emitWithBulkStatus((0, transactionDetailReducer_1.setEntityRecommendationForLineIdsForTransactionDetail)(transactionId, transactionWithCOT, lineIds, entity, amount, recommendationWithCOTByLineId, uncategorizedIncomeExpense), (0, transactionDetailReducer_1.updateVendorBulkRecommendationsFetchStatus)(transactionId, 'Completed'));
92
+ return emitWithBulkStatus((0, transactionDetailReducer_1.setEntityRecommendationForLineIdsForTransactionDetail)(transactionId, transactionWithCOT, lineIds, entity, amount, recommendationWithCOTByLineId, uncategorizedIncomeExpense), isBulkDetailFetch
93
+ ? (0, transactionDetailReducer_1.updateVendorBulkRecommendationsFetchStatus)(transactionId, 'Completed')
94
+ : undefined);
89
95
  }), (0, operators_1.catchError)((error) => {
90
96
  const errorMessage = 'fetchEntityRecommendationsForLineUpdate failed: ' +
91
97
  (error instanceof Error
@@ -94,7 +100,9 @@ const fetchEntityRecommendationsForLineUpdateEpic = (actions$, state$, zeniAPI)
94
100
  const status = (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', errorMessage);
95
101
  return emitWithBulkStatus(payload.flowType === 'categorization'
96
102
  ? (0, transactionsViewReducer_1.markCategoryClassRecommendationsFailureForCategorization)(payload.selectedTab, transactionId, lineIds, status)
97
- : (0, transactionDetailReducer_1.markCategoryClassRecommendationsFailureForTransactionDetail)(transactionId, lineIds, status), (0, transactionDetailReducer_1.updateVendorBulkRecommendationsFetchStatus)(transactionId, 'Error', status));
103
+ : (0, transactionDetailReducer_1.markCategoryClassRecommendationsFailureForTransactionDetail)(transactionId, lineIds, status), isBulkDetailFetch
104
+ ? (0, transactionDetailReducer_1.updateVendorBulkRecommendationsFetchStatus)(transactionId, 'Error', status)
105
+ : undefined);
98
106
  }));
99
107
  return (0, rxjs_1.concat)((0, rxjs_1.of)(startAction), httpStream$);
100
108
  }))));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "5.1.54-betaRD1",
3
+ "version": "5.1.54",
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",