Exemplo n.º 1
0
        string BuildNull()
        {
            var comparer = new PropertyComparerDTO()
            {
            };

            return(JsonConvert.SerializeObject(comparer));
        }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
0
        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));
        }
Exemplo n.º 5
0
        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));
        }