using System; using System.Collections.Generic; using LCU.API.Collections.RepoApi.Domain.Extensions; using LCU.API.Collections.RepoApi.Domain.Processing; using LCU.API.Collections.RepoApi.Extensions; using LCU.Shared.Collections.RepoApiLib.Models; namespace LCU.API.Collections.RepoApi.Domain.AlertChecker { public class SkipEndChecker : IAlertChecker { private readonly int _dayCount; private const string O4RStatus = "O4R"; public SkipEndChecker(int dayCount = 30) { _dayCount = dayCount; } public List CheckForAlert(RepoAccountProcessingSlip slip) { if (slip.UpdatedRepoAccount.Status == O4RStatus && slip.UpdatedRepoAccount.GetDaysInStatus(O4RStatus) >= _dayCount && slip.UpdatedRepoAccount.IsCurrentlySkipClaim()) { return new List { new EventAlert() { RepoId = slip.UpdatedRepoAccount.RepoId, AccountNo = slip.UpdatedRepoAccount.AccountNo, Message = "Skip Claim Ended", CreatedBy = "Batch", DateAdded = DateTime.Now } }; } return null; } } }