string BuildNull() { var comparer = new PropertyComparerDTO() { }; return(JsonConvert.SerializeObject(comparer)); }
string BuildCRE() { var comparer = new PropertyComparerDTO() { DatabaseProperty = new PropertyDTO() { Name = "The Summit Apartments" }, AgencyProperty = new PropertyDTO() { Name = "Apartments Summit The" }, Provider = "CRE" }; return(JsonConvert.SerializeObject(comparer)); }
string BuildOTBRE() { var comparer = new PropertyComparerDTO() { DatabaseProperty = new PropertyDTO() { Name = "Super High Apartments, Sydney", Address = "32 Sir John Young Crescent, Sydney NSW" }, AgencyProperty = new PropertyDTO() { Name = "*Super*-High! APARTMENTS (Sydney)", Address = "32 Sir John-Young Crescent, Sydney, NSW." }, Provider = "OTBRE" }; return(JsonConvert.SerializeObject(comparer)); }
public IActionResult MatchPropert([FromBody] PropertyComparerDTO comparer) { if (comparer == null) { return(BadRequest()); } if (comparer.AgencyProperty == null || comparer.DatabaseProperty == null || string.IsNullOrEmpty(comparer.Provider)) { return(BadRequest()); } var provider = AgencyFactory.GetProvider(comparer.Provider); if (provider == null) { return(BadRequest($"{comparer.Provider} is invalid provider")); } bool result = provider.IsMatch(_mapper.Map <Property>(comparer.AgencyProperty), _mapper.Map <Property>(comparer.DatabaseProperty)); return(Ok(result)); }
string BuildLRE() { var comparer = new PropertyComparerDTO() { DatabaseProperty = new PropertyDTO() { AgencyCode = "21212er222", Latitude = -33.9014586, Longitude = 151.206287 }, AgencyProperty = new PropertyDTO() { AgencyCode = "21212er222", Latitude = -33.901191, Longitude = 151.207628 }, Provider = "LRE" }; return(JsonConvert.SerializeObject(comparer)); }