public IActionResult PredictSet()

in cloud-run/rideshare-plus-website/RidesharePlus/Controllers/PredictController.cs [23:56]


    public IActionResult PredictSet(PredictViewModel predictViewModel)
    {
        BigQueryService bigQueryService = new BigQueryService();
        bool isRaining = false;
        bool isSnowing = false;

        if (string.IsNullOrWhiteSpace(predictViewModel.RideDistance))
        {
           predictViewModel.RideDistance = "short";
        }
        if (predictViewModel.SimulateWeather == "rain")
        {
            isRaining = true;
        }
        if (predictViewModel.SimulateWeather == "snow")
        {
            isSnowing = true;
        }

        bigQueryService.GeneratePredictions(predictViewModel.RideDistance, isRaining, isSnowing);

        DataStoreService dataStoreService = new DataStoreService();
        DataStoreModel dataStoreModel = dataStoreService.GetDataStore;

        if (dataStoreModel == null || dataStoreModel.LookerHighValueRides == null)
        {
            // need to configure looker
            return RedirectToAction("Configure", "Predict");
        }
        else
        {
            return RedirectToAction("Visualize", "Predict");
        }
    }