Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search specific parameters for each vertical #2

Merged
merged 3 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,53 @@ 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
havan marked this conversation as resolved.
Show resolved Hide resolved
//
// ![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"
havan marked this conversation as resolved.
Show resolved Hide resolved
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
havan marked this conversation as resolved.
Show resolved Hide resolved
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;

// 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 = 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
}
39 changes: 35 additions & 4 deletions proto/cmp/types/v1alpha1/filter.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,48 @@ 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;


havan marked this conversation as resolved.
Show resolved Hide resolved
}

// 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;
}
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