diff --git a/proto/cmp/services/accommodation/v2/info.proto b/proto/cmp/services/accommodation/v2/info.proto index 65f5e01..42b1af3 100644 --- a/proto/cmp/services/accommodation/v2/info.proto +++ b/proto/cmp/services/accommodation/v2/info.proto @@ -5,7 +5,7 @@ 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 "cmp/types/v2/product_code.proto"; import "google/protobuf/timestamp.proto"; message AccommodationProductInfoRequest { @@ -19,7 +19,7 @@ message AccommodationProductInfoRequest { repeated cmp.types.v1.Language languages = 3; // Property codes - repeated cmp.types.v1.SupplierProductCode supplier_codes = 4; + repeated cmp.types.v2.SupplierProductCode supplier_codes = 4; } message AccommodationProductInfoResponse { diff --git a/proto/cmp/services/accommodation/v2/property_types.proto b/proto/cmp/services/accommodation/v2/property_types.proto index b7c9334..837e298 100644 --- a/proto/cmp/services/accommodation/v2/property_types.proto +++ b/proto/cmp/services/accommodation/v2/property_types.proto @@ -4,15 +4,15 @@ 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/contact_info.proto"; +import "cmp/types/v2/location.proto"; +import "cmp/types/v2/product_code.proto"; import "cmp/types/v2/service_fact.proto"; +import "cmp/types/v2/traveller.proto"; import "google/protobuf/timestamp.proto"; // Represents property info for an accommodation product @@ -25,10 +25,10 @@ message Property { google.protobuf.Timestamp last_modified = 1; // Supplier product Code - cmp.types.v1.SupplierProductCode supplier_code = 2; + cmp.types.v2.SupplierProductCode supplier_code = 2; // Product code which can be of different types - repeated cmp.types.v1.ProductCode product_codes = 3; + repeated cmp.types.v2.ProductCode product_codes = 3; // Ex: "Beach Hotel Alanya" string name = 4; @@ -43,10 +43,10 @@ message Property { cmp.services.accommodation.v2.CategoryUnit category_unit = 7; // Contact Info: phone, address, email, links - cmp.types.v1.ContactInfo contact_info = 8; + cmp.types.v2.ContactInfo contact_info = 8; // Location coordinate - cmp.types.v1.Coordinates coordinates = 9; + cmp.types.v2.Coordinates coordinates = 9; // Status of the property cmp.types.v1.ProductStatus status = 10; @@ -177,7 +177,7 @@ message Occupancy { message OccupancyOption { // Guest type like adult, child, infant. - cmp.types.v1.TravellerType guest_type = 1; + cmp.types.v2.TravellerType guest_type = 1; // Min guests int32 min = 2; diff --git a/proto/cmp/services/accommodation/v2/search.proto b/proto/cmp/services/accommodation/v2/search.proto index 6981c8a..efef92e 100644 --- a/proto/cmp/services/accommodation/v2/search.proto +++ b/proto/cmp/services/accommodation/v2/search.proto @@ -15,8 +15,8 @@ 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"; +import "cmp/types/v2/traveller.proto"; // The `Accommodation Search Request` message type facilitates the request for // accommodations like hotel and holiday home searches within the platform. In the @@ -109,7 +109,7 @@ message AccommodationSearchResponse { 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; + repeated cmp.types.v2.BasicTraveller travellers = 4; } // Service definition for Accommodation search diff --git a/proto/cmp/services/accommodation/v2/search_parameters_types.proto b/proto/cmp/services/accommodation/v2/search_parameters_types.proto new file mode 100644 index 0000000..25f24bc --- /dev/null +++ b/proto/cmp/services/accommodation/v2/search_parameters_types.proto @@ -0,0 +1,53 @@ +syntax = "proto3"; + +package cmp.services.accommodation.v2; + +import "cmp/types/v1/meal_plan.proto"; +import "cmp/types/v1/rate.proto"; +import "cmp/types/v2/location.proto"; +import "cmp/types/v2/product_code.proto"; + +// This type is used in search requests for parameters like location, meal plan +// codes etc. +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/accommodation/v1/search_parameters_types.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/accommodation/v1/search_parameters_types.proto.dot.svg) +message AccommodationSearchParameters { + // Geo Location for search, set only one of the fields at once. + // + // This "one of" field enforces only one of the fields below. They all share + // memory, setting one will remove the others. + oneof geo_location { + // A list of location codes or just one code. + cmp.types.v2.LocationCodes location_codes = 1; + + // Single geographic point represented by two double fields. + cmp.types.v2.Coordinates location_coordinates = 2; + + // Geo tree type, represented by Country, Region, and City_or_Resort. + cmp.types.v2.GeoTree location_geo_tree = 3; + + // Geo circle. Represented by a coordinate and a distance for radius + cmp.types.v2.GeoCircle location_geo_circle = 4; + + // Geo polygon. Represented by a list of coordinate points. + cmp.types.v2.GeoPolygon location_geo_polygon = 5; + } + + // Mealplan codes + repeated cmp.types.v1.MealPlan meal_plan_codes = 6; + + // Rate plans + repeated cmp.types.v1.RatePlan rate_plans = 7; + + // Rate Rules + // To be used when searching for specific rates like refundable or resellable offers + repeated cmp.types.v1.RateRule rate_rules = 8; + + // Product code list + // Here a list of property codes would be used that could be of different types + repeated cmp.types.v2.ProductCode product_codes = 9; + + // Or a list of provider codes would be used + repeated cmp.types.v2.SupplierProductCode supplier_codes = 10; +} diff --git a/proto/cmp/services/accommodation/v2/search_query_types.proto b/proto/cmp/services/accommodation/v2/search_query_types.proto index fbf1a50..7607be2 100644 --- a/proto/cmp/services/accommodation/v2/search_query_types.proto +++ b/proto/cmp/services/accommodation/v2/search_query_types.proto @@ -2,10 +2,10 @@ syntax = "proto3"; package cmp.services.accommodation.v2; -import "cmp/services/accommodation/v1/search_parameters_types.proto"; +import "cmp/services/accommodation/v2/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"; +import "cmp/types/v2/traveller.proto"; message AccommodationSearchQuery { // Integer query ID, unique per search request @@ -13,13 +13,13 @@ message AccommodationSearchQuery { // 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; + cmp.services.accommodation.v2.AccommodationSearchParameters search_parameters_accommodation = 2; // Travel period cmp.types.v1.TravelPeriod travel_period = 3; // Travellers - repeated cmp.types.v1.BasicTraveller travellers = 4; + repeated cmp.types.v2.BasicTraveller travellers = 4; // Total number of rooms / holiday homes int32 unit_count = 5; diff --git a/proto/cmp/services/accommodation/v2/unit_types.proto b/proto/cmp/services/accommodation/v2/unit_types.proto index 1c1b40c..395fea2 100644 --- a/proto/cmp/services/accommodation/v2/unit_types.proto +++ b/proto/cmp/services/accommodation/v2/unit_types.proto @@ -4,11 +4,11 @@ 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/product_code.proto"; import "cmp/types/v2/service_fact.proto"; // A Unit can represent a room in a hotel. One search option can have multiple units @@ -76,10 +76,10 @@ message Unit { int32 remaining_units = 14; // Property code which can be of different types - cmp.types.v1.ProductCode property_code = 15; + cmp.types.v2.ProductCode property_code = 15; // Supplier Property code, consistent in ProductList, ProductInfo and Search - cmp.types.v1.SupplierProductCode supplier_code = 16; + cmp.types.v2.SupplierProductCode supplier_code = 16; // Remarks // Non structural aspects related to the unit a supplier wants to include in the search diff --git a/proto/cmp/services/activity/v2/activity_types.proto b/proto/cmp/services/activity/v2/activity_types.proto new file mode 100644 index 0000000..300463a --- /dev/null +++ b/proto/cmp/services/activity/v2/activity_types.proto @@ -0,0 +1,259 @@ +syntax = "proto3"; + +package cmp.services.activity.v2; + +import "cmp/types/v1/bookability.proto"; +import "cmp/types/v1/datetime_range.proto"; +import "cmp/types/v1/delivery.proto"; +import "cmp/types/v1/description.proto"; +import "cmp/types/v1/duration.proto"; +import "cmp/types/v1/file.proto"; +import "cmp/types/v1/language.proto"; +import "cmp/types/v1/redemption.proto"; +import "cmp/types/v2/address.proto"; +import "cmp/types/v2/contact_info.proto"; +import "cmp/types/v2/location.proto"; +import "cmp/types/v2/product_code.proto"; +import "google/protobuf/timestamp.proto"; + +// Activity +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/activity/v1/activity_types.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/activity/v1/activity_types.proto.dot.svg) +message Activity { + // Context for Inventory system concepts that need to be included in an info + // response, like an OwnerCode, PTC_OfferParameters, Tax codes, Disclosure RefID, + // etc. or a serialized combination of these codes. + string context = 1; + + // Ex: "2023-08-28T12:03:50", specifying when the static data of a product was + // last updated + google.protobuf.Timestamp last_modified = 2; + + // An identifier for external sessions, aiding in tracking and continuity across + // sessions. + string external_session_id = 3; + + // External Product codes for the result. These can be of different types + cmp.types.v2.ProductCode product_code = 4; + + // Unit ID for the result + // + // 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. + string unit_code = 5; + + // Service codes for the result + // + // 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. + string service_code = 6; + + // Status of the result, whether it is immediately bookable or not + cmp.types.v1.Bookability bookability = 7; +} + +message ActivityLocation { + // Ex: Ctra. de la Porrassa, s/n, Magaluf, ES 07181 in structured fields + cmp.types.v2.Address address = 1; + + // Geo Tree. Country, region, city_or_resort + cmp.types.v2.GeoTree geo_tree = 2; + + // Coordinate + cmp.types.v2.Coordinates coordinates = 3; +} + +message PickupDropoffEvent { + // Supplier specific pick-up code. Avoid using this and use a more generic concept + // where possible, so that the integration is suitable for more than one partner. + // + // Ex: "AESPMI43NU", + string location_code = 1; + // Ex: "Sunny Beach Hotel", + string location_name = 2; + + // True if this pickup location is selected for the activity + // + // If the boolean is set to false, this is a specific indication that + // pick-up/drop-off at this location is not possible. An activity search response + // can have one result without a transfer service and without a PickupDropoffEvent + // to indicate that there is no transfer included. Or a PickupDropoffEvent with + // pick_up indicator set to false can be included to make it explicit. + bool pickup_indicator = 3; + + // Ex: "OTHERS / Parking Varadero (bus stop css nº50)", + string other_info = 4; + + // Datetime of the pickup dropoff event as Unix timestamp + google.protobuf.Timestamp date_time = 5; + + // Longitude and Latitude of the location + cmp.types.v2.Coordinates coordinates = 6; +} + +// Activity static info +message ActivityExtendedInfo { + // Activity dynamic info references + cmp.services.activity.v2.Activity activity = 1; + + // Available Units + repeated cmp.services.activity.v2.ActivityUnit units = 2; + + // Available Services + repeated cmp.services.activity.v2.ActivityService services = 3; + + // Transfer Zone(s) in which participants of the activity can be used for pick-up + // and drop-off + repeated cmp.services.activity.v2.TransferZone zones = 4; + + // Descriptions with different languages + repeated cmp.types.v1.LocalizedDescriptionSet descriptions = 5; + + // Coordinates of where the activity takes place + cmp.services.activity.v2.ActivityLocation location = 6; + + // Activity Features + repeated cmp.services.activity.v2.ActivityFeature features = 7; + + // Tags + repeated cmp.services.activity.v2.ActivityTag tags = 8; + + // Languages + repeated cmp.types.v1.Language languages = 9; + + // Contact Info; Address, Email, Phone, Urls + cmp.types.v2.ContactInfo contact_info = 10; + + // Images + repeated cmp.types.v1.Image images = 11; + + // Videos + repeated cmp.types.v1.Video videos = 12; + + // Supplier code from the Inventory System for this activity response. + string supplier_unit_code = 13; + + // Activity Category Code + string category_code = 14; + + // Category name which describes the category_code + string category_name = 15; + + // Type Code + string type_code = 16; + + // Type name which describes type_code + string type_name = 17; + + // Supplier Product codes for the result + // These must match the supplier codes provided in the ProductList and + // ProductInfo messages + cmp.types.v2.SupplierProductCode supplier_code = 18; + + // Supplier Name + string supplier_code_name = 19; + + // Duration range (min, max) of the activity in minutes + cmp.types.v1.DurationRange duration_range = 20; + + // Time given for confirmation before the offer expires + cmp.types.v1.Duration max_confirmation_duration = 21; + + // Allow Free Sale + bool allow_free_sale = 22; + + // The ability to confirm instantly + bool instant_confirmation = 23; + + // Can be delivered instantly + bool instant_delivery = 24; + + // Check availability + bool availability_required = 25; + + // Availability Type + string availability_type = 26; + + // Delivery Formats; such as QR Code, NFT, Ticket, ... etc + repeated cmp.types.v1.DeliveryFormat delivery_formats = 27; + + // Delivery Methods; such as Email, SMS, Post, ... etc + repeated cmp.types.v1.DeliveryMethod delivery_methods = 28; + + // Redemption method + repeated cmp.types.v1.RedemptionMethod redemption_methods = 29; +} + +// The unit gives us a choice of the different options that are available in an +// activity, like for example a normal ticket or a VIP ticket. a 2 hour or 4 hour +// jeep safari. A ticket to a specific section of a stadium. +message ActivityUnit { + //Schedule + cmp.types.v1.DateTimeRange schedule = 1; + + // Unit Code + string code = 2; + + // Unit Name + string name = 3; + + // Unit Description + string description = 4; +} + +// Services can be selected like do we go to the activity by ourselves or is a +// transfer from our hotel included. Do we book the VIP ticket with or without +// alcoholic drinks included? +message ActivityService { + // Service Code + string code = 1; + + // Service Name + string name = 2; + + // Service Description + string description = 3; + + // Included items in the activity service + repeated string included = 4; + + // Excluded items in the activity service + repeated string excluded = 5; +} + +message TransferZone { + // Zone Code used in transfer operations + string code = 1; + + // Geo tree type, represented by Country, Region, and City_or_Resort. + cmp.types.v2.GeoTree geo_tree = 2; + + // pick-up and drop-off information about location and time + repeated cmp.services.activity.v2.PickupDropoffEvent pickup_dropoff_events = 3; +} + +message ActivityFeature { + // Feature description + string description = 1; + + // Feature Code + string code = 2; +} + +message ActivityTag { + // active status + bool active = 1; + + // Unique ID + int32 id = 2; + + // Name + string name = 3; + + // Slug; giving an informal name to the tag + string slug = 4; +} diff --git a/proto/cmp/services/activity/v2/info.proto b/proto/cmp/services/activity/v2/info.proto new file mode 100644 index 0000000..8723bd6 --- /dev/null +++ b/proto/cmp/services/activity/v2/info.proto @@ -0,0 +1,42 @@ +syntax = "proto3"; + +package cmp.services.activity.v2; + +import "cmp/services/activity/v2/activity_types.proto"; +import "cmp/types/v1/common.proto"; +import "cmp/types/v1/language.proto"; +import "cmp/types/v2/product_code.proto"; +import "google/protobuf/timestamp.proto"; + +message ActivityProductInfoRequest { + // Message header + cmp.types.v1.RequestHeader header = 1; + + // Only respond with the products that are new, modified or deactivated after this + // timestamp. + google.protobuf.Timestamp modified_after = 2; + + // Languages to be included in the response for descriptions. Null means all + // available languages. + repeated cmp.types.v1.Language languages = 3; + + // Activity codes + repeated cmp.types.v2.SupplierProductCode supplier_codes = 4; +} + +message ActivityProductInfoResponse { + // Message header + cmp.types.v1.ResponseHeader header = 1; + + // Product list: Activities + repeated cmp.services.activity.v2.ActivityExtendedInfo activities = 2; +} + +// Activity product info service definition +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/activity/v1/info.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/activity/v1/info.proto.dot.svg) +service ActivityProductInfoService { + // Returns product list for activity + rpc ActivityProductInfo(ActivityProductInfoRequest) returns (ActivityProductInfoResponse); +} diff --git a/proto/cmp/services/activity/v2/list.proto b/proto/cmp/services/activity/v2/list.proto new file mode 100644 index 0000000..d2bfb74 --- /dev/null +++ b/proto/cmp/services/activity/v2/list.proto @@ -0,0 +1,32 @@ +syntax = "proto3"; + +package cmp.services.activity.v2; + +import "cmp/services/activity/v2/activity_types.proto"; +import "cmp/types/v1/common.proto"; +import "google/protobuf/timestamp.proto"; + +message ActivityProductListRequest { + // 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 ActivityProductListResponse { + // Message header + cmp.types.v1.ResponseHeader header = 1; + + // Product list: Activities + repeated cmp.services.activity.v2.Activity activities = 2; +} + +// This service is used to get a product list for activities. +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/activity/v1/list.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/activity/v1/list.proto.dot.svg) +service ActivityProductListService { + // Gets an optional `modified_after` date and returns a product list. + rpc ActivityProductList(ActivityProductListRequest) returns (ActivityProductListResponse); +} diff --git a/proto/cmp/services/activity/v2/search.proto b/proto/cmp/services/activity/v2/search.proto index a984d8b..f7f75e6 100644 --- a/proto/cmp/services/activity/v2/search.proto +++ b/proto/cmp/services/activity/v2/search.proto @@ -40,10 +40,10 @@ 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/location.proto"; import "cmp/types/v2/search.proto"; +import "cmp/types/v2/traveller.proto"; // Search request for Activities message ActivitySearchRequest { @@ -70,7 +70,7 @@ message ActivitySearchRequest { cmp.types.v1.TravelPeriod travel_period = 5; // Travellers - repeated cmp.types.v1.BasicTraveller travellers = 6; + repeated cmp.types.v2.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 @@ -85,19 +85,19 @@ message ActivitySearchRequest { 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; + cmp.types.v2.LocationCodes source_location_codes = 7; // Single geographic point represented by two double fields. - cmp.types.v1.Coordinates source_location_coordinates = 8; + cmp.types.v2.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; + cmp.types.v2.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; + cmp.types.v2.GeoCircle source_location_geo_circle = 10; // Geo polygon. Represented by a list of coordinate points. - cmp.types.v1.GeoPolygon source_location_geo_polygon = 11; + cmp.types.v2.GeoPolygon source_location_geo_polygon = 11; } // For search, set only one of the field at once. Service location specifies the @@ -110,19 +110,19 @@ message ActivitySearchRequest { // 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; + cmp.types.v2.LocationCodes service_location_codes = 12; // Single geographic point represented by two double fields. - cmp.types.v1.Coordinates service_location_coordinates = 13; + cmp.types.v2.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; + cmp.types.v2.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; + cmp.types.v2.GeoCircle service_location_geo_circle = 15; // Geo polygon. Represented by a list of coordinate points. - cmp.types.v1.GeoPolygon service_location_geo_polygon = 16; + cmp.types.v2.GeoPolygon service_location_geo_polygon = 16; } } @@ -144,7 +144,7 @@ message ActivitySearchResponse { // 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; + repeated cmp.types.v2.BasicTraveller travellers = 4; } // Activity Search Service diff --git a/proto/cmp/services/activity/v2/search_parameters_types.proto b/proto/cmp/services/activity/v2/search_parameters_types.proto index 338b709..c7de8b2 100644 --- a/proto/cmp/services/activity/v2/search_parameters_types.proto +++ b/proto/cmp/services/activity/v2/search_parameters_types.proto @@ -4,8 +4,8 @@ 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"; +import "cmp/types/v2/product_code.proto"; // These are Activity specific search parameters // @@ -20,11 +20,11 @@ message ActivitySearchParameters { // 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; + repeated cmp.types.v2.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; + repeated cmp.types.v2.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 diff --git a/proto/cmp/services/activity/v2/search_result_types.proto b/proto/cmp/services/activity/v2/search_result_types.proto index f7ae55c..e4c492e 100644 --- a/proto/cmp/services/activity/v2/search_result_types.proto +++ b/proto/cmp/services/activity/v2/search_result_types.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package cmp.services.activity.v2; -import "cmp/services/activity/v1/activity_types.proto"; +import "cmp/services/activity/v2/activity_types.proto"; import "cmp/types/v1/datetime_range.proto"; import "cmp/types/v1/price_type.proto"; import "cmp/types/v2/price.proto"; @@ -18,16 +18,16 @@ message ActivitySearchResult { int32 result_id = 1; // Activity basic info - cmp.services.activity.v1.Activity info = 2; + cmp.services.activity.v2.Activity info = 2; // Schedule cmp.types.v1.DateTimeRange schedule = 3; // Activity location - cmp.services.activity.v1.ActivityLocation location = 4; + cmp.services.activity.v2.ActivityLocation location = 4; // Pickup Dropoff - repeated cmp.services.activity.v1.PickupDropoffEvent pickup_dropoff_events = 5; + repeated cmp.services.activity.v2.PickupDropoffEvent pickup_dropoff_events = 5; // Min participants int32 min_participants = 6; diff --git a/proto/cmp/services/book/v2/mint.proto b/proto/cmp/services/book/v2/mint.proto index 1dd1c71..9aecd22 100644 --- a/proto/cmp/services/book/v2/mint.proto +++ b/proto/cmp/services/book/v2/mint.proto @@ -6,9 +6,9 @@ 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 "cmp/types/v2/traveller.proto"; import "google/protobuf/timestamp.proto"; message MintRequest { @@ -26,7 +26,7 @@ message MintRequest { string booking_reference = 6; - repeated cmp.types.v1.ExtensiveTraveller travellers = 7; + repeated cmp.types.v2.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", diff --git a/proto/cmp/services/info/v2/entry_requirements.proto b/proto/cmp/services/info/v2/entry_requirements.proto new file mode 100644 index 0000000..ee2a86f --- /dev/null +++ b/proto/cmp/services/info/v2/entry_requirements.proto @@ -0,0 +1,112 @@ +syntax = "proto3"; + +package cmp.services.info.v2; + +import "cmp/types/v1/common.proto"; +import "cmp/types/v1/datetime_range.proto"; +import "cmp/types/v1/filter.proto"; +import "cmp/types/v1/language.proto"; +import "cmp/types/v1/localized.proto"; +import "cmp/types/v1/travel_type.proto"; +import "cmp/types/v1/uuid.proto"; +import "cmp/types/v2/country.proto"; +import "google/protobuf/timestamp.proto"; + +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/info/v1/entry_requirements.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/info/v1/entry_requirements.proto.dot.svg) +service CountryEntryRequirementsService { + rpc CountryEntryRequirements(CountryEntryRequirementsRequest) returns (CountryEntryRequirementsResponse); +} + +message CountryEntryRequirementsRequest { + // Message header + cmp.types.v1.RequestHeader header = 1; + + // Departure country + cmp.types.v2.Country departure = 2; + + // Destination country + cmp.types.v2.Country destination = 3; + + // Citizenship + cmp.types.v2.Country citizenship = 4; + + // Residence + cmp.types.v2.Country residence = 5; + + // Transit country + cmp.types.v2.Country transit = 6; + + // Travel type, ex: business or tourism + cmp.types.v1.TravelType travel_type = 7; + + // Date time range, start and end dates of visit, as timestamp. + cmp.types.v1.DateTimeRange datetime_range = 8; + + // Languages requested + repeated cmp.types.v1.Language languages = 9; + + bool exclude_categories = 10; + + bool include_items = 11; + + repeated cmp.types.v1.Filter filters = 12; +} + +message CountryEntryRequirementsResponse { + // Message header + cmp.types.v1.ResponseHeader header = 1; + + // This must be a UUID according to RFC 4122 + cmp.types.v1.UUID response_id = 2; + + // Categories + repeated cmp.services.info.v2.CountryEntryRequirementCategory categories = 3; + + // Items + repeated cmp.services.info.v2.CountryEntryRequirementItem items = 4; +} + +// Types + +message CountryEntryRequirementCategory { + // Category key. FIXME: Can this field be an enum? + string key = 1; + + // List of localized names + repeated cmp.types.v1.LocalizedString names = 2; + + // Items + repeated cmp.services.info.v2.CountryEntryRequirementItem items = 3; + + // Sub categories + repeated cmp.services.info.v2.CountryEntryRequirementCategory sub_categories = 4; +} + +message CountryEntryRequirementItem { + // Item type key. FIXME: Can this field be an enum? + string key = 1; + + // Language specific names and descriptions + repeated cmp.services.info.v2.LocalizedItemInfo info = 2; + + // Status of the item. TODO: Add more explanation, what it means if it's false? + cmp.services.info.v2.ItemStatus status = 3; + + // Significant update date + google.protobuf.Timestamp last_significant_update = 4; +} + +message LocalizedItemInfo { + string name = 1; + string description = 2; + cmp.types.v1.Language language = 3; +} + +// FIXME: We need to clarify what true, false and undefined means for status and +// maybe update this enum accordingly +enum ItemStatus { + ITEM_STATUS_UNSPECIFIED = 0; + ITEM_STATUS_TRUE = 1; + ITEM_STATUS_FALSE = 2; +} diff --git a/proto/cmp/services/insurance/v1/info.proto b/proto/cmp/services/insurance/v1/info.proto new file mode 100644 index 0000000..804be07 --- /dev/null +++ b/proto/cmp/services/insurance/v1/info.proto @@ -0,0 +1,42 @@ +syntax = "proto3"; + +package cmp.services.insurance.v1; + +import "cmp/services/insurance/v1/insurance_types.proto"; +import "cmp/types/v1/common.proto"; +import "cmp/types/v1/language.proto"; +import "cmp/types/v2/product_code.proto"; +import "google/protobuf/timestamp.proto"; + +message InsuranceProductInfoRequest { + // Message header + cmp.types.v1.RequestHeader header = 1; + + // Only respond with the products that are new, modified or deactivated after this + // timestamp. + google.protobuf.Timestamp modified_after = 2; + + // Languages to be included in the response for descriptions. Null means all + // available languages. + repeated cmp.types.v1.Language languages = 3; + + // Insurance codes + repeated cmp.types.v2.SupplierProductCode supplier_codes = 4; +} + +message InsuranceProductInfoResponse { + // Message header + cmp.types.v1.ResponseHeader header = 1; + + // Product list: Insurances + repeated cmp.services.insurance.v1.PolicyExtendedInfo insurances = 2; +} + +// Insurance product info service definition +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/insurance/v1/info.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/insurance/v1/info.proto.dot.svg) +service InsuranceProductInfoService { + // Returns product info for insurance + rpc InsuranceProductInfo(InsuranceProductInfoRequest) returns (InsuranceProductInfoResponse); +} diff --git a/proto/cmp/services/insurance/v1/insurance_types.proto b/proto/cmp/services/insurance/v1/insurance_types.proto new file mode 100644 index 0000000..c8ba406 --- /dev/null +++ b/proto/cmp/services/insurance/v1/insurance_types.proto @@ -0,0 +1,166 @@ +syntax = "proto3"; + +package cmp.services.insurance.v1; + +import "cmp/types/v1/file.proto"; +import "cmp/types/v1/inclusivity.proto"; +import "cmp/types/v1/link.proto"; +import "cmp/types/v2/contact_info.proto"; +import "cmp/types/v2/price.proto"; +import "cmp/types/v2/product_code.proto"; +import "google/protobuf/timestamp.proto"; + +// Insurance +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/insurance/v1/insurance_types.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/insurance/v1/insurance_types.proto.dot.svg) +message Insurance { + // Context for Inventory system concepts that need to be included in an info + // response, like an OwnerCode, PTC_OfferParameters, Tax codes, Disclosure RefID, + // etc. or a serialized combination of these codes. + string context = 1; + + // An identifier for external sessions, aiding in tracking and continuity across + // sessions. + string external_session_id = 2; + + // List of insurance policies + repeated cmp.services.insurance.v1.Policy policies = 3; +} + +message Policy { + // Product Code + cmp.types.v2.ProductCode product_code = 1; + + // Description + string description = 2; + + // Ex: "2023-08-28T12:03:50", specifying when the static data of a product was + // last updated + google.protobuf.Timestamp last_modified = 3; +} + +message PolicyExtendedInfo { + // Insurance Policy dynamic info + cmp.services.insurance.v1.Policy policy = 1; + + // Carrier code, this provider is the holder of the policy and not a supplier to the Camino Network + string carrier_code = 2; + + // Carrier name + string carrier_name = 3; + + // URL to logo + cmp.types.v1.Image logo = 4; + + // Enum of possible types, to be used for filtering + cmp.services.insurance.v1.PolicyType policy_type = 5; + + // Support contact + cmp.types.v2.ContactInfo support_contact = 6; + + // Criteria + repeated cmp.services.insurance.v1.PolicyCriteria criteria = 7; + + // Units + repeated cmp.services.insurance.v1.PolicyUnit units = 8; + + // Services + repeated cmp.services.insurance.v1.PolicyService services = 9; +} + +message PolicyCriteria { + // Criteria Code + string code = 1; + + // Criteria Name + string name = 2; +} + +message PolicyUnit { + // Unit code + string code = 1; + + // Unit name + string name = 2; + + // Coverage details + cmp.services.insurance.v1.PolicyCoverage policy_coverage = 4; +} + +message PolicyService { + // Service Code + string code = 1; + + // Service name + string name = 2; + + // Codes of units + repeated string unit_codes = 3; + + // Coverage details + cmp.services.insurance.v1.PolicyCoverage policy_coverage = 4; +} + +enum PolicyType { + POLICY_TYPE_UNSPECIFIED = 0; + POLICY_TYPE_OTHER = 1; + POLICY_TYPE_CANCEL = 2; + POLICY_TYPE_TRAVEL = 3; + POLICY_TYPE_TRAVEL_MEDICAL = 4; + POLICY_TYPE_MEDICAL = 5; + POLICY_TYPE_EMERGENCY = 6; + POLICY_TYPE_RENTAL_CAR = 7; + POLICY_TYPE_PERSONAL_BELONGINGS = 8; + POLICY_TYPE_FLIGHT = 9; + POLICY_TYPE_DEATH = 10; +} + +message PolicyCoverage { + // Maximum coverage amount + cmp.types.v2.Price max_coverage_amount = 3; + + // URL to Detailed list of risks covered + cmp.types.v1.Link coverage_link = 4; + + // URL to Specific events or conditions that are not covered by the policy + cmp.types.v1.Link exclusions_link = 5; + + // pre-existing conditions coverage + cmp.types.v1.Inclusivity preconditions_coverage = 6; + + // URL to Details on whether pre-existing medical conditions are covered, and if so, under what terms. + cmp.types.v1.Link preconditions_coverage_link = 7; + + // URL to Full legal terms of the policy, privacy policy, compliance, ... etc + cmp.types.v1.Link terms = 8; + + // URL to Frequently asked questions about the policy page + cmp.types.v1.Link faq = 9; +} + +message InsuredBooking { + // Location of insured booking: on-chain or off-chain + oneof location { + // On-Chain booking + cmp.services.insurance.v1.OnChainBooking on_chain = 1; + // Off-Chain booking + cmp.services.insurance.v1.OffChainBooking off_chain = 2; + } +} + +message OnChainBooking { + // Token ID + string token_id = 1; + // Smart Contract Address + string smart_contract_id = 2; + // Chain ID of the evm compatible chain that contract is deployed. For Camino (mainnet) it is 500. And for Columbus (testnet) it is 501. + int32 chain_id = 3; +} + +message OffChainBooking { + // Location of booking in some other off-chain system like booking.com + string location = 1; + // Booking reference + string reference = 2; +} diff --git a/proto/cmp/services/insurance/v1/list.proto b/proto/cmp/services/insurance/v1/list.proto new file mode 100644 index 0000000..0f0245f --- /dev/null +++ b/proto/cmp/services/insurance/v1/list.proto @@ -0,0 +1,32 @@ +syntax = "proto3"; + +package cmp.services.insurance.v1; + +import "cmp/services/insurance/v1/insurance_types.proto"; +import "cmp/types/v1/common.proto"; +import "google/protobuf/timestamp.proto"; + +message InsuranceProductListRequest { + // 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 InsuranceProductListResponse { + // Message header + cmp.types.v1.ResponseHeader header = 1; + + // Product list: Insurance + repeated cmp.services.insurance.v1.Insurance insurances = 2; +} + +// This service is used to get a product list for insurances. +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/insurance/v1/list.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/insurance/v1/list.proto.dot.svg) +service InsuranceProductListService { + // Gets an optional `modified_after` date and returns a product list. + rpc InsuranceProductList(InsuranceProductListRequest) returns (InsuranceProductListResponse); +} diff --git a/proto/cmp/services/insurance/v1/search.proto b/proto/cmp/services/insurance/v1/search.proto new file mode 100644 index 0000000..82834a6 --- /dev/null +++ b/proto/cmp/services/insurance/v1/search.proto @@ -0,0 +1,90 @@ +syntax = "proto3"; + +// ## InsuranceServices +// +// Insurance Services has two main processes: +// +// - selling insurances: this process follows the same flow as selling any travel +// product on the Camino Network: Static data download using the InsuranceProductList +// message to obtain the (changed) portfolio of product a supplier offers, followed by +// the InsuranceProductInfo message to get the exact detail of each product. The real-time data +// does not contain any static information and consists of the InsuranceSearch message, followed +// by the generic Validate and Mint messages. +// +// - making an insurance claim: this is a special workflow, only used in the Insurance Services. +// A claim form is requested based on the insurance policy purchased. This "template" is then +// filled with the required information, the necessary documents are attached, and the claim is +// submitted to the supplier. The supplier pushes a status upon change to the distributor. +// It might be possible that further information is required or that an off-line conversation is taking place. +// This finally leads to an acceptance and pay-out or a denial. +package cmp.services.insurance.v1; + +import "cmp/services/insurance/v1/search_query_types.proto"; +import "cmp/services/insurance/v1/search_result_types.proto"; +import "cmp/types/v1/common.proto"; +import "cmp/types/v2/search.proto"; +import "cmp/types/v2/traveller.proto"; + +// InsuranceSearchRequest +// +// The Insurance Search Request message type facilitates the request for insurances +// like health or cancellation insurances 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 insurances we would like to be offered. +// In the Response, each InsuranceSearchResult is one bookable option as a "result_id". +// Each consists of a "product" which indicates a type of insurance and if more options of +// one type are available, then different units are offered. In case of an additional service, +// like a sports package in combination with a health insurance, you would find one search result +// with just the health insurance and another search result with both the health insurance and +// the sports package. +message InsuranceSearchRequest { + // 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.insurance.v1.InsuranceSearchQuery queries = 4; +} + +// The `Insurance Search Response` message type facilitates the response for +// insurances like hotel and holiday home searches within the platform. +// +// In the response a search_id must be included and a search_option_id for every +// bookable option responded. Included, compulsary and optional services can be +// included. A simple "free cancellation upto" can be set or full cancellation +// pilicies can be included. +message InsuranceSearchResponse { + // 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.insurance.v1.InsuranceSearchResult results = 3; + + // Global definition of the travellers for all results to be used via the traveller_id each unit. + repeated cmp.types.v2.BasicTraveller travellers = 4; +} + +// Service definition for Insurance search +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/insurance/v1/search.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/insurance/v1/search.proto.dot.svg) +service InsuranceSearchService { + // Insurance Search method + rpc InsuranceSearch(InsuranceSearchRequest) returns (InsuranceSearchResponse); +} diff --git a/proto/cmp/services/insurance/v1/search_parameters_types.proto b/proto/cmp/services/insurance/v1/search_parameters_types.proto new file mode 100644 index 0000000..7231e89 --- /dev/null +++ b/proto/cmp/services/insurance/v1/search_parameters_types.proto @@ -0,0 +1,42 @@ +syntax = "proto3"; + +package cmp.services.insurance.v1; + +import "cmp/services/insurance/v1/insurance_types.proto"; +import "cmp/types/v1/loyalty_program.proto"; +import "cmp/types/v1/travel_period.proto"; +import "cmp/types/v2/country.proto"; +import "cmp/types/v2/price.proto"; +import "cmp/types/v2/product_code.proto"; +import "cmp/types/v2/traveller.proto"; + +// This type is used in search requests for parameters like insured booking, network, ... etc +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/insurance/v1/search_parameters_types.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/insurance/v1/search_parameters_types.proto.dot.svg) +message InsuranceSearchParameters { + // Product code list + // Here a list of property codes would be used that could be of different types + repeated cmp.types.v2.ProductCode product_codes = 1; + + // Value of booking to be insured, only valid with CFAR, Flight? and Rantal Car? insurances + cmp.types.v2.Price amount_purchase = 2; + + // Insurance location and its references. Location can be on-chain or off-chain. + cmp.services.insurance.v1.InsuredBooking booking_to_insure = 3; + + // The country code of the end-consumer nationality. This code is optional for normal NFT, but required for an NFT that is a receipt for a physical product. + cmp.types.v2.Country nationality = 4; + + // The country code of the end-consumer place of residence + cmp.types.v2.Country country_residence = 5; + + // Travel period + cmp.types.v1.TravelPeriod travel_period = 6; + + // Travellers + repeated cmp.types.v2.BasicTraveller travellers = 7; + + // Loyalty Program + cmp.types.v1.LoyaltyProgram loyalty_program = 8; +} diff --git a/proto/cmp/services/insurance/v1/search_query_types.proto b/proto/cmp/services/insurance/v1/search_query_types.proto new file mode 100644 index 0000000..fc3e7ad --- /dev/null +++ b/proto/cmp/services/insurance/v1/search_query_types.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; + +package cmp.services.insurance.v1; + +import "cmp/services/insurance/v1/search_parameters_types.proto"; + +message InsuranceSearchQuery { + // Integer query ID, unique per search request + int32 query_id = 1; + + // Insurance specific search parameters Ex: Specific search parameters like + // insured booking, nationality, blockchain, ... etc + cmp.services.insurance.v1.InsuranceSearchParameters search_parameters_insurance = 2; +} diff --git a/proto/cmp/services/insurance/v1/search_result_types.proto b/proto/cmp/services/insurance/v1/search_result_types.proto new file mode 100644 index 0000000..50ea092 --- /dev/null +++ b/proto/cmp/services/insurance/v1/search_result_types.proto @@ -0,0 +1,43 @@ +syntax = "proto3"; + +package cmp.services.insurance.v1; + +import "cmp/types/v1/bookability.proto"; +import "cmp/types/v2/price.proto"; + +// This type represents a search result and is used in the +// `InsuranceSearchResponse` message. +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/insurance/v1/search_result_types.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/insurance/v1/search_result_types.proto.dot.svg) +message InsuranceSearchResult { + // 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; + + // Policies for this search result + repeated cmp.services.insurance.v1.PolicyCodes policies = 3; + + // ## Total price in detail, with breakdowns + cmp.types.v2.PriceDetail total_price_detail = 4; + + // Freetext remarks without any functionality + string remarks = 5; + + // Status of the result, whether it is immediately bookable or not + cmp.types.v1.Bookability bookability = 6; +} + +message PolicyCodes { + // Product Code + string product_code = 1; + + // Unit Code + string unit_code = 2; + + // Service Code + string service_code = 3; +} diff --git a/proto/cmp/services/transport/v2/search.proto b/proto/cmp/services/transport/v2/search.proto index 3d74efc..66c849a 100644 --- a/proto/cmp/services/transport/v2/search.proto +++ b/proto/cmp/services/transport/v2/search.proto @@ -15,8 +15,8 @@ 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"; +import "cmp/types/v2/traveller.proto"; // Transport Search Request message TransportSearchRequest { @@ -59,7 +59,7 @@ message TransportSearchResponse { 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; + repeated cmp.types.v2.BasicTraveller travellers = 5; } // Transport Search Service definition. diff --git a/proto/cmp/services/transport/v2/search_parameters_types.proto b/proto/cmp/services/transport/v2/search_parameters_types.proto index 37da998..ca35ad8 100644 --- a/proto/cmp/services/transport/v2/search_parameters_types.proto +++ b/proto/cmp/services/transport/v2/search_parameters_types.proto @@ -3,9 +3,9 @@ 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"; +import "cmp/types/v2/product_code.proto"; // Transport Search Parameters // @@ -14,12 +14,12 @@ import "cmp/types/v2/price.proto"; 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; + repeated cmp.types.v2.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; + repeated cmp.types.v2.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; diff --git a/proto/cmp/services/transport/v2/search_query_types.proto b/proto/cmp/services/transport/v2/search_query_types.proto index 59c38a3..34b1ad6 100644 --- a/proto/cmp/services/transport/v2/search_query_types.proto +++ b/proto/cmp/services/transport/v2/search_query_types.proto @@ -4,8 +4,8 @@ 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"; +import "cmp/types/v2/location.proto"; +import "cmp/types/v2/traveller.proto"; // Transport search query. Multiple trips can be send, each representing multi-leg // journey. @@ -23,7 +23,7 @@ message TransportSearchQuery { 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; + repeated cmp.types.v2.BasicTraveller travellers = 2; // Trips repeated cmp.services.transport.v2.QueryTrip trips = 3; @@ -50,5 +50,5 @@ message QueryTransitEvent { cmp.types.v1.Date date = 1; // Event location - cmp.types.v1.LocationCode location_code = 2; + cmp.types.v2.LocationCode location_code = 2; } diff --git a/proto/cmp/services/transport/v2/trip_types.proto b/proto/cmp/services/transport/v2/trip_types.proto index 79c2ee6..7215be9 100644 --- a/proto/cmp/services/transport/v2/trip_types.proto +++ b/proto/cmp/services/transport/v2/trip_types.proto @@ -4,10 +4,10 @@ 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/location.proto"; import "cmp/types/v2/price.proto"; +import "cmp/types/v2/product_code.proto"; import "cmp/types/v2/service_fact.proto"; import "google/protobuf/timestamp.proto"; @@ -27,7 +27,7 @@ message TransitEvent { google.protobuf.Timestamp date_time = 1; // Event location - cmp.types.v1.LocationCode location_code = 2; + cmp.types.v2.LocationCode location_code = 2; } // A segment of a trip @@ -63,11 +63,11 @@ message TripSegment { // 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; + cmp.types.v2.ProductCode product_code = 5; // Supplier specific code, matching the supplier code in ProductList and ProductInfo // messages - cmp.types.v1.SupplierProductCode supplier_code = 6; + cmp.types.v2.SupplierProductCode supplier_code = 6; // Departure cmp.services.transport.v2.TransitEvent departure = 7; diff --git a/proto/cmp/types/v1/inclusivity.proto b/proto/cmp/types/v1/inclusivity.proto new file mode 100644 index 0000000..a08af1e --- /dev/null +++ b/proto/cmp/types/v1/inclusivity.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; + +package cmp.types.v1; + +// An Option to specify if an item is included or not included in the context +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1/inclusivity.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1/inclusivity.proto.dot.svg) +enum Inclusivity { + INCLUSIVITY_UNSPECIFIED = 0; + INCLUSIVITY_INCLUDED = 1; + INCLUSIVITY_NOT_INCLUDED = 2; +} diff --git a/proto/cmp/types/v1/loyalty_program.proto b/proto/cmp/types/v1/loyalty_program.proto new file mode 100644 index 0000000..003a9e0 --- /dev/null +++ b/proto/cmp/types/v1/loyalty_program.proto @@ -0,0 +1,32 @@ +syntax = "proto3"; + +package cmp.types.v1; + +import "cmp/types/v1/link.proto"; + +// Loyalty Program +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v2/loyalty_program.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v2/loyalty_program.proto.dot.svg) +message LoyaltyProgram { + // In case of an off-chain loyalty program, this is the id of the loyalty program in loyalty system + oneof loyalty_id { + // Smart Contract address of a loyalty program + string contract_address = 1; + // Off-chain loyalty program + cmp.types.v1.OffChainLoyaltyProgram off_chain_loyalty = 2; + } + + // Official name of the loyalty program that might be required to map + string name = 3; + + // Url to the details of the loyalty program + cmp.types.v1.Link link = 4; +} + +message OffChainLoyaltyProgram { + // Identification number/code for the loyalty program + string id = 1; + // Membership ID + string membership_id = 2; +} diff --git a/proto/cmp/types/v2/address.proto b/proto/cmp/types/v2/address.proto new file mode 100644 index 0000000..b74c41e --- /dev/null +++ b/proto/cmp/types/v2/address.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; + +package cmp.types.v2; + +import "cmp/types/v2/location.proto"; + +// This type represents an address for places like a home or hotel etc. +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1/address.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1/address.proto.dot.svg) +message Address { + string line_1 = 1; + string line_2 = 2; + string district = 3; + string zip_code = 5; + cmp.types.v2.GeoTree geo_tree = 6; +} diff --git a/proto/cmp/types/v2/contact_info.proto b/proto/cmp/types/v2/contact_info.proto new file mode 100644 index 0000000..5af89e0 --- /dev/null +++ b/proto/cmp/types/v2/contact_info.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; + +package cmp.types.v2; + +import "cmp/types/v1/email.proto"; +import "cmp/types/v1/link.proto"; +import "cmp/types/v1/phone.proto"; +import "cmp/types/v2/address.proto"; + +// Contact Info for general use. +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1/contact_info.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1/contact_info.proto.dot.svg) +message ContactInfo { + // Address + repeated cmp.types.v2.Address address = 1; + + // Phones + repeated cmp.types.v1.Phone phones = 2; + + // Emails + repeated cmp.types.v1.Email emails = 3; + + // Websites + repeated cmp.types.v1.Link links = 4; +} diff --git a/proto/cmp/types/v2/country.proto b/proto/cmp/types/v2/country.proto new file mode 100644 index 0000000..cf0bff9 --- /dev/null +++ b/proto/cmp/types/v2/country.proto @@ -0,0 +1,265 @@ +syntax = "proto3"; + +package cmp.types.v2; + +// Country options according to ISO 3166-1, with the 31 most popular countries +// first, using fewer bytes in the code thus reducing message size. +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v2/country.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v2/country.proto.dot.svg) +enum Country { + COUNTRY_UNSPECIFIED = 0; + + COUNTRY_AE = 1; // United Arab Emirates + COUNTRY_AR = 2; // Argentina + COUNTRY_AT = 3; // Austria + COUNTRY_AU = 4; // Australia + COUNTRY_BE = 5; // Belgium + COUNTRY_BR = 6; // Brazil + COUNTRY_BS = 7; // Bahamas + COUNTRY_CA = 8; // Canada + COUNTRY_CH = 9; // Switzerland + COUNTRY_CN = 10; // China + COUNTRY_DE = 11; // Germany + COUNTRY_DK = 12; // Denmark + COUNTRY_ES = 13; // Spain + COUNTRY_FR = 14; // France + COUNTRY_GB = 15; // United Kingdom of Great Britain and Northern Ireland + COUNTRY_GR = 16; // Greece + COUNTRY_IN = 17; // India + COUNTRY_IT = 18; // Italy + COUNTRY_JP = 19; // Japan + COUNTRY_MT = 20; // Malta + COUNTRY_MX = 21; // Mexico + COUNTRY_NL = 22; // Netherlands + COUNTRY_NO = 23; // Norway + COUNTRY_NZ = 24; // New Zealand + COUNTRY_PL = 25; // Poland + COUNTRY_PT = 26; // Portugal + COUNTRY_RU = 27; // Russian Federation + COUNTRY_SE = 28; // Sweden + COUNTRY_SG = 29; // Singapore + COUNTRY_TH = 30; // Thailand + COUNTRY_TR = 31; // Türkiye + COUNTRY_US = 32; // United States of America + + COUNTRY_AD = 33; // Andorra + COUNTRY_AF = 34; // Afghanistan + COUNTRY_AG = 35; // Antigua and Barbuda + COUNTRY_AI = 36; // Anguilla + COUNTRY_AL = 37; // Albania + COUNTRY_AM = 38; // Armenia + COUNTRY_AO = 39; // Angola + COUNTRY_AQ = 40; // Antarctica + COUNTRY_AS = 41; // American Samoa + COUNTRY_AW = 42; // Aruba + COUNTRY_AX = 43; // Åland Islands + COUNTRY_AZ = 44; // Azerbaijan + COUNTRY_BA = 45; // Bosnia and Herzegovina + COUNTRY_BB = 46; // Barbados + COUNTRY_BD = 47; // Bangladesh + COUNTRY_BF = 48; // Burkina Faso + COUNTRY_BG = 49; // Bulgaria + COUNTRY_BH = 50; // Bahrain + COUNTRY_BI = 51; // Burundi + COUNTRY_BJ = 52; // Benin + COUNTRY_BL = 53; // Saint Barthélemy + COUNTRY_BM = 54; // Bermuda + COUNTRY_BN = 55; // Brunei Darussalam + COUNTRY_BO = 56; // Bolivia (Plurinational State of) + COUNTRY_BQ = 57; // Bonaire, Sint Eustatius and Saba + COUNTRY_BT = 58; // Bhutan + COUNTRY_BV = 59; // Bouvet Island + COUNTRY_BW = 60; // Botswana + COUNTRY_BY = 61; // Belarus + COUNTRY_BZ = 62; // Belize + COUNTRY_CC = 63; // Cocos (Keeling) Islands + COUNTRY_CD = 64; // Congo, Democratic Republic + COUNTRY_CF = 65; // Central African Republic + COUNTRY_CG = 66; // Congo + COUNTRY_CI = 67; // Côte d'Ivoire + COUNTRY_CK = 68; // Cook Islands + COUNTRY_CL = 69; // Chile + COUNTRY_CM = 70; // Cameroon + COUNTRY_CO = 71; // Colombia + COUNTRY_CR = 72; // Costa Rica + COUNTRY_CU = 73; // Cuba + COUNTRY_CV = 74; // Cabo Verde + COUNTRY_CW = 75; // Curaçao + COUNTRY_CX = 76; // Christmas Island + COUNTRY_CY = 77; // Cyprus[b] + COUNTRY_CZ = 78; // Czechia + COUNTRY_DJ = 79; // Djibouti + COUNTRY_DM = 80; // Dominica + COUNTRY_DO = 81; // Dominican Republic + COUNTRY_DZ = 82; // Algeria + COUNTRY_EC = 83; // Ecuador + COUNTRY_EE = 84; // Estonia + COUNTRY_EG = 85; // Egypt + COUNTRY_EH = 86; // Western Sahara[b] + COUNTRY_ER = 87; // Eritrea + COUNTRY_ET = 88; // Ethiopia + COUNTRY_FI = 89; // Finland + COUNTRY_FJ = 90; // Fiji + COUNTRY_FK = 91; // Falkland Islands (Malvinas)[b] + COUNTRY_FM = 92; // Micronesia (Federated States of) + COUNTRY_FO = 93; // Faroe Islands + COUNTRY_GA = 94; // Gabon + COUNTRY_GD = 95; // Grenada + COUNTRY_GE = 96; // Georgia + COUNTRY_GF = 97; // French Guiana + COUNTRY_GG = 98; // Guernsey + COUNTRY_GH = 99; // Ghana + COUNTRY_GI = 100; // Gibraltar + COUNTRY_GL = 101; // Greenland + COUNTRY_GM = 102; // Gambia + COUNTRY_GN = 103; // Guinea + COUNTRY_GP = 104; // Guadeloupe + COUNTRY_GQ = 105; // Equatorial Guinea + COUNTRY_GS = 106; // South Georgia and the South Sandwich Islands + COUNTRY_GT = 107; // Guatemala + COUNTRY_GU = 108; // Guam + COUNTRY_GW = 109; // Guinea-Bissau + COUNTRY_GY = 110; // Guyana + COUNTRY_HK = 111; // Hong Kong + COUNTRY_HM = 112; // Heard Island and McDonald Islands + COUNTRY_HN = 113; // Honduras + COUNTRY_HR = 114; // Croatia + COUNTRY_HT = 115; // Haiti + COUNTRY_HU = 116; // Hungary + COUNTRY_ID = 117; // Indonesia + COUNTRY_IE = 118; // Ireland + COUNTRY_IL = 119; // Israel + COUNTRY_IM = 120; // Isle of Man + COUNTRY_IO = 121; // British Indian Ocean Territory + COUNTRY_IQ = 122; // Iraq + COUNTRY_IR = 123; // Iran (Islamic Republic of) + COUNTRY_IS = 124; // Iceland + COUNTRY_JE = 125; // Jersey + COUNTRY_JM = 126; // Jamaica + COUNTRY_JO = 127; // Jordan + COUNTRY_KE = 128; // Kenya + COUNTRY_KG = 129; // Kyrgyzstan + COUNTRY_KH = 130; // Cambodia + COUNTRY_KI = 131; // Kiribati + COUNTRY_KM = 132; // Comoros + COUNTRY_KN = 133; // Saint Kitts and Nevis + COUNTRY_KP = 134; // Korea, Democratic People's Republic of (North) + COUNTRY_KR = 135; // Korea, Republic of (South) + COUNTRY_KW = 136; // Kuwait + COUNTRY_KY = 137; // Cayman Islands + COUNTRY_KZ = 138; // Kazakhstan + COUNTRY_LA = 139; // Lao People's Democratic Republic + COUNTRY_LB = 140; // Lebanon + COUNTRY_LC = 141; // Saint Lucia + COUNTRY_LI = 142; // Liechtenstein + COUNTRY_LK = 143; // Sri Lanka + COUNTRY_LR = 144; // Liberia + COUNTRY_LS = 145; // Lesotho + COUNTRY_LT = 146; // Lithuania + COUNTRY_LU = 147; // Luxembourg + COUNTRY_LV = 148; // Latvia + COUNTRY_LY = 149; // Libya + COUNTRY_MA = 150; // Morocco + COUNTRY_MC = 151; // Monaco + COUNTRY_MD = 152; // Moldova, Republic of + COUNTRY_ME = 153; // Montenegro + COUNTRY_MF = 154; // Saint Martin (French part) + COUNTRY_MG = 155; // Madagascar + COUNTRY_MH = 156; // Marshall Islands + COUNTRY_MK = 157; // North Macedonia + COUNTRY_ML = 158; // Mali + COUNTRY_MM = 159; // Myanmar + COUNTRY_MN = 160; // Mongolia + COUNTRY_MO = 161; // Macao + COUNTRY_MP = 162; // Northern Mariana Islands + COUNTRY_MQ = 163; // Martinique + COUNTRY_MR = 164; // Mauritania + COUNTRY_MS = 165; // Montserrat + COUNTRY_MU = 166; // Mauritius + COUNTRY_MV = 167; // Maldives + COUNTRY_MW = 168; // Malawi + COUNTRY_MY = 169; // Malaysia + COUNTRY_MZ = 170; // Mozambique + COUNTRY_NA = 171; // Namibia + COUNTRY_NC = 172; // New Caledonia + COUNTRY_NE = 173; // Niger + COUNTRY_NF = 174; // Norfolk Island + COUNTRY_NG = 175; // Nigeria + COUNTRY_NI = 176; // Nicaragua + COUNTRY_NP = 177; // Nepal + COUNTRY_NR = 178; // Nauru + COUNTRY_NU = 179; // Niue + COUNTRY_OM = 180; // Oman + COUNTRY_PA = 181; // Panama + COUNTRY_PE = 182; // Peru + COUNTRY_PF = 183; // French Polynesia + COUNTRY_PG = 184; // Papua New Guinea + COUNTRY_PH = 185; // Philippines + COUNTRY_PK = 186; // Pakistan + COUNTRY_PM = 187; // Saint Pierre and Miquelon + COUNTRY_PN = 188; // Pitcairn + COUNTRY_PR = 189; // Puerto Rico + COUNTRY_PS = 190; // Palestine, State of + COUNTRY_PW = 191; // Palau + COUNTRY_PY = 192; // Paraguay + COUNTRY_QA = 193; // Qatar + COUNTRY_RE = 194; // Réunion + COUNTRY_RO = 195; // Romania + COUNTRY_RS = 196; // Serbia + COUNTRY_RW = 197; // Rwanda + COUNTRY_SA = 198; // Saudi Arabia + COUNTRY_SB = 199; // Solomon Islands + COUNTRY_SC = 200; // Seychelles + COUNTRY_SD = 201; // Sudan + COUNTRY_SH = 202; // Saint Helena, Ascension and Tristan da Cunha + COUNTRY_SI = 203; // Slovenia + COUNTRY_SJ = 204; // Svalbard and Jan Mayen[e] + COUNTRY_SK = 205; // Slovakia + COUNTRY_SL = 206; // Sierra Leone + COUNTRY_SM = 207; // San Marino + COUNTRY_SN = 208; // Senegal + COUNTRY_SO = 209; // Somalia + COUNTRY_SR = 210; // Suriname + COUNTRY_SS = 211; // South Sudan + COUNTRY_ST = 212; // Sao Tome and Principe + COUNTRY_SV = 213; // El Salvador + COUNTRY_SX = 214; // Sint Maarten (Dutch part) + COUNTRY_SY = 215; // Syrian Arab Republic + COUNTRY_SZ = 216; // Eswatini + COUNTRY_TC = 217; // Turks and Caicos Islands + COUNTRY_TD = 218; // Chad + COUNTRY_TF = 219; // French Southern Territories + COUNTRY_TG = 220; // Togo + COUNTRY_TJ = 221; // Tajikistan + COUNTRY_TK = 222; // Tokelau + COUNTRY_TL = 223; // Timor-Leste + COUNTRY_TM = 224; // Turkmenistan + COUNTRY_TN = 225; // Tunisia + COUNTRY_TO = 226; // Tonga + COUNTRY_TT = 227; // Trinidad and Tobago + COUNTRY_TV = 228; // Tuvalu + COUNTRY_TW = 229; // Taiwan, Province of China + COUNTRY_TZ = 230; // Tanzania, United Republic of + COUNTRY_UA = 231; // Ukraine + COUNTRY_UG = 232; // Uganda + COUNTRY_UM = 233; // United States Minor Outlying Islands + COUNTRY_UY = 234; // Uruguay + COUNTRY_UZ = 235; // Uzbekistan + COUNTRY_VA = 236; // Holy See + COUNTRY_VC = 237; // Saint Vincent and the Grenadines + COUNTRY_VE = 238; // Venezuela (Bolivarian Republic of) + COUNTRY_VG = 239; // Virgin Islands (British) + COUNTRY_VI = 240; // Virgin Islands (U.S.) + COUNTRY_VN = 241; // Viet Nam + COUNTRY_VU = 242; // Vanuatu + COUNTRY_WF = 243; // Wallis and Futuna + COUNTRY_WS = 244; // Samoa + COUNTRY_YE = 245; // Yemen + COUNTRY_YT = 246; // Mayotte + COUNTRY_ZA = 247; // South Africa + COUNTRY_ZM = 248; // Zambia + COUNTRY_ZW = 249; // Zimbabwe + + COUNTRY_GLOBAL = 250; // Global +} diff --git a/proto/cmp/types/v2/location.proto b/proto/cmp/types/v2/location.proto new file mode 100644 index 0000000..59055c5 --- /dev/null +++ b/proto/cmp/types/v2/location.proto @@ -0,0 +1,104 @@ +syntax = "proto3"; + +package cmp.types.v2; + +import "cmp/types/v1/measurement.proto"; +import "cmp/types/v2/country.proto"; + +// ### Coordinate +// +// Represents a geographic location +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1/location.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1/location.proto.dot.svg) +message Coordinates { + // The latitude in degrees. It must be in the range [-90.0, +90.0]. + double latitude = 1; + // The longitude in degrees. It must be in the range [-180.0, +180.0]. + double longitude = 2; +} + +// Geo Circle +message GeoCircle { + cmp.types.v2.Coordinates center = 1; + cmp.types.v1.Length radius = 2; +} + +// Geo Polygon +message GeoPolygon { + // GPS points of the polygon + repeated cmp.types.v2.Coordinates points = 1; +} + +// Geo Tree +// +// Contrary to Geo coordinates, circle and polygon, a geotree is supplier specific +// and would require mapping for every connection. If possible use generic concepts, +// so that implementations can easily be reused among suppliers. +message GeoTree { + cmp.types.v2.Country country = 1; + string region = 2; + string city_or_resort = 3; +} + +// Location Code +// +// Location codes can be generic across multiple suppliers that support standardized +// code types. However, using provider specific codes makes an implementation more +// unique. +message LocationCode { + string code = 1; + cmp.types.v2.LocationCodeType type = 2; +} + +// Represents a list of `LocationCode` message type. We need to encapsulate repeated +// field here because repeated fields can not be used in `oneof` fields. +// +// Protobuf `oneof` field type does not support repeated member fields. To get the +// same functionality we need to wrap the needed message type with another message. +message LocationCodes { + repeated cmp.types.v2.LocationCode codes = 1; +} + +// Location Code Type +enum LocationCodeType { + LOCATION_CODE_TYPE_UNSPECIFIED = 0; + + LOCATION_CODE_TYPE_PROVIDER_CODE = 1; + + // IATA airport code + LOCATION_CODE_TYPE_IATA_CODE = 2; + + // ICAO airport code + LOCATION_CODE_TYPE_ICAO_CODE = 3; + + // A 3-character code used for train stations. Previously referred to as CRS + // (Computer Reservation System) or NRS (National Reservation System) codes. + LOCATION_CODE_TYPE_3ALPHA_CODE = 4; + + // A 6-digit code for train stations generally used for retail purposes + LOCATION_CODE_TYPE_NLC_CODE = 5; + + // Codes relating to points used in deriving train schedules + LOCATION_CODE_TYPE_TIPLOC_CODE = 6; + + // These codes can refer to locations such as sidings and junctions. STANOX codes + // are grouped by geographical area - the first two digits specify the area in + // which the location exists. + LOCATION_CODE_TYPE_STANOX_CODE = 7; + + // Used by multi-modal journey planners and timetables + LOCATION_CODE_TYPE_ATCO_CODE = 8; + + // Used in combination with the Google Places API + LOCATION_CODE_TYPE_GOOGLE_PLACE_ID = 9; + + // Used in combination with the Foursquare Places API + LOCATION_CODE_TYPE_FOURSQUARE_FSQ_ID = 10; + + // Used in combination with the OSM Overpass API + LOCATION_CODE_TYPE_OPENSTREETMAPS_REF = 11; + + // Used in combination with the HERE Places API + LOCATION_CODE_TYPE_HERE_ID = 12; +} diff --git a/proto/cmp/types/v2/product_code.proto b/proto/cmp/types/v2/product_code.proto new file mode 100644 index 0000000..011d17f --- /dev/null +++ b/proto/cmp/types/v2/product_code.proto @@ -0,0 +1,56 @@ +syntax = "proto3"; + +package cmp.types.v2; + +// Product code and type +// +// This is being used in requests to specify the a list of products to be included in the reponse +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v2/product_code.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v2/product_code.proto.dot.svg) +message ProductCode { + // In most cases like in accommodation, just the field "code" and "type" will be + // used. For example in case of a GiataID (for example code=182568), a provider + // hotel code (for example a hotel code=AESPMI1234), a transfer code, etc. + // However, for flight and train it is common to have a code and a number like "EW + // 51" or "ICE 2803", which would then be code=EW and number=51 or code=ICE and + // number=2803. It is not recommended to concatenate for example the airline code + // and the flight number into the code field as "EW 51", as this would cause different + // implementations for providers of the same product. + // + // Please note that when utilizing licensed codes or formats such as GiataID and DRV + // GlobalTypes, it is the partners' responsibility to confirm and settle any associated + // license fees directly with the respective organizations + string code = 1; + int32 number = 2; + cmp.types.v2.ProductCodeType type = 3; +} + +// TODO: here we added an enum, should we create a new version of it ? +// Product Code type +enum ProductCodeType { + PRODUCT_CODE_TYPE_UNSPECIFIED = 0; + PRODUCT_CODE_TYPE_GIATA = 1; + PRODUCT_CODE_TYPE_GOAL_ID = 2; + PRODUCT_CODE_TYPE_IATA = 3; + PRODUCT_CODE_TYPE_ICAO = 4; + PRODUCT_CODE_TYPE_SUPPLIER = 5; +} + +message SupplierProductCode { + // The supplier product code is unique for a product provided by the supplier and it + // must remain consistent across the different messages like the ProductList, ProductInfo + // and Search messages. Mapping is done on static data, however making a search request + // with a GiataID or an ICAO code, could return one or more search results with each + // individual supplier codes in case the code type is not unique and the supplier has + // multiple products for the requested code. An example could be making a request for an + // accommodation with a GiataID and the supplier can offer a product with just the hotel, + // the hotel with a ski pass or the hotel with a rent a car. For packages we can imagine + // an accommodation, the accommodation with a flight and transfer or the accommodation with + // a flight and a rent a car. As the product descriptions from the supplier will have + // different services, it is safe to assume the product codes will be differnt, the product + // name will be different and the descriptions and amenities as well in the ProductList and + // ProductInfo messages. + string supplier_code = 1; + int32 supplier_number = 2; +} diff --git a/proto/cmp/types/v2/search.proto b/proto/cmp/types/v2/search.proto index ce12b9c..09e9194 100644 --- a/proto/cmp/types/v2/search.proto +++ b/proto/cmp/types/v2/search.proto @@ -3,11 +3,11 @@ 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/country.proto"; import "cmp/types/v2/currency.proto"; // Search parameters for the search requests @@ -24,7 +24,7 @@ message SearchParameters { 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; + cmp.types.v2.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 diff --git a/proto/cmp/types/v2/traveller.proto b/proto/cmp/types/v2/traveller.proto new file mode 100644 index 0000000..64f8118 --- /dev/null +++ b/proto/cmp/types/v2/traveller.proto @@ -0,0 +1,78 @@ +syntax = "proto3"; + +package cmp.types.v2; + +import "cmp/types/v1/date.proto"; +import "cmp/types/v1/document.proto"; +import "cmp/types/v2/contact_info.proto"; +import "cmp/types/v2/country.proto"; + +// Traveller +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1/traveller.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1/traveller.proto.dot.svg) +message BasicTraveller { + // Guest number, the lowest number is the lead-pax. This ID is also used for + // referencing services linked to specific participants, like baggage. + // the traveller_id must be kept consistent between the search request and response. + // Conclusively if the request specifies traveller 0 and 1, then the response also refers + // to these traveller numbers. If the request specifies 1 and 2 or 10 and 20, then the + // response also returns these references. + // The traveller_id is specified in each unit and only detailed once in the search response + // repeated travellers field + int32 traveller_id = 1; + + // Traveller type from enum below + cmp.types.v2.TravellerType type = 2; + + // Birthdate + cmp.types.v1.Date birthdate = 3; + + // The country code for the nationality of the traveller. + cmp.types.v2.Country nationality = 4; +} + +// Traveller Type +enum TravellerType { + TRAVELLER_TYPE_UNSPECIFIED = 0; + TRAVELLER_TYPE_ADULT = 1; + TRAVELLER_TYPE_CHILD = 2; + TRAVELLER_TYPE_INFANT = 3; + TRAVELLER_TYPE_SENIOR = 4; +} + +message ExtensiveTraveller { + // Guest number, the lowest number is the lead-pax. This ID is also used for + // referencing services linked to specific participants, like baggage. + int32 traveller_id = 1; + + // Gender from the enum below + cmp.types.v2.GenderType gender = 2; + + // Many systems might just have one field for all first names and just one field + // for all surnames of a traveller. However, we see many countries with many + // surnames and authorities that require the names data to be correctly registered + // as in the passport of the traveller. In this case you can for example find in + // the fist name field "Diana Frances" and in the surname field "Spencer". However + // with double barrelled surnames this becomes problematic like in the case of + // firstname: "Winnie" Surname: "Madikizela-Mandela". In Spanish tradition, double + // surnames are the norm, which are composed of surname of their fathers, followed + // by the (first) surname of their mothers. These names are combined without + // hyphen for example Julio Iglesias de la Cueva and Enrique Iglesias Preysler. + // Conclusively systems that haye a limited number of first name and surname + // fields can just use one antry and systems that have multipl can fit John legen + // into first_name: John, first_name: Roger, surname: Stephens, surname: Legend. + repeated string first_names = 3; + repeated string surnames = 4; + cmp.types.v2.ContactInfo contact_info = 5; + repeated cmp.types.v1.Document documents = 6; +} + +// Gender Type +enum GenderType { + GENDER_TYPE_UNSPECIFIED = 0; + GENDER_TYPE_MALE = 1; + GENDER_TYPE_FEMALE = 2; + GENDER_TYPE_NONBINARY = 3; + GENDER_TYPE_AGENDER = 4; +}