##Spot Hero Backend Challenge

  • As per the requirements mentioned in the challenge doc.
  • Application will run on port 5000 (if running on Macos Monterey, stop sharing Airplay, using 5000 port)
  • Challenge implementation is in the GO language
    • Using the gorm library for object relationship mapping
    • Using the gorm sqlite library for database.
    • using the sqlmock library for test mocking.
    • using the mux library for rest endpoints routing.
    • Using the provided seeded data for rates.
  • Start the Application on port 5000 through main.go file.
  • Data is loaded into the rates.db, if needed to delete the file and application startup will load the data.
  • Test cases are present for price, rate endpoints and model.
  • Following are the sample endpoints results

      curl http://localhost:5000/rates
      curl http://localhost:5000/price\?start\=2015-07-01T07:00:00-05:00\&end\=2015-07-01T12:00:00-05:00
      curl http://localhost:5000/price\?start\=2015-07-04T15:00:00%2B00:00\&end\=2015-07-04T20:00:00%2B00:00
      curl http://localhost:5000/price\?start\=2015-07-04T07:00:00%2B05:00\&end\=2015-07-04T20:00:00%2B05:00


  • ISO-8601 date pattern only has zone offset, hard to determine the timezon based on offset.
  • Price: 2000 test case is green because not considering different time zone offset, still considering America/Chicago


View Github