Skip to content

Commit

Permalink
Search specific parameters for each vertical (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
SamJaarsma authored Dec 19, 2023
1 parent 18afbfa commit 1bdb163
Show file tree
Hide file tree
Showing 7 changed files with 147 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,62 @@ syntax = "proto3";

package cmp.services.activity.v1alpha1;

import "cmp/types/v1alpha1/language.proto";
import "cmp/types/v1alpha1/time.proto";
import "cmp/types/v1alpha1/price.proto";

// ### Activity Search Parameters
//
// These are Activity specific search parameters
//
// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/activity/v1alpha1/search_parameters_types.proto.dot.xs.svg)
// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/activity/v1alpha1/search_parameters_types.proto.dot.svg)
message ActivitySearchParameters {}
message ActivitySearchParameters {
// Specify the language(s) a potential guide should speak for example a tour in
// the Anne Frank house in Amsterdam in French or the tour at the pyramids in
// Egypt should be in Russian
repeated cmp.types.v1alpha1.Language spoken_language = 1;

// Specify one or more product codes to be included in the search response
//
// Ex: "TC000000"
repeated string product_code = 2;

// Specify one or more activity IDs to be included in the search response
//
// Ex: "EESPMI46VY"
repeated string activity_id = 3;

// Specify one or more service codes to be included in the search response
//
// Ex: "XO"
repeated string service_code = 4;

// Specify one or more category codes to be included in the search response
//
// Ex: "XA"
repeated string category_code = 5;

// Specify one or more type codes to be included in the search response
//
// Ex: "SF"
repeated string type_code = 6;

// Duration
//
// Specify the minimal and maximum duration of an activity to be included in the
// search response
cmp.types.v1alpha1.Time min_duration = 7;
cmp.types.v1alpha1.Time max_duration = 8;

// Pricerange
//
// Specify the minimum and maximum price of an activity to be included in the
// search response
cmp.types.v1alpha1.Price min_price = 9;
cmp.types.v1alpha1.Price max_price = 10;

// Specify one or more brand codes or distribution channels for which assigned
// product is to be included in the search response
repeated string brand_code = 11;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,57 @@ syntax = "proto3";

package cmp.services.transport.v1alpha1;

import "cmp/types/v1alpha1/time.proto";
import "cmp/types/v1alpha1/price.proto";

// ### Transport Search Parameters
//
// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/transport/v1alpha1/search_parameters_types.proto.dot.xs.svg)
// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/transport/v1alpha1/search_parameters_types.proto.dot.svg)
message TransportSearchParameters {}
message TransportSearchParameters {
// Specify one or more type codes to be included in the search response
// Ex: "SF"
repeated string product_code = 1;

// Duration
// Specify the minimal and maximum duration of an activity to be included in the search response
cmp.types.v1alpha1.Time min_duration = 2;
cmp.types.v1alpha1.Time max_duration = 3;

// Pricerange
// Specify the minimum and maximum price of an activity to be included in the search response
cmp.types.v1alpha1.Price min_price = 4;
cmp.types.v1alpha1.Price max_price = 5;

// Brandcode
// Specify one or more brand codes or distribution channels for which assigned product is
// to be included in the search response
repeated string brand_code = 6;

// Maximum number of segments
// Specify the maximum number of segments a trip might be containing
// if only a direct flight, transfer or train journey the maximum number of segments is set to one.
int32 max_segments = 7;

// Travelling
// Specify the departure and/or arrival time of the trip
cmp.types.v1alpha1.Time travelling_min_departure_time = 8;
cmp.types.v1alpha1.Time travelling_max_departure_time = 9;
cmp.types.v1alpha1.Time travelling_min_arrival_time = 10;
cmp.types.v1alpha1.Time travelling_max_arrival_time = 11;

// Returning
// Specify the departure and/or arrival time of the trip
cmp.types.v1alpha1.Time returning_min_departure_time = 12;
cmp.types.v1alpha1.Time returning_max_departure_time = 13;
cmp.types.v1alpha1.Time returning_min_arrival_time = 14;
cmp.types.v1alpha1.Time returning_max_arrival_time = 15;

// using filters
// filters have a code, a type and a value.
// filters for business class, first class or economy flights can be set using filters and IATA codelist
// filters for private, shuttle, speedyshuttle can be based on GlobalTypes or OTA codelist
// filters for 1st or 2nd class train can be based UIC codes or OTA codelist
// filters can also be set for provider specific codes
// see filter.proto for more details
}
42 changes: 38 additions & 4 deletions proto/cmp/types/v1alpha1/filter.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,51 @@ package cmp.types.v1alpha1;
// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1alpha1/filter.proto.dot.xs.svg)
// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1alpha1/filter.proto.dot.svg)
message Filter {
// Filter code agreed between provider and distributor
// Filters can be based on a type of a specific code standard or codes agreed
// between provider and distributor in which case the type can be set to
// "provider"
//
//
// filters have a code, a type and a value. filters for business class, first
// class or economy flights can be set using filters and IATA codelist filters for
// private, shuttle, speedyshuttle can be based on GlobalTypes or OTA codelist
// filters for 1st or 2nd class train can be based UIC codes or OTA codelist
// filters can also be set for provider specific codes. However, that makes the
// implementation provider specific which undermines the "connect once, connect to
// many" replication idea
//
// FIXME: Should filters be standardized per vertical?
string filter_code = 1;

// Description of the filter code.
string filter_description = 2;

// A filter type can be set to for example "DRV GlobalTypes".
string filter_type = 3;
// A filter type can be set to for example "DRV GlobalTypes", "IATA codes", "UIC
// codes", "ACRISS codes".
FilterType filter_type = 3;

// Adding a filter value like for example "star_rating=5" or "row_number=1".
string filter_value = 4;
}

// Filter Type
enum FilterType {
FILTER_TYPE_UNSPECIFIED = 0;
// provider specific codes - discouraged to be used as this increases maintenance
// of APIs
FILTER_TYPE_PROVIDER_CODE = 1;
// DRV GlobalTypes https://globaltypecenter.com/
FILTER_TYPE_GLOBAL_TYPE = 2;
// International Air Transport Association https://www.iata.org/
FILTER_TYPE_IATA = 3;
// International Civil Aviation Organization, an agency of the UN
// https://www.icao.int/
FILTER_TYPE_ICAO = 4;
// rail standarization of the UIC https://uic.org/standardisation
FILTER_TYPE_UIC = 5;
// code standard for car classification codes https://www.acriss.org/
FILTER_TYPE_ACRISS = 6;
// well known standard https://www.iso.org/
FILTER_TYPE_ISO = 7;
// settlement services provider https://www.arccorp.com/
FILTER_TYPE_ARC = 8;
}
2 changes: 1 addition & 1 deletion proto/cmp/types/v1alpha1/language.proto
Original file line number Diff line number Diff line change
Expand Up @@ -196,4 +196,4 @@ enum Language {
LANGUAGE_YO = 181; // Yoruba
LANGUAGE_ZA = 182; // "Zhuang, Chuang"
LANGUAGE_ZU = 183; // Zulu
}
}
2 changes: 1 addition & 1 deletion proto/cmp/types/v1alpha1/price.proto
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ message PriceDetail {
message Price {
cmp.types.v1alpha1.Currency currency = 1;
float net = 2;
}
}
1 change: 1 addition & 0 deletions proto/cmp/types/v1alpha1/sorting.proto
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ enum SortingType {
SORTING_TYPE_POPULARITY = 2;
SORTING_TYPE_DISTANCE = 3;
SORTING_TYPE_RATING = 4;
SORTING_TYPE_EMISSION = 5;
}

// Sorting order
Expand Down
2 changes: 1 addition & 1 deletion proto/cmp/types/v1alpha1/time.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ package cmp.types.v1alpha1;
message Time {
int32 hours = 1;
int32 minutes = 2;
}
}

0 comments on commit 1bdb163

Please sign in to comment.