Improve passenger pickup/drop handling
Some checks failed
Build and Push Docker Image / build_and_push (push) Failing after 3m8s

This commit is contained in:
Arnaud Delcasse
2025-09-25 06:36:14 +02:00
parent a95cd6eb55
commit b7ac71741f
14 changed files with 1042 additions and 2085 deletions

View File

@@ -7,11 +7,14 @@ import (
"git.coopgo.io/coopgo-platform/carpool-service/internal"
"git.coopgo.io/coopgo-platform/routing-service/encoding/polylines"
"github.com/paulmach/orb"
"github.com/paulmach/orb/geojson"
"github.com/rs/zerolog/log"
)
// GetDriverJourneys searches for matching punctual planned driver journeys.
func (h *CarpoolServiceHandler) GetDriverJourneys(departure orb.Point, arrival orb.Point, departureRadius *float64, arrivalRadius *float64, minDate time.Time, maxDate time.Time, count *int64) ([]internal.PlannedRouteSchedule, error) {
func (h *CarpoolServiceHandler) GetDriverJourneys(departureFeature *geojson.Feature, arrivalFeature *geojson.Feature, departureRadius *float64, arrivalRadius *float64, minDate time.Time, maxDate time.Time, count *int64) ([]internal.PlannedRouteSchedule, error) {
departure := departureFeature.Point()
arrival := arrivalFeature.Point()
log.Debug().
Any("departure", departure).
Any("arrival", arrival).
@@ -69,11 +72,14 @@ func (h *CarpoolServiceHandler) GetDriverJourneys(departure orb.Point, arrival o
log.Error().Err(err).Msg("error getting route with viapoints")
continue
}
journeys = append(journeys, internal.PlannedRouteSchedule{
ID: r.ID,
Route: r.Route,
DepartureDate: r.DepartureDate,
Itinerary: itinerary,
ID: r.ID,
Route: r.Route,
DepartureDate: r.DepartureDate,
Itinerary: itinerary,
PassengerPickup: departureFeature,
PassengerDrop: arrivalFeature,
})
counted = counted + 1
if counted == *count {