Skip to content

Commit

Permalink
Add Activity product info service and message types (#22)
Browse files Browse the repository at this point in the history
* buf format, bookable -> bookability, typo fixes
* coordinate --> coordinates

---------

Co-authored-by: Ekrem Seren <[email protected]>
  • Loading branch information
mo-c4t and havan authored Aug 21, 2024
1 parent 0ea2dfb commit fdad4d5
Show file tree
Hide file tree
Showing 16 changed files with 434 additions and 97 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ message Property {
repeated cmp.types.v1alpha.Phone phones = 10;

// Location coordinate
cmp.types.v1alpha.Coordinate coordinate = 11;
cmp.types.v1alpha.Coordinates coordinates = 11;

// Ex: "www.hotel.com"
string website = 12;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ message AccommodationSearchParameters {
cmp.types.v1alpha.LocationCodes location_codes = 1;

// Single geographic point represented by two double fields.
cmp.types.v1alpha.Coordinate location_coordinate = 2;
cmp.types.v1alpha.Coordinates location_coordinates = 2;

// Geo tree type, representted by Country, Region, and City_or_Resort.
// Geo tree type, represented by Country, Region, and City_or_Resort.
cmp.types.v1alpha.GeoTree location_geo_tree = 3;

// Geo circle. Represented by a coordinate and a distance for radius
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ syntax = "proto3";
package cmp.services.accommodation.v1alpha;

import "cmp/services/accommodation/v1alpha/unit_types.proto";
import "cmp/types/v1alpha/bookable.proto";
import "cmp/types/v1alpha/bookability.proto";
import "cmp/types/v1alpha/cancel_policy.proto";
import "cmp/types/v1alpha/price.proto";
import "cmp/types/v1alpha/rate.proto";
Expand Down Expand Up @@ -37,5 +37,5 @@ message AccommodationSearchResult {
string remarks = 7;

// Status of the result, whether it is immediately bookable or not
cmp.types.v1alpha.Bookability bookable = 8;
cmp.types.v1alpha.Bookability bookability = 8;
}
252 changes: 252 additions & 0 deletions proto/cmp/services/activity/v1alpha/activity_types.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,252 @@
syntax = "proto3";

package cmp.services.activity.v1alpha;

import "cmp/types/v1alpha/address.proto";
import "cmp/types/v1alpha/bookability.proto";
import "cmp/types/v1alpha/contact_info.proto";
import "cmp/types/v1alpha/datetime_range.proto";
import "cmp/types/v1alpha/delivery.proto";
import "cmp/types/v1alpha/description.proto";
import "cmp/types/v1alpha/duration.proto";
import "cmp/types/v1alpha/file.proto";
import "cmp/types/v1alpha/language.proto";
import "cmp/types/v1alpha/location.proto";
import "cmp/types/v1alpha/product_code.proto";
import "cmp/types/v1alpha/redemption.proto";
import "google/protobuf/timestamp.proto";

// This represents Activity types which is needed for different activity services (search, info, ... etc)
//
// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/activity/v1alpha/activity_types.proto.dot.xs.svg)
// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/activity/v1alpha/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.v1alpha.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.v1alpha.Bookability bookability = 7;
}

message ActivityLocation {
// Ex: Ctra. de la Porrassa, s/n, Magaluf, ES 07181 in structured fields
cmp.types.v1alpha.Address address = 1;

// Geo Tree. Country, region, city_or_resort
cmp.types.v1alpha.GeoTree geo_tree = 2;

// Coordinate
cmp.types.v1alpha.Coordinates coordinates = 3;
}

message PickupDropoffEvent {
// Ex: "AESPMI43NU",
string location_code = 1;
// Ex: "Sunny Beach Hotel",
string location_name = 2;

// True if this pickup location is selected for the activity
//
// Ex: "true"
//
// FIXME: How is this relevant for the search result message?
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.v1alpha.Coordinates coordinates = 6;
}

enum PricingType {
PRICING_TYPE_UNSPECIFIED = 0;
PRICING_TYPE_PERPERSON = 1;
PRICING_TYPE_PERGROUP = 2;
}

message ActivityExtendedInfo {
// Activity dynamic info
Activity activity = 1;

// Units
repeated ActivityUnit units = 2;

// Service Info
ActivityService service = 3;

// Zones
repeated ActivityZone zones = 4;

// Descriptions with different languages
repeated cmp.types.v1alpha.LocalizedDescriptionSet descriptions = 5;

// Coordinates
cmp.types.v1alpha.Coordinates coordinates = 6;

// Activity Features
repeated ActivityFeature features = 7;

// Tags
repeated ActivityTag tags = 8;

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

// Contact Info; Address, Email, Phone, Urls
cmp.types.v1alpha.ContactInfo contact_info = 10;

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

// Videos
repeated cmp.types.v1alpha.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.v1alpha.SupplierProductCode supplier_code = 18;

// Supplier Name
string supplier_code_name = 19;

// Duration range (min, max) of the activity in minutes
cmp.types.v1alpha.DurationRange duration_range = 20;

// Time given for confirmation before the offer expires
cmp.types.v1alpha.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.v1alpha.DeliveryFormat delivery_formats = 27;

// Delivery Methods; such as Email, SMS, Post, ... etc
repeated cmp.types.v1alpha.DeliveryMethod delivery_methods = 28;

// Redemption method
repeated cmp.types.v1alpha.RedemptionMethod redemption_methods = 29;
}

message ActivityUnit {
// Schedule
cmp.types.v1alpha.DateTimeRange schedule = 1;

// Unit Code
string code = 2;

// Unit Name
string name = 3;

// Unit Description
string description = 4;
}

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;

// Encluded items in the activity service
repeated string excluded = 5;
}

message ActivityZone {
// Unit Code
string code = 1;

// Geo tree type, represented by Country, Region, and City_or_Resort.
cmp.types.v1alpha.GeoTree geo_tree = 2;

// pick-up and drop-off information about location and time
repeated 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;
}
40 changes: 40 additions & 0 deletions proto/cmp/services/activity/v1alpha/info.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
syntax = "proto3";

package cmp.services.activity.v1alpha;

import "cmp/services/activity/v1alpha/activity_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 ActivityProductInfoRequest {
// 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;

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

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

// Product list: Activities
repeated ActivityExtendedInfo activities = 2;
}

// Activity product info service definition
//
// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/activity/v1alpha/info.proto.dot.xs.svg)
// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/activity/v1alpha/info.proto.dot.svg)
service ActivityProductInfoService {
// Returns product list for activity
rpc ActivityProductInfo(ActivityProductInfoRequest) returns (ActivityProductInfoResponse);
}
2 changes: 1 addition & 1 deletion proto/cmp/services/activity/v1alpha/list.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package cmp.services.activity.v1alpha;

import "cmp/services/activity/v1alpha/search_result_types.proto";
import "cmp/services/activity/v1alpha/activity_types.proto";
import "cmp/types/v1alpha/common.proto";
import "google/protobuf/timestamp.proto";

Expand Down
8 changes: 4 additions & 4 deletions proto/cmp/services/activity/v1alpha/search.proto
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ message ActivitySearchRequest {
cmp.types.v1alpha.LocationCodes source_location_codes = 7;

// Single geographic point represented by two double fields.
cmp.types.v1alpha.Coordinate source_location_coordinate = 8;
cmp.types.v1alpha.Coordinates source_location_coordinates = 8;

// Geo tree type, representted by Country, Region, and City_or_Resort.
// Geo tree type, represented by Country, Region, and City_or_Resort.
cmp.types.v1alpha.GeoTree source_location_geo_tree = 9;

// Geo circle. Represented by a coordinate and a distance for radius
Expand All @@ -81,9 +81,9 @@ message ActivitySearchRequest {
cmp.types.v1alpha.LocationCodes service_location_codes = 12;

// Single geographic point represented by two double fields.
cmp.types.v1alpha.Coordinate service_location_coordinate = 13;
cmp.types.v1alpha.Coordinates service_location_coordinates = 13;

// Geo tree type, representted by Country, Region, and City_or_Resort.
// Geo tree type, represented by Country, Region, and City_or_Resort.
cmp.types.v1alpha.GeoTree service_location_geo_tree = 14;

// Geo circle. Represented by a coordinate and a distance for radius
Expand Down
Loading

0 comments on commit fdad4d5

Please sign in to comment.