initial commit

This commit is contained in:
2025-03-05 00:30:53 +01:00
commit 9da7b99e5d
32 changed files with 4541 additions and 0 deletions

12
types/availabilities.go Normal file
View File

@@ -0,0 +1,12 @@
package types
import geojson "github.com/paulmach/orb/geojson"
type DriverRegularAvailability struct {
ID string `json:"id" bson:"_id"`
DriverId string `json:"driver_id" bson:"driver_id"`
Day int `json:"day" bson:"day"`
StartTime string `json:"start_time" bson:"start_time"`
EndTime string `json:"end_time" bson:"end_time"`
Address *geojson.Feature `json:"address" bson:"address"`
}

11
types/booking.go Normal file
View File

@@ -0,0 +1,11 @@
package types
type Booking struct {
Id string `json:"id" bson:"_id"`
GroupId string `json:"group_id" bson:"group_id"`
DriverId string `json:"driver_id" bson:"driver_id"`
PassengerId string `json:"passenger_id" bson:"passenger_id"`
Status string `json:"status" bson:"status"`
Journey *DriverJourney `json:"journey,omitempty" bson:"journey,omitempty"`
}

36
types/journeys.go Normal file
View File

@@ -0,0 +1,36 @@
package types
import (
"time"
geojson "github.com/paulmach/orb/geojson"
)
type SolidarityTransportPrice struct {
Amount float64
Currency string
}
type DriverJourney struct {
Id string `json:"id" bson:"_id"`
DriverId string `json:"driver_id" bson:"driver_id"`
PassengerPickup *geojson.Feature `json:"passenger_pickup" bson:"passenger_pickup"`
PassengerDrop *geojson.Feature `json:"passenger_drop" bson:"passenger_drop"`
PassengerDistance int64 `json:"passenger_distance" bson:"passenger_distance"`
DriverDeparture *geojson.Feature `json:"driver_departure" bson:"driver_departure"`
DriverArrival *geojson.Feature `json:"driver_arrival" bson:"driver_arrival"`
DriverDistance int64 `json:"driver_distance" bson:"driver_distance"`
Duration time.Duration
JourneyPolyline string `json:"journey_polyline" bson:"journey_polyline"`
PassengerPickupDate time.Time `json:"passenger_pickup_date" bson:"passenger_pickup_date"`
DriverDepartureDate time.Time `json:"driver_departure_date" bson:"driver_departure_date"`
Price SolidarityTransportPrice
}
type PassengerTrip struct {
Id string `json:"id" bson:"_id"`
PassengerId string `json:"passenger_id" bson:"passenger_id"`
PassengerPickup *geojson.Feature `json:"passenger_pickup" bson:"passenger_pickup"`
PassengerDrop *geojson.Feature `json:"passenger_drop" bson:"passenger_drop"`
PassengerPickupDate time.Time `json:"passenger_pickup_date" bson:"passenger_pickup_date"`
}