Adding
This commit is contained in:
+26
@@ -0,0 +1,26 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace LCU.API.Collections.RepoApi.Domain.Processing
|
||||
{
|
||||
public class AlertProcessingSlip
|
||||
{
|
||||
public RepoAccountProcessingSlip AccountProcessingSlip { get; set; }
|
||||
public string Message { get; set; }
|
||||
public List<string> WatchedStatusTypes { get; set; }
|
||||
public List<string> WatchedTransactionTypes { get; set; }
|
||||
|
||||
public AlertProcessingSlip
|
||||
(
|
||||
RepoAccountProcessingSlip accountProcessingSlip,
|
||||
string message,
|
||||
List<string> watchedStatusTypes,
|
||||
List<string> watchedTransactionTypes
|
||||
)
|
||||
{
|
||||
AccountProcessingSlip = accountProcessingSlip;
|
||||
Message = message;
|
||||
WatchedStatusTypes = watchedStatusTypes;
|
||||
WatchedTransactionTypes = watchedTransactionTypes;
|
||||
}
|
||||
}
|
||||
}
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
using System.Collections.Generic;
|
||||
using LCU.API.Collections.CollectionsApiLib.Models;
|
||||
using LCU.API.Collections.RepoApi.Exceptions;
|
||||
using LCU.Shared.Collections.RepoApiLib.Models;
|
||||
using LCU.Shared.Collections.RepoApiLib.Models.Consumer;
|
||||
using LCU.Shared.Collections.RepoApiLib.Models.Producer;
|
||||
using LCU.Shared.Collections.RepoApiLib.Models.Settings;
|
||||
|
||||
namespace LCU.API.Collections.RepoApi.Domain.Processing
|
||||
{
|
||||
/**
|
||||
* This class represents everything you need to do a logical update or creation of a RepoAccount
|
||||
*/
|
||||
public class RepoAccountProcessingSlip
|
||||
{
|
||||
public ProcessingItem RequestedBy { get; set; }
|
||||
public string AccountNo { get; set; }
|
||||
public int CaseId { get; set; }
|
||||
public TemenosAccount RecoveryAccount { get; set; }
|
||||
public TemenosCase RecoveryCase { get; set; }
|
||||
public RepoAccount ExistingRepoAccount { get; set; }
|
||||
public RepoAccount UpdatedRepoAccount { get; set; }
|
||||
public Settings CurrentSettings { get; set; }
|
||||
|
||||
public IReadOnlyCollection<CoreTransaction> TransactionHistory { get; set; }
|
||||
|
||||
public MemberDetail Member { get; set; }
|
||||
|
||||
public LoanDetail Loan { get; set; }
|
||||
|
||||
public IReadOnlyCollection<AuctionAssignment> AuctionAssignments { get; set; }
|
||||
|
||||
public IReadOnlyCollection<RepoLetter> Letters { get; set; }
|
||||
|
||||
public void AssertReadyForPreChecks()
|
||||
{
|
||||
if (RequestedBy == null)
|
||||
{
|
||||
throw new MissingRequirementException("Processing Item",
|
||||
$"RepoAccount Processing Slip requires a processing item.");
|
||||
}
|
||||
|
||||
if (RecoveryAccount == null)
|
||||
{
|
||||
throw new MissingRequirementException("Recovery Account",
|
||||
$"{RequestedBy.AccountNo} did not have account.");
|
||||
}
|
||||
|
||||
if (CurrentSettings == null)
|
||||
{
|
||||
throw new MissingRequirementException("Settings",
|
||||
$"RepoAccount Processing Slip requires settings.");
|
||||
}
|
||||
}
|
||||
public void AssertReadyForFullProcessing()
|
||||
{
|
||||
AssertReadyForPreChecks();
|
||||
|
||||
if (RecoveryCase == null)
|
||||
{
|
||||
throw new MissingRequirementException("Recovery Case",
|
||||
$"{RecoveryAccount.AccountId} did not have case {CaseId}.");
|
||||
}
|
||||
|
||||
if (Loan == null)
|
||||
{
|
||||
throw new MissingRequirementException("Loan", "Loan required to process.");
|
||||
}
|
||||
|
||||
if (Letters == null)
|
||||
{
|
||||
throw new MissingRequirementException("Letters", "Letters required to process.");
|
||||
}
|
||||
}
|
||||
|
||||
public void AssertReadyForAlertChecks()
|
||||
{
|
||||
AssertReadyForFullProcessing();
|
||||
|
||||
if (TransactionHistory == null && ExistingRepoAccount.ReferenceStatus != "Chargeoff")
|
||||
{
|
||||
throw new MissingRequirementException("Transactions", "Transactions required to process alerts.");
|
||||
}
|
||||
|
||||
if (Member == null)
|
||||
{
|
||||
throw new MissingRequirementException("Member", "Member required to process alerts.");
|
||||
}
|
||||
|
||||
if (AuctionAssignments == null)
|
||||
{
|
||||
throw new MissingRequirementException("Auction Assignments", "Auction Assignments required to process alerts.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user