Skip to content

Commit

Permalink
Merge pull request #59 from IliyanIlievPH/57
Browse files Browse the repository at this point in the history
fix partner by coordinates request validation
  • Loading branch information
IliyanIlievPH committed Jun 18, 2020
2 parents eb57c28 + c13d353 commit ee3abe9
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ public GetNearPartnersByCoordinatesModelValidation()
.InclusiveBetween(-90, 90)
.WithMessage("Latitude value must be between -90 and 90.")
.NotNull()
.When(p => string.IsNullOrEmpty(p.CountryIso3Code) || p.Longitude.HasValue || p.RadiusInKm.HasValue);
.When(p => string.IsNullOrEmpty(p.CountryIso3Code) || p.Longitude.HasValue);

RuleFor(p => p.Longitude)
.InclusiveBetween(-180, 180)
.WithMessage("Longitude value must be between -180 and 180.")
.NotNull()
.When(p => string.IsNullOrEmpty(p.CountryIso3Code) || p.Latitude.HasValue || p.RadiusInKm.HasValue);
.When(p => string.IsNullOrEmpty(p.CountryIso3Code) || p.Latitude.HasValue);

RuleFor(p => p.RadiusInKm)
.GreaterThan(0)
Expand Down

0 comments on commit ee3abe9

Please sign in to comment.