2023-03-27 18:54:56 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
|
2023-03-29 11:30:24 +00:00
|
|
|
option go_package = "git.coopgo.io/coopgo-platform/carpool-service/servers/grpc/proto";
|
2023-03-27 18:54:56 +00:00
|
|
|
|
|
|
|
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) {}
|
2023-04-05 18:57:27 +00:00
|
|
|
rpc GetPlannedTrip(GetPlannedTripRequest) returns (GetPlannedTripResponse) {}
|
2023-05-07 23:29:59 +00:00
|
|
|
rpc GetUserBookings(GetUserBookingsRequest) returns (GetUserBookingsResponse) {}
|
2023-03-27 18:54:56 +00:00
|
|
|
|
2023-05-07 23:29:59 +00:00
|
|
|
// OCSS interactions
|
2023-03-27 18:54:56 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2023-04-05 18:57:27 +00:00
|
|
|
message GetPlannedTripRequest {
|
|
|
|
string id = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message GetPlannedTripResponse {
|
|
|
|
CarpoolFeatureCollection planned_trip = 1;
|
|
|
|
}
|
|
|
|
|
2023-05-07 23:29:59 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2023-03-27 18:54:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
// 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;
|
2023-04-03 18:35:12 +00:00
|
|
|
optional int64 time_delta = 6;
|
|
|
|
optional double departure_radius = 7;
|
|
|
|
optional double arrival_radius = 8;
|
|
|
|
optional int64 count = 9;
|
2023-03-27 18:54:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
2023-04-03 18:35:12 +00:00
|
|
|
optional int64 time_delta = 6;
|
|
|
|
optional double departure_radius = 7;
|
|
|
|
optional double arrival_radius = 8;
|
|
|
|
optional int64 count = 9;
|
2023-03-27 18:54:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
2023-04-03 18:35:12 +00:00
|
|
|
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;
|
2023-03-27 18:54:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
2023-04-03 18:35:12 +00:00
|
|
|
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;
|
2023-03-27 18:54:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|