public async Task <IActionResult> ConfirmLocation(int id)
        {
            try
            {
                var trip = await _context.Trips.Where(t => t.Id == id).SingleOrDefaultAsync();

                var customer = await _context.Customers.Where(c => c.Id == trip.CustomerId).SingleOrDefaultAsync();

                if (trip == null)
                {
                    return(NotFound());
                }
                else
                {
                    if (trip.TripStatus == "DuringTrip")
                    {
                        trip.TripStatus = "ConfirmLocation";
                        _context.Update(trip);
                        await _context.SaveChangesAsync();
                    }
                    ConfirmLocation location = new ConfirmLocation()
                    {
                        Street  = customer.DestinationStreet,
                        City    = customer.DestinationCity,
                        State   = customer.DestinationState,
                        Zipcode = customer.DestinationZip
                    };
                    return(Ok(location));
                }
            }
            catch
            {
                return(StatusCode(500));
            }
        }
        public async Task <IActionResult> ConfirmLocation(int id, [FromBody] ConfirmLocation location)
        {
            try
            {
                var trip = await _context.Trips.Where(t => t.Id == id).SingleOrDefaultAsync();

                var vehicle = await _context.Vehicles.Where(v => v.Id == trip.VehicleId).SingleOrDefaultAsync();

                var customer = await _context.Customers.Where(c => c.Id == trip.CustomerId).SingleOrDefaultAsync();

                if (trip == null)
                {
                    return(NotFound());
                }
                else
                {
                    //Lat, Lng
                    double[] endDestination = await GetGeoCode(location);

                    trip.EndLat     = endDestination[0];
                    trip.EndLng     = endDestination[1];
                    trip.TripStatus = "CheckStatus";
                    _context.Update(trip);

                    vehicle.CurrentStreet = location.Street;
                    vehicle.CurrentCity   = location.City;
                    vehicle.CurrentState  = location.State;
                    vehicle.CurrentZip    = location.Zipcode;
                    _context.Update(vehicle);

                    customer.CurrentStreet = location.Street;
                    customer.CurrentCity   = location.City;
                    customer.CurrentState  = location.State;
                    customer.CurrentZip    = location.Zipcode;
                    customer.CurrentLat    = endDestination[0];
                    customer.CurrentLong   = endDestination[1];
                    _context.Update(customer);

                    await _context.SaveChangesAsync();

                    return(Ok());
                }
            }
            catch
            {
                return(StatusCode(500));
            }
        }
        // Lat, Lng

        private async Task <double[]> GetGeoCode(ConfirmLocation location)
        {
            // hard code for now, API calls will eventually be service
            var geoCodingEngine             = GoogleMaps.Geocode;
            GeocodingRequest geocodeRequest = new()
            {
                Address = $"{location.Street}, {location.City}, {location.State} {location.Zipcode}",
                ApiKey  = Secrets.GOOGLE_API_KEY,
            };
            GeocodingResponse geocode = await geoCodingEngine.QueryAsync(geocodeRequest);

            double lat = geocode.Results.First().Geometry.Location.Latitude;
            double lng = geocode.Results.First().Geometry.Location.Longitude;

            return(new double[] { lat, lng });
        }