90 lines
3.7 KiB
C#
90 lines
3.7 KiB
C#
using System.Xml.Linq;
|
|
using CRIF.ACTion.Common;
|
|
using CRIF.ACTion.Configuration;
|
|
using Landmark.OLA.Models.Assets;
|
|
using Landmark.OLA.Models.Loan;
|
|
|
|
namespace CRIF.ACTion.Loan
|
|
{
|
|
public class AppDetailHelocSection : AppDetailsSection
|
|
{
|
|
private readonly List<XObject> _content;
|
|
|
|
private readonly XElement _fieldsElement;
|
|
|
|
public AppDetailHelocSection(XNamespace sectionNamespace, CrifSettings settings,
|
|
string interestRateType = null, string calculationType = null)
|
|
: base(sectionNamespace, "appDetailHELOC", settings, interestRateType, calculationType)
|
|
{
|
|
_content = [];
|
|
}
|
|
|
|
private protected AppDetailHelocSection(XNamespace sectionNamespace, CrifSettings settings,
|
|
string elementName, string interestRateType = null, string calculationType = null)
|
|
: base(sectionNamespace, elementName, settings, interestRateType, calculationType)
|
|
{
|
|
_content = [];
|
|
}
|
|
|
|
public virtual void AddPropertyDetails(RealEstateBase realEstateBase, bool? mfgHomeIncludesLand = null)
|
|
{
|
|
var appDetailPropertiesElement = new XElement(CrifNamespaces.App + "appDetailProperties");
|
|
|
|
var propertyType = "RealEstate";
|
|
var collateralType = CrifConstants.CollateralIds[CrifConstants.Collateral.ResidentialRealEstate];
|
|
|
|
string subType;
|
|
if (mfgHomeIncludesLand.HasValue)
|
|
{
|
|
propertyType = "MfgHomeAndLand";
|
|
collateralType = mfgHomeIncludesLand.Value ?
|
|
CrifConstants.CollateralIds[CrifConstants.Collateral.ManufacturedHomeAndLand] :
|
|
CrifConstants.CollateralIds[CrifConstants.Collateral.ManufacturedHome];
|
|
|
|
subType = ((ManufacturedHome)realEstateBase).Type.Value.ToString();
|
|
}
|
|
else
|
|
{
|
|
subType = ((RealEstate)realEstateBase).Type.Value.ToString();
|
|
}
|
|
|
|
var statusID = "Active";
|
|
var includeInLTVCalculations = true;
|
|
|
|
|
|
var appDetailPropertyElement = new XElement(CrifNamespaces.App + "appDetailProperty",
|
|
new XAttribute(CrifNamespaces.Common + "idRef", realEstateBase.GetOrCreateGuid()),
|
|
new XAttribute(CrifNamespaces.Common + "propertyType", propertyType),
|
|
new XAttribute(CrifNamespaces.Common + "propertySubType", subType),
|
|
new XAttribute(CrifNamespaces.App + "isCollateralFL", realEstateBase.IsCollateral),
|
|
new XAttribute(CrifNamespaces.App + "isTradeInFL", realEstateBase.IsTradeIn),
|
|
new XAttribute(CrifNamespaces.App + "statusID", statusID),
|
|
new XAttribute(CrifNamespaces.App + "includeInLTVCalculations", includeInLTVCalculations),
|
|
new XAttribute(CrifNamespaces.App + "collateralTypeID", collateralType)
|
|
);
|
|
|
|
appDetailPropertiesElement.Add(appDetailPropertyElement);
|
|
|
|
_content.Add(appDetailPropertiesElement);
|
|
}
|
|
|
|
public void AddHmdaDisclosed(bool? acceptedDisclosure)
|
|
{
|
|
if ((!acceptedDisclosure.HasValue) || !acceptedDisclosure.Value)
|
|
{
|
|
return;
|
|
}
|
|
|
|
var hmdaElement = new XElement(CrifNamespaces.App + "appDetailHMDA2018",
|
|
new XAttribute(CrifNamespaces.App + "isNoticeDisclosedFL", acceptedDisclosure.Value));
|
|
|
|
_content.Add(hmdaElement);
|
|
}
|
|
|
|
public override void SetDetails(LoanApplication loanApplication, Guid channelRef, object[] additionalContent = null, XElement fieldsElement = null, XElement vehicleValuationsElement = null)
|
|
{
|
|
base.SetDetails(loanApplication, channelRef, [.. _content], _fieldsElement);
|
|
}
|
|
}
|
|
}
|