DFE-Digital/teaching-vacancies

Refactor location API endpoint

cpjmcquillan opened this issue · 0 comments

Create an API endpoint that returns location data

The endpoint should take a location search query as an input and return

  • boundary data for the corresponding LocationPolygon if it is active, and search type: insidePolygon
  • the search query if the LocationPolygon is active but no data exists, and search type: textual
  • geocoded coordinates if the location is not an active LocationPolygon, and search type: aroundRadius

This should be an extension of the coordinates API, which would also see location search logic removed from the client. For a given location parameter, either geocoded coordinates, polygon boundary data, or the inputted location parameter should be returned along with the type of location search to be carried out.

For reference:

Acceptance criteria

  • Endpoint that returns the appropriate data as json for a given location
  • Code review