Skip to content

Commit

Permalink
[LIST] add product list for accommodation
Browse files Browse the repository at this point in the history
  • Loading branch information
havan committed Dec 12, 2023
1 parent fb9692d commit 0c13376
Show file tree
Hide file tree
Showing 9 changed files with 214 additions and 33 deletions.
32 changes: 32 additions & 0 deletions proto/cmp/services/accommodation/v1alpha1/list.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
syntax = "proto3";

package cmp.services.accommodation.v1alpha1;

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

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

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

// ### Accommodation Product List Service
//
// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1alpha1/list.proto.dot.xs.svg)
// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1alpha1/list.proto.dot.svg)
service AccommodationProductListService {
// Returns product list for accommodation (properties)
rpc AccommodationProductList(AccommodationProductListRequest) returns (AccommodationProductListResponse);
}
100 changes: 76 additions & 24 deletions proto/cmp/services/accommodation/v1alpha1/property_types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,93 @@ syntax = "proto3";

package cmp.services.accommodation.v1alpha1;

import "cmp/types/v1alpha1/country.proto";
import "cmp/types/v1alpha1/address.proto";
import "cmp/types/v1alpha1/email.proto";
import "cmp/types/v1alpha1/location.proto";
import "cmp/types/v1alpha1/price.proto";
import "cmp/types/v1alpha1/phone.proto";
import "google/protobuf/timestamp.proto";

// ### Property Info message type
// ### Property message type
//
// Represents property info for an accommodation product
//
// Represents basic property info
// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/accommodation/v1alpha1/property_types.proto.dot.xs.svg)
// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/accommodation/v1alpha1/property_types.proto.dot.svg)
message PropertyInfo {
// Name of the property
string property_name = 1;
message Property {
// Ex: "2023-08-28T12:03:50",
google.protobuf.Timestamp last_modified = 1;

// GIATA ID
string giata_id = 2;
// Ex: "AESPMI1234"
string property_code = 2;

// Goal ID
int32 goal_id = 3;
// Ex: "Beach Hotel Alanya"
string name = 3;

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

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

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

// Ex: Address type
cmp.types.v1alpha1.Address address = 7;

// Emails
repeated cmp.types.v1alpha1.Email emails = 8;

// Country
cmp.types.v1alpha1.Country country = 4;
// Phones
repeated cmp.types.v1alpha1.Phone phones = 9;

// Region
string region = 6;
// Location coordinate
cmp.types.v1alpha1.Coordinate coordinate = 10;

// City or Resort. The fieldname city_or_resort has been chosen as these concepts are used interchangeable in holiday applications and
//business/city break applications and distribution applications have to implement provider specific mapping.
string city_or_resort = 7;
// Ex: "www.hotel.com"
string website = 11;

// Coordinates of the property
cmp.types.v1alpha1.Coordinate location = 8;
// Status of the property
// FIXME: Chaned "deactivated" to "status". But we should still make this an enum. ??
string status = 12;

// Status of the property. FIXME: Can we make this an enum?
string status = 9;
// GIATA ID
string giata_id = 13;

// Goal ID
int32 goal_id = 14;

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

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;
}

// ## Total price in detail, with breakdowns
cmp.types.v1alpha1.PriceDetail total_price_detail = 10;
enum CategoryUnit {
CATEGORY_UNIT_UNSPECIFIED = 0;
CATEGORY_UNIT_STARS = 1;
CATEGORY_UNIT_PALMS = 2;
}
5 changes: 2 additions & 3 deletions proto/cmp/services/accommodation/v1alpha1/search.proto
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ import "cmp/types/v1alpha1/search.proto";
//
// Developers leveraging this message type should ensure proper validation and handling, especially considering fields
// that are still under review, like `speech_request`.
// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/accommodation/v1alpha1/search.proto.dot.xs.svg)
// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/accommodation/v1alpha1/search.proto.dot.svg)
message AccommodationSearchRequest {
// Message Header. Contains api version, message info string and end-user wallet address
cmp.types.v1alpha1.Header header = 1;
Expand Down Expand Up @@ -61,7 +59,8 @@ message AccommodationSearchResponse {

// ### Accommodation Search Service definition
//
// [Click for the AccommodationSearch Diagram](https://playground.docs.camino.network/assets/files/accommodation_search.proto.dot-175583e9938ec6523a48686688156d80.svg)
// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/accommodation/v1alpha1/search.proto.dot.xs.svg)
// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/accommodation/v1alpha1/search.proto.dot.svg)
service AccommodationSearchService {
// Accommodation Search method
rpc AccommodationSearch(AccommodationSearchRequest) returns (AccommodationSearchResponse);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ syntax = "proto3";

package cmp.services.accommodation.v1alpha1;

import "cmp/services/accommodation/v1alpha1/property_types.proto";
import "cmp/services/accommodation/v1alpha1/unit_types.proto";
import "cmp/types/v1alpha1/cancel_policy.proto";
import "cmp/types/v1alpha1/price.proto";
import "cmp/types/v1alpha1/rate.proto";

// ### Search result type for Accommodation Search Service
Expand All @@ -19,11 +19,11 @@ message AccommodationSearchResult {
// increasing by 1 for every search result.
int32 result_id = 1;

// Property information
PropertyInfo property_info = 2;
// Units for this search result
repeated Unit units = 2;

// Units for this search result.
repeated Unit units = 3;
// ## Total price in detail, with breakdowns
cmp.types.v1alpha1.PriceDetail total_price_detail = 3;

// The RateRule specifies whether a search result is non-refundable or not
repeated cmp.types.v1alpha1.RateRule rate_rules = 4;
Expand Down
5 changes: 4 additions & 1 deletion proto/cmp/services/accommodation/v1alpha1/unit_types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,12 @@ message Unit {
// Remaining units
int32 remaining_units = 15;

// Propert code
string property_code = 16;

// Remarks
// FIXME: Is this field "per Unit" or should it be "per search request"?
string remarks = 16;
string remarks = 17;
}

message Bed {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ message ActivitySearchResult {
string pricing_type = 9;
}

// ### Activity Info
//
// FIXME: We need optimizations in this type
message ActivityInfo {
// Ex: "TC000000"
string product_code = 1;
Expand Down
19 changes: 19 additions & 0 deletions proto/cmp/types/v1alpha1/address.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
syntax = "proto3";

package cmp.types.v1alpha1;

import "cmp/types/v1alpha1/location.proto";

// Address
//
// This type represents an address for a home or hotel etc.
//
// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1alpha1/address.proto.dot.xs.svg)
// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1alpha1/address.proto.dot.svg)
message Address {
string line_1 = 1;
string line_2 = 2;
string district = 3;
int32 zip_code = 5;
GeoTree geo_tree = 6;
}
38 changes: 38 additions & 0 deletions proto/cmp/types/v1alpha1/email.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
syntax = "proto3";

package cmp.types.v1alpha1;

// Email
//
// Email type for hotels, holiday homes etc
//
// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1alpha1/email.proto.dot.xs.svg)
// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1alpha1/email.proto.dot.svg)
message Email {
string email = 1;
EmailType email_type = 2;
string email_type_other = 3;
}

// Email Types
//
// FIXME: Check email types
enum EmailType {
EMAIL_TYPE_UNSPECIFIED = 0;
EMAIL_TYPE_OTHER = 1; // For emails that don't fit into other categories.
EMAIL_TYPE_RECEPTION = 2; // For accommodation properties like hotels.
EMAIL_TYPE_BOOKING = 3; // For booking confirmations.
EMAIL_TYPE_SUPPORT = 4; // General customer support.
EMAIL_TYPE_INQUIRY_RESPONSE = 5; // Responses to customer inquiries.
EMAIL_TYPE_TRANSPORT_INFO = 6; // Information regarding transport services.
EMAIL_TYPE_RENTAL_CONFIRMATION = 7; // Confirmation for car rentals.
EMAIL_TYPE_ACTIVITY_DETAILS = 8; // Details about booked activities or events.
EMAIL_TYPE_FEEDBACK_REQUEST = 9; // Requests for customer feedback.
EMAIL_TYPE_BILLING = 10; // Billing and payment related emails.
EMAIL_TYPE_CANCELLATION = 11; // Cancellation notices.
EMAIL_TYPE_REMINDER = 12; // Reminders for reservations or activities.
EMAIL_TYPE_PROMOTIONAL = 13; // Promotional emails, offers, discounts.
EMAIL_TYPE_UPDATES = 14; // Updates about services or policy changes.
EMAIL_TYPE_ALERTS = 15; // Alerts or important notices.
EMAIL_TYPE_NEWSLETTER = 16; // Regular newsletters.
}
35 changes: 35 additions & 0 deletions proto/cmp/types/v1alpha1/phone.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
syntax = "proto3";

package cmp.types.v1alpha1;

// Phone
//
// Phone type for hotels, holiday homes etc
//
// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1alpha1/phone.proto.dot.xs.svg)
// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1alpha1/phone.proto.dot.svg)
message Phone {
string phone = 1;
PhoneType phone_type = 2;
string phone_type_other = 3;
}

enum PhoneType {
PHONE_TYPE_UNSPECIFIED = 0;
PHONE_TYPE_OTHER = 1; // For phone numbers that don't fit into other categories.
PHONE_TYPE_RECEPTION = 2; // For accommodation properties like hotels.
PHONE_TYPE_BOOKING = 3; // Booking-related inquiries.
PHONE_TYPE_SUPPORT = 4; // Customer support and service.
PHONE_TYPE_INQUIRIES = 5; // General inquiries.
PHONE_TYPE_TRANSPORT_SERVICE = 6; // Transport services, like taxi or shuttle services.
PHONE_TYPE_RENTAL_SERVICE = 7; // Car rental service numbers.
PHONE_TYPE_ACTIVITY_COORDINATOR = 8; // Coordinators for activities or events.
PHONE_TYPE_BILLING = 9; // Billing and payment inquiries.
PHONE_TYPE_EMERGENCY = 10; // Emergency contact numbers.
PHONE_TYPE_FAX = 11; // Fax numbers.
PHONE_TYPE_MOBILE = 12; // Mobile phone numbers.
PHONE_TYPE_HOME = 13; // Home phone numbers.
PHONE_TYPE_BUSINESS = 14; // Business or office phone numbers.
PHONE_TYPE_TOLL_FREE = 15; // Toll-free numbers.
PHONE_TYPE_HOTLINE = 16; // Hotlines, for specialized support or services.
}

0 comments on commit 0c13376

Please sign in to comment.