Skip to content

Commit

Permalink
Add specific search parameters for transport and activity
Browse files Browse the repository at this point in the history
  • Loading branch information
havan committed Dec 15, 2023
1 parent c408115 commit 25fdda4
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 34 deletions.
12 changes: 7 additions & 5 deletions proto/cmp/services/accommodation/v1alpha1/search.proto
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ import "cmp/types/v1alpha1/traveller.proto";
// Developers leveraging this message type should ensure proper validation and handling, especially considering fields
// that are still under review, like `speech_request`.
message AccommodationSearchRequest {
// Message Header. Contains api version, message info string and end-user wallet address
// Message header. Contains API version, message info string and end-user wallet address
cmp.types.v1alpha1.Header header = 1;

// Search request metadata
cmp.types.v1alpha1.SearchRequestMetadata metadata = 2;

// Generic Search Parameters
// Generic search parameters
// Ex: Inclusion of OnRequest options and inclusion of only the cheapest or all options.
cmp.types.v1alpha1.SearchParameters search_parameters_generic = 3;

// Accommodation Specific Search Parameters
// Accommodation specific search parameters
// Ex: Specific search parameters like geo location, meal plan, rate plan and rate rules.
AccommodationSearchParameters search_parameters_accommodation = 4;

Expand All @@ -57,11 +57,13 @@ message AccommodationSearchRequest {
// ### Accommodation Search Response
//
// The `Accommodation Search Response` message type facilitates the response for accommodations like hotel and holiday
// home searches within the platform. In the response a search_id must be included and a search_option_id for every bookable
// home searches within the platform.
//
// In the response a search_id must be included and a search_option_id for every bookable
// option responded. Included, compulsary and optional services can be included. A simple "free cancellation upto" can
// be set or full cancellation pilicies can be included.
message AccommodationSearchResponse {
// Message Header. Contains api version, message info string and end user wallet address.
// Message header. Contains API version, message info string and end user wallet address.
cmp.types.v1alpha1.Header header = 1;

// Search response metadata
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import "cmp/types/v1alpha1/location.proto";
import "cmp/types/v1alpha1/meal_plan.proto";
import "cmp/types/v1alpha1/rate.proto";

// ### Activity Search Parameters
//
// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/accommodation/v1alpha1/search_parameters_types.proto.dot.xs.svg)
// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/accommodation/v1alpha1/search_parameters_types.proto.dot.svg)
message AccommodationSearchParameters {
Expand Down
44 changes: 25 additions & 19 deletions proto/cmp/services/activity/v1alpha1/search.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ syntax = "proto3";
// This package is a **WIP**.
package cmp.services.activity.v1alpha1;

import "cmp/services/activity/v1alpha1/search_parameters_types.proto";
import "cmp/services/activity/v1alpha1/search_result_types.proto";
import "cmp/types/v1alpha1/common.proto";
import "cmp/types/v1alpha1/location.proto";
Expand All @@ -21,46 +22,51 @@ import "cmp/types/v1alpha1/traveller.proto";
//
// Search request for Activities
message ActivitySearchRequest {
// Message Header. Contains api version, message info string and end-user wallet address
// Message header. Contains API version, message info string and end-user wallet address
cmp.types.v1alpha1.Header header = 1;

// Search request metadata
cmp.types.v1alpha1.SearchRequestMetadata metadata = 2;

// Search parameters. Example: inclusion of OnRequest options and inclusion of only the cheapest or all options.
cmp.types.v1alpha1.SearchParameters search_parameters = 3;
// Generic search parameters
// Ex: Inclusion of OnRequest options and inclusion of only the cheapest or all options.
cmp.types.v1alpha1.SearchParameters search_parameters_generic = 3;

// Activiy specific search parameters
// Ex: ??
ActivitySearchParameters search_parameters_activity = 4;

// Travel period
cmp.types.v1alpha1.TravelPeriod travel_period = 4;
cmp.types.v1alpha1.TravelPeriod travel_period = 5;

// Travellers
repeated cmp.types.v1alpha1.Traveller travellers = 5;
repeated cmp.types.v1alpha1.Traveller travellers = 6;

// ### Source Location
//
// For search, set only one of the fields at once.
// Source location indicates the customer’s position at the start of the service. Typical value would be
// Source location indicates the customer’s position at the start of the service. Typical value would be
// the stay hotel or the touristic destination. The source location is needed for service and transfer
// availability, pickup location and pickup time calculation.
// availability, pickup location and pickup time calculation.
//
// This one of field enforces only one of the fields below. They all share memory,
// setting one will remove the others.
oneof source_location {
// The code and code type of a stay location the provider will be able to process
// Ex. GiataID
cmp.types.v1alpha1.LocationCodes source_location_codes = 6;
cmp.types.v1alpha1.LocationCodes source_location_codes = 7;

// Single geographic point represented by two double fields.
cmp.types.v1alpha1.Coordinate source_location_coordinate = 7;
cmp.types.v1alpha1.Coordinate source_location_coordinate = 8;

// Geo tree type, representted by Country, Region, and City_or_Resort.
cmp.types.v1alpha1.GeoTree source_location_geo_tree = 8;
cmp.types.v1alpha1.GeoTree source_location_geo_tree = 9;

// Geo circle. Represented by a coordinate and a distance for radius
cmp.types.v1alpha1.GeoCircle source_location_geo_circle = 9;
cmp.types.v1alpha1.GeoCircle source_location_geo_circle = 10;

// Geo polygon. Represented by a list of coordinate points.
cmp.types.v1alpha1.GeoPolygon source_location_geo_polygon = 10;
cmp.types.v1alpha1.GeoPolygon source_location_geo_polygon = 11;
}

// ### Service Location
Expand All @@ -72,27 +78,27 @@ message ActivitySearchRequest {
// This one of field enforces only one of the fields below. They all share memory,
// setting one will remove the others.
//
oneof service_location {
oneof service_location {
// The code and code type of a stay location the distributor will be able to process
// Ex. Google Place ID, Foursquare fsq_id, OpenStreetMap Ref, Here ID or any other agreed code type.
cmp.types.v1alpha1.LocationCodes service_location_codes = 11;
cmp.types.v1alpha1.LocationCodes service_location_codes = 12;

// Single geographic point represented by two double fields.
cmp.types.v1alpha1.Coordinate service_location_coordinate = 12;
cmp.types.v1alpha1.Coordinate service_location_coordinate = 13;

// Geo tree type, representted by Country, Region, and City_or_Resort.
cmp.types.v1alpha1.GeoTree service_location_geo_tree = 13;
cmp.types.v1alpha1.GeoTree service_location_geo_tree = 14;

// Geo circle. Represented by a coordinate and a distance for radius
cmp.types.v1alpha1.GeoCircle service_location_geo_circle = 14;
cmp.types.v1alpha1.GeoCircle service_location_geo_circle = 15;

// Geo polygon. Represented by a list of coordinate points.
cmp.types.v1alpha1.GeoPolygon service_location_geo_polygon = 15;
cmp.types.v1alpha1.GeoPolygon service_location_geo_polygon = 16;
}
}

message ActivitySearchResponse {
// Message Header. Contains api version, message info string and end user wallet address.
// Message header. Contains API version, message info string and end user wallet address.
cmp.types.v1alpha1.Header header = 1;

// Search response metadata
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
syntax = "proto3";

package cmp.services.activity.v1alpha1;

// ### Activity 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 {}
23 changes: 14 additions & 9 deletions proto/cmp/services/transport/v1alpha1/search.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ syntax = "proto3";
// This package is a WIP.
package cmp.services.transport.v1alpha1;

import "cmp/services/transport/v1alpha1/search_parameters_types.proto";
import "cmp/services/transport/v1alpha1/search_result_types.proto";
import "cmp/services/transport/v1alpha1/source_types.proto";
import "cmp/services/transport/v1alpha1/trip_types.proto";
Expand All @@ -20,43 +21,47 @@ import "cmp/types/v1alpha1/traveller.proto";

// ### Transport Search Request
message TransportSearchRequest {
// Message Header. Contains api version, message info string and end-user wallet address
// Message header. Contains API version, message info string and end-user wallet address
cmp.types.v1alpha1.Header header = 1;

// Search request metadata
cmp.types.v1alpha1.SearchRequestMetadata metadata = 2;

// Search parameters. Example: inclusion of OnRequest options and inclusion of only
// the cheapest or all options.
cmp.types.v1alpha1.SearchParameters search_parameters = 6;
// Generic search parameters
// Ex: Inclusion of OnRequest options and inclusion of only the cheapest or all options.
cmp.types.v1alpha1.SearchParameters search_parameters = 3;

// Transport specific search parameters
// Ex: ??
TransportSearchParameters search_parameters_transport = 4;

// Content source types for this search request to specify which sources to include
// Ex: ContentSourceType.CONTENT_SOURCE_TYPE_GDS, ContentSourceType.CONTENT_SOURCE_TYPE_NDC
// ContentSourceType.CONTENT_SOURCE_TYPE_3RD_PARTY
repeated ContentSourceType conten_source_types = 5;

// Travellers
repeated cmp.types.v1alpha1.Traveller travellers = 7;
repeated cmp.types.v1alpha1.Traveller travellers = 6;

// Travelling trip
// to avoid confusion of the direction of travel that occurs with terms like "inbound"
// and "outbound". The travelling trip is also used for "one way" in which case the
// returning trip is omitted. For tours or roadtrips, multiple requests with just a
// travelling trip for sequential dates can be submitted to specific suppliers of
// each part of tour or roadtrip.
Trip travelling_trip = 9;
Trip travelling_trip = 7;

// Returning trip
// In many cases our travel plans consist of going to a destination and return to
// the same place where we started
Trip returning_trip = 10;
Trip returning_trip = 8;

// Remarks
string remarks = 11;
string remarks = 9;
}

message TransportSearchResponse {
// Message Header. Contains api version, message info string and end-user wallet address
// Message header. Contains API version, message info string and end-user wallet address
cmp.types.v1alpha1.Header header = 1;

// Search response metadata
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
syntax = "proto3";

package cmp.services.transport.v1alpha1;

// ### 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 {}
3 changes: 2 additions & 1 deletion proto/cmp/services/transport/v1alpha1/source_types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ syntax = "proto3";
package cmp.services.transport.v1alpha1;

// ### Content Source Type message type
//
// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/transport/v1alpha1/source_types.proto.dot.xs.svg)
// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/transport/v1alpha1/source_types.proto.dot.svg)
enum ContentSourceType {
Expand All @@ -11,5 +12,5 @@ enum ContentSourceType {
CONTENT_SOURCE_TYPE_NDC = 2;
CONTENT_SOURCE_TYPE_OWN_PRODUCT = 3;
CONTENT_SOURCE_TYPE_DIRECT_CONTRACT = 4;
CONTENT_SOURCE_TYPE_3RD_PARTY = 5;
CONTENT_SOURCE_TYPE_3RD_PARTY = 5;
}
1 change: 1 addition & 0 deletions proto/cmp/services/transport/v1alpha1/trip_types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import "google/protobuf/timestamp.proto";

// ### Trip message type
// This message type represents a one way trip, either travelling or returning.
//
// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/transport/v1alpha1/trip_types.proto.dot.xs.svg)
// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/transport/v1alpha1/trip_types.proto.dot.svg)
message Trip {
Expand Down

0 comments on commit 25fdda4

Please sign in to comment.