improvements
Some checks failed
Build and Push Docker Image / build_and_push (push) Failing after 3m6s

This commit is contained in:
Arnaud Delcasse
2025-10-08 09:01:37 +02:00
parent fc5b33e88c
commit 723c12a657
14 changed files with 733 additions and 64 deletions

View File

@@ -9,7 +9,7 @@ import (
"github.com/rs/zerolog/log"
)
func (h Handler) BookDriverJourney(passengerid string, driverid string, journeyid string, returnWaitingDuration time.Duration, priceAmount float64, priceCurrency string, data map[string]any) (*types.Booking, error) {
func (h Handler) BookDriverJourney(passengerid string, driverid string, journeyid string, returnWaitingDuration time.Duration, priceAmount float64, priceCurrency string, driverCompensationAmount float64, driverCompensationCurrency string, data map[string]any) (*types.Booking, error) {
journey, err := h.Storage.GetDriverJourney(journeyid)
if err != nil {
log.Error().Err(err).Msg("could not find driver journey")
@@ -26,14 +26,16 @@ func (h Handler) BookDriverJourney(passengerid string, driverid string, journeyi
log.Debug().Float64("Price", priceAmount).Any("journey", journey.Price).Msg("store booking")
booking := types.Booking{
Id: uuid.NewString(),
GroupId: uuid.NewString(),
Status: "WAITING_CONFIRMATION",
PassengerId: passengerid,
DriverId: driverid,
Journey: journey,
ReturnWaitingDuration: returnWaitingDuration,
Data: data,
Id: uuid.NewString(),
GroupId: uuid.NewString(),
Status: "WAITING_CONFIRMATION",
PassengerId: passengerid,
DriverId: driverid,
Journey: journey,
ReturnWaitingDuration: returnWaitingDuration,
Data: data,
DriverCompensationAmount: driverCompensationAmount,
DriverCompensationCurrency: driverCompensationCurrency,
}
if err := h.Storage.CreateBooking(booking); err != nil {