Files
2026-04-20 14:47:24 -05:00

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 AuctionOnHoldChecker : IAlertChecker
{
private const string RehoStatus = "REHO";
public List<EventAlert> CheckForAlert(RepoAccountProcessingSlip slip)
{
var newEventAlerts = new List<EventAlert>();
foreach (var auctionAssignment in slip.AuctionAssignments)
{
if (
slip.UpdatedRepoAccount.Status == RehoStatus
&& auctionAssignment?.HoldStatus != null
&& auctionAssignment.HoldStatus > 0)
{
newEventAlerts.Add(
new EventAlert()
{
RepoId = slip.UpdatedRepoAccount.RepoId,
AccountNo = slip.UpdatedRepoAccount.AccountNo,
Message = "Auction On Hold",
CreatedBy = "Batch",
DateAdded = DateTime.Now
}
);
}
}
return newEventAlerts.Count > 0 ? newEventAlerts : null;
}
}
}