Return handling
Some checks failed
Build and Push Docker Image / build_and_push (push) Failing after 40s

This commit is contained in:
2025-05-28 07:32:24 +02:00
parent 3d32c9a24a
commit d237401c81
17 changed files with 587 additions and 249 deletions

View File

@@ -9,7 +9,7 @@ import (
"github.com/rs/zerolog/log"
)
func (h Handler) BookDriverJourney(passengerid string, driverid string, journeyid string) (*types.Booking, error) {
func (h Handler) BookDriverJourney(passengerid string, driverid string, journeyid string, returnWaitingDuration time.Duration) (*types.Booking, error) {
journey, err := h.Storage.GetDriverJourney(journeyid)
if err != nil {
log.Error().Err(err).Msg("could not find driver journey")
@@ -21,12 +21,13 @@ func (h Handler) BookDriverJourney(passengerid string, driverid string, journeyi
}
booking := types.Booking{
Id: uuid.NewString(),
GroupId: uuid.NewString(),
Status: "WAITING_CONFIRMATION",
PassengerId: passengerid,
DriverId: driverid,
Journey: journey,
Id: uuid.NewString(),
GroupId: uuid.NewString(),
Status: "WAITING_CONFIRMATION",
PassengerId: passengerid,
DriverId: driverid,
Journey: journey,
ReturnWaitingDuration: returnWaitingDuration,
}
if err := h.Storage.CreateBooking(booking); err != nil {