Add motivation field to organized carpool bookings
All checks were successful
Build and Push Docker Image / build_and_push (push) Successful in 1m58s

This commit is contained in:
Arnaud Delcasse
2025-10-08 18:51:22 +02:00
parent b431d460bf
commit 38cb3c5ad9
8 changed files with 23 additions and 6 deletions

View File

@@ -11,7 +11,7 @@ import (
)
// Book handles the booking flow
func (h *CarpoolServiceHandler) Book(booking ocss.Booking) (*internal.Booking, error) {
func (h *CarpoolServiceHandler) Book(booking ocss.Booking, motivation *string) (*internal.Booking, error) {
log.Debug().Any("booking", booking).Msg("handler - Book")
log.Debug().Str("passengerPickupDate", booking.PassengerPickupDate.ToTime().Format(time.RFC3339)).Msg("handler - Book")
log.Debug().Str("internal_operator_id", h.InternalOperatorID).Str("driver_operator", booking.Driver.Operator).Str("passenger_operator", booking.Passenger.Operator).Msg("operator comparison")
@@ -62,6 +62,7 @@ func (h *CarpoolServiceHandler) Book(booking ocss.Booking) (*internal.Booking, e
}
futureBooking.Booking = booking
futureBooking.Motivation = motivation
err := h.Storage.CreateBooking(futureBooking)
if err != nil {