diff --git a/proto/cmp/services/accommodation/v2/info.proto b/proto/cmp/services/accommodation/v2/info.proto new file mode 100644 index 00000000..65f5e010 --- /dev/null +++ b/proto/cmp/services/accommodation/v2/info.proto @@ -0,0 +1,40 @@ +syntax = "proto3"; + +package cmp.services.accommodation.v2; + +import "cmp/services/accommodation/v2/property_types.proto"; +import "cmp/types/v1/common.proto"; +import "cmp/types/v1/language.proto"; +import "cmp/types/v1/product_code.proto"; +import "google/protobuf/timestamp.proto"; + +message AccommodationProductInfoRequest { + // Message header + cmp.types.v1.RequestHeader header = 1; + + // Only respond with the products that are modified after this timestamp + google.protobuf.Timestamp modified_after = 2; + + // Languages + repeated cmp.types.v1.Language languages = 3; + + // Property codes + repeated cmp.types.v1.SupplierProductCode supplier_codes = 4; +} + +message AccommodationProductInfoResponse { + // Message header + cmp.types.v1.ResponseHeader header = 1; + + // Product list: Properties + repeated cmp.services.accommodation.v2.PropertyExtendedInfo properties = 2; +} + +// Accommodation product info service definition +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/accommodation/v1/info.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/accommodation/v1/info.proto.dot.svg) +service AccommodationProductInfoService { + // Returns product list for accommodation (properties) + rpc AccommodationProductInfo(AccommodationProductInfoRequest) returns (AccommodationProductInfoResponse); +} diff --git a/proto/cmp/services/accommodation/v2/list.proto b/proto/cmp/services/accommodation/v2/list.proto new file mode 100644 index 00000000..02bf2f4a --- /dev/null +++ b/proto/cmp/services/accommodation/v2/list.proto @@ -0,0 +1,32 @@ +syntax = "proto3"; + +package cmp.services.accommodation.v2; + +import "cmp/services/accommodation/v2/property_types.proto"; +import "cmp/types/v1/common.proto"; +import "google/protobuf/timestamp.proto"; + +message AccommodationProductListRequest { + // Message header + cmp.types.v1.RequestHeader header = 1; + + // Only respond with the products that are modified after this timestamp + google.protobuf.Timestamp modified_after = 2; +} + +message AccommodationProductListResponse { + // Message header + cmp.types.v1.ResponseHeader header = 1; + + // Product list: Properties + repeated cmp.services.accommodation.v2.Property properties = 2; +} + +// Accommodation product list service definition +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/accommodation/v1/list.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/accommodation/v1/list.proto.dot.svg) +service AccommodationProductListService { + // Returns product list for accommodation (properties) + rpc AccommodationProductList(AccommodationProductListRequest) returns (AccommodationProductListResponse); +} diff --git a/proto/cmp/services/accommodation/v2/property_types.proto b/proto/cmp/services/accommodation/v2/property_types.proto new file mode 100644 index 00000000..b7c93343 --- /dev/null +++ b/proto/cmp/services/accommodation/v2/property_types.proto @@ -0,0 +1,193 @@ +syntax = "proto3"; + +package cmp.services.accommodation.v2; + +import "cmp/types/v1/amenity.proto"; +import "cmp/types/v1/bed.proto"; +import "cmp/types/v1/contact_info.proto"; +import "cmp/types/v1/description.proto"; +import "cmp/types/v1/file.proto"; +import "cmp/types/v1/location.proto"; +import "cmp/types/v1/meal_plan.proto"; +import "cmp/types/v1/product_code.proto"; +import "cmp/types/v1/product_status.proto"; +import "cmp/types/v1/traveller.proto"; +import "cmp/types/v2/service_fact.proto"; +import "google/protobuf/timestamp.proto"; + +// Represents property info for an accommodation product +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/accommodation/v1/property_types.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/accommodation/v1/property_types.proto.dot.svg) +message Property { + // Ex: "2023-08-28T12:03:50", specifying when the static data of a product was + // last updated + google.protobuf.Timestamp last_modified = 1; + + // Supplier product Code + cmp.types.v1.SupplierProductCode supplier_code = 2; + + // Product code which can be of different types + repeated cmp.types.v1.ProductCode product_codes = 3; + + // Ex: "Beach Hotel Alanya" + string name = 4; + + // Ex: "Hilton" + string chain = 5; + + // Ex: CATEGORY_RATING_4_5 + cmp.services.accommodation.v2.CategoryRating category_rating = 6; + + // Ex: CATEGORY_UNIT_PALMS + cmp.services.accommodation.v2.CategoryUnit category_unit = 7; + + // Contact Info: phone, address, email, links + cmp.types.v1.ContactInfo contact_info = 8; + + // Location coordinate + cmp.types.v1.Coordinates coordinates = 9; + + // Status of the property + cmp.types.v1.ProductStatus status = 10; + + // Airports + // Ex: ["PMI", "ZRH", "AYT"] + repeated string airports = 11; +} + +enum CategoryRating { + CATEGORY_RATING_UNSPECIFIED = 0; + CATEGORY_RATING_0_5 = 1; + CATEGORY_RATING_1_0 = 2; + CATEGORY_RATING_1_5 = 3; + CATEGORY_RATING_2_0 = 4; + CATEGORY_RATING_2_5 = 5; + CATEGORY_RATING_3_0 = 6; + CATEGORY_RATING_3_5 = 7; + CATEGORY_RATING_4_0 = 8; + CATEGORY_RATING_4_5 = 9; + CATEGORY_RATING_5_0 = 10; + CATEGORY_RATING_5_5 = 11; + CATEGORY_RATING_6_0 = 12; + CATEGORY_RATING_6_5 = 13; + CATEGORY_RATING_7_0 = 14; + CATEGORY_RATING_7_5 = 15; + CATEGORY_RATING_8_0 = 16; + CATEGORY_RATING_8_5 = 17; + CATEGORY_RATING_9_0 = 18; + CATEGORY_RATING_9_5 = 19; + CATEGORY_RATING_10_0 = 20; +} + +enum CategoryUnit { + CATEGORY_UNIT_UNSPECIFIED = 0; + CATEGORY_UNIT_STARS = 1; + CATEGORY_UNIT_PALMS = 2; +} + +// This message type contains extended info about a property +message PropertyExtendedInfo { + // Property + cmp.services.accommodation.v2.Property property = 1; + + // Images + repeated cmp.types.v1.Image images = 2; + + // Videos + repeated cmp.types.v1.Video videos = 3; + + // Segmentation classification + repeated string classifications = 4; + + // Property descriptions + repeated cmp.types.v1.LocalizedDescriptionSet localized_descriptions = 5; + + // Room descriptions + repeated cmp.types.v1.LocalizedDescriptionSet localized_room_descriptions = 6; + + // Payment type. Ex: "MERCHANT" + string payment_type = 7; + + // Rooms + repeated cmp.services.accommodation.v2.Room rooms = 8; +} + +message Room { + // Room code of the unit in case of hotel. Ex: "RMSDDB0000". For holiday homes + // often no room codes are used. This code must explicitly match the supplier_room_code + // in the ProductList and the ProductInfo messages, so that the static data like room + // amenities, descriptions, images etc. can be married to the dynamic price and + // availability data for display to the end user. + string supplier_code = 1; + + // Room name. In case of hotel a standardized room name is often derrived from + // room code structures. Exmple: "superior seaview room". + // For holiday homes we expect names like "Master Bedroom", "Second Bedroom" or + // "Bathroom" when specific descriptions for each room are available. + string supplier_name = 2; + + // Original room name as assigned by the hotel. In case of spefifically designated room + // names by chains and both the chain and the customer wants to adhere to them. + // Ex: "CEIBA CLUB", "CEIBA GOVERNORS SUITE", "GOVERNORS SUITE" or "ENCLAVE NATURE VIEW" + // For holiday homes specific room names if availbale can be given. + string original_name = 3; + + repeated cmp.types.v1.Image images = 4; + repeated cmp.types.v1.Video videos = 5; + + // Room descriptions + repeated cmp.types.v1.LocalizedDescriptionSet descriptions = 6; + + // Meal plan (Board code) + repeated cmp.types.v1.MealPlan meal_plans = 7; + + // Beds + repeated cmp.types.v1.Bed beds = 8; + + // Occupancy + cmp.services.accommodation.v2.Occupancy total_occupancy = 9; + + // Services + repeated cmp.types.v2.ServiceFact services = 10; + + // Amenities + repeated cmp.types.v1.Amenity amenities = 11; +} + +message Occupancy { + // Min guests + int32 min_guests = 1; + + // Max guests + int32 max_guests = 2; + + // Standard occupancy + int32 standard_occupancy = 3; + + // Full payers + int32 full_payers = 4; + + // If infants are counted in total guests or not + bool infant_counted_in_total_guests = 5; + + // Occupancy options + repeated cmp.services.accommodation.v2.OccupancyOption occupancy_options = 6; +} + +message OccupancyOption { + // Guest type like adult, child, infant. + cmp.types.v1.TravellerType guest_type = 1; + + // Min guests + int32 min = 2; + + // Max guests + int32 max = 3; + + // Min age + int32 min_age = 4; + + // Max age + int32 max_age = 5; +} diff --git a/proto/cmp/services/accommodation/v2/search.proto b/proto/cmp/services/accommodation/v2/search.proto new file mode 100644 index 00000000..6981c8a7 --- /dev/null +++ b/proto/cmp/services/accommodation/v2/search.proto @@ -0,0 +1,122 @@ +syntax = "proto3"; + +// ## Accommodation Services +// +// The Accommodation services are used for both hotels and holiday homes, often +// called short term rentals. +// +// Any search message response in the Camino Messenger Protocol only includes +// dynamic data. Static data can be cached and kept up to data with the Product List +// and Product Details messages. +// +// This package is a **WIP**. +package cmp.services.accommodation.v2; + +import "cmp/services/accommodation/v2/search_query_types.proto"; +import "cmp/services/accommodation/v2/search_result_types.proto"; +import "cmp/types/v1/common.proto"; +import "cmp/types/v1/traveller.proto"; +import "cmp/types/v2/search.proto"; + +// The `Accommodation Search Request` message type facilitates the request for +// accommodations like hotel and holiday home searches within the platform. In the +// request the market, language and currency are specified at the top-level. +// +// In "queries" we specify the details of the trip like dates, properties or +// locations or filters. The purpose of such a structure is to allow for multi-room +// and multi-property search requests. +// +// For the response this means that there is no grouping of different +// room, mealplan or rateplan options in single room or single property searches. +// Each AccommodationSearchResult is one bookable option as a "result_id". +// +// Simple example: +// a search for 1 room for 2 adults would be just 1 query, with one travel period and +// one set of search parameters. The response has one query_id with many result_ids +// for various rooms, mealplans and rateplans in one hotel and depending on the search +// parameters, again for other hotels. Each property+room+rateplan+mealplan is one +// result_id with just one unit. +// +// The simple example is also applicable for holiday homes where one or multiple +// result_ids will be returned for various homes matching the query. The results will +// probably not include a mealplan and in general no room information as all rooms in +// the home are included. Flexible and non-refundable as well as packaging rateplans +// are already surfacing in some distribution channels. +// +// Multi room example: +// a search for 1 room for 2 adults in one query and another room for two adults and a +// child of 8 in another room in the same hotel or destination for the same dates in +// another query in the search request. This will lead to a search response with just +// one unit for eavery possible option available for each query_id, with many result_ids. +// +// The same concept is valid for multiple homes for more than one family travelling +// together to one park or destination. +// +// Road-trip or circuit example: +// a search for one or multiple rooms or homes in queries that have sequential dates +// and destinations. For example a trip to Las Vegas, a flight to New York and decending +// the atlantic coastline to New Orleans or Orlando by car with stops in various places. +// +// The hostel, convention or groups example: +// Often just 5 rooms for 10 peopleare requested or specific bed combinations like 5 +// single-use rooms (for 5 travellers) and 5 double rooms (10 travellers) are requested. +// In this case the number of rooms is specified and the total amount of travellers, +// but no distribution of travellers per room is detailed in the request. The reponse +// then hold multiple units for one search_id and result_id, so that if 5 rooms are +// requested, but only 2 standard rooms are available, the requested amount can be +// completed with a different room type (superior, seaview,..) +// +// In general, the number of available rooms should be considered to ensure that for +// requests with multiple rooms or homes, the same room or home is not offered twice +// to different travellers. +// +message AccommodationSearchRequest { + // 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. + // In the search parameters multiple filters can be applied for upfront filtering + // of the search results to for example to only include hotels that are less than + // one kilometer from the beach, have a kids club and offer an a la carte restaurant + cmp.types.v2.SearchParameters search_parameters_generic = 3; + + // This field represents a list of search queries that can be used to create + // multiroom multi location searches. + repeated cmp.services.accommodation.v2.AccommodationSearchQuery queries = 4; +} + +// 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 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. + cmp.types.v1.ResponseHeader header = 1; + + // Search response metadata + cmp.types.v2.SearchResponseMetadata metadata = 2; + + // Unique combinations of bookable search results, like property, + repeated cmp.services.accommodation.v2.AccommodationSearchResult results = 3; + + // Global definition of the travellers for all results to be used via the traveller_id each unit. + repeated cmp.types.v1.BasicTraveller travellers = 4; +} + +// Service definition for Accommodation search +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/accommodation/v1/search.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/accommodation/v1/search.proto.dot.svg) +service AccommodationSearchService { + // Accommodation Search method + rpc AccommodationSearch(AccommodationSearchRequest) returns (AccommodationSearchResponse); +} diff --git a/proto/cmp/services/accommodation/v2/search_query_types.proto b/proto/cmp/services/accommodation/v2/search_query_types.proto new file mode 100644 index 00000000..fbf1a505 --- /dev/null +++ b/proto/cmp/services/accommodation/v2/search_query_types.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; + +package cmp.services.accommodation.v2; + +import "cmp/services/accommodation/v1/search_parameters_types.proto"; +import "cmp/services/accommodation/v2/unit_types.proto"; +import "cmp/types/v1/travel_period.proto"; +import "cmp/types/v1/traveller.proto"; + +message AccommodationSearchQuery { + // Integer query ID, unique per search request + int32 query_id = 1; + + // Accommodation specific search parameters Ex: Specific search parameters like + // geo location, meal plan, rate plan and rate rules. + cmp.services.accommodation.v1.AccommodationSearchParameters search_parameters_accommodation = 2; + + // Travel period + cmp.types.v1.TravelPeriod travel_period = 3; + + // Travellers + repeated cmp.types.v1.BasicTraveller travellers = 4; + + // Total number of rooms / holiday homes + int32 unit_count = 5; + + // Type of the unit, like room or holiday home + cmp.services.accommodation.v2.UnitType unit_type = 6; +} diff --git a/proto/cmp/services/accommodation/v2/search_result_types.proto b/proto/cmp/services/accommodation/v2/search_result_types.proto new file mode 100644 index 00000000..d50214ec --- /dev/null +++ b/proto/cmp/services/accommodation/v2/search_result_types.proto @@ -0,0 +1,41 @@ +syntax = "proto3"; + +package cmp.services.accommodation.v2; + +import "cmp/services/accommodation/v2/unit_types.proto"; +import "cmp/types/v1/bookability.proto"; +import "cmp/types/v1/rate.proto"; +import "cmp/types/v2/cancel_policy.proto"; +import "cmp/types/v2/price.proto"; + +// This type represents a search result and is used in the +// `AccommodationSearchResponse` message. +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/accommodation/v1/search_result_types.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/accommodation/v1/search_result_types.proto.dot.svg) +message AccommodationSearchResult { + // ID for the search result. This is an increasing number starting at 0 and + // increasing by 1 for every search result. + int32 result_id = 1; + + // This field represents the query ID associated with the search result. + int32 query_id = 2; + + // Units for this search result + repeated cmp.services.accommodation.v2.Unit units = 3; + + // ## Total price in detail, with breakdowns + cmp.types.v2.PriceDetail total_price_detail = 4; + + // The RateRule specifies whether a search result is non-refundable or not + repeated cmp.types.v1.RateRule rate_rules = 5; + + // The cancellation conditions related to an option + cmp.types.v2.CancelPolicy cancel_policy = 6; + + // Freetext remarks without any functionality + string remarks = 7; + + // Status of the result, whether it is immediately bookable or not + cmp.types.v1.Bookability bookability = 8; +} diff --git a/proto/cmp/services/accommodation/v2/unit_types.proto b/proto/cmp/services/accommodation/v2/unit_types.proto new file mode 100644 index 00000000..1c1b40c0 --- /dev/null +++ b/proto/cmp/services/accommodation/v2/unit_types.proto @@ -0,0 +1,94 @@ +syntax = "proto3"; + +package cmp.services.accommodation.v2; + +import "cmp/types/v1/bed.proto"; +import "cmp/types/v1/meal_plan.proto"; +import "cmp/types/v1/product_code.proto"; +import "cmp/types/v1/rate.proto"; +import "cmp/types/v1/travel_period.proto"; +import "cmp/types/v2/cancel_policy.proto"; +import "cmp/types/v2/price.proto"; +import "cmp/types/v2/service_fact.proto"; + +// 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. +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/accommodation/v1/unit_types.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/accommodation/v1/unit_types.proto.dot.svg) +message Unit { + // Unit Type. Used to distinguish between hotel rooms and holiday homes. + // Ex: `UnitType.UNIT_TYPE_ROOM` + cmp.services.accommodation.v2.UnitType type = 1; + + // Room code of the unit in case of hotel. Ex: "RMSDDB0000". This code must explicitly + // match the supplier_room_code in the ProductList and the ProductInfo messages, so that + // the static data like room amenities, descriptions, images etc. can be married to the + // dynamic price and availability data for display to the end user. + string supplier_room_code = 2; + + // Room name. In case of enrichment additional name of the unit code. + // In theory, this field should never be included as it is already available in + // the static data. However, some providers prefer to be specific to avoid room + // mapping issues. Ex: "Double Standard Room" + string supplier_room_name = 3; + + // Original room name as assigned by the hotel. In case of spefifically designated room + // names by chains and both the chain and the customer wants to adhere to them. + // Ex: "CEIBA CLUB", "CEIBA GOVERNORS SUITE", "GOVERNORS SUITE" or "ENCLAVE NATURE VIEW" + string original_room_name = 4; + + // Travel period + cmp.types.v1.TravelPeriod travel_period = 5; + + // Traveller_id is a list of travellers related to this unit. The details can be found in + // the search response repeated travellers field + repeated int32 traveller_ids = 6; + + // Beds + repeated cmp.types.v1.Bed beds = 7; + + // Price in detail with breakdowns + cmp.types.v2.PriceDetail price_detail = 8; + + // Included, compulsory and optional services available + repeated cmp.types.v2.ServiceFact services = 9; + + // Mealplan code + cmp.types.v1.MealPlan meal_plan_code = 10; + + // Rate plan + cmp.types.v1.RatePlan rate_plan = 11; + + // Rate Rule + cmp.types.v1.RateRule rate_rule = 12; + + // 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.v2.CancelPolicy cancel_policies = 13; + + // Number of remaining units at the time of calculation + int32 remaining_units = 14; + + // Property code which can be of different types + cmp.types.v1.ProductCode property_code = 15; + + // Supplier Property code, consistent in ProductList, ProductInfo and Search + cmp.types.v1.SupplierProductCode supplier_code = 16; + + // Remarks + // Non structural aspects related to the unit a supplier wants to include in the search + // response + string remarks = 17; +} + +enum UnitType { + UNIT_TYPE_UNSPECIFIED = 0; + UNIT_TYPE_ROOM = 1; + UNIT_TYPE_HOLIDAY_HOME = 2; +} diff --git a/proto/cmp/services/activity/v2/search.proto b/proto/cmp/services/activity/v2/search.proto new file mode 100644 index 00000000..a984d8b7 --- /dev/null +++ b/proto/cmp/services/activity/v2/search.proto @@ -0,0 +1,158 @@ +syntax = "proto3"; + +// ### Activity Services +// +// The Activity services are used for both tickets and excursions. +// +// Any search message response in the Camino Messenger Protocol only includes +// dynamic data in the search, validate and mint process. Static data can be cached +// and kept up to date with the Product List and Product Details messages. +// +// Partners keep the list of activity products up-to-date on a daily basis, by +// getting changes since yesterday with the ActivityProductList service. The details +// of the updated activities are bing pulled using the ActivityProductInfo service. +// +// Once we have a traveller interested in an activity, the ActivitySearch service is +// used to obtain the pricing of relevant activities that are available. In this +// process there is no repeated exchange of static data to reduce the message size, +// reduce cost and increase processing speed. +// +// Similar to all other message types, the Activity service is constructed using the +// "Product", "Unit" and "Service" layers. For example the product is a Taylor Swift +// concert or a Disney World ticket. The unit then gives us a choice of the +// different options that are available, like for example a normal ticket or a VIP +// ticket. Finally we would have the services, which can be selected like do we go +// there by ourselves or is a transfer from our hotel included. This then would +// result to product=Disneyland, unit=VIP, service=TRFIncluded. +// +// It is of course impossible to offer a transfer from every hotel in Florida to +// Disney World. A supplier might have defined just the ticket, without transfer. And +// additionally a ticket with transfer from the 25 most popular hotels in the area. +// If the PickUp is not provided in the search request, the response should include +// an option without transfer and further options that include a transfer from +// several hotels that are close together and would cost the same for the ticket and +// transfer. +// +// The Activity search messages will be adapted to work with the SeatMap services, +// just like the Transport service. This package is **WIP**. +package cmp.services.activity.v2; + +import "cmp/services/activity/v2/search_parameters_types.proto"; +import "cmp/services/activity/v2/search_result_types.proto"; +import "cmp/types/v1/common.proto"; +import "cmp/types/v1/location.proto"; +import "cmp/types/v1/travel_period.proto"; +import "cmp/types/v1/traveller.proto"; +import "cmp/types/v2/search.proto"; + +// Search request for Activities +message ActivitySearchRequest { + // 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, inclusion of only the cheapest or all + // options, setting the market, language, currency, sorting and filters etc. + cmp.types.v2.SearchParameters search_parameters_generic = 3; + + // Activity specific search parameters + // + // Here we set for example a list of activity product codes that we want to search + // for, set min or mar duration or price. + cmp.services.activity.v2.ActivitySearchParameters search_parameters_activity = 4; + + // Travel period + cmp.types.v1.TravelPeriod travel_period = 5; + + // Travellers + repeated cmp.types.v1.BasicTraveller travellers = 6; + + // 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 the + // stay hotel or the touristic destination. The source location is needed for + // service and transfer availability, pickup location and pickup time calculation. + // Setting the source_location will reduce the list of options to the activities + // that can be serviced. In the example of Disney World and Orlando it will reduce + // the list substantially as the non-relevant pick-up points will not be included. + // + // 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.v1.LocationCodes source_location_codes = 7; + + // Single geographic point represented by two double fields. + cmp.types.v1.Coordinates source_location_coordinates = 8; + + // Geo tree type, represented by Country, Region, and City_or_Resort. + cmp.types.v1.GeoTree source_location_geo_tree = 9; + + // Geo circle. Represented by a coordinate and a distance for radius + cmp.types.v1.GeoCircle source_location_geo_circle = 10; + + // Geo polygon. Represented by a list of coordinate points. + cmp.types.v1.GeoPolygon source_location_geo_polygon = 11; + } + + // For search, set only one of the field at once. Service location specifies the + // areas involved in a ticket or excursion service. Service location indicates the + // area of the requested services. Typical value would be the region or resort. + // + // This one of field enforces only one of the fields below. They all share memory, + // setting one will remove the others. + 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.v1.LocationCodes service_location_codes = 12; + + // Single geographic point represented by two double fields. + cmp.types.v1.Coordinates service_location_coordinates = 13; + + // Geo tree type, represented by Country, Region, and City_or_Resort. + cmp.types.v1.GeoTree service_location_geo_tree = 14; + + // Geo circle. Represented by a coordinate and a distance for radius + cmp.types.v1.GeoCircle service_location_geo_circle = 15; + + // Geo polygon. Represented by a list of coordinate points. + cmp.types.v1.GeoPolygon service_location_geo_polygon = 16; + } +} + +message ActivitySearchResponse { + // Message header. Contains API version, message info string and end user wallet + // address. + cmp.types.v1.ResponseHeader header = 1; + + // Search response metadata + // + // The most important field is the search_id, which is a UUID that needs to be + // carried through to the validate request. + cmp.types.v2.SearchResponseMetadata metadata = 2; + + // Unique combinations of bookable search results, each identified by a result_id + // that needs to be carried through to the validate request. + repeated cmp.services.activity.v2.ActivitySearchResult results = 3; + + // The traveller_id is specified in each result and the ids are detailed with + // basic traveller data only once in the top-level search response to avoid + // repetition. + repeated cmp.types.v1.BasicTraveller travellers = 4; +} + +// Activity Search Service +// +// Takes `ActivitySearchRequest` message type and returns `ActivitySearchResponse` message type. +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/activity/v1/search.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/activity/v1/search.proto.dot.svg) +service ActivitySearchService { + rpc ActivitySearch(ActivitySearchRequest) returns (ActivitySearchResponse); +} diff --git a/proto/cmp/services/activity/v2/search_parameters_types.proto b/proto/cmp/services/activity/v2/search_parameters_types.proto new file mode 100644 index 00000000..338b7094 --- /dev/null +++ b/proto/cmp/services/activity/v2/search_parameters_types.proto @@ -0,0 +1,55 @@ +syntax = "proto3"; + +package cmp.services.activity.v2; + +import "cmp/types/v1/duration.proto"; +import "cmp/types/v1/language.proto"; +import "cmp/types/v1/product_code.proto"; +import "cmp/types/v2/price.proto"; + +// These are Activity specific search parameters +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/activity/v1/search_parameters_types.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/activity/v1/search_parameters_types.proto.dot.svg) +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.v1.Language spoken_languages = 1; + + // Specify one or more supplier codes to be included in the search response + // These must match the supplier codes provided in the ProductList and + // ProductInfo messages + repeated cmp.types.v1.SupplierProductCode supplier_codes = 2; + + // Specify one or more product codes to be included in the search response + // These can be of different types + repeated cmp.types.v1.ProductCode product_codes = 3; + + // Specify one or more unit IDs to be included in the search response + // The purpose of this concept is to allow for different activities for one product + // like "Windsurfing" and "Kitesurfing" under "Salou Playa Llarga". + // Code and description match the information provided in the ProductList and + // ProductInfo message. These are in general also supplier specific. + repeated string unit_codes = 4; + + // Specify one or more service codes to be included in the search response + // Several different packages could be included like "Windsurfing" with or without + // "Wetsuit". Code and description match the information provided in the ProductInfo message + // These are in general also supplier specific + repeated string service_codes = 5; + + // Duration + // + // Specify the minimal and maximum duration of an activity to be included in the + // search response + cmp.types.v1.Duration min_duration = 6; + cmp.types.v1.Duration max_duration = 7; + + // Price range + // + // Specify the minimum and maximum price of an activity to be included in the + // search response + cmp.types.v2.Price min_price = 8; + cmp.types.v2.Price max_price = 9; +} diff --git a/proto/cmp/services/activity/v2/search_result_types.proto b/proto/cmp/services/activity/v2/search_result_types.proto new file mode 100644 index 00000000..f7ae55ce --- /dev/null +++ b/proto/cmp/services/activity/v2/search_result_types.proto @@ -0,0 +1,44 @@ +syntax = "proto3"; + +package cmp.services.activity.v2; + +import "cmp/services/activity/v1/activity_types.proto"; +import "cmp/types/v1/datetime_range.proto"; +import "cmp/types/v1/price_type.proto"; +import "cmp/types/v2/price.proto"; + +// 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/v1/search_result_types.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/activity/v1/search_result_types.proto.dot.svg) +message ActivitySearchResult { + // Option ID for the search option. This is an increasing number starting at 0 and + // increasing by 1 for every search result. + int32 result_id = 1; + + // Activity basic info + cmp.services.activity.v1.Activity info = 2; + + // Schedule + cmp.types.v1.DateTimeRange schedule = 3; + + // Activity location + cmp.services.activity.v1.ActivityLocation location = 4; + + // Pickup Dropoff + repeated cmp.services.activity.v1.PickupDropoffEvent pickup_dropoff_events = 5; + + // Min participants + int32 min_participants = 6; + + // Max participants + int32 max_participants = 7; + + // Price with value and currency code + cmp.types.v2.Price price = 8; + + // Pricing type + // Ex: "PerPerson", "PerGroup" + cmp.types.v1.ChargeType charge_type = 9; +} diff --git a/proto/cmp/services/book/v2/mint.proto b/proto/cmp/services/book/v2/mint.proto new file mode 100644 index 00000000..1dd1c714 --- /dev/null +++ b/proto/cmp/services/book/v2/mint.proto @@ -0,0 +1,95 @@ +syntax = "proto3"; + +package cmp.services.book.v2; + +import "cmp/types/v1/common.proto"; +import "cmp/types/v1/language.proto"; +import "cmp/types/v1/payment.proto"; +import "cmp/types/v1/pubkey.proto"; +import "cmp/types/v1/traveller.proto"; +import "cmp/types/v1/uuid.proto"; +import "cmp/types/v2/price.proto"; +import "google/protobuf/timestamp.proto"; + +message MintRequest { + // Message header + cmp.types.v1.RequestHeader header = 1; + + // This must be a UUID according to RFC 4122 + cmp.types.v1.UUID validation_id = 2; + + string external_session_id = 3; + + cmp.types.v1.Language language = 4; + + string market = 5; + + string booking_reference = 6; + + repeated cmp.types.v1.ExtensiveTraveller travellers = 7; + + // The comments field is meant to pass noncommittal remarks entered by the + // end-consumer about the service reservation, like "non-smoking room please", + // "top floor room please". + string comment = 8; + + // Public keys that will be used to encrypt the private booking data + repeated cmp.types.v1.PublicKey public_keys = 9; + + // Buyer's address. Only this address should be allowed to buy the `BookingToken` + // on chain. + string buyer_address = 10; + + // This field is only relevant for off chain virtual credit card payments. + cmp.types.v1.AdditionalPaymentInfo additional_payment_info = 11; +} + +message MintResponse { + // Message header + cmp.types.v1.ResponseHeader header = 1; + + // This must be a UUID according to RFC 4122 + cmp.types.v1.UUID mint_id = 2; + + // This must be a UUID according to RFC 4122 + cmp.types.v1.UUID validation_id = 3; + + string provider_booking_reference = 4; + + // Timestamp of the booking in the inventory system of the supplier. + google.protobuf.Timestamp provider_booking_timestamp = 5; + + // Price of the `BookingToken`. This field is meant to be populated by the + // supplier plugin and used by the supplier bot while minting the `BookingToken`. + cmp.types.v2.Price price = 6; + + // ID of the token that represents the booking of the service. This will be + // populated by the supplier bot after the `BookingToken` is minted on chain. + uint64 booking_token_id = 7; + + // URI of the token that represents the booking of the service. This should be + // populated by the Supplier partner plugin. It is up to the supplier to decide + // what kind of storage (IPFS, HTTP, ...) to use here. + string booking_token_uri = 8; + + // Mint transaction ID that will be populated by the supplier bot after the + // `BookingToken` is minted on chain. + string mint_transaction_id = 9; + + // On chain booking token should be only buyable until this timestamp and should + // expire after that. + google.protobuf.Timestamp buyable_until = 10; + + // Transaction ID of the buy operation. This field is populated by the distributor + // (buyer) bot after the buy operation and passed to the distributor middleware + // (partner plugin) in the mint response. + // + // This field is not meant for the supplier. + string buy_transaction_id = 11; +} + +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/book/v1/mint.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/book/v1/mint.proto.dot.svg) +service MintService { + rpc Mint(MintRequest) returns (MintResponse); +} diff --git a/proto/cmp/services/book/v2/validate.proto b/proto/cmp/services/book/v2/validate.proto new file mode 100644 index 00000000..aaa6283d --- /dev/null +++ b/proto/cmp/services/book/v2/validate.proto @@ -0,0 +1,52 @@ +syntax = "proto3"; + +package cmp.services.book.v2; + +import "cmp/types/v1/common.proto"; +import "cmp/types/v1/seat_map.proto"; +import "cmp/types/v1/uuid.proto"; +import "cmp/types/v2/price.proto"; +import "cmp/types/v2/search.proto"; + +message ValidationRequest { + // Message header + cmp.types.v1.RequestHeader header = 1; + + // Validation object + cmp.services.book.v2.ValidationObject validation_object = 2; +} + +message ValidationResponse { + // Message header + cmp.types.v1.ResponseHeader header = 1; + + // Unique validation ID. This must be a UUID according to RFC 4122 + cmp.types.v1.UUID validation_id = 2; + + // Validation object + cmp.services.book.v2.ValidationObject validation_object = 3; + + // Price details for the validated product + cmp.types.v2.PriceDetail price_detail = 4; +} + +// Validation message that represents a single `result_id` from the search results +// message and also the optional `unit_identifier` for specific services that +// requires it. For example a seat for a concert. +message ValidationObject { + // Search result identifier with `search_id` & `result_id` + cmp.types.v2.SearchIdentifier search_identifier = 1; + + // Unit identifier that is used to describe selected units from the `result_id`. + // For example: seats for a concert. + oneof unit_identifier { + // Selected seat(s) represented as a seat map inventory message type. + cmp.types.v1.SeatMapInventory seat_selection = 2; + } +} + +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/book/v1/validate.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/book/v1/validate.proto.dot.svg) +service ValidationService { + rpc Validation(ValidationRequest) returns (ValidationResponse); +} diff --git a/proto/cmp/services/partner/v2/partner_configuration.proto b/proto/cmp/services/partner/v2/partner_configuration.proto new file mode 100644 index 00000000..964e4eae --- /dev/null +++ b/proto/cmp/services/partner/v2/partner_configuration.proto @@ -0,0 +1,46 @@ +syntax = "proto3"; + +package cmp.services.partner.v2; + +import "cmp/types/v2/partner.proto"; + +// Partner Configuration message type +// +// This message type represents the partner configuration on T-Chain (not +// implemented yet) +message PartnerConfiguration { + // List of partners from the on-chain Partner Configuration + repeated cmp.types.v2.Partner partners = 1; +} + +message GetPartnerConfigurationRequest { + // Only respond with updated partners after this block height. + int32 block_height = 2; + + // Partner wallet addresses. Response is returned with only partners that have + // these addresses. + repeated string partner_addresses = 3; +} + +message GetPartnerConfigurationResponse { + // Partner configuration + cmp.services.partner.v2.PartnerConfiguration partner_configuration = 1; + + // Current block height. Distributors can keep this info for later reference. + int32 current_block_height = 2; +} + +// Get Partner Configuration Service +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/partner/v1/partner_configuration.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/partner/v1/partner_configuration.proto.dot.svg) +service GetPartnerConfigurationService { + // #### GetPartnerConfiguration + // + // Takes `GetPartnerConfigurationRequest` which contains optional block height and + // partner wallet addresses and returns `GetPartnerConfigurationResponse` which + // contains the current block height and the`PartnerConfiguration` for the given + // addresses (if any, returns all if none is provided) and only if the data is + // changed after the provided block height. + rpc GetPartnerConfiguration(GetPartnerConfigurationRequest) returns (GetPartnerConfigurationResponse); +} diff --git a/proto/cmp/services/seat_map/v2/availability.proto b/proto/cmp/services/seat_map/v2/availability.proto new file mode 100644 index 00000000..036df60a --- /dev/null +++ b/proto/cmp/services/seat_map/v2/availability.proto @@ -0,0 +1,59 @@ +syntax = "proto3"; + +package cmp.services.seat_map.v2; + +import "cmp/types/v1/common.proto"; +import "cmp/types/v1/seat_map.proto"; +import "cmp/types/v2/search.proto"; + +// Request for seat map availability data +// +// Requests the seat map availability data for a given map ID +message SeatMapAvailabilityRequest { + // Message header + // + // Header contains information about the request + cmp.types.v1.RequestHeader header = 1; + + // Required. The identifier of the seat map. + oneof identifier { + // Mint Identifier + // + // Example: For flights which book before seat selection. In this case, the + // buyer already have a `mint_id` because the service is already booked (minted + // on-chain). + string mint_id = 2; + + // Search result identifier with `search_id` & `result_id` + // + // Example: For requesting seat availability for search results. In this case, + // booking has not happended yet. + cmp.types.v2.SearchIdentifier search_identifier = 3; + } +} + +// Response for seat map availability request +// +// Contains the seat map availability data for a given map ID +message SeatMapAvailabilityResponse { + // Message header + // + // Header contains information about the response + cmp.types.v1.ResponseHeader header = 1; + + // Required. Seat map availability data. + cmp.types.v1.SeatMapInventory seat_map = 2; +} + +// Service for requesting seat map availability data +// +// Service is used to request the seat map availability data for a given map ID +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/seat_map/v1/availability.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/seat_map/v1/availability.proto.dot.svg) +service SeatMapAvailabilityService { + // Get seat map availability data + // + // Requests the seat map availability data for a given map ID + rpc SeatMapAvailability(SeatMapAvailabilityRequest) returns (SeatMapAvailabilityResponse); +} diff --git a/proto/cmp/services/transport/v2/search.proto b/proto/cmp/services/transport/v2/search.proto new file mode 100644 index 00000000..3d74efc7 --- /dev/null +++ b/proto/cmp/services/transport/v2/search.proto @@ -0,0 +1,74 @@ +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 data with the Product List +// and Product Details messages. +// +// This package is a WIP. +package cmp.services.transport.v2; + +import "cmp/services/transport/v2/search_query_types.proto"; +import "cmp/services/transport/v2/search_result_types.proto"; +import "cmp/types/v1/common.proto"; +import "cmp/types/v1/content_source.proto"; +import "cmp/types/v1/traveller.proto"; +import "cmp/types/v2/search.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; + + // Conten 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 conten_source_types = 3; + + // Transit search results + repeated cmp.services.transport.v2.TransportSearchResult results = 4; + + // Global definition of the travellers for all results to be used via the traveller_id + repeated cmp.types.v1.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/v1/search.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/transport/v1/search.proto.dot.svg) +service TransportSearchService { + rpc TransportSearch(TransportSearchRequest) returns (TransportSearchResponse); +} diff --git a/proto/cmp/services/transport/v2/search_parameters_types.proto b/proto/cmp/services/transport/v2/search_parameters_types.proto new file mode 100644 index 00000000..37da9981 --- /dev/null +++ b/proto/cmp/services/transport/v2/search_parameters_types.proto @@ -0,0 +1,56 @@ +syntax = "proto3"; + +package cmp.services.transport.v2; + +import "cmp/types/v1/duration.proto"; +import "cmp/types/v1/product_code.proto"; +import "cmp/types/v1/time.proto"; +import "cmp/types/v2/price.proto"; + +// Transport Search Parameters +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/transport/v1/search_parameters_types.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/transport/v1/search_parameters_types.proto.dot.svg) +message TransportSearchParameters { + // Specify one or more type codes to be included in the search response + // Ex: code "EW" number "1234" of the type "IATA" + repeated cmp.types.v1.ProductCode product_codes = 1; + + // Specify one or more supplier codes to be included in the search response + // These must match the supplier codes provided in the ProductList and + // ProductInfo messages + repeated cmp.types.v1.SupplierProductCode supplier_code_codes = 2; + + // The minimum duration of a transport to be included in the search response + cmp.types.v1.Duration min_duration = 3; + + // The maximum duration of a transport to be included in the search response + cmp.types.v1.Duration max_duration = 4; + + // The minimum price of a transport to be included in the search response + cmp.types.v2.Price min_price = 5; + + // The maximum price of a transport to be included in the search response + cmp.types.v2.Price max_price = 6; + + // One or more brand codes or distribution channels for which assigned product is + // to be included in the search response + repeated string brand_codes = 7; + + // 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 = 8; + + // Minimum departure time of the trip + cmp.types.v1.Time trip_min_departure_time = 9; + + // Maximum departure time of the trip + cmp.types.v1.Time trip_max_departure_time = 10; + + // Minimum arrival time of the trip + cmp.types.v1.Time trip_min_arrival_time = 11; + + // Maximum arrival time of the trip + cmp.types.v1.Time trip_max_arrival_time = 12; +} diff --git a/proto/cmp/services/transport/v2/search_query_types.proto b/proto/cmp/services/transport/v2/search_query_types.proto new file mode 100644 index 00000000..59c38a31 --- /dev/null +++ b/proto/cmp/services/transport/v2/search_query_types.proto @@ -0,0 +1,54 @@ +syntax = "proto3"; + +package cmp.services.transport.v2; + +import "cmp/services/transport/v2/search_parameters_types.proto"; +import "cmp/types/v1/date.proto"; +import "cmp/types/v1/location.proto"; +import "cmp/types/v1/traveller.proto"; + +// Transport search query. Multiple trips can be send, each representing multi-leg +// journey. +// +// Ex: +// - 1 trip in trips : One way journey from PMI to BCN. +// - 2 trips in trips: Roundtrip journey from PMI to BCN and then BCN to PMI. +// - 3 trips in trips: PMI->BCN + BCN->BER + BER->PMI (1 two legged flight (connection) and 1 direct (return) flight) +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/transport/v1/search_query_types.proto.dot.xs.svg) +// [Open Message +// Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/transport/v1/search_query_types.proto.dot.svg) +message TransportSearchQuery { + // ID + int32 query_id = 1; + + // Global definition of the travellers for all requests to be used via the traveller_id + repeated cmp.types.v1.BasicTraveller travellers = 2; + + // Trips + repeated cmp.services.transport.v2.QueryTrip trips = 3; +} + +// Version of `Trip` object in `trip_types.prot` for search request's queries. It +// contains only departure and arrival objects, lacking the segments field. +message QueryTrip { + // Departure event + cmp.services.transport.v2.QueryTransitEvent departure = 1; + + // Arrival event + cmp.services.transport.v2.QueryTransitEvent arrival = 2; + + // Transport specific search parameters + cmp.services.transport.v2.TransportSearchParameters search_parameters_transport = 3; +} + +// Represents a departure or arrival event for search request's query. This type is +// different from `TransitEvent` in `trip_types.proto` by having a `date` object +// instead of a `datetime` object. +message QueryTransitEvent { + // Date time of the event + cmp.types.v1.Date date = 1; + + // Event location + cmp.types.v1.LocationCode location_code = 2; +} diff --git a/proto/cmp/services/transport/v2/search_result_types.proto b/proto/cmp/services/transport/v2/search_result_types.proto new file mode 100644 index 00000000..efb70a96 --- /dev/null +++ b/proto/cmp/services/transport/v2/search_result_types.proto @@ -0,0 +1,70 @@ +syntax = "proto3"; + +package cmp.services.transport.v2; + +import "cmp/services/transport/v2/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/v1/search_result_types.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/transport/v1/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.v2.Trip 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; +} diff --git a/proto/cmp/services/transport/v2/trip_types.proto b/proto/cmp/services/transport/v2/trip_types.proto new file mode 100644 index 00000000..79c2ee6c --- /dev/null +++ b/proto/cmp/services/transport/v2/trip_types.proto @@ -0,0 +1,126 @@ +syntax = "proto3"; + +package cmp.services.transport.v2; + +import "cmp/types/v1/baggage.proto"; +import "cmp/types/v1/duration.proto"; +import "cmp/types/v1/location.proto"; +import "cmp/types/v1/measurement.proto"; +import "cmp/types/v1/product_code.proto"; +import "cmp/types/v2/price.proto"; +import "cmp/types/v2/service_fact.proto"; +import "google/protobuf/timestamp.proto"; + +// 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/v1/trip_types.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/transport/v1/trip_types.proto.dot.svg) +message Trip { + // Departure and Arrival dates and times can be derrived from the first and last segments + // Trip segments are the legs offered + repeated cmp.services.transport.v2.TripSegment segments = 1; +} + +// Represents a departure or arrival event +message TransitEvent { + // Date time of the event + google.protobuf.Timestamp date_time = 1; + + // Event location + cmp.types.v1.LocationCode location_code = 2; +} + +// A segment of a trip +message TripSegment { + // Segment ID + // Ex: "SEG1234" + string segment_id = 1; + + // Provider Code Ex: "EW" for Eurowings in case of a flight. DB for Deutsche Bahn + // in case of train. HT for Holiday Taxi or MTS for MTS in case of a transfer. + string provider_code = 2; + + // Retailer Code, replacing Marketing carrier The example would be where Iberia is + // selling an Iberia Express flight. So in this example the retailer_code for + // Iberia would be "IB" and the provider_code for Iberia Express would be "I2". + // Similar "interline" or "code share" operation may exist in rail and transfer. + string retailer_code = 3; + + // 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 + // Spoorwegen (NS) or the French SNCF. Holiday Taxis could be selling a transfer + // that is operated by Transunion. + string sub_supplier_code = 4; + + // Product Code and Number + // + // For flights we use the IATA or ICAO airline code in the code field and the + // flight number in the number field. + // + // For train some operators use a combination of a code and a number like + // Eurostar, but others just use a code or a number (SNCF). + // + // Transfers are often identified by just a product code servicing an area. + cmp.types.v1.ProductCode product_code = 5; + + // Supplier specific code, matching the supplier code in ProductList and ProductInfo + // messages + cmp.types.v1.SupplierProductCode supplier_code = 6; + + // Departure + cmp.services.transport.v2.TransitEvent departure = 7; + + // Arrival + cmp.services.transport.v2.TransitEvent arrival = 8; + + // Flights, trains and transfers often offer different service types + // for a product. Think about economy or business for flights, first and second + // class on trains and a shared shuttle or a private transfer. + // + // Service type code examples: + // flight: "Y", "J", "F". + // train: "1st", "2nd" or "S", "C", "P" + // transfer: "S", "P", "VIP", "SS" + string service_type_code = 9; + + // Service type description examples: + // flight: "Economy Class", "Business Class", "First Class" + // train: "First Class", "Second Class" or "standard", "comfort", and "premium",.. + // 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 + // 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; + + // Segment duration in minutes + cmp.types.v1.Duration segment_duration = 12; + + // Segment Distance + // + // Ex: `Length(value=15, unit=LengthUnit.DISTANCE_UNIT_KILOMETERS)` + cmp.types.v1.Length segment_distance = 13; + + // Min PAX + // + // Ex: `1` + int32 min_pax = 14; + + // Max PAX + // + // Ex: `3` + int32 max_pax = 15; + + // Luggage + // + // Ex: `3` + cmp.types.v1.Baggage baggage = 16; + + // Price + // + // Ex: `Price(net=240, currency=Currency.CURRENCY_EUR) + cmp.types.v2.Price price = 17; +} diff --git a/proto/cmp/types/v2/cancel_policy.proto b/proto/cmp/types/v2/cancel_policy.proto new file mode 100644 index 00000000..ebe3962c --- /dev/null +++ b/proto/cmp/types/v2/cancel_policy.proto @@ -0,0 +1,57 @@ +syntax = "proto3"; + +package cmp.types.v2; + +import "cmp/types/v1/datetime_range.proto"; +import "cmp/types/v2/price.proto"; +import "google/protobuf/timestamp.proto"; + +// Cancellation Policy: The cancellation policy section consists of 3 options: +// +// - A simple boolean for refundable or non-refundable options +// - A "free cancellation upto" DateTime +// - Complete cancellation policies with from/to DateTime stamps +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1/cancel_policy.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1/cancel_policy.proto.dot.svg) +message CancelPolicy { + // the search result is refundable or not (at least one cancellation penalty exists + // that provides a (partial) refund) + bool refundable = 1; + + // The "free cancellation upto" identifier specifies the exact DateTime upto when + // this booking can be cancelled free of charge. + google.protobuf.Timestamp free_cancellation_upto = 2; + + // Full cancellation policies can be complex and extensive. Inclusion in search + // messages should be avoided because they substantially increase the message size + // for each option and in general detailed cancellation information is required at + // a later step in the booking flow. + // + // Specify several date ranges with their penalties relative to the start + // date-time of the service. When in the inventory system several entries with + // different hours before specified, like for example 10€ from 240 hours (10 days) + // before consumption, 50€ from 5 days before consumption and 100€ from 24 hours + // before consumption, they must be computed to one uniform format of date ranges + // and penalties, related to the start DateTime of the service or product + // delivery. + repeated cmp.types.v2.CancelPenalty cancel_penalties = 3; +} + +// Cancellation Penalty +message CancelPenalty { + // When this penalty is valid. Either use the start and end date of the DateTime + // range + cmp.types.v1.DateTimeRange datetime_range = 1; + + // Penalty value. Percentages of the selling price are purposely not allowed for + // simplicity and uniformity. + cmp.types.v2.Price value = 2; + + // Description of the penalty in a non computable manner. The Description should + // be in the language that is specified in the request. + string description = 3; + + // For which rateplan the penalty is valid. + repeated string valid_for_rate_plans = 4; +} diff --git a/proto/cmp/types/v2/change_policy.proto b/proto/cmp/types/v2/change_policy.proto new file mode 100644 index 00000000..ad5eeef9 --- /dev/null +++ b/proto/cmp/types/v2/change_policy.proto @@ -0,0 +1,60 @@ +syntax = "proto3"; + +package cmp.types.v2; + +import "cmp/types/v1/datetime_range.proto"; +import "cmp/types/v2/price.proto"; +import "google/protobuf/timestamp.proto"; + +// Change Policy: The change policy section consists of 3 options: +// +// - A simple boolean for changable or non-changable search results +// - A "free change upto" DateTime for a search result +// - Multiple change types with start/end DateTime stamps for a search result +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1/change_policy.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1/change_policy.proto.dot.svg) +message ChangePolicy { + // the search result is changeable or not (at least one change type exists) + bool change_allowed = 1; + + // The "free change upto" identifier specifies the exact DateTime upto when + // this search result can be changed free of charge. + google.protobuf.Timestamp free_change_upto = 2; + + // Full change policies can be complex and extensive. Inclusion in search + // messages should be avoided because they substantially increase the message size + // for each option and in general detailed cancellation information is required at + // a later step in the booking flow. + // + // Specify several change types with their change fee relative to the start + // date-time of the service. When in the inventory system several entries with + // different hours before specified, like for example 10€ from 240 hours (10 days) + // before consumption, 50€ from 5 days before consumption and 100€ from 24 hours + // before consumption, they must be computed to one uniform format of date ranges + // and fees, related to the start DateTime of the service or product + // delivery. + repeated cmp.types.v2.ChangeType change_types = 3; +} + +// ChangeTypes +// TODO: Add documentation +message ChangeType { + // Change type code + string code = 1; + + // When this change type and date is valid. Either use the start and end date of + // the DateTime range + cmp.types.v1.DateTimeRange datetime_range = 2; + + // change fee. Percentages of the selling price are purposely not allowed for + // simplicity and uniformity. + cmp.types.v2.Price value = 3; + + // Description of the change in a non computable manner. The Description should be + // in the language that is specified in the request. + string description = 4; + + // For which rateplan the policy is valid. + repeated string valid_for_rate_plans = 5; +} diff --git a/proto/cmp/types/v2/currency.proto b/proto/cmp/types/v2/currency.proto new file mode 100644 index 00000000..201c1e3e --- /dev/null +++ b/proto/cmp/types/v2/currency.proto @@ -0,0 +1,185 @@ +syntax = "proto3"; + +package cmp.types.v2; + +import "cmp/types/v2/token.proto"; +import "google/protobuf/empty.proto"; + +// See extensive explanation at Price in price.proto +message Currency { + oneof currency { + cmp.types.v2.IsoCurrency iso_currency = 1; + + cmp.types.v2.TokenCurrency token_currency = 2; + + google.protobuf.Empty native_token = 3; + } +} + +// Currency list of ISO 4217 standard +// +// First 20 currencies are the most traded currencies in the world. This is done to +// optimize the size of the protobuf message size. +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1/currency.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1/currency.proto.dot.svg) +enum IsoCurrency { + ISO_CURRENCY_UNSPECIFIED = 0; // Placeholder or unspecified currency + + ISO_CURRENCY_AUD = 1; // Australian dollar + ISO_CURRENCY_BRL = 2; // Brazilian real + ISO_CURRENCY_CAD = 3; // Canadian dollar + ISO_CURRENCY_CHF = 4; // Swiss franc + ISO_CURRENCY_CNY = 5; // Renminbi (China) + ISO_CURRENCY_EUR = 6; // Euro + ISO_CURRENCY_GBP = 7; // British pound + ISO_CURRENCY_HKD = 8; // Hong Kong dollar + ISO_CURRENCY_IDR = 9; // Indonesian rupiah + ISO_CURRENCY_INR = 10; // Indian rupee + ISO_CURRENCY_JPY = 11; // Japanese yen + ISO_CURRENCY_KRW = 12; // South Korean won + ISO_CURRENCY_MXN = 13; // Mexican peso + ISO_CURRENCY_NOK = 14; // Norwegian krone + ISO_CURRENCY_RUB = 15; // Russian ruble + ISO_CURRENCY_SAR = 16; // Saudi riyal + ISO_CURRENCY_SEK = 17; // Swedish krona + ISO_CURRENCY_SGD = 18; // Singapore dollar + ISO_CURRENCY_TRY = 19; // Turkish lira + ISO_CURRENCY_USD = 20; // United States dollar + + ISO_CURRENCY_AED = 21; // United Arab Emirates dirham + ISO_CURRENCY_AFN = 22; // Afghan afghani + ISO_CURRENCY_ALL = 23; // Albanian lek + ISO_CURRENCY_AMD = 24; // Armenian dram + ISO_CURRENCY_ANG = 25; // Netherlands Antillean guilder + ISO_CURRENCY_AOA = 26; // Angolan kwanza + ISO_CURRENCY_ARS = 27; // Argentine peso + ISO_CURRENCY_AWG = 28; // Aruban florin + ISO_CURRENCY_AZN = 29; // Azerbaijani manat + ISO_CURRENCY_BAM = 30; // Bosnia and Herzegovina convertible mark + ISO_CURRENCY_BBD = 31; // Barbados dollar + ISO_CURRENCY_BDT = 32; // Bangladeshi taka + ISO_CURRENCY_BGN = 33; // Bulgarian lev + ISO_CURRENCY_BHD = 34; // Bahraini dinar + ISO_CURRENCY_BIF = 35; // Burundian franc + ISO_CURRENCY_BMD = 36; // Bermudian dollar + ISO_CURRENCY_BND = 37; // Brunei dollar + ISO_CURRENCY_BOB = 38; // Bolivian boliviano + ISO_CURRENCY_BSD = 39; // Bahamian dollar + ISO_CURRENCY_BTN = 40; // Bhutanese ngultrum + ISO_CURRENCY_BWP = 41; // Botswana pula + ISO_CURRENCY_BYN = 42; // Belarusian ruble + ISO_CURRENCY_BZD = 43; // Belize dollar + ISO_CURRENCY_CDF = 44; // Congolese franc + ISO_CURRENCY_CLP = 45; // Chilean peso + ISO_CURRENCY_COP = 46; // Colombian peso + ISO_CURRENCY_CRC = 47; // Costa Rican colón + ISO_CURRENCY_CUC = 48; // Cuban convertible peso + ISO_CURRENCY_CUP = 49; // Cuban peso + ISO_CURRENCY_CVE = 50; // Cape Verdean escudo + ISO_CURRENCY_CZK = 51; // Czech koruna + ISO_CURRENCY_DJF = 52; // Djiboutian franc + ISO_CURRENCY_DKK = 53; // Danish krone + ISO_CURRENCY_DOP = 54; // Dominican peso + ISO_CURRENCY_DZD = 55; // Algerian dinar + ISO_CURRENCY_EGP = 56; // Egyptian pound + ISO_CURRENCY_ERN = 57; // Eritrean nakfa + ISO_CURRENCY_ETB = 58; // Ethiopian birr + ISO_CURRENCY_FJD = 59; // Fijian dollar + ISO_CURRENCY_FKP = 60; // Falkland Islands pound + ISO_CURRENCY_GEL = 61; // Georgian lari + ISO_CURRENCY_GHS = 62; // Ghanaian cedi + ISO_CURRENCY_GIP = 63; // Gibraltar pound + ISO_CURRENCY_GMD = 64; // Gambian dalasi + ISO_CURRENCY_GNF = 65; // Guinean franc + ISO_CURRENCY_GTQ = 66; // Guatemalan quetzal + ISO_CURRENCY_GYD = 67; // Guyanese dollar + ISO_CURRENCY_HNL = 68; // Honduran lempira + ISO_CURRENCY_HRK = 69; // Croatian kuna + ISO_CURRENCY_HTG = 70; // Haitian gourde + ISO_CURRENCY_HUF = 71; // Hungarian forint + ISO_CURRENCY_ILS = 72; // Israeli new shekel + ISO_CURRENCY_IQD = 73; // Iraqi dinar + ISO_CURRENCY_IRR = 74; // Iranian rial + ISO_CURRENCY_ISK = 75; // Icelandic króna + ISO_CURRENCY_JMD = 76; // Jamaican dollar + ISO_CURRENCY_JOD = 77; // Jordanian dinar + ISO_CURRENCY_KES = 78; // Kenyan shilling + ISO_CURRENCY_KGS = 79; // Kyrgyzstani som + ISO_CURRENCY_KHR = 80; // Cambodian riel + ISO_CURRENCY_KMF = 81; // Comoro franc + ISO_CURRENCY_KPW = 82; // North Korean won + ISO_CURRENCY_KWD = 83; // Kuwaiti dinar + ISO_CURRENCY_KYD = 84; // Cayman Islands dollar + ISO_CURRENCY_KZT = 85; // Kazakhstani tenge + ISO_CURRENCY_LAK = 86; // Lao kip + ISO_CURRENCY_LBP = 87; // Lebanese pound + ISO_CURRENCY_LKR = 88; // Sri Lanka rupee + ISO_CURRENCY_LRD = 89; // Liberian dollar + ISO_CURRENCY_LSL = 90; // Lesotho loti + ISO_CURRENCY_LYD = 91; // Libyan dinar + ISO_CURRENCY_MAD = 92; // Moroccan dirham + ISO_CURRENCY_MDL = 93; // Moldovan leu + ISO_CURRENCY_MGA = 94; // Malagasy ariary + ISO_CURRENCY_MKD = 95; // Macedonian denar + ISO_CURRENCY_MMK = 96; // Myanmar kyat + ISO_CURRENCY_MNT = 97; // Mongolian tögrög + ISO_CURRENCY_MOP = 98; // Macanese pataca + ISO_CURRENCY_MRU = 99; // Mauritanian ouguiya + ISO_CURRENCY_MUR = 100; // Mauritian rupee + ISO_CURRENCY_MVR = 101; // Maldivian rufiyaa + ISO_CURRENCY_MWK = 102; // Malawian kwacha + ISO_CURRENCY_MYR = 103; // Malaysian ringgit + ISO_CURRENCY_MZN = 104; // Mozambican metical + ISO_CURRENCY_NAD = 105; // Namibian dollar + ISO_CURRENCY_NGN = 106; // Nigerian naira + ISO_CURRENCY_NIO = 107; // Nicaraguan córdoba + ISO_CURRENCY_NPR = 108; // Nepalese rupee + ISO_CURRENCY_NZD = 109; // New Zealand dollar + ISO_CURRENCY_OMR = 110; // Omani rial + ISO_CURRENCY_PAB = 111; // Panamanian balboa + ISO_CURRENCY_PEN = 112; // Peruvian sol + ISO_CURRENCY_PGK = 113; // Papua New Guinean kina + ISO_CURRENCY_PHP = 114; // Philippine peso + ISO_CURRENCY_PKR = 115; // Pakistani rupee + ISO_CURRENCY_PLN = 116; // Polish złoty + ISO_CURRENCY_PYG = 117; // Paraguayan guaraní + ISO_CURRENCY_QAR = 118; // Qatari riyal + ISO_CURRENCY_RON = 119; // Romanian leu + ISO_CURRENCY_RSD = 120; // Serbian dinar + ISO_CURRENCY_RWF = 121; // Rwandan franc + ISO_CURRENCY_SBD = 122; // Solomon Islands dollar + ISO_CURRENCY_SCR = 123; // Seychellois rupee + ISO_CURRENCY_SDG = 124; // Sudanese pound + ISO_CURRENCY_SHP = 125; // Saint Helena pound + ISO_CURRENCY_SLL = 126; // Sierra Leonean leone + ISO_CURRENCY_SOS = 127; // Somali shilling + ISO_CURRENCY_SRD = 128; // Surinamese dollar + ISO_CURRENCY_SSP = 129; // South Sudanese pound + ISO_CURRENCY_STN = 130; // São Tomé and Príncipe dobra + ISO_CURRENCY_SVC = 131; // Salvadoran colón + ISO_CURRENCY_SYP = 132; // Syrian pound + ISO_CURRENCY_SZL = 133; // Swazi lilangeni + ISO_CURRENCY_THB = 134; // Thai baht + ISO_CURRENCY_TJS = 135; // Tajikistani somoni + ISO_CURRENCY_TMT = 136; // Turkmenistan manat + ISO_CURRENCY_TND = 137; // Tunisian dinar + ISO_CURRENCY_TOP = 138; // Tongan paʻanga + ISO_CURRENCY_TTD = 139; // Trinidad and Tobago dollar + ISO_CURRENCY_TWD = 140; // New Taiwan dollar + ISO_CURRENCY_TZS = 141; // Tanzanian shilling + ISO_CURRENCY_UAH = 142; // Ukrainian hryvnia + ISO_CURRENCY_UGX = 143; // Ugandan shilling + ISO_CURRENCY_UYU = 144; // Uruguayan peso + ISO_CURRENCY_UZS = 145; // Uzbekistani soʻm + ISO_CURRENCY_VND = 146; // Vietnamese đồng + ISO_CURRENCY_VUV = 147; // Vanuatu vatu + ISO_CURRENCY_WST = 148; // Samoan tālā + ISO_CURRENCY_XAF = 149; // Central African CFA franc + ISO_CURRENCY_XCD = 150; // East Caribbean dollar + ISO_CURRENCY_XOF = 151; // West African CFA franc + ISO_CURRENCY_XPF = 152; // CFP franc + ISO_CURRENCY_YER = 153; // Yemeni rial + ISO_CURRENCY_ZAR = 154; // South African rand + ISO_CURRENCY_ZMW = 155; // Zambian kwacha +} diff --git a/proto/cmp/types/v2/partner.proto b/proto/cmp/types/v2/partner.proto new file mode 100644 index 00000000..74d7b2af --- /dev/null +++ b/proto/cmp/types/v2/partner.proto @@ -0,0 +1,157 @@ +syntax = "proto3"; + +package cmp.types.v2; + +import "cmp/types/v1/wallet.proto"; +import "cmp/types/v2/token.proto"; + +// ### Partner message type +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1/partner.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1/partner.proto.dot.svg) +message Partner { + // Short name of the partner. Ex: Chain4Travel + string short_name = 1; + + // Legal name of the partner. Ex: Chain4Travel AG + string legal_name = 2; + + // Business description + string business_description = 3; + + // Domain for the partner + // + // Ex: chain4travel.com + // + // Provider should create two DNS records for their address to verify they own + // the `partner_wallet_address` below. Two records should be for public key and + // the corresponding address. + // + // Example DNS TXT Records: + // `@ IN TXT "camino-t-addr=T-camino1tdkgjhfjq8z4glnvu8davxvdm66jx55tfr6qnz" TTL 3600` + // `@ IN TXT "camino-pubkey=043134d4b70236e59f99ae9e6ed9d1d512bacfa83506c9371ff4e372b7837844d82b1c56d81d04a23e25b18ff3f7eb531a5ef17df3bf5730b29e13f854a65b4651" TTL 3600` + // + // FIXME: Need review here! + string domain = 4; + + // Supported tokens for payment (on-chain). If a TokenCurrency is specified, this + // then means that on-chain payment is supported. + repeated cmp.types.v2.TokenCurrency on_chain_currencies = 5; + + // Off chain payment support + bool off_chain_payment_supported = 6; + + // Supported services + repeated cmp.types.v2.PartnerService services = 7; + + // Partner addresses of the messenger bots + repeated cmp.types.v1.WalletAddress addresses = 8; + + // Partner's consortium member wallet address. This address should be the one who + // creates the entry in Partner Configuration on the chain. + cmp.types.v1.WalletAddress partner_wallet_address = 9; +} + +// Partner Service +// +// Message representing a service sold by a partner. +message PartnerService { + // Name of the service. + // + // FIXME: Should we include package name also here? If not, how should the bot + // supposed to find the message? If yes, package name also includes the version + // which means partner will need to update supported services with every new + // version. + // + // Ex: "cmp.services.accommodation.v1.AccommodationSearchService" + string service_name = 1; + + // Response of the service. + // + // Ex: "cmp.services.accommodation.v1.AccommodationSearchResponse" + // + // FIXME: Do we need this? One can check the service definition and see the + // response message type. + string response_name = 2; + + // Result field + // + // Ex: "options" representing the field at + // "cmp.services.accommodation.v1.AccommodationSearchResponse.options" which + // is a SearchOption type + string result_field = 3; + + // Result Type. + // + // Ex: ResultType.RESULT_TYPE_DISCRETE + cmp.types.v2.ResultType result_type = 4; + + // Default bundled price for the service + cmp.types.v2.BundledPrice bundled_price = 5; + + // Exclusive bundled prices for specific addresses. + // + // This field should be a serialized proto message of `CustomBundledPrice` type. + // The field's scalar type is `bytes` on purpose, so it can be encrypted if it's + // desired. + repeated bytes custom_bundled_prices = 6; +} + +// Custom Bundle Price +// +// This message encapsulates `BundledPrice` message to be used for a custom price +// per buyer. If it's required, this message can be encrypted before adding it to +// the `PartnerService` message type. +message CustomBundledPrice { + // Address of the wallet that the bundled price below is valid for. + string address = 1; + + // Bundled price that is exclusive to the wallet address above. + cmp.types.v2.BundledPrice bundled_price = 2; +} + +// Bundled Price +// +// Message representing a bundled price of a service. +message BundledPrice { + // Bundle size. + // + // Example for a chat bot: 1 + // + // Example for SearchOptions: 100 + int32 results_per_bundle = 1; + + // Bundle Unit, represents the bundle's unit. For example for search results it + // should be `BundleUnit.BUNDLE_UNIT_COUNT` or for AI Chat bot results it can be + // `BundleUnit.BUNDLE_UNIT_BYTES` or `BundleUnit.BUNDLE_UNIT_KILOBYTES` + cmp.types.v2.BundleUnit results_per_bundle_unit = 2; + + // Price per bundle, in nCAMs + // + // Ex: 100 + int64 price_per_bundle = 3; +} + +// Bundle unit message type +enum BundleUnit { + BUNDLE_UNIT_UNSPECIFIED = 0; + BUNDLE_UNIT_COUNT = 1; + BUNDLE_UNIT_BYTES = 2; + BUNDLE_UNIT_KILOBYTES = 3; + BUNDLE_UNIT_MEGABYTES = 4; + // BUNDLE_UNIT_CHARACTERS = 5; // Characters, words?? +} + +enum ResultType { + RESULT_TYPE_UNSPECIFIED = 0; + + // Objects countable with integers, like the SearchOption of an + // `AccommodationSearchResponse` + RESULT_TYPE_DISCRETE = 1; + + // Continous data types like strings. + // + // Ex: A response from a chat bot can be 100 chars long or 20000 chars long. Or in + // bytes or kilobytes for some binary data. + RESULT_TYPE_NON_DISCRETE = 2; +} diff --git a/proto/cmp/types/v2/price.proto b/proto/cmp/types/v2/price.proto new file mode 100644 index 00000000..9b5d4597 --- /dev/null +++ b/proto/cmp/types/v2/price.proto @@ -0,0 +1,83 @@ +syntax = "proto3"; + +package cmp.types.v2; + +import "cmp/types/v1/price_type.proto"; +import "cmp/types/v2/currency.proto"; + +// ### PriceDetail +// +// This message consists of the value as a Price object and additional fields as +// binding, concept, and breakdown. +// +// Breakdown is a recursively inherited object of PriceDetail. This way complex +// pricing structures can be represented. +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1/price.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1/price.proto.dot.svg) +message PriceDetail { + // Principle price element + cmp.types.v2.Price price = 1; + + // Identification whether the price must be respected towards the end-user + // and the product or service cannot be offered for a lower price. + bool binding = 2; + + // Description of the product or service this price(element) is valid for. + string description = 3; + + // If not specified, the default of the boolean is false which means it is + // included in the price. If set to True, it means that this PriceDetail is only + // payable locally. For example local tourism tax that you pay at the reception of + // a hotel. Intended to be used in the breakdown. + bool locally_payable = 4; + + // Type of price breakdown. This is meant to be used in price breakdown + // definitions, when we want to specify the different elements of how a total + // price was computed. + cmp.types.v1.PriceBreakdownType type = 5; + + // We can use a single PriceDetail to represent a price breakdown. + repeated cmp.types.v2.PriceDetail breakdowns = 6; +} + +// ### Simple Price type message Price +// +// Value of the price, this should be an integer converted to string. +// +// This field is a string intentionally. Because the currency can be a crypto +// currency, we need a reliable way to represent big integers as most of the crypto +// currencies have 18 decimals precision. +// +// Definition of the price message: The combination of "value" and "decimals" fields +// express always the value of the currency, not of the fraction of the currency [ +// ETH not wei, CAM and not aCAM, BTC and not Satoshi, EUR not EUR-Cents ] Be aware +// that partners should not do rounding with crypto currencies. +// +// Example implementations: off-chain payment of 100 € or 100 $: value=10000 +// decimals=2 iso_currency=EUR or USD +// +// On-chain payment of 100.65 EURSH value=10065 decimals=2 contract_address=0x... +// this currency has 5 decimals on Columbus and conclusively to create the +// transaction value, 10065 must be divided by 10^2 = 100.65 EURSH and created in +// its smallest fraction by multiplying 100.65 EURSH * 10^5 => 10065000 (example +// conversion to bigint without losing accuracy: bigint(10065) * 10^(5-2)) +// +// On-chain payment of 0.0065 BTC value=65 decimals=4 contract_address=0x... Using +// the contract address, we get the decimals decimals and the currency name or +// abbreviation: 8 decimals & WBTC Because we see 4 decimals specified in the +// message we divide 65 by 10^4 == 0.0065 WBTC (for showing in the front-end UIs) +// +// This currency has 8 decimals on-chain and conclusively to use the value of +// 0.0065 for on-chain operations must be converted to big integer as bigint(65) * +// 10^(8-4) == 650000 +// +// On-chain payment of 1 nCAM value=1 decimals=9 this currency has denominator 18 on +// Columbus and conclusively to mint the value of 1 nCam must be divided by 10^9 = +// 0.000000001 CAM and minted in its smallest fraction by multiplying 0.000000001 * +// 10^18 => 1000000000 aCAM +message Price { + string value = 1; + int32 decimals = 2; + cmp.types.v2.Currency currency = 3; +} diff --git a/proto/cmp/types/v2/search.proto b/proto/cmp/types/v2/search.proto new file mode 100644 index 00000000..ce12b9cb --- /dev/null +++ b/proto/cmp/types/v2/search.proto @@ -0,0 +1,115 @@ +syntax = "proto3"; + +package cmp.types.v2; + +import "cmp/types/v1/content_source.proto"; +import "cmp/types/v1/country.proto"; +import "cmp/types/v1/filter.proto"; +import "cmp/types/v1/language.proto"; +import "cmp/types/v1/sorting.proto"; +import "cmp/types/v1/uuid.proto"; +import "cmp/types/v2/currency.proto"; + +// Search parameters for the search requests +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1/search.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1/search.proto.dot.svg) +message SearchParameters { + // Requested currency in which prices have to be supplied in the response + // according to ISO 4217 Currency codes + cmp.types.v2.Currency currency = 1; + + // Requested language setting for descriptions in the response according to ISO + // 639-1 Language codes + cmp.types.v1.Language language = 2; + + // Request generated for a specific market according to ISO 3166-1 Country codes + cmp.types.v1.Country market = 3; + + // Request generated for a specific brand or point-of-sale by one distributor + // Specify one or more brand codes or distribution channels for which assigned + // product is to be included in the search response + repeated string brand_codes = 4; + + // Include OnRequest options in the response or only immediately bookable options + bool include_on_request = 5; + + // Only show the cheapest option for one product, or include all possible + // combinations + bool include_combinations = 6; + + // Limit the maximum number of options included in the response + int32 max_options = 7; + + // Specify the sorting required in the response + cmp.types.v1.Sorting sorting = 8; + + // Filters for the search. Various provider and product specific filters can be + // provided here in agreed name/value pairs. + repeated cmp.types.v1.Filter filters = 9; + + // Free-text field to provide more detials for better offer personalization. This + // field can be provided in combination with a Geo location or as stand-alone. + // If speech is provided as a recording for better offer personalization, then + // the recording has to be processed to text. + // This field can be provided in combination with a Geo location + // or as stand-alone. + string search_description_text = 10; + + // 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 cmp.types.v1.ContentSourceType content_source_types = 11; +} + +// This message type is used in every search request to contain the request metadata +message SearchRequestMetadata { + // Request unique identifier + cmp.types.v1.UUID request_id = 1; + + // An identifier for external sessions, aiding in tracking and continuity across + // sessions. + string external_session_id = 2; +} + +// This message type is used in every search response to contain the response metadata +message SearchResponseMetadata { + // Search_id to be used in the Validation Request. This must be a UUID according + // to RFC 4122 + cmp.types.v1.UUID search_id = 1; + + // Context for Inventory system concepts that need to be included in a search response, + // like an OwnerCode, PTC_OfferParameters, Tax codes, Disclosure RefID, etc. or a + // serialized combination of these codes. + string context = 2; + + // Errors encountered in the generation of the response. Standardized error list + // to be created. + repeated string errors = 3; + + // Warnings encountered in the generation of the response. This section might include + // information about fields not processed due to incompatibilities with the + // inventory system + repeated string warnings = 4; + + // Supplier code from the Inventory System for this search response. + string supplier_code = 5; + + // An identifier for external sessions, aiding in tracking and continuity across + // sessions. + string external_session_id = 6; +} + +// Search identifier +message SearchIdentifier { + // Search ID that is returned in the search response message in the `metadata`` + // (`SearchResponseMetadata`) field. + cmp.types.v1.UUID search_id = 1; + + // Result ID that is that is returned by `result_id` field of the search result + // messages, for example: `AccommodationSearchResult`. + int32 result_id = 2; +} diff --git a/proto/cmp/types/v2/service_fact.proto b/proto/cmp/types/v2/service_fact.proto new file mode 100644 index 00000000..15877bd3 --- /dev/null +++ b/proto/cmp/types/v2/service_fact.proto @@ -0,0 +1,75 @@ +syntax = "proto3"; + +package cmp.types.v2; + +import "cmp/types/v2/price.proto"; + +// Service fact message type +// Service facts are smaller services that are included, can be booked optionally +// or must be booked together with a main product or service. For example on Christmas +// eve a gala dinner is included in the stay. Or an early check-in can be booked when +// travellers have an early flight. Or cleaning cost must be included for every booking +// of a holiday home. +// +// It is important that these optional, included or compulsary services are simple. For +// complex combinations like a hotel with a rent-a-car or a skipass or ski lessons, packages +// should be used so that each service can be described properly and a choice of what car, +// which ski pass and what level of ski class that be properly selected. +// +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1/service_fact.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1/service_fact.proto.dot.svg) +message ServiceFact { + // A code for the specific service, when a service is optional, this code is + // referenced in the validate request, so that the optional service will be added + // to the booking. + string code = 1; + + // A description of the service like "business class", "shuttle transfer", "early + // check-in" etc. + string description = 2; + + // the price and price breakdown of the service + cmp.types.v2.PriceDetail price_detail = 3; + + // whether the service is included, optional or compulsory. When a price is + // mentioned and the service is included, then the price of the service is already + // included in the total price of this option and it is better to omit the + // price_detail field. In case of an optional or compulsory service, the service + // must be specifically be booked and the price is added to the total price. + cmp.types.v2.ServiceAvailabilityType availability_type = 4; + + // The ChargeBasisType specifies whether this service is only charged once for the + // whole booking, for each participant, for each room or flight etc, for each day + // or for a combination of these concepts like for example "foreign distilleries + // per participant per day" or just once in case of a massage, but you would be + // able to order 3 of them in the booking. + cmp.types.v2.ChargeBasisType charge_basis = 5; + + // We can use a single ServiceFact to express just one service. But many services + // are actually a combination of several services, like the typical + // priority boarding, which also allows for a larger carry-on bag. + repeated cmp.types.v2.ServiceFact details = 6; + + // the count of the number of services. In case the service requires specification + // of the number or frequency of the products that will be included. For example + // "bouquet of roses, qty=24" or "baggage qty=2". + int32 quantity = 7; +} + +enum ServiceAvailabilityType { + SERVICE_AVAILABILITY_TYPE_UNSPECIFIED = 0; + SERVICE_AVAILABILITY_TYPE_INCLUDED = 1; + SERVICE_AVAILABILITY_TYPE_COMPULSORY = 2; + SERVICE_AVAILABILITY_TYPE_OPTIONAL = 3; +} + +enum ChargeBasisType { + CHARGE_BASIS_TYPE_UNSPECIFIED = 0; + CHARGE_BASIS_TYPE_PER_PAX = 1; + CHARGE_BASIS_TYPE_PER_PAX_PER_DAY = 2; + CHARGE_BASIS_TYPE_PER_UNIT = 3; + CHARGE_BASIS_TYPE_PER_UNIT_PER_DAY = 4; + CHARGE_BASIS_TYPE_PER_DAY = 5; + CHARGE_BASIS_TYPE_ONCE = 6; +} diff --git a/proto/cmp/types/v2/token.proto b/proto/cmp/types/v2/token.proto new file mode 100644 index 00000000..269d55b0 --- /dev/null +++ b/proto/cmp/types/v2/token.proto @@ -0,0 +1,21 @@ +syntax = "proto3"; + +package cmp.types.v2; + +// Token Reference +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1/token.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1/token.proto.dot.svg) +message TokenCurrency { + string contract_address = 1; +} + +// Booking token that represents to access to the service +message Token { + // Contract address of the smart contract or the address of natively implemented + // asset on-chain. + string contract = 1; + + // Token ID + uint64 token_id = 2; +} diff --git a/scripts/dependency_checker.py b/scripts/dependency_checker.py index 60369e5d..6db9d12a 100755 --- a/scripts/dependency_checker.py +++ b/scripts/dependency_checker.py @@ -274,8 +274,8 @@ def print_dependency_graph(dep_dict): include_file = directory_path + correct_include messages = extract_proto_definitions(include_file) for message in messages: - message_search = f"{prefix_dots}.{old_include_version}.{message}" - message_replace = f"{prefix_dots}.{new_include_version}.{message}" + message_search = f"{prefix_dots}.{old_include_version}.{message} " + message_replace = f"{prefix_dots}.{new_include_version}.{message} " search_replace_fixes.append( (message_search, message_replace) ) # First we need to create a new file with version+1 where we can make the changes @@ -310,6 +310,14 @@ def print_dependency_graph(dep_dict): package_replace = f"package {prefix_dots}.v{version_number}" search_replace_fixes.append( (package_search, package_replace) ) + # Update the references inside of the file to the new version + messages = extract_proto_definitions(directory_path + new_filename) + for message in messages: + message_search = f"{prefix_dots}.{old_include_version}.{message} " + message_replace = f"{prefix_dots}.{new_include_version}.{message} " + search_replace_fixes.append( (message_search, message_replace) ) + + search_replace_in_file(directory_path + new_filename, search_replace_fixes) fixed_new_version_files.append(new_filename)