Giter VIP home page Giter VIP logo

servicearea's Introduction

Take Home Coding Test

What next

There are a couple of areas where this needs to be improved.

  • Implement tests for relevent areas
  • Change the geocode services to return back standardised address information, perhaps implementing a better interface for the new return data as currently only the latitude and longitude are returned however structured data about the address as is documented would be better.
  • I think that the project could be structured better, but I've tried to keep relevent information together. I'm not sure on the best practice for TypeScript, particularly where I should define interfaces.
  • I have implemented the search term as a url parameter, I was and still am torn as to whether this should have been a query parameter instead. Probably.
  • There is no validation on the incoming geojson data

Implementation

GET /v1/servicearea/{search_term} Performing a GET request to the service area validates the provided search term and returns the search term plus the result if it is processed.

Example A Invalid search parameter: Only accepts alphanumeric or spaces GET /v1/servicearea/ 422 Unprocessable Entity

{
    "status": "ERROR",
    "reason": "Invalid Search Term"
}

Valid search for the first line of an address GET /v1/servicearea/10%20downing%20street 200 OK

{
    "status": "OK",
    "search": "10 downing street",
    "location": {
        "lat": 51.5033635,
        "lng": -0.1276248,
        "serviceArea": "LONCENTRAL"
    }
}

Valid search but not matching service area or unable to find location GET /v1/servicearea/110%20sherwood%20cresent 404 Not Found

{
    "status": "NOT_FOUND",
    "search": "110 sherwood crescent"
}

servicearea's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.