Skip to content

Commit

Permalink
Update traling version name from v1alpha1 to v1alpha (#10)
Browse files Browse the repository at this point in the history
* change v1alpha1 to v1alpha
* add google timestamp to diagram generation
* update workflow to only run on dev and c4t pushes and PRs
  • Loading branch information
havan authored Jan 17, 2024
1 parent f20e9a1 commit 64dc057
Show file tree
Hide file tree
Showing 58 changed files with 428 additions and 417 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
paths:
- "proto/**"
- ".github/workflows/**"
branches:
- c4t
- dev
pull_request:
# Only run when there are changes under proto dir
paths:
Expand Down Expand Up @@ -68,7 +71,7 @@ jobs:
diagrams:
runs-on: ubuntu-latest
needs: buf-lint
if: ${{ (github.ref == 'refs/heads/draft') || (github.ref == 'refs/heads/dev') }}
if: ${{ (github.ref == 'refs/heads/draft') || (github.ref == 'refs/heads/dev') || (github.ref == 'refs/heads/c4t') }}
steps:
# Setup environment
- name: Checkout the repo
Expand Down
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
syntax = "proto3";

package cmp.services.accommodation.v1alpha1;
package cmp.services.accommodation.v1alpha;

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

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

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

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

// Property codes
repeated string property_codes = 4;
}

message AccommodationProductInfoResponse {
// Message header
cmp.types.v1alpha1.Header header = 1;
cmp.types.v1alpha.Header 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/v1alpha1/info.proto.dot.xs.svg)
// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/accommodation/v1alpha1/info.proto.dot.svg)
// ![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);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
syntax = "proto3";

package cmp.services.accommodation.v1alpha1;
package cmp.services.accommodation.v1alpha;

import "cmp/services/accommodation/v1alpha1/property_types.proto";
import "cmp/types/v1alpha1/common.proto";
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.v1alpha1.Header header = 1;
cmp.types.v1alpha.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;
cmp.types.v1alpha.Header 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/v1alpha1/list.proto.dot.xs.svg)
// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/accommodation/v1alpha1/list.proto.dot.svg)
// ![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);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
syntax = "proto3";

package cmp.services.accommodation.v1alpha1;

import "cmp/types/v1alpha1/address.proto";
import "cmp/types/v1alpha1/amenity.proto";
import "cmp/types/v1alpha1/bed.proto";
import "cmp/types/v1alpha1/description.proto";
import "cmp/types/v1alpha1/email.proto";
import "cmp/types/v1alpha1/file.proto";
import "cmp/types/v1alpha1/location.proto";
import "cmp/types/v1alpha1/meal_plan.proto";
import "cmp/types/v1alpha1/phone.proto";
import "cmp/types/v1alpha1/service_fact.proto";
import "cmp/types/v1alpha1/traveller.proto";
package cmp.services.accommodation.v1alpha;

import "cmp/types/v1alpha/address.proto";
import "cmp/types/v1alpha/amenity.proto";
import "cmp/types/v1alpha/bed.proto";
import "cmp/types/v1alpha/description.proto";
import "cmp/types/v1alpha/email.proto";
import "cmp/types/v1alpha/file.proto";
import "cmp/types/v1alpha/location.proto";
import "cmp/types/v1alpha/meal_plan.proto";
import "cmp/types/v1alpha/phone.proto";
import "cmp/types/v1alpha/service_fact.proto";
import "cmp/types/v1alpha/traveller.proto";
import "google/protobuf/timestamp.proto";

// ### Property message type
//
// Represents property info for an accommodation product
//
// ![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)
// ![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",
google.protobuf.Timestamp last_modified = 1;
Expand All @@ -41,16 +41,16 @@ message Property {
CategoryUnit category_unit = 6;

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

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

// Phones
repeated cmp.types.v1alpha1.Phone phones = 9;
repeated cmp.types.v1alpha.Phone phones = 9;

// Location coordinate
cmp.types.v1alpha1.Coordinate coordinate = 10;
cmp.types.v1alpha.Coordinate coordinate = 10;

// Ex: "www.hotel.com"
string website = 11;
Expand Down Expand Up @@ -106,19 +106,19 @@ message PropertyExtendedInfo {
Property property = 1;

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

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

// Segmentation classification
repeated string classification = 4;

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

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

// Payment type. Ex: "MERCHANT"
string payment_type = 7;
Expand All @@ -140,26 +140,26 @@ enum PropertyStatus {
message Room {
string code = 1;
string name = 2;
repeated cmp.types.v1alpha1.Image images = 3;
repeated cmp.types.v1alpha1.Video videos = 4;
repeated cmp.types.v1alpha.Image images = 3;
repeated cmp.types.v1alpha.Video videos = 4;

// Room descriptions
repeated cmp.types.v1alpha1.LocalizedDescriptionSet descriptions = 5;
repeated cmp.types.v1alpha.LocalizedDescriptionSet descriptions = 5;

// Meal plan (Board code)
repeated cmp.types.v1alpha1.MealPlan meal_plan = 6;
repeated cmp.types.v1alpha.MealPlan meal_plan = 6;

// Beds
repeated cmp.types.v1alpha1.Bed beds = 7;
repeated cmp.types.v1alpha.Bed beds = 7;

// Occupancy
Occupancy total_occupancy = 8;

// Services
repeated cmp.types.v1alpha1.ServiceFact services = 9;
repeated cmp.types.v1alpha.ServiceFact services = 9;

// Amenities
repeated cmp.types.v1alpha1.Amenity amenities = 10;
repeated cmp.types.v1alpha.Amenity amenities = 10;
}

message Occupancy {
Expand All @@ -184,7 +184,7 @@ message Occupancy {

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

// Min guests
int32 min = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ syntax = "proto3";
// and Product Details messages.
//
// This package is a **WIP**.
package cmp.services.accommodation.v1alpha1;
package cmp.services.accommodation.v1alpha;

import "cmp/services/accommodation/v1alpha1/search_query_types.proto";
import "cmp/services/accommodation/v1alpha1/search_result_types.proto";
import "cmp/types/v1alpha1/common.proto";
import "cmp/types/v1alpha1/search.proto";
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";

// The `Accommodation Search Request` message type facilitates the request for
// accommodations like hotel and holiday home searches within the platform. In the
Expand All @@ -39,14 +39,14 @@ import "cmp/types/v1alpha1/search.proto";
message AccommodationSearchRequest {
// Message header. Contains API version, message info string and end-user wallet
// address
cmp.types.v1alpha1.Header header = 1;
cmp.types.v1alpha.Header header = 1;

// Search request metadata
cmp.types.v1alpha1.SearchRequestMetadata metadata = 2;
cmp.types.v1alpha.SearchRequestMetadata metadata = 2;

// Generic search parameters Ex: Inclusion of OnRequest options and inclusion of
// only the cheapest or all options.
cmp.types.v1alpha1.SearchParameters search_parameters_generic = 3;
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.
Expand All @@ -63,19 +63,19 @@ message AccommodationSearchRequest {
message AccommodationSearchResponse {
// Message header. Contains API version, message info string and end user wallet
// address.
cmp.types.v1alpha1.Header header = 1;
cmp.types.v1alpha.Header header = 1;

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

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

// Service definition for Accommodation search
//
// ![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)
// ![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);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
syntax = "proto3";

package cmp.services.accommodation.v1alpha1;
package cmp.services.accommodation.v1alpha;

import "cmp/types/v1alpha1/location.proto";
import "cmp/types/v1alpha1/meal_plan.proto";
import "cmp/types/v1alpha1/product_code.proto";
import "cmp/types/v1alpha1/rate.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/rate.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/v1alpha1/search_parameters_types.proto.dot.xs.svg)
// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/accommodation/v1alpha1/search_parameters_types.proto.dot.svg)
// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/accommodation/v1alpha/search_parameters_types.proto.dot.xs.svg)
// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/accommodation/v1alpha/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 {
// FIXME: Do we need a list of location code here? Other fields are not lists.
cmp.types.v1alpha1.LocationCodes location_codes = 1;
cmp.types.v1alpha.LocationCodes location_codes = 1;

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

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

// Geo circle. Represented by a coordinate and a distance for radius
cmp.types.v1alpha1.GeoCircle location_geo_circle = 4;
cmp.types.v1alpha.GeoCircle location_geo_circle = 4;

// Geo polygon. Represented by a list of coordinate points.
cmp.types.v1alpha1.GeoPolygon location_geo_polygon = 5;
cmp.types.v1alpha.GeoPolygon location_geo_polygon = 5;
}

// Mealplan codes
repeated cmp.types.v1alpha1.MealPlan meal_plan_codes = 6;
repeated cmp.types.v1alpha.MealPlan meal_plan_codes = 6;

// Rate plans
repeated cmp.types.v1alpha1.RatePlan rate_plan = 7;
repeated cmp.types.v1alpha.RatePlan rate_plan = 7;

// Rate Rules
// To be used when searching for specific rates like refundable or resellable offers
repeated cmp.types.v1alpha1.RateRule rate_rules = 8;
repeated cmp.types.v1alpha.RateRule rate_rules = 8;

// Product code list
// Here a list of property codes would be used
repeated cmp.types.v1alpha1.ProductCode product_codes = 9;
repeated cmp.types.v1alpha.ProductCode product_codes = 9;
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
syntax = "proto3";

package cmp.services.accommodation.v1alpha1;
package cmp.services.accommodation.v1alpha;

import "cmp/services/accommodation/v1alpha1/search_parameters_types.proto";
import "cmp/services/accommodation/v1alpha1/unit_types.proto";
import "cmp/types/v1alpha1/travel_period.proto";
import "cmp/types/v1alpha1/traveller.proto";
import "cmp/services/accommodation/v1alpha/search_parameters_types.proto";
import "cmp/services/accommodation/v1alpha/unit_types.proto";
import "cmp/types/v1alpha/travel_period.proto";
import "cmp/types/v1alpha/traveller.proto";

message AccommodationSearchQuery {
// Integer query ID, unique per search request
Expand All @@ -16,10 +16,10 @@ message AccommodationSearchQuery {
AccommodationSearchParameters search_parameters_accommodation = 2;

// Travel period
cmp.types.v1alpha1.TravelPeriod travel_period = 3;
cmp.types.v1alpha.TravelPeriod travel_period = 3;

// Travellers
repeated cmp.types.v1alpha1.Traveller travellers = 4;
repeated cmp.types.v1alpha.Traveller travellers = 4;

// Total number of rooms / holiday homes
int32 unit_count = 5;
Expand Down
Loading

0 comments on commit 64dc057

Please sign in to comment.