Skip to content

Commit

Permalink
introduce search query for transport
Browse files Browse the repository at this point in the history
  • Loading branch information
havan committed Jan 12, 2024
1 parent 99baeb4 commit e0277aa
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 46 deletions.
2 changes: 1 addition & 1 deletion proto/cmp/services/accommodation/v1alpha1/search.proto
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ message AccommodationSearchResponse {
repeated AccommodationSearchResult results = 3;
}

// ### Accommodation Search Service definition
// Service definition for Accommodation search
//
// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/accommodation/v1alpha1/search.proto.dot.xs.svg)
// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/accommodation/v1alpha1/search.proto.dot.svg)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ package cmp.services.accommodation.v1alpha1;

import "cmp/types/v1alpha1/location.proto";
import "cmp/types/v1alpha1/meal_plan.proto";
import "cmp/types/v1alpha1/rate.proto";
import "cmp/types/v1alpha1/product_code.proto";
import "cmp/types/v1alpha1/rate.proto";

// ### Accommodation Search Parameters
// This type is used in search requests for parameters like location, meal plan
// codes etc.
//
// ![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)
Expand Down Expand Up @@ -46,4 +47,4 @@ message AccommodationSearchParameters {
// Product code list
// Here a list of property codes would be used
repeated cmp.types.v1alpha1.ProductCode product_codes = 9;
}
}
6 changes: 3 additions & 3 deletions proto/cmp/services/accommodation/v1alpha1/unit_types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ import "cmp/types/v1alpha1/service_fact.proto";
import "cmp/types/v1alpha1/travel_period.proto";
import "cmp/types/v1alpha1/traveller.proto";

// ### Unit
//
// A Unit can represent a room in a hotel. One search option can have multiple units
// for multi-room requests Ex: one request for 2 rooms for 4 adults, 2 in each room.
//
// A unit can also be a different property in a multi-property request for holiday
// homes. Ex: 1 house for 4 persons and another house for 6 persons.
//
Expand Down Expand Up @@ -58,7 +57,8 @@ message Unit {
// Rate Rule
cmp.types.v1alpha1.RateRule rate_rule = 13;

// This is a list so that various policies can be expressed
// This is a list so that various policies can be expressed.
//
// Ex: 10-5 days before arrival x€, 4-1 days before arrival y€ and 0 days before
// arrival z€
repeated cmp.types.v1alpha1.CancelPolicy cancel_policies = 14;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ import "cmp/types/v1alpha1/location.proto";
import "cmp/types/v1alpha1/price.proto";
import "google/protobuf/timestamp.proto";

// ### Search option type for Activity Search Service
// This type represents a search result and is used in the `ActivitySearchResponse`
// message.
//
// This type represents a search result and is used in the
// `ActivitySearchResponse` message.
// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/activity/v1alpha1/search_option_types.proto.dot.xs.svg)
// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/activity/v1alpha1/search_option_types.proto.dot.svg)
message ActivitySearchResult {
Expand Down Expand Up @@ -115,7 +114,7 @@ message PickupDropoffEvent {
// Ex: "OTHERS / Parking Varadero(bus stop css nº50)",
string other_info = 4;

// Ex: "2023-07-15T09:05:00"
// Datetime of the pickup dropoff event as Unix timestamp
google.protobuf.Timestamp date_time = 5;
}

Expand Down
32 changes: 5 additions & 27 deletions proto/cmp/services/transport/v1alpha1/search.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@ 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_query_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";
import "cmp/types/v1alpha1/common.proto";
import "cmp/types/v1alpha1/search.proto";
import "cmp/types/v1alpha1/traveller.proto";

// ### Transport Search Request
message TransportSearchRequest {
Expand All @@ -34,36 +32,16 @@ message TransportSearchRequest {
// 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 = 6;
repeated ContentSourceType conten_source_types = 4;

// 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 = 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 = 8;
// Multiple search queries for this search request
repeated TransportSearchQuery queries = 5;

// Remarks
string remarks = 9;
Expand All @@ -88,7 +66,7 @@ message TransportSearchResponse {
repeated TransportSearchResult results = 4;
}

// ### Transport Search Service
// Transport Search Service definition.
//
// Takes `TransportSearchRequest` message type and returns `TransportSearchResponse`
// message type.
Expand Down
37 changes: 37 additions & 0 deletions proto/cmp/services/transport/v1alpha1/search_query_types.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
syntax = "proto3";

package cmp.services.transport.v1alpha1;

import "cmp/services/transport/v1alpha1/search_parameters_types.proto";
import "cmp/services/transport/v1alpha1/trip_types.proto";
import "cmp/types/v1alpha1/traveller.proto";

// Transport search query
//
// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/transport/v1alpha1/search_query_types.proto.dot.xs.svg)
// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/transport/v1alpha1/search_query_types.proto.dot.svg)
message TransportSearchQuery {
// ID
int32 query_id = 1;

// Transport specific search parameters
TransportSearchParameters search_parameters_transport = 4;

// Travellers
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 = 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 = 8;
}
10 changes: 5 additions & 5 deletions proto/cmp/services/transport/v1alpha1/search_result_types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import "cmp/types/v1alpha1/traveller.proto";

// Transport search result
//
// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/transport/v1alpha1/search_option_types.proto.dot.xs.svg)
// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/transport/v1alpha1/search_option_types.proto.dot.svg)
// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/transport/v1alpha1/search_result_types.proto.dot.xs.svg)
// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/transport/v1alpha1/search_result_types.proto.dot.svg)
message TransportSearchResult {
// Unique option ID for this search
int32 option_id = 1;
// Unique result ID
int32 result_id = 1;

// Offer ID.
//
Expand Down Expand Up @@ -60,4 +60,4 @@ message TransportSearchResult {

// Observations
string observations = 14;
}
}
4 changes: 1 addition & 3 deletions proto/cmp/services/transport/v1alpha1/trip_types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import "cmp/types/v1alpha1/price.proto";
import "cmp/types/v1alpha1/time.proto";
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)
Expand Down Expand Up @@ -95,7 +93,7 @@ message TripSegment {
// Max PAX
//
// Ex: `3`
int32 max_max = 13;
int32 max_pax = 13;

// Luggage
//
Expand Down

0 comments on commit e0277aa

Please sign in to comment.