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 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 { new EventAlert() { RepoId = slip.UpdatedRepoAccount.RepoId, AccountNo = slip.UpdatedRepoAccount.AccountNo, Message = "Sold No Proceeds", CreatedBy = "Batch", DateAdded = DateTime.Now } }; } } return null; } } }