Align .editorconfig files

When debugging only
app.Services.GetRequiredService<IPCRBService>();

Injected AppSettings instead of using GetEnvironmentVariable at Services level

Get ready to use VSCode IDE
This commit is contained in:
2024-12-03 12:23:56 -07:00
parent 89790f4fc1
commit 538b1f817e
72 changed files with 3420 additions and 391 deletions

View File

@ -3,6 +3,7 @@ using System.Net.Mail;
using System.Text;
using MesaFabApproval.API.Utilities;
using MesaFabApproval.Models;
using MesaFabApproval.Shared.Models;
using MesaFabApproval.Shared.Utilities;
@ -54,18 +55,17 @@ public class PCRBService : IPCRBService {
IMemoryCache cache,
IUserService userService,
IApprovalService approvalService,
ISmtpService smtpService) {
ISmtpService smtpService,
AppSettings appSettings) {
_logger = logger ?? throw new ArgumentNullException("ILogger not injected");
_dalService = dalService ?? throw new ArgumentNullException("IDalService not injected");
_cache = cache ?? throw new ArgumentNullException("IMemoryCache not injected");
_userService = userService ?? throw new ArgumentNullException("IUserService not injected");
_pcrbAttachmentPath = Environment.GetEnvironmentVariable("FabApprovalPcrbAttachmentPath") ??
throw new ArgumentNullException("FabApprovalPcrbAttachmentPath environment variable not found");
_approvalService = approvalService ??
throw new ArgumentNullException("IApprovalService not injected");
_smtpService = smtpService ?? throw new ArgumentNullException("ISmtpService not injected");
_siteBaseUrl = Environment.GetEnvironmentVariable("NewFabApprovalBaseUrl") ??
throw new ArgumentNullException("FabApprovalBaseUrl environment variable not found");
_siteBaseUrl = appSettings.SiteBaseUrl;
_pcrbAttachmentPath = appSettings.PcrbAttachmentPath;
}
public async Task CreateNewPCRB(PCRB pcrb) {
@ -295,7 +295,7 @@ public class PCRBService : IPCRBService {
IEnumerable<PCRBAttachment>? attachments = null;
if (!bypassCache)
if (!bypassCache)
attachments = _cache.Get<IEnumerable<PCRBAttachment>>($"pcrbAttachments{planNumber}");
if (attachments is null) {
@ -609,7 +609,7 @@ public class PCRBService : IPCRBService {
IEnumerable<Approval> approvals = await _approvalService.GetApprovalsForIssueId(pcrb.PlanNumber, true);
List<Approval> approvalsNeedingNotification = approvals.Where(a => a.Step == pcrb.CurrentStep &&
List<Approval> approvalsNeedingNotification = approvals.Where(a => a.Step == pcrb.CurrentStep &&
a.NotifyDate <= DateTimeUtilities.MIN_DT &&
a.AssignedDate > DateTimeUtilities.MIN_DT).ToList();
@ -764,4 +764,4 @@ public class PCRBService : IPCRBService {
throw;
}
}
}
}