Add driver compensation fields to OCSS Booking struct
Build and Push Docker Image / build_and_push (push) Failing after 2m59s Details

Add DriverCompensationAmount and DriverCompensationCurrency fields to the Booking struct to support storing driver compensation information in the database.
This commit is contained in:
Arnaud Delcasse 2025-10-08 16:20:09 +02:00
parent feb4909a70
commit 5dbb3e23d4
1 changed files with 20 additions and 18 deletions

View File

@ -99,22 +99,24 @@ func BookingStatusFromString(bs string) BookingStatus {
// Booking describes the booking parameters and status, in the context of a "Booking by API" OCSS flow
type Booking struct {
ID string `json:"id" bson:"_id"`
Driver User `json:"driver"`
Passenger User `json:"passenger"`
PassengerPickupDate OCSSTime `json:"passengerPickupDate" bson:"passengerPickupDate"`
PassengerPickupLat float64 `json:"passengerPickupLat" bson:"passengerPickupLat"`
PassengerPickupLng float64 `json:"passengerPickupLng" bson:"passengerPickupLng"`
PassengerDropLat float64 `json:"passengerDropLat" bson:"passengerDropLat"`
PassengerDropLng float64 `json:"passengerDropLng" bson:"passengerDropLng"`
PassengerPickupAddress *string `json:"passengerPickupAddress,omitempty" bson:"passengerPickupAddress,omitempty"`
PassengerDropAddress *string `json:"passengerDropAddress,omitempty" bson:"passengerDropAddress,omitempty"`
Status BookingStatus `json:"status"`
Distance *int64 `json:"distance,omitempty" bson:"distance,omitempty"`
Duration *time.Duration `json:"duration,omitempty" bson:"duration,omitempty"`
WebUrl *string `json:"webUrl,omitempty" bson:"webUrl,omitempty"`
Price Price `json:"price"`
Car *Car `json:"car,omitempty" bson:"car,omitempty"`
DriverJourneyID string `json:"driverJourneyId" bson:"driverJourneyId"`
PassengerJourneyID string `json:"passengerJourneyId" bson:"passengerJourneyId"`
ID string `json:"id" bson:"_id"`
Driver User `json:"driver"`
Passenger User `json:"passenger"`
PassengerPickupDate OCSSTime `json:"passengerPickupDate" bson:"passengerPickupDate"`
PassengerPickupLat float64 `json:"passengerPickupLat" bson:"passengerPickupLat"`
PassengerPickupLng float64 `json:"passengerPickupLng" bson:"passengerPickupLng"`
PassengerDropLat float64 `json:"passengerDropLat" bson:"passengerDropLat"`
PassengerDropLng float64 `json:"passengerDropLng" bson:"passengerDropLng"`
PassengerPickupAddress *string `json:"passengerPickupAddress,omitempty" bson:"passengerPickupAddress,omitempty"`
PassengerDropAddress *string `json:"passengerDropAddress,omitempty" bson:"passengerDropAddress,omitempty"`
Status BookingStatus `json:"status"`
Distance *int64 `json:"distance,omitempty" bson:"distance,omitempty"`
Duration *time.Duration `json:"duration,omitempty" bson:"duration,omitempty"`
WebUrl *string `json:"webUrl,omitempty" bson:"webUrl,omitempty"`
Price Price `json:"price"`
Car *Car `json:"car,omitempty" bson:"car,omitempty"`
DriverJourneyID string `json:"driverJourneyId" bson:"driverJourneyId"`
PassengerJourneyID string `json:"passengerJourneyId" bson:"passengerJourneyId"`
DriverCompensationAmount *float64 `json:"driverCompensationAmount,omitempty" bson:"driverCompensationAmount,omitempty"`
DriverCompensationCurrency *string `json:"driverCompensationCurrency,omitempty" bson:"driverCompensationCurrency,omitempty"`
}