Skip to content

Commit

Permalink
added v1
Browse files Browse the repository at this point in the history
  • Loading branch information
mo-c4t committed Aug 28, 2024
1 parent ae259c4 commit 18f6ed0
Show file tree
Hide file tree
Showing 77 changed files with 5,059 additions and 0 deletions.
40 changes: 40 additions & 0 deletions proto/cmp/services/accommodation/v1/info.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
syntax = "proto3";

package cmp.services.accommodation.v1alpha;

import "cmp/services/accommodation/v1alpha/property_types.proto";
import "cmp/types/v1alpha/common.proto";
import "cmp/types/v1alpha/language.proto";
import "cmp/types/v1alpha/product_code.proto";
import "google/protobuf/timestamp.proto";

message AccommodationProductInfoRequest {
// Message header
cmp.types.v1alpha.RequestHeader header = 1;

// Only respond with the products that are modified after this timestamp
google.protobuf.Timestamp modified_after = 2;

// Languages
repeated cmp.types.v1alpha.Language languages = 3;

// Property codes
repeated cmp.types.v1alpha.SupplierProductCode supplier_codes = 4;
}

message AccommodationProductInfoResponse {
// Message header
cmp.types.v1alpha.ResponseHeader header = 1;

// Product list: Properties
repeated PropertyExtendedInfo properties = 2;
}

// Accommodation product info service definition
//
// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/accommodation/v1alpha/info.proto.dot.xs.svg)
// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/accommodation/v1alpha/info.proto.dot.svg)
service AccommodationProductInfoService {
// Returns product list for accommodation (properties)
rpc AccommodationProductInfo(AccommodationProductInfoRequest) returns (AccommodationProductInfoResponse);
}
32 changes: 32 additions & 0 deletions proto/cmp/services/accommodation/v1/list.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
syntax = "proto3";

package cmp.services.accommodation.v1alpha;

import "cmp/services/accommodation/v1alpha/property_types.proto";
import "cmp/types/v1alpha/common.proto";
import "google/protobuf/timestamp.proto";

message AccommodationProductListRequest {
// Message header
cmp.types.v1alpha.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.v1alpha.ResponseHeader header = 1;

// Product list: Properties
repeated Property properties = 2;
}

// Accommodation product list service definition
//
// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/accommodation/v1alpha/list.proto.dot.xs.svg)
// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/accommodation/v1alpha/list.proto.dot.svg)
service AccommodationProductListService {
// Returns product list for accommodation (properties)
rpc AccommodationProductList(AccommodationProductListRequest) returns (AccommodationProductListResponse);
}
193 changes: 193 additions & 0 deletions proto/cmp/services/accommodation/v1/property_types.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
syntax = "proto3";

package cmp.services.accommodation.v1alpha;

import "cmp/types/v1alpha/amenity.proto";
import "cmp/types/v1alpha/bed.proto";
import "cmp/types/v1alpha/contact_info.proto";
import "cmp/types/v1alpha/description.proto";
import "cmp/types/v1alpha/file.proto";
import "cmp/types/v1alpha/location.proto";
import "cmp/types/v1alpha/meal_plan.proto";
import "cmp/types/v1alpha/product_code.proto";
import "cmp/types/v1alpha/product_status.proto";
import "cmp/types/v1alpha/service_fact.proto";
import "cmp/types/v1alpha/traveller.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/v1alpha/property_types.proto.dot.xs.svg)
// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/accommodation/v1alpha/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.v1alpha.SupplierProductCode supplier_code = 2;

// Product code which can be of different types
repeated cmp.types.v1alpha.ProductCode product_codes = 3;

// Ex: "Beach Hotel Alanya"
string name = 4;

// Ex: "Hilton"
string chain = 5;

// Ex: CategoryRating.CATEGORY_RATING_4_5
CategoryRating category_rating = 6;

// Ex: CategoryUnit.CATEGORY_UNIT_PALMS
CategoryUnit category_unit = 7;

// Contact Info: phone, address, email, links
cmp.types.v1alpha.ContactInfo contact_info = 8;

// Location coordinate
cmp.types.v1alpha.Coordinates coordinates = 9;

// Status of the property
cmp.types.v1alpha.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
Property property = 1;

// Images
repeated cmp.types.v1alpha.Image images = 2;

// Videos
repeated cmp.types.v1alpha.Video videos = 3;

// Segmentation classification
repeated string classifications = 4;

// Property descriptions
repeated cmp.types.v1alpha.LocalizedDescriptionSet localized_descriptions = 5;

// Room descriptions
repeated cmp.types.v1alpha.LocalizedDescriptionSet localized_room_descriptions = 6;

// Payment type. Ex: "MERCHANT"
string payment_type = 7;

// Rooms
repeated 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.v1alpha.Image images = 4;
repeated cmp.types.v1alpha.Video videos = 5;

// Room descriptions
repeated cmp.types.v1alpha.LocalizedDescriptionSet descriptions = 6;

// Meal plan (Board code)
repeated cmp.types.v1alpha.MealPlan meal_plans = 7;

// Beds
repeated cmp.types.v1alpha.Bed beds = 8;

// Occupancy
Occupancy total_occupancy = 9;

// Services
repeated cmp.types.v1alpha.ServiceFact services = 10;

// Amenities
repeated cmp.types.v1alpha.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 OccupancyOption occupancy_options = 6;
}

message OccupancyOption {
// Guest type like adult, child, infant.
cmp.types.v1alpha.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;
}
122 changes: 122 additions & 0 deletions proto/cmp/services/accommodation/v1/search.proto
Original file line number Diff line number Diff line change
@@ -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.v1alpha;

import "cmp/services/accommodation/v1alpha/search_query_types.proto";
import "cmp/services/accommodation/v1alpha/search_result_types.proto";
import "cmp/types/v1alpha/common.proto";
import "cmp/types/v1alpha/search.proto";
import "cmp/types/v1alpha/traveller.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.v1alpha.RequestHeader header = 1;

// Search request metadata
cmp.types.v1alpha.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.v1alpha.SearchParameters search_parameters_generic = 3;

// This field represents a list of search queries that can be used to create
// multiroom multi location searches.
repeated 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.v1alpha.ResponseHeader header = 1;

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

// Unique combinations of bookable search results, like property,
repeated AccommodationSearchResult results = 3;

// Global definition of the travellers for all results to be used via the traveller_id each unit.
repeated cmp.types.v1alpha.BasicTraveller travellers = 4;
}

// Service definition for Accommodation search
//
// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/accommodation/v1alpha/search.proto.dot.xs.svg)
// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/accommodation/v1alpha/search.proto.dot.svg)
service AccommodationSearchService {
// Accommodation Search method
rpc AccommodationSearch(AccommodationSearchRequest) returns (AccommodationSearchResponse);
}
Loading

0 comments on commit 18f6ed0

Please sign in to comment.