diff --git a/Hippo.Core/Services/PaymentsService.cs b/Hippo.Core/Services/PaymentsService.cs index 0fad28a3..ba2313f3 100644 --- a/Hippo.Core/Services/PaymentsService.cs +++ b/Hippo.Core/Services/PaymentsService.cs @@ -235,20 +235,18 @@ public async Task NotifyAboutFailedPayments() } if (invalidOrderIdsInCluster.Count > 0) { - //Get lists of cluster admins - //Send email to cluster admins with list of orders that have failed payments - //https://localhost:44371/caesfarm/order/details/46 + //Send email to cluster admins / financial admins with list of orders that have failed payments - var clusterAdmins = await _dbContext.Users.AsNoTracking().Where(u => u.Permissions.Any(p => p.Cluster.Id == orderGroup.Key && p.Role.Name == Role.Codes.ClusterAdmin)).Select(a => a.Email).ToArrayAsync(); - //TODO: Notify the cluster admins with a single email + var notificationList = await _dbContext.Users.AsNoTracking().Where(a => a.Permissions.Any(p => p.Cluster.Id == orderGroup.Key && (p.Role.Name == Role.Codes.ClusterAdmin || p.Role.Name == Role.Codes.FinancialAdmin))).Select(a => a.Email).Distinct().ToArrayAsync(); try { - await _notificationService.AdminPaymentFailureNotification(clusterAdmins, cluster.Name, invalidOrderIdsInCluster.ToArray()); + await _notificationService.AdminPaymentFailureNotification(notificationList, cluster.Name, invalidOrderIdsInCluster.ToArray()); } catch (Exception ex) { - Log.Error(ex, "Failed to notify cluster admins for cluster {0}", cluster.Id); + + Log.Error(ex, "Failed to notify cluster admins/financial for cluster {0}", cluster.Id); } } diff --git a/Hippo.Core/Services/SlothService.cs b/Hippo.Core/Services/SlothService.cs index 4803b9b8..fa29596d 100644 --- a/Hippo.Core/Services/SlothService.cs +++ b/Hippo.Core/Services/SlothService.cs @@ -174,7 +174,7 @@ private TransactionViewModel CreateTransaction(FinancialDetail financialDetail, { var slothTransaction = new TransactionViewModel { - AutoApprove = financialDetail.AutoApprove, + AutoApprove = false, //financialDetail.AutoApprove, MerchantTrackingNumber = $"{payment.OrderId}-{payment.Id}", ProcessorTrackingNumber = $"{payment.OrderId}-{payment.Id}", ValidateFinancialSegmentStrings = true, diff --git a/Hippo.Web/ClientApp/src/components/Financial/FinancialDetail.tsx b/Hippo.Web/ClientApp/src/components/Financial/FinancialDetail.tsx index 185b2434..2f796ccb 100644 --- a/Hippo.Web/ClientApp/src/components/Financial/FinancialDetail.tsx +++ b/Hippo.Web/ClientApp/src/components/Financial/FinancialDetail.tsx @@ -163,21 +163,6 @@ export const FinancialDetail = () => { /> -
- {" "} - - setFinancialDetail((prevFinancialDetail) => ({ - ...prevFinancialDetail, - autoApprove: e.target.checked, - })) - } - /> -
{" "} {financialDetail.chartString && ( diff --git a/Hippo.Web/Controllers/FinancialController.cs b/Hippo.Web/Controllers/FinancialController.cs index 474a7f9d..524560c9 100644 --- a/Hippo.Web/Controllers/FinancialController.cs +++ b/Hippo.Web/Controllers/FinancialController.cs @@ -42,7 +42,7 @@ public async Task FinancialDetails() FinancialSystemApiKey = string.Empty, FinancialSystemApiSource = existingFinancialDetail?.FinancialSystemApiSource, ChartString = existingFinancialDetail?.ChartString, - AutoApprove = existingFinancialDetail?.AutoApprove ?? false, + AutoApprove = false, // existingFinancialDetail?.AutoApprove ?? false, MaskedApiKey = "NOT SET" }; @@ -103,7 +103,7 @@ public async Task UpdateFinancialDetails([FromBody] FinancialDeta //var xxx = await _secretsService.GetSecret(existingFinancialDetail.SecretAccessKey); existingFinancialDetail.FinancialSystemApiSource = model.FinancialSystemApiSource; existingFinancialDetail.ChartString = validateChartString.ChartString; - existingFinancialDetail.AutoApprove = model.AutoApprove; + existingFinancialDetail.AutoApprove = false; // model.AutoApprove; if (existingFinancialDetail.Id == 0) { @@ -121,7 +121,7 @@ public async Task UpdateFinancialDetails([FromBody] FinancialDeta FinancialSystemApiKey = string.Empty, FinancialSystemApiSource = existingFinancialDetail?.FinancialSystemApiSource, ChartString = existingFinancialDetail?.ChartString, - AutoApprove = existingFinancialDetail?.AutoApprove ?? false, + AutoApprove = false, //existingFinancialDetail?.AutoApprove ?? false, MaskedApiKey = "NOT SET" }; var apiKey = await _secretsService.GetSecret(existingFinancialDetail?.SecretAccessKey);