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:
@ -44,7 +44,7 @@ public class ApprovalService : IApprovalService {
|
||||
queryBuilder.Append($"values ({approval.IssueID}, '{approval.RoleName}', '{approval.SubRole}', {approval.UserID}, ");
|
||||
queryBuilder.Append($"{approval.SubRoleID}, 0, '{approval.AssignedDate.ToString("yyyy-MM-dd HH:mm:ss")}', ");
|
||||
queryBuilder.Append($"3, 0, {approval.Step}, {approval.TaskID});");
|
||||
|
||||
|
||||
int rowsCreated = await _dalService.ExecuteAsync(queryBuilder.ToString());
|
||||
|
||||
if (rowsCreated <= 0) throw new Exception("Unable to insert approval in database");
|
||||
@ -63,7 +63,7 @@ public class ApprovalService : IApprovalService {
|
||||
if (issueId <= 0) throw new ArgumentException($"{issueId} is not a valid issue ID");
|
||||
|
||||
IEnumerable<Approval>? approvals = new List<Approval>();
|
||||
|
||||
|
||||
if (!bypassCache)
|
||||
approvals = _cache.Get<IEnumerable<Approval>>($"approvals{issueId}");
|
||||
|
||||
@ -78,7 +78,7 @@ public class ApprovalService : IApprovalService {
|
||||
|
||||
foreach (Approval approval in approvals) {
|
||||
int successfulUpdates = 0;
|
||||
|
||||
|
||||
User? user = await _userService.GetUserByUserId(approval.UserID);
|
||||
if (user is not null) {
|
||||
approval.User = user;
|
||||
@ -86,11 +86,11 @@ public class ApprovalService : IApprovalService {
|
||||
}
|
||||
|
||||
if (approval.ItemStatus < 0)
|
||||
approval.StatusMessage = "Denied";
|
||||
approval.StatusMessage = "Denied";
|
||||
if (approval.ItemStatus == 0)
|
||||
approval.StatusMessage = "Assigned";
|
||||
approval.StatusMessage = "Assigned";
|
||||
if (approval.ItemStatus > 0)
|
||||
approval.StatusMessage = "Approved";
|
||||
approval.StatusMessage = "Approved";
|
||||
}
|
||||
|
||||
_cache.Set($"approvals{issueId}", approvals, DateTimeOffset.Now.AddMinutes(5));
|
||||
@ -107,7 +107,7 @@ public class ApprovalService : IApprovalService {
|
||||
try {
|
||||
_logger.LogInformation($"Attempting to get role ID by name");
|
||||
|
||||
if (string.IsNullOrWhiteSpace(roleName))
|
||||
if (string.IsNullOrWhiteSpace(roleName))
|
||||
throw new ArgumentException("Role name cannot be null or empty");
|
||||
|
||||
int roleId = _cache.Get<int>($"role{roleName}");
|
||||
@ -170,7 +170,7 @@ public class ApprovalService : IApprovalService {
|
||||
if (subRoleId <= 0) throw new ArgumentException($"{subRoleId} is not a valid sub role ID");
|
||||
|
||||
List<User>? members = _cache.Get<List<User>>($"approvalMembers{subRoleId}");
|
||||
|
||||
|
||||
if (members is null || members.Count() <= 0) {
|
||||
IEnumerable<int>? memberIds = _cache.Get<IEnumerable<int>>($"approvalMemberIds{subRoleId}");
|
||||
|
||||
@ -211,7 +211,7 @@ public class ApprovalService : IApprovalService {
|
||||
if (userId <= 0) throw new ArgumentException($"{userId} is not a valid user ID");
|
||||
|
||||
IEnumerable<Approval>? approvals = null;
|
||||
|
||||
|
||||
if (!bypassCache) approvals = _cache.Get<IEnumerable<Approval>>($"approvalMembers{userId}");
|
||||
|
||||
if (approvals is null) {
|
||||
@ -317,4 +317,4 @@ public class ApprovalService : IApprovalService {
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user