Skip to content

Commit

Permalink
Transport list (#47)
Browse files Browse the repository at this point in the history
* adding transport product list service
---------

Co-authored-by: Ekrem Seren <[email protected]>
  • Loading branch information
mo-c4t and havan authored Oct 17, 2024
1 parent 4971984 commit 8736680
Show file tree
Hide file tree
Showing 13 changed files with 347 additions and 11 deletions.
2 changes: 1 addition & 1 deletion proto/cmp/services/accommodation/v1/search.proto
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ message AccommodationSearchRequest {
// 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 option responded. Included, compulsary and optional services can be
// bookable option responded. Included, compulsory and optional services can be
// included. A simple "free cancellation upto" can be set or full cancellation
// pilicies can be included.
message AccommodationSearchResponse {
Expand Down
2 changes: 1 addition & 1 deletion proto/cmp/services/accommodation/v2/search.proto
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ message AccommodationSearchRequest {
// 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 option responded. Included, compulsary and optional services can be
// bookable option responded. Included, compulsory and optional services can be
// included. A simple "free cancellation upto" can be set or full cancellation
// pilicies can be included.
message AccommodationSearchResponse {
Expand Down
2 changes: 1 addition & 1 deletion proto/cmp/services/insurance/v1/search.proto
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ message InsuranceSearchRequest {
// insurances 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 option responded. Included, compulsary and optional services can be
// bookable option responded. Included, compulsory and optional services can be
// included. A simple "free cancellation upto" can be set or full cancellation
// pilicies can be included.
message InsuranceSearchResponse {
Expand Down
37 changes: 37 additions & 0 deletions proto/cmp/services/transport/v1/list.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
syntax = "proto3";

package cmp.services.transport.v1;

import "cmp/services/transport/v3/trip_types.proto";
import "cmp/types/v1/common.proto";
import "google/protobuf/timestamp.proto";

message TransportProductListRequest {
// Message header
cmp.types.v1.RequestHeader header = 1;

// Only respond with the products that are modified after this timestamp
//
// Timestamps may be used for both off-chain and on-chain operations.
// For on-chain operations, only seconds are supported, and nanoseconds
// will be ignored.
google.protobuf.Timestamp modified_after = 2;
}

message TransportProductListResponse {
// Message header
cmp.types.v1.ResponseHeader header = 1;

// Product list: Trips
repeated cmp.services.transport.v3.TripBasic trips = 2;
}

// This service is used to get a product list for transportation.
//
// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/transport/v1/list.proto.dot.xs.svg)
//
// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/transport/v1/list.proto.dot.svg)
service TransportProductListService {
// Gets an optional `modified_after` date and returns a product list.
rpc TransportProductList(TransportProductListRequest) returns (TransportProductListResponse);
}
2 changes: 1 addition & 1 deletion proto/cmp/services/transport/v1/search.proto
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ message TransportSearchResponse {
// Search response metadata
cmp.types.v1.SearchResponseMetadata metadata = 2;

// Conten source types for this search request.
// Content source types for this search request.
//
// Ex: ContentSourceType.CONTENT_SOURCE_TYPE_GDS,
// ContentSourceType.CONTENT_SOURCE_TYPE_NDC
Expand Down
4 changes: 2 additions & 2 deletions proto/cmp/services/transport/v1/trip_types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ message TripSegment {
// Sub supplier code, replacing Operating carrier or identifying sub contracted
// services provided by other suppliers.
//
// DB could be selling an intenational train trip operated by the Dutch Nederlands
// DB could be selling an international train trip operated by the Dutch Nederlands
// Spoorwegen (NS) or the French SNCF. Holiday Taxis could be selling a transfer
// that is operated by Transunion.
string sub_supplier_code = 4;
Expand Down Expand Up @@ -92,7 +92,7 @@ message TripSegment {
// transfer: "Shuttle", "Private", "VIP Limosine", "Speedy Shuttle",...
string service_type_description = 10;

// Included, optional or compulsary services for this segment or leg. Just a code and
// Included, optional or compulsory services for this segment or leg. Just a code and
// description can be included if it is a package (seat, priority, large carry-on).
// or a price detail can be included for optionally pre-ordered meals for example.
repeated cmp.types.v1.ServiceFact services = 11;
Expand Down
2 changes: 1 addition & 1 deletion proto/cmp/services/transport/v2/search.proto
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ message TransportSearchResponse {
// Search response metadata
cmp.types.v2.SearchResponseMetadata metadata = 2;

// Conten source types for this search request.
// Content source types for this search request.
//
// Ex: ContentSourceType.CONTENT_SOURCE_TYPE_GDS,
// ContentSourceType.CONTENT_SOURCE_TYPE_NDC
Expand Down
4 changes: 2 additions & 2 deletions proto/cmp/services/transport/v2/trip_types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ message TripSegment {
// Sub supplier code, replacing Operating carrier or identifying sub contracted
// services provided by other suppliers.
//
// DB could be selling an intenational train trip operated by the Dutch Nederlands
// DB could be selling an international train trip operated by the Dutch Nederlands
// Spoorwegen (NS) or the French SNCF. Holiday Taxis could be selling a transfer
// that is operated by Transunion.
string sub_supplier_code = 4;
Expand Down Expand Up @@ -92,7 +92,7 @@ message TripSegment {
// transfer: "Shuttle", "Private", "VIP Limosine", "Speedy Shuttle",...
string service_type_description = 10;

// Included, optional or compulsary services for this segment or leg. Just a code and
// Included, optional or compulsory services for this segment or leg. Just a code and
// description can be included if it is a package (seat, priority, large carry-on).
// or a price detail can be included for optionally pre-ordered meals for example.
repeated cmp.types.v2.ServiceFact services = 11;
Expand Down
75 changes: 75 additions & 0 deletions proto/cmp/services/transport/v3/search.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
syntax = "proto3";

// ## Transport Service
//
// The Transport Service is used for flights, trains, and buses.
//
// Any search message response in the Camino Messenger Protocol only includes
// dynamic data. Static data can be cached and kept up to date with the Product List
// and Product Details messages.
//
// This package is a WIP.
package cmp.services.transport.v3;

import "cmp/services/transport/v2/search_query_types.proto";
import "cmp/services/transport/v3/search_result_types.proto";
import "cmp/types/v1/common.proto";
import "cmp/types/v1/content_source.proto";
import "cmp/types/v2/search.proto";
import "cmp/types/v2/traveller.proto";

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

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

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

// Multiple search queries for this search request
repeated cmp.services.transport.v2.TransportSearchQuery queries = 4;

// Remarks
string remarks = 5;
}

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

// Search response metadata
cmp.types.v2.SearchResponseMetadata metadata = 2;

// Content source types for this search request.
//
// Ex: ContentSourceType.CONTENT_SOURCE_TYPE_GDS,
// ContentSourceType.CONTENT_SOURCE_TYPE_NDC
// ContentSourceType.CONTENT_SOURCE_TYPE_3RD_PARTY
repeated cmp.types.v1.ContentSourceType content_source_types = 3;

// Transit search results
repeated cmp.services.transport.v3.TransportSearchResult results = 4;

// Global definition of the travellers for all results to be used via the traveller_id
repeated cmp.types.v2.BasicTraveller travellers = 5;
}

// Transport Search Service definition.
//
// Takes `TransportSearchRequest` message type and returns `TransportSearchResponse`
// message type.
//
// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/transport/v3/search.proto.dot.xs.svg)
//
// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/transport/v3/search.proto.dot.svg)
service TransportSearchService {
rpc TransportSearch(TransportSearchRequest) returns (TransportSearchResponse);
}
71 changes: 71 additions & 0 deletions proto/cmp/services/transport/v3/search_result_types.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
syntax = "proto3";

package cmp.services.transport.v3;

import "cmp/services/transport/v3/trip_types.proto";
import "cmp/types/v1/bookability.proto";
import "cmp/types/v1/datetime_range.proto";
import "cmp/types/v1/link.proto";
import "cmp/types/v1/rate.proto";
import "cmp/types/v2/cancel_policy.proto";
import "cmp/types/v2/change_policy.proto";
import "cmp/types/v2/price.proto";

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

// Query ID is the id of the query this result is generated for
int32 query_id = 2;

// Offer ID.
//
// Option to carry through an offer identifier for other stateful provider systems
// like NDC AirShopping RS
string offer_id = 3;

// Travellers
repeated int32 traveller_ids = 4;

// Travelling trip. A travelling trip can be repeated and will be in many cases 2
// trips: an outbound and returning trip from and to the same destination.
// However, it is very much possible to specify your trip around the world into
// several "Trips". For example AMS-NYC and after a couple of days NYC-IAH. There
// we rent a car and do a road trip to San Fransisco and we take a flight from SFO
// to SYD, where afer a couple of days we move on to Indonesia, Thailand, Japan,
// Türkiye and back to Amsterdam again.
repeated cmp.services.transport.v3.TripExtended travelling_trips = 5;

// Total Price
cmp.types.v2.PriceDetail total_price = 6;

// Rate Rules
repeated cmp.types.v1.RateRule rate_rules = 7;

// Links
repeated cmp.types.v1.Link links = 8;

// Status of the result, whether it is immediately bookable or not
cmp.types.v1.Bookability bookability = 9;

// Validity of the search option.
//
// `DateTimeRange` type with `start_date` and `end_date` in which the option can
// be booked. If the start_date is omitted, the offer can be booked until the
// end-date.
cmp.types.v1.DateTimeRange validity = 10;

// Cancel Policy
cmp.types.v2.CancelPolicy cancel_policy = 11;

// Change Policy
cmp.types.v2.ChangePolicy change_policy = 12;

// Observations
string observations = 13;
}
Loading

0 comments on commit 8736680

Please sign in to comment.