164 lines
4.9 KiB
Protocol Buffer
164 lines
4.9 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
option go_package = "git.coopgo.io/coopgo-platform/carpool-service/servers/grpc/proto";
|
|
|
|
import "google/protobuf/timestamp.proto";
|
|
import "carpool-service-types.proto";
|
|
|
|
service CarpoolService {
|
|
// Internal trips and journeys management
|
|
// 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 interactions
|
|
rpc DriverJourneys(DriverJourneysRequest) returns (DriverJourneysResponse) {}
|
|
rpc PassengerJourneys(PassengerJourneysRequest) returns (PassengerJourneysResponse) {}
|
|
rpc DriverRegularTrips(DriverRegularTripsRequest) returns (DriverRegularTripsResponse) {}
|
|
rpc PassengerRegularTrips(PassengerRegularTripsRequest) returns (PassengerRegularTripsResponse) {}
|
|
rpc CreateBooking(CreateBookingRequest) returns (CreateBookingResponse) {}
|
|
rpc UpdateBooking(UpdateBookingRequest) returns (UpdateBookingResponse) {}
|
|
rpc GetBooking(GetBookingRequest) returns (GetBookingResponse) {}
|
|
}
|
|
|
|
// Internal trips and journeys management messages
|
|
message CreateRegularRoutesRequest{
|
|
repeated CarpoolFeatureCollection routes = 1;
|
|
}
|
|
|
|
message CreateRegularRoutesResponse{}
|
|
|
|
message DeleteRegularRoutesRequest {
|
|
repeated string ids = 1;
|
|
}
|
|
|
|
message DeleteRegularRoutesResponse {}
|
|
|
|
message GetUserPlanningRequest {
|
|
string user_id = 1;
|
|
google.protobuf.Timestamp min_departure_date = 2;
|
|
google.protobuf.Timestamp max_departure_date = 3;
|
|
}
|
|
|
|
message GetUserPlanningResponse {
|
|
map<string, CarpoolRoutesCollection> routes_by_dates = 1;
|
|
bool missing_planning = 2;
|
|
}
|
|
|
|
message GetPlannedTripRequest {
|
|
string id = 1;
|
|
}
|
|
|
|
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
|
|
message DriverJourneysRequest {
|
|
double departure_lat = 1;
|
|
double departure_lng = 2;
|
|
double arrival_lat = 3;
|
|
double arrival_lng = 4;
|
|
google.protobuf.Timestamp departure_date = 5;
|
|
optional int64 time_delta = 6;
|
|
optional double departure_radius = 7;
|
|
optional double arrival_radius = 8;
|
|
optional int64 count = 9;
|
|
}
|
|
|
|
message DriverJourneysResponse {
|
|
repeated CarpoolServiceDriverJourney driver_journeys = 1;
|
|
}
|
|
|
|
message PassengerJourneysRequest {
|
|
double departure_lat = 1;
|
|
double departure_lng = 2;
|
|
double arrival_lat = 3;
|
|
double arrival_lng = 4;
|
|
google.protobuf.Timestamp departure_date = 5;
|
|
optional int64 time_delta = 6;
|
|
optional double departure_radius = 7;
|
|
optional double arrival_radius = 8;
|
|
optional int64 count = 9;
|
|
}
|
|
|
|
message PassengerJourneysResponse {
|
|
repeated CarpoolServicePassengerJourney passenger_journeys = 1;
|
|
}
|
|
|
|
message DriverRegularTripsRequest {
|
|
double departure_lat = 1;
|
|
double departure_lng = 2;
|
|
double arrival_lat = 3;
|
|
double arrival_lng = 4;
|
|
string departure_time_of_day = 5;
|
|
repeated string departure_week_days = 6;
|
|
optional int64 time_delta = 7;
|
|
optional double departure_radius = 8;
|
|
optional double arrival_radius = 9;
|
|
optional google.protobuf.Timestamp min_departure_date = 10;
|
|
optional google.protobuf.Timestamp max_departure_date = 11;
|
|
optional int64 count = 12;
|
|
}
|
|
|
|
message DriverRegularTripsResponse {
|
|
repeated CarpoolServiceDriverRegularTrip driver_regular_trips = 1;
|
|
}
|
|
|
|
message PassengerRegularTripsRequest {
|
|
double departure_lat = 1;
|
|
double departure_lng = 2;
|
|
double arrival_lat = 3;
|
|
double arrival_lng = 4;
|
|
string departure_time_of_day = 5;
|
|
repeated string departure_week_days = 6;
|
|
optional int64 time_delta = 7;
|
|
optional double departure_radius = 8;
|
|
optional double arrival_radius = 9;
|
|
optional google.protobuf.Timestamp min_departure_date = 10;
|
|
optional google.protobuf.Timestamp max_departure_date = 11;
|
|
optional int64 count = 12;
|
|
}
|
|
|
|
message PassengerRegularTripsResponse {
|
|
repeated CarpoolServiceDriverRegularTrip driver_regular_trips = 1;
|
|
}
|
|
|
|
message CreateBookingRequest {
|
|
CarpoolServiceBooking booking = 1;
|
|
}
|
|
|
|
message CreateBookingResponse {
|
|
CarpoolServiceBooking booking = 1;
|
|
}
|
|
|
|
message UpdateBookingRequest {
|
|
string booking_id = 1;
|
|
CarpoolServiceBookingStatus status = 2;
|
|
string message = 3;
|
|
}
|
|
|
|
message UpdateBookingResponse {}
|
|
|
|
message GetBookingRequest {
|
|
string booking_id = 1;
|
|
}
|
|
|
|
message GetBookingResponse {
|
|
CarpoolServiceBooking booking = 1;
|
|
} |