Open ajtran303 opened 3 years ago
Going to need to install the figaro
gem to configure Environment Variables for the API keys.
Additionally, Webmock / VCR for testing external API calls.
I started by making a PORO for handling date / time conversions. It looks like I need one for handling temperature conversions as well.
I have added a temperature poro.
It appears that the endpoint needs to say how much precipitation there is. The precipitation data will not be there unless there is actual precipitation in the forecast.
These are the key values to look out for from the OpenWeatherMap OneCall API:
pop - probability of precipitation - if it's too low then there will be none
rain - volume in mm
snow - volume in mm
from eyeballing, a pop
value as high as .25
does not forecast any mm of precipitation
but at at .8
"pop": 0.8,
"rain": 2.48,
so there could be some kind of threshold or absence of precipitation
i can find out more by looking up data for where it is raining or snowing right now
In Minneapolis, pop .24
brings rain
.3`
This feature is working and needs some sad path / exception handling
Given this request
Retrieve weather data for a city that includes:
Requirements:
Endpoint needs to use the city and state from the GET request and send it to MapQuest’s Geocoding API to retrieve the latitude and longitude for the city. Use of the MapQuest’s Geocoding API is a hard requirement.
Retrieve forecast data from the OpenWeather One Call API using the latitude and longitude from MapQuest.
Testing should look for more than just the presence of attribute fields in the response. Testing should also determine which fields should NOT be present. (don’t send unnecessary data)