Refactor watering scale logic flow

This commit is contained in:
Matthew Oslan
2019-06-28 00:33:00 -04:00
parent 95dadf601d
commit dc171ebe68
11 changed files with 70 additions and 50 deletions

View File

@@ -1,14 +1,14 @@
import { GeoCoordinates, WateringData, WeatherData } from "../../types";
import { GeoCoordinates, ZimmermanWateringData, WeatherData } from "../../types";
export class WeatherProvider {
/**
* Retrieves weather data necessary for watering level calculations.
* Retrieves weather data necessary for Zimmerman watering level calculations.
* @param coordinates The coordinates to retrieve the watering data for.
* @return A Promise that will be resolved with the WateringData if it is successfully retrieved,
* or rejected with an error message if an error occurs while retrieving the WateringData or the WeatherProvider
* @return A Promise that will be resolved with the ZimmermanWateringData if it is successfully retrieved,
* or rejected with an error message if an error occurs while retrieving the ZimmermanWateringData or the WeatherProvider
* does not support this method.
*/
getWateringData( coordinates : GeoCoordinates ): Promise< WateringData > {
getWateringData( coordinates : GeoCoordinates ): Promise< ZimmermanWateringData > {
throw "Selected WeatherProvider does not support getWateringData";
}