matcher/src/modules/ad/interface/grpc-controllers/matcher.proto

102 lines
1.8 KiB
Protocol Buffer

syntax = "proto3";
package matcher;
service MatcherService {
rpc Match(MatchRequest) returns (Matches);
}
message MatchRequest {
string id = 1;
bool driver = 2;
bool passenger = 3;
Frequency frequency = 4;
string fromDate = 5;
string toDate = 6;
repeated ScheduleItem schedule = 7;
bool strict = 8;
repeated Waypoint waypoints = 9;
AlgorithmType algorithmType = 10;
int32 remoteness = 11;
bool useProportion = 12;
int32 proportion = 13;
bool useAzimuth = 14;
int32 azimuthMargin = 15;
float maxDetourDistanceRatio = 16;
float maxDetourDurationRatio = 17;
int32 identifier = 18;
optional int32 page = 19;
optional int32 perPage = 20;
}
message ScheduleItem {
int32 day = 1;
string time = 2;
int32 margin = 3;
}
message Waypoint {
int32 position = 1;
double lon = 2;
double lat = 3;
string name = 4;
string houseNumber = 5;
string street = 6;
string locality = 7;
string postalCode = 8;
string country = 9;
}
enum Frequency {
PUNCTUAL = 1;
RECURRENT = 2;
}
enum AlgorithmType {
PASSENGER_ORIENTED = 0;
}
message Match {
string id = 1;
string adId = 2;
string role = 3;
int32 distance = 4;
int32 duration = 5;
int32 initialDistance = 6;
int32 initialDuration = 7;
int32 distanceDetour = 8;
int32 durationDetour = 9;
double distanceDetourPercentage = 10;
double durationDetourPercentage = 11;
repeated Journey journeys = 12;
}
message Journey {
int32 day = 1;
string firstDate = 2;
string lastDate = 3;
repeated Step steps = 4;
}
message Step {
int32 distance = 1;
int32 duration = 2;
double lon = 3;
double lat = 4;
string time = 5;
repeated Actor actors = 6;
}
message Actor {
string role = 1;
string target = 2;
}
message Matches {
string id = 1;
repeated Match data = 2;
int32 total = 3;
int32 page = 4;
int32 perPage = 5;
}