Add PostgreSQL database option and more booking flow functionalities

This commit is contained in:
2023-05-08 01:29:59 +02:00
parent d8346a20be
commit e2e6759dc0
40 changed files with 1594 additions and 907 deletions

View File

@@ -122,31 +122,34 @@ func (CarpoolServicePriceType) EnumDescriptor() ([]byte, []int) {
type CarpoolServiceBookingStatus int32
const (
CarpoolServiceBookingStatus_INITIATED CarpoolServiceBookingStatus = 0
CarpoolServiceBookingStatus_WAITING_CONFIRMATION CarpoolServiceBookingStatus = 1
CarpoolServiceBookingStatus_CONFIRMED CarpoolServiceBookingStatus = 2
CarpoolServiceBookingStatus_CANCELLED CarpoolServiceBookingStatus = 3
CarpoolServiceBookingStatus_COMPLETED_PENDING_VALIDATION CarpoolServiceBookingStatus = 4
CarpoolServiceBookingStatus_VALIDATED CarpoolServiceBookingStatus = 5
CarpoolServiceBookingStatus_INITIATED CarpoolServiceBookingStatus = 0
CarpoolServiceBookingStatus_WAITING_DRIVER_CONFIRMATION CarpoolServiceBookingStatus = 1
CarpoolServiceBookingStatus_WAITING_PASSENGER_CONFIRMATION CarpoolServiceBookingStatus = 2
CarpoolServiceBookingStatus_CONFIRMED CarpoolServiceBookingStatus = 3
CarpoolServiceBookingStatus_CANCELLED CarpoolServiceBookingStatus = 4
CarpoolServiceBookingStatus_COMPLETED_PENDING_VALIDATION CarpoolServiceBookingStatus = 5
CarpoolServiceBookingStatus_VALIDATED CarpoolServiceBookingStatus = 6
)
// Enum value maps for CarpoolServiceBookingStatus.
var (
CarpoolServiceBookingStatus_name = map[int32]string{
0: "INITIATED",
1: "WAITING_CONFIRMATION",
2: "CONFIRMED",
3: "CANCELLED",
4: "COMPLETED_PENDING_VALIDATION",
5: "VALIDATED",
1: "WAITING_DRIVER_CONFIRMATION",
2: "WAITING_PASSENGER_CONFIRMATION",
3: "CONFIRMED",
4: "CANCELLED",
5: "COMPLETED_PENDING_VALIDATION",
6: "VALIDATED",
}
CarpoolServiceBookingStatus_value = map[string]int32{
"INITIATED": 0,
"WAITING_CONFIRMATION": 1,
"CONFIRMED": 2,
"CANCELLED": 3,
"COMPLETED_PENDING_VALIDATION": 4,
"VALIDATED": 5,
"INITIATED": 0,
"WAITING_DRIVER_CONFIRMATION": 1,
"WAITING_PASSENGER_CONFIRMATION": 2,
"CONFIRMED": 3,
"CANCELLED": 4,
"COMPLETED_PENDING_VALIDATION": 5,
"VALIDATED": 6,
}
)
@@ -1290,6 +1293,9 @@ type CarpoolServiceBooking struct {
Car *CarpoolServiceCar `protobuf:"bytes,16,opt,name=car,proto3,oneof" json:"car,omitempty"`
DriverJourneyId string `protobuf:"bytes,17,opt,name=driver_journey_id,json=driverJourneyId,proto3" json:"driver_journey_id,omitempty"`
PassengerJourneyId string `protobuf:"bytes,18,opt,name=passenger_journey_id,json=passengerJourneyId,proto3" json:"passenger_journey_id,omitempty"`
DriverRoute *CarpoolFeatureCollection `protobuf:"bytes,30,opt,name=driver_route,json=driverRoute,proto3,oneof" json:"driver_route,omitempty"`
PassengerRoute *CarpoolFeatureCollection `protobuf:"bytes,31,opt,name=passenger_route,json=passengerRoute,proto3,oneof" json:"passenger_route,omitempty"`
DriverDepartureDate *timestamppb.Timestamp `protobuf:"bytes,32,opt,name=driverDepartureDate,proto3,oneof" json:"driverDepartureDate,omitempty"`
}
func (x *CarpoolServiceBooking) Reset() {
@@ -1450,6 +1456,27 @@ func (x *CarpoolServiceBooking) GetPassengerJourneyId() string {
return ""
}
func (x *CarpoolServiceBooking) GetDriverRoute() *CarpoolFeatureCollection {
if x != nil {
return x.DriverRoute
}
return nil
}
func (x *CarpoolServiceBooking) GetPassengerRoute() *CarpoolFeatureCollection {
if x != nil {
return x.PassengerRoute
}
return nil
}
func (x *CarpoolServiceBooking) GetDriverDepartureDate() *timestamppb.Timestamp {
if x != nil {
return x.DriverDepartureDate
}
return nil
}
type CarpoolServicePreferences struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -2378,7 +2405,7 @@ var file_carpool_service_types_proto_rawDesc = []byte{
0x42, 0x13, 0x0a, 0x11, 0x5f, 0x6a, 0x6f, 0x75, 0x72, 0x6e, 0x65, 0x79, 0x5f, 0x70, 0x6f, 0x6c,
0x79, 0x6c, 0x69, 0x6e, 0x65, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x77, 0x65, 0x62, 0x5f, 0x75, 0x72,
0x6c, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65,
0x73, 0x22, 0xc2, 0x07, 0x0a, 0x15, 0x43, 0x61, 0x72, 0x70, 0x6f, 0x6f, 0x6c, 0x53, 0x65, 0x72,
0x73, 0x22, 0xde, 0x09, 0x0a, 0x15, 0x43, 0x61, 0x72, 0x70, 0x6f, 0x6f, 0x6c, 0x53, 0x65, 0x72,
0x76, 0x69, 0x63, 0x65, 0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x69,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2b, 0x0a, 0x06, 0x64,
0x72, 0x69, 0x76, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x43, 0x61,
@@ -2432,126 +2459,146 @@ var file_carpool_service_types_proto_rawDesc = []byte{
0x0a, 0x14, 0x70, 0x61, 0x73, 0x73, 0x65, 0x6e, 0x67, 0x65, 0x72, 0x5f, 0x6a, 0x6f, 0x75, 0x72,
0x6e, 0x65, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x70, 0x61,
0x73, 0x73, 0x65, 0x6e, 0x67, 0x65, 0x72, 0x4a, 0x6f, 0x75, 0x72, 0x6e, 0x65, 0x79, 0x49, 0x64,
0x42, 0x1b, 0x0a, 0x19, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x65, 0x6e, 0x67, 0x65, 0x72, 0x5f, 0x70,
0x69, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x19, 0x0a,
0x17, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x65, 0x6e, 0x67, 0x65, 0x72, 0x5f, 0x64, 0x72, 0x6f, 0x70,
0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x64, 0x69, 0x73,
0x74, 0x61, 0x6e, 0x63, 0x65, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69,
0x6f, 0x6e, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x77, 0x65, 0x62, 0x5f, 0x75, 0x72, 0x6c, 0x42, 0x06,
0x0a, 0x04, 0x5f, 0x63, 0x61, 0x72, 0x22, 0xff, 0x01, 0x0a, 0x19, 0x43, 0x61, 0x72, 0x70, 0x6f,
0x6f, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65,
0x6e, 0x63, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x07, 0x73, 0x6d, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x18,
0x01, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x07, 0x73, 0x6d, 0x6f, 0x6b, 0x69, 0x6e, 0x67,
0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x07, 0x61, 0x6e, 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x18, 0x02,
0x20, 0x01, 0x28, 0x08, 0x48, 0x01, 0x52, 0x07, 0x61, 0x6e, 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x88,
0x01, 0x01, 0x12, 0x19, 0x0a, 0x05, 0x6d, 0x75, 0x73, 0x69, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28,
0x08, 0x48, 0x02, 0x52, 0x05, 0x6d, 0x75, 0x73, 0x69, 0x63, 0x88, 0x01, 0x01, 0x12, 0x20, 0x0a,
0x09, 0x69, 0x73, 0x5f, 0x74, 0x61, 0x6c, 0x6b, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08,
0x48, 0x03, 0x52, 0x08, 0x69, 0x73, 0x54, 0x61, 0x6c, 0x6b, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12,
0x26, 0x0a, 0x0c, 0x6c, 0x75, 0x67, 0x67, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18,
0x05, 0x20, 0x01, 0x28, 0x03, 0x48, 0x04, 0x52, 0x0b, 0x6c, 0x75, 0x67, 0x67, 0x61, 0x67, 0x65,
0x53, 0x69, 0x7a, 0x65, 0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x73, 0x6d, 0x6f, 0x6b,
0x69, 0x6e, 0x67, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x61, 0x6e, 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x42,
0x08, 0x0a, 0x06, 0x5f, 0x6d, 0x75, 0x73, 0x69, 0x63, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x69, 0x73,
0x5f, 0x74, 0x61, 0x6c, 0x6b, 0x65, 0x72, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x6c, 0x75, 0x67, 0x67,
0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x22, 0xf9, 0x02, 0x0a, 0x12, 0x43, 0x61, 0x72,
0x70, 0x6f, 0x6f, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12,
0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12,
0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28,
0x09, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x61,
0x6c, 0x69, 0x61, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x6c, 0x69, 0x61,
0x73, 0x12, 0x22, 0x0a, 0x0a, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18,
0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x09, 0x66, 0x69, 0x72, 0x73, 0x74, 0x4e, 0x61,
0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x20, 0x0a, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6e, 0x61,
0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x08, 0x6c, 0x61, 0x73, 0x74,
0x4e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x19, 0x0a, 0x05, 0x67, 0x72, 0x61, 0x64, 0x65,
0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x48, 0x02, 0x52, 0x05, 0x67, 0x72, 0x61, 0x64, 0x65, 0x88,
0x01, 0x01, 0x12, 0x1d, 0x0a, 0x07, 0x70, 0x69, 0x63, 0x74, 0x75, 0x72, 0x65, 0x18, 0x07, 0x20,
0x01, 0x28, 0x09, 0x48, 0x03, 0x52, 0x07, 0x70, 0x69, 0x63, 0x74, 0x75, 0x72, 0x65, 0x88, 0x01,
0x01, 0x12, 0x1b, 0x0a, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28,
0x09, 0x48, 0x04, 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x30,
0x0a, 0x11, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74,
0x69, 0x74, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x48, 0x05, 0x52, 0x10, 0x76, 0x65, 0x72,
0x69, 0x66, 0x69, 0x65, 0x64, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x88, 0x01, 0x01,
0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x42,
0x0c, 0x0a, 0x0a, 0x5f, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x08, 0x0a,
0x06, 0x5f, 0x67, 0x72, 0x61, 0x64, 0x65, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x70, 0x69, 0x63, 0x74,
0x75, 0x72, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x42, 0x14,
0x0a, 0x12, 0x5f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x69, 0x64, 0x65, 0x6e,
0x74, 0x69, 0x74, 0x79, 0x22, 0x5d, 0x0a, 0x11, 0x43, 0x61, 0x72, 0x70, 0x6f, 0x6f, 0x6c, 0x53,
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x61, 0x72, 0x12, 0x19, 0x0a, 0x05, 0x6d, 0x6f, 0x64,
0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x6d, 0x6f, 0x64, 0x65,
0x6c, 0x88, 0x01, 0x01, 0x12, 0x19, 0x0a, 0x05, 0x62, 0x72, 0x61, 0x6e, 0x64, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x05, 0x62, 0x72, 0x61, 0x6e, 0x64, 0x88, 0x01, 0x01, 0x42,
0x08, 0x0a, 0x06, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x62, 0x72,
0x61, 0x6e, 0x64, 0x22, 0xa7, 0x01, 0x0a, 0x13, 0x43, 0x61, 0x72, 0x70, 0x6f, 0x6f, 0x6c, 0x53,
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x31, 0x0a, 0x04, 0x74,
0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x43, 0x61, 0x72, 0x70,
0x6f, 0x6f, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x69, 0x63, 0x65, 0x54,
0x79, 0x70, 0x65, 0x48, 0x00, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1b,
0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x48, 0x01,
0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x08, 0x63,
0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52,
0x08, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x88, 0x01, 0x01, 0x42, 0x07, 0x0a, 0x05,
0x5f, 0x74, 0x79, 0x70, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74,
0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x22, 0xd7, 0x01,
0x0a, 0x16, 0x43, 0x61, 0x72, 0x70, 0x6f, 0x6f, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x30, 0x0a, 0x14, 0x70, 0x61, 0x73, 0x73,
0x65, 0x6e, 0x67, 0x65, 0x72, 0x5f, 0x70, 0x69, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x64, 0x61, 0x79,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x70, 0x61, 0x73, 0x73, 0x65, 0x6e, 0x67, 0x65,
0x72, 0x50, 0x69, 0x63, 0x6b, 0x75, 0x70, 0x44, 0x61, 0x79, 0x12, 0x3e, 0x0a, 0x1c, 0x70, 0x61,
0x73, 0x73, 0x65, 0x6e, 0x67, 0x65, 0x72, 0x5f, 0x70, 0x69, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x74,
0x69, 0x6d, 0x65, 0x5f, 0x6f, 0x66, 0x5f, 0x64, 0x61, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
0x52, 0x18, 0x70, 0x61, 0x73, 0x73, 0x65, 0x6e, 0x67, 0x65, 0x72, 0x50, 0x69, 0x63, 0x6b, 0x75,
0x70, 0x54, 0x69, 0x6d, 0x65, 0x4f, 0x66, 0x44, 0x61, 0x79, 0x12, 0x4b, 0x0a, 0x11, 0x6a, 0x6f,
0x75, 0x72, 0x6e, 0x65, 0x79, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x18,
0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x43, 0x61, 0x72, 0x70, 0x6f, 0x6f, 0x6c, 0x53,
0x12, 0x41, 0x0a, 0x0c, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65,
0x18, 0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x43, 0x61, 0x72, 0x70, 0x6f, 0x6f, 0x6c,
0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f,
0x6e, 0x48, 0x06, 0x52, 0x0b, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x52, 0x6f, 0x75, 0x74, 0x65,
0x88, 0x01, 0x01, 0x12, 0x47, 0x0a, 0x0f, 0x70, 0x61, 0x73, 0x73, 0x65, 0x6e, 0x67, 0x65, 0x72,
0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x43,
0x61, 0x72, 0x70, 0x6f, 0x6f, 0x6c, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x43, 0x6f, 0x6c,
0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x07, 0x52, 0x0e, 0x70, 0x61, 0x73, 0x73, 0x65,
0x6e, 0x67, 0x65, 0x72, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x88, 0x01, 0x01, 0x12, 0x51, 0x0a, 0x13,
0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x75, 0x72, 0x65, 0x44,
0x61, 0x74, 0x65, 0x18, 0x20, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65,
0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x08, 0x52, 0x13, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x44,
0x65, 0x70, 0x61, 0x72, 0x74, 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, 0x65, 0x88, 0x01, 0x01, 0x42,
0x1b, 0x0a, 0x19, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x65, 0x6e, 0x67, 0x65, 0x72, 0x5f, 0x70, 0x69,
0x63, 0x6b, 0x75, 0x70, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x19, 0x0a, 0x17,
0x5f, 0x70, 0x61, 0x73, 0x73, 0x65, 0x6e, 0x67, 0x65, 0x72, 0x5f, 0x64, 0x72, 0x6f, 0x70, 0x5f,
0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x64, 0x69, 0x73, 0x74,
0x61, 0x6e, 0x63, 0x65, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x77, 0x65, 0x62, 0x5f, 0x75, 0x72, 0x6c, 0x42, 0x06, 0x0a,
0x04, 0x5f, 0x63, 0x61, 0x72, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72,
0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x65,
0x6e, 0x67, 0x65, 0x72, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x42, 0x16, 0x0a, 0x14, 0x5f, 0x64,
0x72, 0x69, 0x76, 0x65, 0x72, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x75, 0x72, 0x65, 0x44, 0x61,
0x74, 0x65, 0x22, 0xff, 0x01, 0x0a, 0x19, 0x43, 0x61, 0x72, 0x70, 0x6f, 0x6f, 0x6c, 0x53, 0x65,
0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73,
0x12, 0x1d, 0x0a, 0x07, 0x73, 0x6d, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28,
0x08, 0x48, 0x00, 0x52, 0x07, 0x73, 0x6d, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x88, 0x01, 0x01, 0x12,
0x1d, 0x0a, 0x07, 0x61, 0x6e, 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08,
0x48, 0x01, 0x52, 0x07, 0x61, 0x6e, 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x88, 0x01, 0x01, 0x12, 0x19,
0x0a, 0x05, 0x6d, 0x75, 0x73, 0x69, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x48, 0x02, 0x52,
0x05, 0x6d, 0x75, 0x73, 0x69, 0x63, 0x88, 0x01, 0x01, 0x12, 0x20, 0x0a, 0x09, 0x69, 0x73, 0x5f,
0x74, 0x61, 0x6c, 0x6b, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x48, 0x03, 0x52, 0x08,
0x69, 0x73, 0x54, 0x61, 0x6c, 0x6b, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x26, 0x0a, 0x0c, 0x6c,
0x75, 0x67, 0x67, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28,
0x03, 0x48, 0x04, 0x52, 0x0b, 0x6c, 0x75, 0x67, 0x67, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65,
0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x73, 0x6d, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x42,
0x0a, 0x0a, 0x08, 0x5f, 0x61, 0x6e, 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x42, 0x08, 0x0a, 0x06, 0x5f,
0x6d, 0x75, 0x73, 0x69, 0x63, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x69, 0x73, 0x5f, 0x74, 0x61, 0x6c,
0x6b, 0x65, 0x72, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x6c, 0x75, 0x67, 0x67, 0x61, 0x67, 0x65, 0x5f,
0x73, 0x69, 0x7a, 0x65, 0x22, 0xf9, 0x02, 0x0a, 0x12, 0x43, 0x61, 0x72, 0x70, 0x6f, 0x6f, 0x6c,
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x6f,
0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f,
0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x6c, 0x69, 0x61, 0x73,
0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x12, 0x22, 0x0a,
0x0a, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28,
0x09, 0x48, 0x00, 0x52, 0x09, 0x66, 0x69, 0x72, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x88, 0x01,
0x01, 0x12, 0x20, 0x0a, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05,
0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65,
0x88, 0x01, 0x01, 0x12, 0x19, 0x0a, 0x05, 0x67, 0x72, 0x61, 0x64, 0x65, 0x18, 0x06, 0x20, 0x01,
0x28, 0x03, 0x48, 0x02, 0x52, 0x05, 0x67, 0x72, 0x61, 0x64, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1d,
0x0a, 0x07, 0x70, 0x69, 0x63, 0x74, 0x75, 0x72, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x48,
0x03, 0x52, 0x07, 0x70, 0x69, 0x63, 0x74, 0x75, 0x72, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1b, 0x0a,
0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x48, 0x04, 0x52,
0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x30, 0x0a, 0x11, 0x76, 0x65,
0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18,
0x09, 0x20, 0x01, 0x28, 0x08, 0x48, 0x05, 0x52, 0x10, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65,
0x64, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b,
0x5f, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x0c, 0x0a, 0x0a, 0x5f,
0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x67, 0x72,
0x61, 0x64, 0x65, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x70, 0x69, 0x63, 0x74, 0x75, 0x72, 0x65, 0x42,
0x09, 0x0a, 0x07, 0x5f, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x42, 0x14, 0x0a, 0x12, 0x5f, 0x76,
0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79,
0x22, 0x5d, 0x0a, 0x11, 0x43, 0x61, 0x72, 0x70, 0x6f, 0x6f, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69,
0x63, 0x65, 0x43, 0x61, 0x72, 0x12, 0x19, 0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x88, 0x01, 0x01,
0x12, 0x19, 0x0a, 0x05, 0x62, 0x72, 0x61, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48,
0x01, 0x52, 0x05, 0x62, 0x72, 0x61, 0x6e, 0x64, 0x88, 0x01, 0x01, 0x42, 0x08, 0x0a, 0x06, 0x5f,
0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x64, 0x22,
0xa7, 0x01, 0x0a, 0x13, 0x43, 0x61, 0x72, 0x70, 0x6f, 0x6f, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69,
0x63, 0x65, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x31, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x43, 0x61, 0x72, 0x70, 0x6f, 0x6f, 0x6c, 0x53,
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x48,
0x00, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1b, 0x0a, 0x06, 0x61, 0x6d,
0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x48, 0x01, 0x52, 0x06, 0x61, 0x6d,
0x6f, 0x75, 0x6e, 0x74, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x08, 0x63, 0x75, 0x72, 0x72, 0x65,
0x6e, 0x63, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, 0x08, 0x63, 0x75, 0x72,
0x72, 0x65, 0x6e, 0x63, 0x79, 0x88, 0x01, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x74, 0x79, 0x70,
0x65, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x0b, 0x0a, 0x09,
0x5f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x22, 0xd7, 0x01, 0x0a, 0x16, 0x43, 0x61,
0x72, 0x70, 0x6f, 0x6f, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x63, 0x68, 0x65,
0x64, 0x75, 0x6c, 0x65, 0x12, 0x30, 0x0a, 0x14, 0x70, 0x61, 0x73, 0x73, 0x65, 0x6e, 0x67, 0x65,
0x72, 0x5f, 0x70, 0x69, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x64, 0x61, 0x79, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x12, 0x70, 0x61, 0x73, 0x73, 0x65, 0x6e, 0x67, 0x65, 0x72, 0x50, 0x69, 0x63,
0x6b, 0x75, 0x70, 0x44, 0x61, 0x79, 0x12, 0x3e, 0x0a, 0x1c, 0x70, 0x61, 0x73, 0x73, 0x65, 0x6e,
0x67, 0x65, 0x72, 0x5f, 0x70, 0x69, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f,
0x6f, 0x66, 0x5f, 0x64, 0x61, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x18, 0x70, 0x61,
0x73, 0x73, 0x65, 0x6e, 0x67, 0x65, 0x72, 0x50, 0x69, 0x63, 0x6b, 0x75, 0x70, 0x54, 0x69, 0x6d,
0x65, 0x4f, 0x66, 0x44, 0x61, 0x79, 0x12, 0x4b, 0x0a, 0x11, 0x6a, 0x6f, 0x75, 0x72, 0x6e, 0x65,
0x79, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28,
0x0b, 0x32, 0x1e, 0x2e, 0x43, 0x61, 0x72, 0x70, 0x6f, 0x6f, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69,
0x63, 0x65, 0x4a, 0x6f, 0x75, 0x72, 0x6e, 0x65, 0x79, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c,
0x65, 0x52, 0x10, 0x6a, 0x6f, 0x75, 0x72, 0x6e, 0x65, 0x79, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75,
0x6c, 0x65, 0x73, 0x22, 0xc8, 0x02, 0x0a, 0x1d, 0x43, 0x61, 0x72, 0x70, 0x6f, 0x6f, 0x6c, 0x53,
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4a, 0x6f, 0x75, 0x72, 0x6e, 0x65, 0x79, 0x53, 0x63, 0x68,
0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x10, 0x6a, 0x6f, 0x75, 0x72, 0x6e, 0x65, 0x79, 0x53, 0x63,
0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x22, 0xc8, 0x02, 0x0a, 0x1d, 0x43, 0x61, 0x72, 0x70,
0x6f, 0x6f, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4a, 0x6f, 0x75, 0x72, 0x6e, 0x65,
0x79, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x4e, 0x0a, 0x15, 0x70, 0x61, 0x73,
0x73, 0x65, 0x6e, 0x67, 0x65, 0x72, 0x5f, 0x70, 0x69, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x64, 0x61,
0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73,
0x74, 0x61, 0x6d, 0x70, 0x52, 0x13, 0x70, 0x61, 0x73, 0x73, 0x65, 0x6e, 0x67, 0x65, 0x72, 0x50,
0x69, 0x63, 0x6b, 0x75, 0x70, 0x44, 0x61, 0x74, 0x65, 0x12, 0x53, 0x0a, 0x15, 0x64, 0x72, 0x69,
0x65, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x4e, 0x0a, 0x15, 0x70, 0x61, 0x73, 0x73, 0x65, 0x6e, 0x67,
0x65, 0x72, 0x5f, 0x70, 0x69, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x02,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70,
0x52, 0x13, 0x70, 0x61, 0x73, 0x73, 0x65, 0x6e, 0x67, 0x65, 0x72, 0x50, 0x69, 0x63, 0x6b, 0x75,
0x70, 0x44, 0x61, 0x74, 0x65, 0x12, 0x53, 0x0a, 0x15, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x5f,
0x64, 0x65, 0x70, 0x61, 0x72, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x03,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70,
0x48, 0x00, 0x52, 0x13, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74,
0x75, 0x72, 0x65, 0x44, 0x61, 0x74, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1c, 0x0a, 0x07, 0x77, 0x65,
0x62, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x06, 0x77,
0x65, 0x62, 0x55, 0x72, 0x6c, 0x88, 0x01, 0x01, 0x12, 0x2e, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65,
0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x43, 0x61, 0x72, 0x70, 0x6f, 0x6f, 0x6c,
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4a, 0x6f, 0x75, 0x72, 0x6e, 0x65, 0x79, 0x54, 0x79,
0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x42, 0x18, 0x0a, 0x16, 0x5f, 0x64, 0x72, 0x69,
0x76, 0x65, 0x72, 0x5f, 0x64, 0x65, 0x70, 0x61, 0x72, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x64, 0x61,
0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73,
0x74, 0x61, 0x6d, 0x70, 0x48, 0x00, 0x52, 0x13, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x44, 0x65,
0x70, 0x61, 0x72, 0x74, 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1c,
0x0a, 0x07, 0x77, 0x65, 0x62, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48,
0x01, 0x52, 0x06, 0x77, 0x65, 0x62, 0x55, 0x72, 0x6c, 0x88, 0x01, 0x01, 0x12, 0x2e, 0x0a, 0x04,
0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x43, 0x61, 0x72,
0x70, 0x6f, 0x6f, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4a, 0x6f, 0x75, 0x72, 0x6e,
0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x42, 0x18, 0x0a, 0x16,
0x5f, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x5f, 0x64, 0x65, 0x70, 0x61, 0x72, 0x74, 0x75, 0x72,
0x65, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x77, 0x65, 0x62, 0x5f, 0x75,
0x72, 0x6c, 0x2a, 0x3f, 0x0a, 0x19, 0x43, 0x61, 0x72, 0x70, 0x6f, 0x6f, 0x6c, 0x53, 0x65, 0x72,
0x76, 0x69, 0x63, 0x65, 0x4a, 0x6f, 0x75, 0x72, 0x6e, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12,
0x0b, 0x0a, 0x07, 0x50, 0x4c, 0x41, 0x4e, 0x4e, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07,
0x44, 0x59, 0x4e, 0x41, 0x4d, 0x49, 0x43, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x4c, 0x49, 0x4e,
0x45, 0x10, 0x02, 0x2a, 0x3c, 0x0a, 0x17, 0x43, 0x61, 0x72, 0x70, 0x6f, 0x6f, 0x6c, 0x53, 0x65,
0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08,
0x0a, 0x04, 0x46, 0x52, 0x45, 0x45, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x50, 0x41, 0x59, 0x49,
0x4e, 0x47, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10,
0x02, 0x2a, 0x95, 0x01, 0x0a, 0x1b, 0x43, 0x61, 0x72, 0x70, 0x6f, 0x6f, 0x6c, 0x53, 0x65, 0x72,
0x76, 0x69, 0x63, 0x65, 0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75,
0x73, 0x12, 0x0d, 0x0a, 0x09, 0x49, 0x4e, 0x49, 0x54, 0x49, 0x41, 0x54, 0x45, 0x44, 0x10, 0x00,
0x12, 0x18, 0x0a, 0x14, 0x57, 0x41, 0x49, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x43, 0x4f, 0x4e, 0x46,
0x49, 0x52, 0x4d, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x4f,
0x4e, 0x46, 0x49, 0x52, 0x4d, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x41, 0x4e,
0x43, 0x45, 0x4c, 0x4c, 0x45, 0x44, 0x10, 0x03, 0x12, 0x20, 0x0a, 0x1c, 0x43, 0x4f, 0x4d, 0x50,
0x4c, 0x45, 0x54, 0x45, 0x44, 0x5f, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x56, 0x41,
0x4c, 0x49, 0x44, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x04, 0x12, 0x0d, 0x0a, 0x09, 0x56, 0x41,
0x4c, 0x49, 0x44, 0x41, 0x54, 0x45, 0x44, 0x10, 0x05, 0x42, 0x42, 0x5a, 0x40, 0x67, 0x69, 0x74,
0x2e, 0x63, 0x6f, 0x6f, 0x70, 0x67, 0x6f, 0x2e, 0x69, 0x6f, 0x2f, 0x63, 0x6f, 0x6f, 0x70, 0x67,
0x6f, 0x2d, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2f, 0x63, 0x61, 0x72, 0x70, 0x6f,
0x6f, 0x6c, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65,
0x72, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
0x74, 0x65, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x77, 0x65, 0x62, 0x5f, 0x75, 0x72, 0x6c, 0x2a, 0x3f,
0x0a, 0x19, 0x43, 0x61, 0x72, 0x70, 0x6f, 0x6f, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
0x4a, 0x6f, 0x75, 0x72, 0x6e, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x50,
0x4c, 0x41, 0x4e, 0x4e, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x59, 0x4e, 0x41,
0x4d, 0x49, 0x43, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x4c, 0x49, 0x4e, 0x45, 0x10, 0x02, 0x2a,
0x3c, 0x0a, 0x17, 0x43, 0x61, 0x72, 0x70, 0x6f, 0x6f, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
0x65, 0x50, 0x72, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x52,
0x45, 0x45, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x50, 0x41, 0x59, 0x49, 0x4e, 0x47, 0x10, 0x01,
0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x02, 0x2a, 0xc0, 0x01,
0x0a, 0x1b, 0x43, 0x61, 0x72, 0x70, 0x6f, 0x6f, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0d, 0x0a,
0x09, 0x49, 0x4e, 0x49, 0x54, 0x49, 0x41, 0x54, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1f, 0x0a, 0x1b,
0x57, 0x41, 0x49, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x44, 0x52, 0x49, 0x56, 0x45, 0x52, 0x5f, 0x43,
0x4f, 0x4e, 0x46, 0x49, 0x52, 0x4d, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x12, 0x22, 0x0a,
0x1e, 0x57, 0x41, 0x49, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x50, 0x41, 0x53, 0x53, 0x45, 0x4e, 0x47,
0x45, 0x52, 0x5f, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x52, 0x4d, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10,
0x02, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x52, 0x4d, 0x45, 0x44, 0x10, 0x03,
0x12, 0x0d, 0x0a, 0x09, 0x43, 0x41, 0x4e, 0x43, 0x45, 0x4c, 0x4c, 0x45, 0x44, 0x10, 0x04, 0x12,
0x20, 0x0a, 0x1c, 0x43, 0x4f, 0x4d, 0x50, 0x4c, 0x45, 0x54, 0x45, 0x44, 0x5f, 0x50, 0x45, 0x4e,
0x44, 0x49, 0x4e, 0x47, 0x5f, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10,
0x05, 0x12, 0x0d, 0x0a, 0x09, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x45, 0x44, 0x10, 0x06,
0x42, 0x42, 0x5a, 0x40, 0x67, 0x69, 0x74, 0x2e, 0x63, 0x6f, 0x6f, 0x70, 0x67, 0x6f, 0x2e, 0x69,
0x6f, 0x2f, 0x63, 0x6f, 0x6f, 0x70, 0x67, 0x6f, 0x2d, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72,
0x6d, 0x2f, 0x63, 0x61, 0x72, 0x70, 0x6f, 0x6f, 0x6c, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63,
0x65, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -2614,16 +2661,19 @@ var file_carpool_service_types_proto_depIdxs = []int32{
2, // 23: CarpoolServiceBooking.status:type_name -> CarpoolServiceBookingStatus
13, // 24: CarpoolServiceBooking.price:type_name -> CarpoolServicePrice
12, // 25: CarpoolServiceBooking.car:type_name -> CarpoolServiceCar
1, // 26: CarpoolServicePrice.type:type_name -> CarpoolServicePriceType
15, // 27: CarpoolServiceSchedule.journey_schedules:type_name -> CarpoolServiceJourneySchedule
16, // 28: CarpoolServiceJourneySchedule.passenger_pickup_date:type_name -> google.protobuf.Timestamp
16, // 29: CarpoolServiceJourneySchedule.driver_departure_date:type_name -> google.protobuf.Timestamp
0, // 30: CarpoolServiceJourneySchedule.type:type_name -> CarpoolServiceJourneyType
31, // [31:31] is the sub-list for method output_type
31, // [31:31] is the sub-list for method input_type
31, // [31:31] is the sub-list for extension type_name
31, // [31:31] is the sub-list for extension extendee
0, // [0:31] is the sub-list for field type_name
4, // 26: CarpoolServiceBooking.driver_route:type_name -> CarpoolFeatureCollection
4, // 27: CarpoolServiceBooking.passenger_route:type_name -> CarpoolFeatureCollection
16, // 28: CarpoolServiceBooking.driverDepartureDate:type_name -> google.protobuf.Timestamp
1, // 29: CarpoolServicePrice.type:type_name -> CarpoolServicePriceType
15, // 30: CarpoolServiceSchedule.journey_schedules:type_name -> CarpoolServiceJourneySchedule
16, // 31: CarpoolServiceJourneySchedule.passenger_pickup_date:type_name -> google.protobuf.Timestamp
16, // 32: CarpoolServiceJourneySchedule.driver_departure_date:type_name -> google.protobuf.Timestamp
0, // 33: CarpoolServiceJourneySchedule.type:type_name -> CarpoolServiceJourneyType
34, // [34:34] is the sub-list for method output_type
34, // [34:34] is the sub-list for method input_type
34, // [34:34] is the sub-list for extension type_name
34, // [34:34] is the sub-list for extension extendee
0, // [0:34] is the sub-list for field type_name
}
func init() { file_carpool_service_types_proto_init() }

View File

@@ -150,6 +150,10 @@ message CarpoolServiceBooking {
optional CarpoolServiceCar car = 16;
string driver_journey_id = 17;
string passenger_journey_id = 18;
optional CarpoolFeatureCollection driver_route = 30;
optional CarpoolFeatureCollection passenger_route = 31;
optional google.protobuf.Timestamp driverDepartureDate = 32;
}
message CarpoolServicePreferences {
@@ -211,9 +215,10 @@ enum CarpoolServicePriceType {
enum CarpoolServiceBookingStatus {
INITIATED = 0;
WAITING_CONFIRMATION = 1;
CONFIRMED = 2;
CANCELLED = 3;
COMPLETED_PENDING_VALIDATION = 4;
VALIDATED = 5;
WAITING_DRIVER_CONFIRMATION = 1;
WAITING_PASSENGER_CONFIRMATION = 2;
CONFIRMED = 3;
CANCELLED = 4;
COMPLETED_PENDING_VALIDATION = 5;
VALIDATED = 6;
}

File diff suppressed because it is too large Load Diff

View File

@@ -10,11 +10,11 @@ service CarpoolService {
// rpc XXXX(Request) returns (Response) {}
rpc CreateRegularRoutes(CreateRegularRoutesRequest) returns (CreateRegularRoutesResponse) {}
rpc DeleteRegularRoutes(DeleteRegularRoutesRequest) returns (DeleteRegularRoutesResponse) {}
rpc GetUserPlanning(GetUserPlanningRequest) returns (GetUserPlanningResponse) {}
rpc GetPlannedTrip(GetPlannedTripRequest) returns (GetPlannedTripResponse) {}
rpc GetUserBookings(GetUserBookingsRequest) returns (GetUserBookingsResponse) {}
// OCSS-like interaction
// OCSS interactions
rpc DriverJourneys(DriverJourneysRequest) returns (DriverJourneysResponse) {}
rpc PassengerJourneys(PassengerJourneysRequest) returns (PassengerJourneysResponse) {}
rpc DriverRegularTrips(DriverRegularTripsRequest) returns (DriverRegularTripsResponse) {}
@@ -55,6 +55,16 @@ message GetPlannedTripResponse {
CarpoolFeatureCollection planned_trip = 1;
}
message GetUserBookingsRequest {
string user_id = 1;
optional google.protobuf.Timestamp min_date = 2;
optional google.protobuf.Timestamp max_date = 3;
}
message GetUserBookingsResponse {
repeated CarpoolServiceBooking bookings = 1;
}
// OCSS-like interaction messages

View File

@@ -28,7 +28,8 @@ type CarpoolServiceClient interface {
DeleteRegularRoutes(ctx context.Context, in *DeleteRegularRoutesRequest, opts ...grpc.CallOption) (*DeleteRegularRoutesResponse, error)
GetUserPlanning(ctx context.Context, in *GetUserPlanningRequest, opts ...grpc.CallOption) (*GetUserPlanningResponse, error)
GetPlannedTrip(ctx context.Context, in *GetPlannedTripRequest, opts ...grpc.CallOption) (*GetPlannedTripResponse, error)
// OCSS-like interaction
GetUserBookings(ctx context.Context, in *GetUserBookingsRequest, opts ...grpc.CallOption) (*GetUserBookingsResponse, error)
// OCSS interactions
DriverJourneys(ctx context.Context, in *DriverJourneysRequest, opts ...grpc.CallOption) (*DriverJourneysResponse, error)
PassengerJourneys(ctx context.Context, in *PassengerJourneysRequest, opts ...grpc.CallOption) (*PassengerJourneysResponse, error)
DriverRegularTrips(ctx context.Context, in *DriverRegularTripsRequest, opts ...grpc.CallOption) (*DriverRegularTripsResponse, error)
@@ -82,6 +83,15 @@ func (c *carpoolServiceClient) GetPlannedTrip(ctx context.Context, in *GetPlanne
return out, nil
}
func (c *carpoolServiceClient) GetUserBookings(ctx context.Context, in *GetUserBookingsRequest, opts ...grpc.CallOption) (*GetUserBookingsResponse, error) {
out := new(GetUserBookingsResponse)
err := c.cc.Invoke(ctx, "/CarpoolService/GetUserBookings", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *carpoolServiceClient) DriverJourneys(ctx context.Context, in *DriverJourneysRequest, opts ...grpc.CallOption) (*DriverJourneysResponse, error) {
out := new(DriverJourneysResponse)
err := c.cc.Invoke(ctx, "/CarpoolService/DriverJourneys", in, out, opts...)
@@ -155,7 +165,8 @@ type CarpoolServiceServer interface {
DeleteRegularRoutes(context.Context, *DeleteRegularRoutesRequest) (*DeleteRegularRoutesResponse, error)
GetUserPlanning(context.Context, *GetUserPlanningRequest) (*GetUserPlanningResponse, error)
GetPlannedTrip(context.Context, *GetPlannedTripRequest) (*GetPlannedTripResponse, error)
// OCSS-like interaction
GetUserBookings(context.Context, *GetUserBookingsRequest) (*GetUserBookingsResponse, error)
// OCSS interactions
DriverJourneys(context.Context, *DriverJourneysRequest) (*DriverJourneysResponse, error)
PassengerJourneys(context.Context, *PassengerJourneysRequest) (*PassengerJourneysResponse, error)
DriverRegularTrips(context.Context, *DriverRegularTripsRequest) (*DriverRegularTripsResponse, error)
@@ -182,6 +193,9 @@ func (UnimplementedCarpoolServiceServer) GetUserPlanning(context.Context, *GetUs
func (UnimplementedCarpoolServiceServer) GetPlannedTrip(context.Context, *GetPlannedTripRequest) (*GetPlannedTripResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetPlannedTrip not implemented")
}
func (UnimplementedCarpoolServiceServer) GetUserBookings(context.Context, *GetUserBookingsRequest) (*GetUserBookingsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetUserBookings not implemented")
}
func (UnimplementedCarpoolServiceServer) DriverJourneys(context.Context, *DriverJourneysRequest) (*DriverJourneysResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method DriverJourneys not implemented")
}
@@ -288,6 +302,24 @@ func _CarpoolService_GetPlannedTrip_Handler(srv interface{}, ctx context.Context
return interceptor(ctx, in, info, handler)
}
func _CarpoolService_GetUserBookings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetUserBookingsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(CarpoolServiceServer).GetUserBookings(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/CarpoolService/GetUserBookings",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(CarpoolServiceServer).GetUserBookings(ctx, req.(*GetUserBookingsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _CarpoolService_DriverJourneys_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DriverJourneysRequest)
if err := dec(in); err != nil {
@@ -437,6 +469,10 @@ var CarpoolService_ServiceDesc = grpc.ServiceDesc{
MethodName: "GetPlannedTrip",
Handler: _CarpoolService_GetPlannedTrip_Handler,
},
{
MethodName: "GetUserBookings",
Handler: _CarpoolService_GetUserBookings_Handler,
},
{
MethodName: "DriverJourneys",
Handler: _CarpoolService_DriverJourneys_Handler,

View File

@@ -3,11 +3,12 @@ package proto
import (
"time"
"git.coopgo.io/coopgo-platform/carpool-service/internal"
"git.coopgo.io/coopgo-platform/carpool-service/interoperability/ocss"
"google.golang.org/protobuf/types/known/timestamppb"
)
func (j *CarpoolServiceDriverJourney) ToOCSS() ocss.DriverJourney {
var departureToPickupWalkingDuration *time.Duration
if j.DepartureToPickupWalkingDuration != nil {
dtpw := time.Duration(*j.DepartureToPickupWalkingDuration)
@@ -39,9 +40,9 @@ func (j *CarpoolServiceDriverJourney) ToOCSS() ocss.DriverJourney {
}
}
var driverDepartureDate *ocss.JSONTime
var driverDepartureDate *ocss.OCSSTime
if j.DriverDepartureDate != nil {
ddd := ocss.JSONTime(j.DriverDepartureDate.AsTime())
ddd := ocss.OCSSTime(j.DriverDepartureDate.AsTime())
driverDepartureDate = &ddd
}
@@ -108,7 +109,8 @@ func (j *CarpoolServiceDriverJourney) ToOCSS() ocss.DriverJourney {
},
},
JourneySchedule: ocss.JourneySchedule{
PassengerPickupDate: ocss.JSONTime(j.PassengerPickupDate.AsTime()),
ID: &j.Id,
PassengerPickupDate: ocss.OCSSTime(j.PassengerPickupDate.AsTime()),
DriverDepartureDate: driverDepartureDate,
WebUrl: j.WebUrl,
Type: j.Type.ToOCSS(),
@@ -131,9 +133,9 @@ func (j *CarpoolServicePassengerJourney) ToOCSS() ocss.PassengerJourney {
}
}
var driverDepartureDate *ocss.JSONTime
var driverDepartureDate *ocss.OCSSTime
if j.DriverDepartureDate != nil {
ddd := ocss.JSONTime(j.DriverDepartureDate.AsTime())
ddd := ocss.OCSSTime(j.DriverDepartureDate.AsTime())
driverDepartureDate = &ddd
}
@@ -171,7 +173,8 @@ func (j *CarpoolServicePassengerJourney) ToOCSS() ocss.PassengerJourney {
},
},
JourneySchedule: ocss.JourneySchedule{
PassengerPickupDate: ocss.JSONTime(j.PassengerPickupDate.AsTime()),
ID: &j.Id,
PassengerPickupDate: ocss.OCSSTime(j.PassengerPickupDate.AsTime()),
DriverDepartureDate: driverDepartureDate,
WebUrl: j.WebUrl,
Type: j.Type.ToOCSS(),
@@ -180,6 +183,218 @@ func (j *CarpoolServicePassengerJourney) ToOCSS() ocss.PassengerJourney {
}
}
func (b *CarpoolServiceBooking) ToOCSS() ocss.Booking {
var duration *time.Duration
if b.Duration != nil {
d := time.Duration(*b.Duration) * time.Second
duration = &d
}
pt := ocss.Free
am := 0.0
cu := "EUR"
price := ocss.Price{
Type: &pt,
Amount: &am,
Currency: &cu,
}
if b.Price != nil {
pricetype := ocss.Unknown
if *b.Price.Type == CarpoolServicePriceType_FREE {
pricetype = ocss.Free
} else if *b.Price.Type == CarpoolServicePriceType_PAYING {
pricetype = ocss.Paying
}
price = ocss.Price{
Type: &pricetype,
Amount: b.Price.Amount,
Currency: b.Price.Currency,
}
}
status := ocss.BookingInitiated
if b.Status == CarpoolServiceBookingStatus_WAITING_DRIVER_CONFIRMATION {
status = ocss.BookingWaitingDriverConfirmation
} else if b.Status == CarpoolServiceBookingStatus_WAITING_PASSENGER_CONFIRMATION {
status = ocss.BookingWaitingPassengerConfirmation
} else if b.Status == CarpoolServiceBookingStatus_CONFIRMED {
status = ocss.BookingConfirmed
} else if b.Status == CarpoolServiceBookingStatus_COMPLETED_PENDING_VALIDATION {
status = ocss.BookingCompletedPendingValidation
} else if b.Status == CarpoolServiceBookingStatus_VALIDATED {
status = ocss.BookingValidated
} else if b.Status == CarpoolServiceBookingStatus_CANCELLED {
status = ocss.BookingCancelled
}
return ocss.Booking{
ID: b.Id,
Driver: ocss.User{
ID: b.Driver.Id,
Operator: b.Driver.Operator,
Alias: b.Driver.Alias,
FirstName: b.Driver.FirstName,
LastName: b.Driver.LastName,
Grade: b.Driver.Grade,
Picture: b.Driver.Picture,
Gender: GenderToOCSS(b.Driver.Gender),
VerifiedIdentity: b.Driver.VerifiedIdentity,
},
Passenger: ocss.User{
ID: b.Passenger.Id,
Operator: b.Passenger.Operator,
Alias: b.Passenger.Alias,
FirstName: b.Passenger.FirstName,
LastName: b.Passenger.LastName,
Grade: b.Passenger.Grade,
Picture: b.Passenger.Picture,
Gender: GenderToOCSS(b.Passenger.Gender),
VerifiedIdentity: b.Passenger.VerifiedIdentity,
},
PassengerPickupDate: ocss.OCSSTime(b.PassengerPickupDate.AsTime()),
PassengerPickupLat: b.PassengerPickupLat,
PassengerPickupLng: b.PassengerPickupLng,
PassengerDropLat: b.PassengerDropLat,
PassengerDropLng: b.PassengerDropLng,
PassengerPickupAddress: b.PassengerPickupAddress,
PassengerDropAddress: b.PassengerDropAddress,
Distance: b.Distance,
Duration: duration,
WebUrl: b.WebUrl,
Price: price,
Status: status,
DriverJourneyID: b.DriverJourneyId,
PassengerJourneyID: b.PassengerJourneyId,
}
}
func BookingFromOCSS(b ocss.Booking) *CarpoolServiceBooking {
passengerPickupDate := b.PassengerPickupDate.ToTime()
status := CarpoolServiceBookingStatus_INITIATED
if b.Status == ocss.BookingWaitingDriverConfirmation {
status = CarpoolServiceBookingStatus_WAITING_DRIVER_CONFIRMATION
} else if b.Status == ocss.BookingWaitingPassengerConfirmation {
status = CarpoolServiceBookingStatus_WAITING_PASSENGER_CONFIRMATION
} else if b.Status == ocss.BookingConfirmed {
status = CarpoolServiceBookingStatus_CONFIRMED
} else if b.Status == ocss.BookingCompletedPendingValidation {
status = CarpoolServiceBookingStatus_COMPLETED_PENDING_VALIDATION
} else if b.Status == ocss.BookingValidated {
status = CarpoolServiceBookingStatus_VALIDATED
} else if b.Status == ocss.BookingCancelled {
status = CarpoolServiceBookingStatus_CANCELLED
}
var duration *int64
if b.Duration != nil {
d := int64(b.Duration.Seconds())
duration = &d
}
var pricetype *CarpoolServicePriceType
if b.Price.Type != nil {
if *b.Price.Type == ocss.Free {
pt := CarpoolServicePriceType_FREE
pricetype = &pt
} else if *b.Price.Type == ocss.Paying {
pt := CarpoolServicePriceType_PAYING
pricetype = &pt
} else if *b.Price.Type == ocss.Unknown {
pt := CarpoolServicePriceType_UNKNOWN
pricetype = &pt
}
}
price := CarpoolServicePrice{
Amount: b.Price.Amount,
Currency: b.Price.Currency,
Type: pricetype,
}
return &CarpoolServiceBooking{
Id: b.ID,
Driver: &CarpoolServiceUser{
Id: b.Driver.ID,
Operator: b.Driver.Operator,
Alias: b.Driver.Alias,
FirstName: b.Driver.FirstName,
LastName: b.Driver.LastName,
Grade: b.Driver.Grade,
Picture: b.Driver.Picture,
Gender: b.Driver.Gender.ToString(),
VerifiedIdentity: b.Driver.VerifiedIdentity,
},
Passenger: &CarpoolServiceUser{
Id: b.Passenger.ID,
Operator: b.Passenger.Operator,
Alias: b.Passenger.Alias,
FirstName: b.Passenger.FirstName,
LastName: b.Passenger.LastName,
Grade: b.Passenger.Grade,
Picture: b.Passenger.Picture,
Gender: b.Passenger.Gender.ToString(),
VerifiedIdentity: b.Passenger.VerifiedIdentity,
},
PassengerPickupDate: timestamppb.New(*passengerPickupDate),
PassengerPickupLat: b.PassengerPickupLat,
PassengerPickupLng: b.PassengerPickupLng,
PassengerDropLat: b.PassengerDropLat,
PassengerDropLng: b.PassengerDropLng,
PassengerPickupAddress: b.PassengerPickupAddress,
PassengerDropAddress: b.PassengerDropAddress,
Status: status,
Distance: b.Distance,
Duration: duration,
WebUrl: b.WebUrl,
Price: &price,
DriverJourneyId: b.DriverJourneyID,
PassengerJourneyId: b.PassengerJourneyID,
}
}
func BookingFromInternal(b internal.Booking) *CarpoolServiceBooking {
booking := BookingFromOCSS(b.Booking)
if b.DriverRoute != nil {
serializedDriverRoute, err := b.DriverRoute.MarshalJSON()
if err == nil {
booking.DriverRoute = &CarpoolFeatureCollection{
Serialized: string(serializedDriverRoute),
}
}
}
if b.PassengerRoute != nil {
serializedPassengerRoute, err := b.PassengerRoute.MarshalJSON()
if err == nil {
booking.PassengerRoute = &CarpoolFeatureCollection{
Serialized: string(serializedPassengerRoute),
}
}
}
return booking
}
func (s CarpoolServiceBookingStatus) ToOCSS() ocss.BookingStatus {
if s == CarpoolServiceBookingStatus_INITIATED {
return ocss.BookingInitiated
} else if s == CarpoolServiceBookingStatus_WAITING_DRIVER_CONFIRMATION {
return ocss.BookingWaitingDriverConfirmation
} else if s == CarpoolServiceBookingStatus_WAITING_PASSENGER_CONFIRMATION {
return ocss.BookingWaitingPassengerConfirmation
} else if s == CarpoolServiceBookingStatus_CONFIRMED {
return ocss.BookingConfirmed
} else if s == CarpoolServiceBookingStatus_COMPLETED_PENDING_VALIDATION {
return ocss.BookingCompletedPendingValidation
} else if s == CarpoolServiceBookingStatus_VALIDATED {
return ocss.BookingValidated
} else if s == CarpoolServiceBookingStatus_CANCELLED {
return ocss.BookingCancelled
}
return ocss.BookingInitiated
}
func (t CarpoolServiceJourneyType) ToOCSS() ocss.JourneyScheduleType {
if t == CarpoolServiceJourneyType_DYNAMIC {
return ocss.Dynamic