standard-covoiturage/bookings.go

35 lines
1.4 KiB
Go

package standardcovoiturage
import "time"
type BookingStatus int64
const (
BookingWaitingConfirmation BookingStatus = iota
BookingConfirmed
BookingCancelled
BookingCompletedPendingValidation
BookingValidated
)
type Booking struct {
ID string `json:"id"` // TODO check uuidv4
Driver User `json:"driver"`
Passenger User `json:"passenger"`
PassengerPickupDate time.Time `json:"passengerPickupDate"`
PassengerPickupLat float64 `json:"passengerPickupLat"`
PassengerPickupLng float64 `json:"passengerPickupLng"`
PassengerDropLat float64 `json:"passengerDropLat"`
PassengerDropLng float64 `json:"passengerDropLng"`
PassengerPickupAddress *string `json:"passengerPickupAddress,omitempty"`
PassengerDropAddress *string `json:"passengerDropAddress,omitempty"`
Status BookingStatus `json:"status"`
Distance *int64 `json:"distance,omitempty"`
Duration *time.Duration `json:"duration,omitempty"`
WebUrl *string `json:"webUrl,omitempty"`
Price Price `json:"price"`
Car *Car `json:"car"`
DriverJourneyID string `json:"driverJourneyId"`
PassengerJourneyID string `json:"passengerJourneyId"`
}