Limiting active approval list

This commit is contained in:
Chase Tucker 2024-10-07 13:14:43 -07:00
parent b9b0299d3f
commit 03197508a2

View File

@ -25,8 +25,9 @@ public class ApprovalService : IApprovalService {
StringBuilder queryBuilder = new();
queryBuilder.Append("select * from Approval where ");
queryBuilder.Append($"ItemStatus=0 and AssignedDate > '{DateTimeOffset.Now.AddDays(-365).DateTime.ToString("yyyy-MM-dd HH:mm:ss")}' and ");
queryBuilder.Append($"(CompletedDate is null or CompletedDate >= '{DateTimeUtilities.MAX_DT.ToString("yyyy-MM-dd HH:mm")}') and ");
queryBuilder.Append($"(NotifyDate is null or NotifyDate < '{DateTimeOffset.Now.AddDays(-5).ToString("yyyy-MM-dd HH:mm")}')");
queryBuilder.Append($"(NotifyDate is null or NotifyDate < '{DateTimeOffset.Now.AddDays(-5).DateTime.ToString("yyyy-MM-dd HH:mm")}')");
IEnumerable<Approval> approvals = await _dalService.QueryAsync<Approval>(queryBuilder.ToString());