38 lines
1.3 KiB
C#
38 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using LCU.API.Collections.RepoApi.Domain.Processing;
|
|
using LCU.Shared.Collections.RepoApiLib.Models;
|
|
|
|
namespace LCU.API.Collections.RepoApi.Domain.AlertChecker
|
|
{
|
|
public class SoldNoProceedsChecker : IAlertChecker
|
|
{
|
|
private const int DaysToWaitForSold = 5;
|
|
|
|
public List<EventAlert> CheckForAlert(RepoAccountProcessingSlip slip)
|
|
{
|
|
foreach (var auctionAssignment in slip.AuctionAssignments)
|
|
{
|
|
if (
|
|
auctionAssignment?.AutoIMS?.SoldDate != null
|
|
&& auctionAssignment.AutoIMS.SoldDate < DateTime.Now.AddDays(-DaysToWaitForSold)
|
|
&& auctionAssignment.AutoIMS.FundsSent == null)
|
|
{
|
|
return new List<EventAlert>
|
|
{
|
|
new EventAlert()
|
|
{
|
|
RepoId = slip.UpdatedRepoAccount.RepoId,
|
|
AccountNo = slip.UpdatedRepoAccount.AccountNo,
|
|
Message = "Sold No Proceeds",
|
|
CreatedBy = "Batch",
|
|
DateAdded = DateTime.Now
|
|
}
|
|
};
|
|
}
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}
|
|
} |