first commit
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Landmark.OLA.Models.Addresses.Enums;
|
||||
|
||||
namespace Landmark.OLA.Models.Addresses
|
||||
{
|
||||
public class Address : IAddress
|
||||
{
|
||||
[Required]
|
||||
[StringLength(40)]
|
||||
public string Address1 { get; set; }
|
||||
|
||||
[StringLength(40)]
|
||||
public string Address2 { get; set; }
|
||||
|
||||
[Required]
|
||||
[StringLength(100)]
|
||||
public string City { get; set; }
|
||||
|
||||
[Required]
|
||||
//Nullable so that there is no default value
|
||||
public StateOption? State { get; set; }
|
||||
|
||||
[Required]
|
||||
[StringLength(5, MinimumLength = 5)]
|
||||
public string PostalCode { get; set; }
|
||||
|
||||
[StringLength(4, MinimumLength = 4)]
|
||||
public string PostalCodeExt { get; set; }
|
||||
|
||||
[Required]
|
||||
//Nullable so that there is no default value.
|
||||
public CountryOption? Country { get; set; }
|
||||
|
||||
public Guid Id { get; private set; }
|
||||
|
||||
public Address()
|
||||
{
|
||||
Id = Guid.NewGuid();
|
||||
}
|
||||
|
||||
public Address(Guid id)
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace Landmark.OLA.Models.Addresses.Enums
|
||||
{
|
||||
public enum CountryOption
|
||||
{
|
||||
//only value allowed by CRIF
|
||||
UnitedStates,
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
namespace Landmark.OLA.Models.Addresses.Enums
|
||||
{
|
||||
public enum ResidenceTypeOption
|
||||
{
|
||||
Own,
|
||||
Rent,
|
||||
Other,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
namespace Landmark.OLA.Models.Addresses.Enums
|
||||
{
|
||||
/// <summary>
|
||||
/// StateEnum values from CRIF's commonSchema.xsd
|
||||
/// </summary>
|
||||
public enum StateOption
|
||||
{
|
||||
AA,
|
||||
AE,
|
||||
AK,
|
||||
AL,
|
||||
AP,
|
||||
AR,
|
||||
AS,
|
||||
AZ,
|
||||
CA,
|
||||
CO,
|
||||
CT,
|
||||
DC,
|
||||
DE,
|
||||
FL,
|
||||
//FM, //Present in XSD but not available in CRIF's v_RptGeoCode_v001 table
|
||||
GA,
|
||||
GU,
|
||||
HI,
|
||||
IA,
|
||||
ID,
|
||||
IL,
|
||||
IN,
|
||||
KS,
|
||||
KY,
|
||||
LA,
|
||||
MA,
|
||||
MD,
|
||||
ME,
|
||||
//MH, //Present in XSD but not available in CRIF's v_RptGeoCode_v001 table
|
||||
MI,
|
||||
MN,
|
||||
MO,
|
||||
MP,
|
||||
MS,
|
||||
MT,
|
||||
NC,
|
||||
ND,
|
||||
NE,
|
||||
NH,
|
||||
NJ,
|
||||
NM,
|
||||
NV,
|
||||
NY,
|
||||
OH,
|
||||
OK,
|
||||
OR,
|
||||
PA,
|
||||
PR,
|
||||
PW,
|
||||
RI,
|
||||
SC,
|
||||
SD,
|
||||
TN,
|
||||
TX,
|
||||
UT,
|
||||
VA,
|
||||
VI,
|
||||
VT,
|
||||
WA,
|
||||
WI,
|
||||
WV,
|
||||
WY,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using Landmark.OLA.Models.Addresses.Enums;
|
||||
|
||||
namespace Landmark.OLA.Models.Addresses
|
||||
{
|
||||
public interface IAddress : IReferenceable
|
||||
{
|
||||
string Address1 { get; set; }
|
||||
|
||||
string Address2 { get; set; }
|
||||
|
||||
string City { get; set; }
|
||||
|
||||
StateOption? State { get; set; }
|
||||
|
||||
string PostalCode { get; set; }
|
||||
|
||||
string PostalCodeExt { get; set; }
|
||||
|
||||
CountryOption? Country { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Landmark.OLA.Models.Addresses
|
||||
{
|
||||
public class PropertyLot : Address
|
||||
{
|
||||
[Required]
|
||||
public bool? IsRented { get; set; }
|
||||
|
||||
[Range(minimum: 0, maximum: 1000000000)]
|
||||
public decimal? RentalAmt { get; set; }
|
||||
|
||||
[Range(minimum: 0, maximum: 1000000000)]
|
||||
public decimal? AnnualPropertyTax { get; set; }
|
||||
|
||||
//TODO #399
|
||||
// public LienPositionEnum lienPositionID { get; set; }
|
||||
|
||||
public PropertyLot()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
public PropertyLot(Guid id)
|
||||
: base(id)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
using FluentValidation;
|
||||
|
||||
namespace Landmark.OLA.Models.Addresses.Validators
|
||||
{
|
||||
public class AddressValidator : AbstractValidator<Address>
|
||||
{
|
||||
public AddressValidator()
|
||||
{
|
||||
RuleFor(x => x.Address1).NotNull();
|
||||
RuleFor(x => x.City).NotNull();
|
||||
RuleFor(x => x.State).NotNull();
|
||||
RuleFor(x => x.PostalCode).NotNull();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user