Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MintService v2 #33

Merged
merged 10 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions proto/cmp/services/accommodation/v2/info.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
syntax = "proto3";

package cmp.services.accommodation.v2;

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

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

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

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

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

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

// Product list: Properties
repeated cmp.services.accommodation.v2.PropertyExtendedInfo properties = 2;
}

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

package cmp.services.accommodation.v2;

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

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

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

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

// Product list: Properties
repeated cmp.services.accommodation.v2.Property properties = 2;
}

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

package cmp.services.accommodation.v2;

import "cmp/types/v1/amenity.proto";
import "cmp/types/v1/bed.proto";
import "cmp/types/v1/contact_info.proto";
import "cmp/types/v1/description.proto";
import "cmp/types/v1/file.proto";
import "cmp/types/v1/location.proto";
import "cmp/types/v1/meal_plan.proto";
import "cmp/types/v1/product_code.proto";
import "cmp/types/v1/product_status.proto";
import "cmp/types/v1/traveller.proto";
import "cmp/types/v2/service_fact.proto";
import "google/protobuf/timestamp.proto";

// Represents property info for an accommodation product
//
// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/accommodation/v1/property_types.proto.dot.xs.svg)
// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/accommodation/v1/property_types.proto.dot.svg)
message Property {
// Ex: "2023-08-28T12:03:50", specifying when the static data of a product was
// last updated
google.protobuf.Timestamp last_modified = 1;

// Supplier product Code
cmp.types.v1.SupplierProductCode supplier_code = 2;

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

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

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

// Ex: CATEGORY_RATING_4_5
cmp.services.accommodation.v2.CategoryRating category_rating = 6;

// Ex: CATEGORY_UNIT_PALMS
cmp.services.accommodation.v2.CategoryUnit category_unit = 7;

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

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

// Status of the property
cmp.types.v1.ProductStatus status = 10;

// Airports
// Ex: ["PMI", "ZRH", "AYT"]
repeated string airports = 11;
}

enum CategoryRating {
CATEGORY_RATING_UNSPECIFIED = 0;
CATEGORY_RATING_0_5 = 1;
CATEGORY_RATING_1_0 = 2;
CATEGORY_RATING_1_5 = 3;
CATEGORY_RATING_2_0 = 4;
CATEGORY_RATING_2_5 = 5;
CATEGORY_RATING_3_0 = 6;
CATEGORY_RATING_3_5 = 7;
CATEGORY_RATING_4_0 = 8;
CATEGORY_RATING_4_5 = 9;
CATEGORY_RATING_5_0 = 10;
CATEGORY_RATING_5_5 = 11;
CATEGORY_RATING_6_0 = 12;
CATEGORY_RATING_6_5 = 13;
CATEGORY_RATING_7_0 = 14;
CATEGORY_RATING_7_5 = 15;
CATEGORY_RATING_8_0 = 16;
CATEGORY_RATING_8_5 = 17;
CATEGORY_RATING_9_0 = 18;
CATEGORY_RATING_9_5 = 19;
CATEGORY_RATING_10_0 = 20;
}

enum CategoryUnit {
CATEGORY_UNIT_UNSPECIFIED = 0;
CATEGORY_UNIT_STARS = 1;
CATEGORY_UNIT_PALMS = 2;
}

// This message type contains extended info about a property
message PropertyExtendedInfo {
// Property
cmp.services.accommodation.v2.Property property = 1;

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

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

// Segmentation classification
repeated string classifications = 4;

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

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

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

// Rooms
repeated cmp.services.accommodation.v2.Room rooms = 8;
}

message Room {
// Room code of the unit in case of hotel. Ex: "RMSDDB0000". For holiday homes
// often no room codes are used. This code must explicitly match the supplier_room_code
// in the ProductList and the ProductInfo messages, so that the static data like room
// amenities, descriptions, images etc. can be married to the dynamic price and
// availability data for display to the end user.
string supplier_code = 1;

// Room name. In case of hotel a standardized room name is often derrived from
// room code structures. Exmple: "superior seaview room".
// For holiday homes we expect names like "Master Bedroom", "Second Bedroom" or
// "Bathroom" when specific descriptions for each room are available.
string supplier_name = 2;

// Original room name as assigned by the hotel. In case of spefifically designated room
// names by chains and both the chain and the customer wants to adhere to them.
// Ex: "CEIBA CLUB", "CEIBA GOVERNORS SUITE", "GOVERNORS SUITE" or "ENCLAVE NATURE VIEW"
// For holiday homes specific room names if availbale can be given.
string original_name = 3;

repeated cmp.types.v1.Image images = 4;
repeated cmp.types.v1.Video videos = 5;

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

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

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

// Occupancy
cmp.services.accommodation.v2.Occupancy total_occupancy = 9;

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

// Amenities
repeated cmp.types.v1.Amenity amenities = 11;
}

message Occupancy {
// Min guests
int32 min_guests = 1;

// Max guests
int32 max_guests = 2;

// Standard occupancy
int32 standard_occupancy = 3;

// Full payers
int32 full_payers = 4;

// If infants are counted in total guests or not
bool infant_counted_in_total_guests = 5;

// Occupancy options
repeated cmp.services.accommodation.v2.OccupancyOption occupancy_options = 6;
}

message OccupancyOption {
// Guest type like adult, child, infant.
cmp.types.v1.TravellerType guest_type = 1;

// Min guests
int32 min = 2;

// Max guests
int32 max = 3;

// Min age
int32 min_age = 4;

// Max age
int32 max_age = 5;
}
122 changes: 122 additions & 0 deletions proto/cmp/services/accommodation/v2/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.v2;

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

// The `Accommodation Search Request` message type facilitates the request for
// accommodations like hotel and holiday home searches within the platform. In the
// request the market, language and currency are specified at the top-level.
//
// In "queries" we specify the details of the trip like dates, properties or
// locations or filters. The purpose of such a structure is to allow for multi-room
// and multi-property search requests.
//
// For the response this means that there is no grouping of different
// room, mealplan or rateplan options in single room or single property searches.
// Each AccommodationSearchResult is one bookable option as a "result_id".
//
// Simple example:
// a search for 1 room for 2 adults would be just 1 query, with one travel period and
// one set of search parameters. The response has one query_id with many result_ids
// for various rooms, mealplans and rateplans in one hotel and depending on the search
// parameters, again for other hotels. Each property+room+rateplan+mealplan is one
// result_id with just one unit.
//
// The simple example is also applicable for holiday homes where one or multiple
// result_ids will be returned for various homes matching the query. The results will
// probably not include a mealplan and in general no room information as all rooms in
// the home are included. Flexible and non-refundable as well as packaging rateplans
// are already surfacing in some distribution channels.
//
// Multi room example:
// a search for 1 room for 2 adults in one query and another room for two adults and a
// child of 8 in another room in the same hotel or destination for the same dates in
// another query in the search request. This will lead to a search response with just
// one unit for eavery possible option available for each query_id, with many result_ids.
//
// The same concept is valid for multiple homes for more than one family travelling
// together to one park or destination.
//
// Road-trip or circuit example:
// a search for one or multiple rooms or homes in queries that have sequential dates
// and destinations. For example a trip to Las Vegas, a flight to New York and decending
// the atlantic coastline to New Orleans or Orlando by car with stops in various places.
//
// The hostel, convention or groups example:
// Often just 5 rooms for 10 peopleare requested or specific bed combinations like 5
// single-use rooms (for 5 travellers) and 5 double rooms (10 travellers) are requested.
// In this case the number of rooms is specified and the total amount of travellers,
// but no distribution of travellers per room is detailed in the request. The reponse
// then hold multiple units for one search_id and result_id, so that if 5 rooms are
// requested, but only 2 standard rooms are available, the requested amount can be
// completed with a different room type (superior, seaview,..)
//
// In general, the number of available rooms should be considered to ensure that for
// requests with multiple rooms or homes, the same room or home is not offered twice
// to different travellers.
//
message AccommodationSearchRequest {
// Message header. Contains API version, message info string and end-user wallet
// address
cmp.types.v1.RequestHeader header = 1;

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

// Generic search parameters Ex: Inclusion of OnRequest options and inclusion of
// only the cheapest or all options.
// In the search parameters multiple filters can be applied for upfront filtering
// of the search results to for example to only include hotels that are less than
// one kilometer from the beach, have a kids club and offer an a la carte restaurant
cmp.types.v2.SearchParameters search_parameters_generic = 3;

// This field represents a list of search queries that can be used to create
// multiroom multi location searches.
repeated cmp.services.accommodation.v2.AccommodationSearchQuery queries = 4;
}

// The `Accommodation Search Response` message type facilitates the response for
// accommodations like hotel and holiday home searches within the platform.
//
// In the response a search_id must be included and a search_option_id for every
// bookable option responded. Included, compulsary and optional services can be
// included. A simple "free cancellation upto" can be set or full cancellation
// pilicies can be included.
message AccommodationSearchResponse {
// Message header. Contains API version, message info string and end user wallet
// address.
cmp.types.v1.ResponseHeader header = 1;

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

// Unique combinations of bookable search results, like property,
repeated cmp.services.accommodation.v2.AccommodationSearchResult results = 3;

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

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