37 lines
1.4 KiB
C#
37 lines
1.4 KiB
C#
using System.Xml.Linq;
|
|
using CRIF.ACTion.Common;
|
|
using CRIF.ACTion.Common.Builders;
|
|
using Landmark.OLA.Models.Individuals;
|
|
|
|
namespace CRIF.ACTion.Loan.Individuals
|
|
{
|
|
public class IncomeSectionBuilder
|
|
{
|
|
private readonly Income _income;
|
|
|
|
public IncomeSectionBuilder(Income income)
|
|
{
|
|
_income = income;
|
|
}
|
|
|
|
public XElement Build()
|
|
{
|
|
var incomeElement = new XElement(CrifNamespaces.Common + "income",
|
|
new XAttribute(CrifNamespaces.Common + "IncomeTypeCD", _income.IncomeTypeCD),
|
|
new XAttribute(CrifNamespaces.Common + "frequency", _income.Frequency),
|
|
new XAttribute(CrifNamespaces.Common + "amountPerPeriod", _income.AmountPerPeriod),
|
|
new XAttribute(CrifNamespaces.Common + "incomeStatus", _income.IncomeStatus),
|
|
new XAttribute(CrifNamespaces.Common + "incomeAdjustmentPercentage", 1m),
|
|
new XAttribute(CrifNamespaces.Common + "adjustedIncome", _income.AmountPerPeriod),
|
|
new XAttribute(CrifNamespaces.Common + "sourceName", BuilderUtils.FormatCrifData(_income.SourceName)));
|
|
|
|
if (_income.HoursPerWeek.HasValue)
|
|
{
|
|
incomeElement.Add(new XAttribute(CrifNamespaces.Common + "hoursPerWeek", _income.HoursPerWeek.Value));
|
|
}
|
|
|
|
return incomeElement;
|
|
}
|
|
}
|
|
}
|