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

Merge initial draft definition of Camino Messenger Protocol to dev branch #1

Merged
merged 87 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
49cce51
Combine hotel and holiday homes to accommodation
havan Nov 16, 2023
d8b4dcf
updated buf.md to reflect new structures and names
SamJaarsma Nov 17, 2023
9fe48be
commented more fields added max responses
SamJaarsma Nov 17, 2023
3226617
added sorting
SamJaarsma Nov 17, 2023
7679c65
added distance sorting and removed unused import
SamJaarsma Nov 17, 2023
6c083c1
corrected typo in sorting added buf with transport
SamJaarsma Nov 21, 2023
86cb353
fixed errors amended cxl
SamJaarsma Nov 21, 2023
1e645ff
fixed last link in buf
SamJaarsma Nov 21, 2023
624ea44
amended cxl policy
SamJaarsma Nov 21, 2023
ade9e2f
cxl comments and md error fix
SamJaarsma Nov 21, 2023
07c685e
remove info from header
havan Nov 21, 2023
ad9e938
break down Price to Price & PriceDetail
havan Nov 21, 2023
dcc7c6b
refactored comments to //
SamJaarsma Nov 21, 2023
34be4ac
Merge branch 'draft' of https://github.com/chain4travel/camino-messen…
SamJaarsma Nov 21, 2023
0edfa93
DateTime and various others
SamJaarsma Nov 23, 2023
10c8ace
documented price
SamJaarsma Nov 23, 2023
57498fe
traveller completed unit search options commented
SamJaarsma Nov 23, 2023
9cf2fd1
added location code type enum
SamJaarsma Nov 24, 2023
22cb98f
corrected market
SamJaarsma Nov 24, 2023
402b643
added filter types value
SamJaarsma Nov 24, 2023
70b8a1a
added description
SamJaarsma Nov 24, 2023
5287ea1
mover property_code to unit level
SamJaarsma Nov 24, 2023
f305c7b
RATE RULES ADAPTED FOR TRANSPORT MESSAGE
SamJaarsma Nov 24, 2023
2516124
added time for transport message
SamJaarsma Nov 24, 2023
322cabe
added fields for Transport
SamJaarsma Nov 24, 2023
530b590
fix field tags, missing imports and servicefact
havan Nov 26, 2023
0f123b0
diagram link to accommodation search
havan Nov 27, 2023
53fa43b
Makefile and script for generating diagrams and sabledocs
havan Nov 27, 2023
e4072e7
remove flight search message definition
havan Nov 27, 2023
6254482
added mealplan, descriptions and removed subunit
SamJaarsma Nov 29, 2023
40c336f
Mealplan changed from string to ENUM
SamJaarsma Nov 29, 2023
74be167
corrected mealplan enum and missing ; in unit
SamJaarsma Nov 29, 2023
409fe3e
removed enrichment
SamJaarsma Nov 29, 2023
093132b
added comment on static data
SamJaarsma Nov 29, 2023
e40373b
UUID for searchID and prefix error in mealplan
SamJaarsma Nov 29, 2023
b08eda4
add partner specific and token types
havan Dec 2, 2023
09d7465
add addresses to partner type
havan Dec 2, 2023
0223c3f
add partner configuration definition and service
havan Dec 3, 2023
bbcb32c
add network fee service & asset type
havan Dec 3, 2023
64d2bbe
refactor OptionFlags type to SearchParameters
havan Dec 3, 2023
db3f4b0
[WIP] add transport service and refactor and updates for cmp.types
havan Dec 3, 2023
d3b6c4d
[WIP] transport service, updates to geo_location and search parameters
havan Dec 3, 2023
3f4dc79
[TRANSPORT] transport service and related common types
havan Dec 3, 2023
f24da5f
typo and syntax fixes for a few comments
havan Dec 3, 2023
0363e2b
update service fact comment
havan Dec 3, 2023
8bc7545
switch to timestamp for trip max/min time
havan Dec 4, 2023
f080180
remove uuid for dns txt record
havan Dec 4, 2023
3e3ea33
remove redundant comment from parner type
havan Dec 4, 2023
a33886e
[REFACTOR] get rid of GeoLocation and refactor file and message names
havan Dec 5, 2023
38e705b
[ACTIVITY] add activity service with request and response messages
havan Dec 5, 2023
88dcb67
[REFACTOR] move repeating code into a new message type
havan Dec 6, 2023
0a0624f
add codeowners and buf build & lint workflow
havan Dec 6, 2023
aa15ee8
fix buf build workflow
havan Dec 6, 2023
22e1ade
update workflow to push to buf.build as draft
havan Dec 6, 2023
e28da4c
only run buf workflow when there are changes under proto dir
havan Dec 6, 2023
391d099
tidy up comments
havan Dec 6, 2023
b5c9175
documentation, adding retailer and supplier roles
SamJaarsma Dec 6, 2023
03dcb12
Update diagram script and workflow
havan Dec 7, 2023
467a429
Checkout the repo before generating
havan Dec 7, 2023
7fdb6f2
Seperate step for checkout action
havan Dec 7, 2023
bdd0210
Add graphviz dependency to workflow
havan Dec 7, 2023
4e5d348
Create smaller svg files
havan Dec 7, 2023
3c99065
Use the gen dir for scaling svgs
havan Dec 7, 2023
c74dee6
trigger workflow
havan Dec 7, 2023
9084709
update md image insert script
havan Dec 7, 2023
013d880
[DIAGRAMS] add diagrams to every proto file
havan Dec 7, 2023
28262e1
updated comments
SamJaarsma Dec 7, 2023
dcf4763
Update PartnerConfig and Partner definitions
havan Dec 7, 2023
5935946
make meal plan and rate plan repeated in Unit
havan Dec 8, 2023
c8cca71
Do not use buf's install action (too much api usage)
havan Dec 8, 2023
db693dd
Use installer for buf-lint and upload with gzip encoding
havan Dec 8, 2023
070d086
Update buf installer script
havan Dec 11, 2023
c4bc1e4
update package level descriptions
havan Dec 11, 2023
0aa1c5f
refactor options to results
havan Dec 12, 2023
fb9692d
pull search request related fields out of search result types
havan Dec 12, 2023
0c13376
[LIST] add product list for accommodation
havan Dec 12, 2023
458d0f6
move diagrams to service definitions
havan Dec 12, 2023
c365cd5
explained source and service location
SamJaarsma Dec 14, 2023
8ea2c1d
fixed enum, corrected field
SamJaarsma Dec 14, 2023
37d0a08
changed address to message
SamJaarsma Dec 14, 2023
23c634f
amended codetypelist locations, location_code inside PickUp DropOff
SamJaarsma Dec 14, 2023
55aae49
amended explanation
SamJaarsma Dec 14, 2023
23eefbc
added DOW to flexible search
SamJaarsma Dec 14, 2023
2edc7e1
Continue the seperation of rq/rs types and various small fixes
havan Dec 14, 2023
c408115
separate search parameters to generic and specific
havan Dec 15, 2023
25fdda4
Add specific search parameters for transport and activity
havan Dec 15, 2023
92bef6e
Fix all comment lines to max 84 chars
havan Dec 15, 2023
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
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* @havan
* @SamJaarsma
108 changes: 108 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: CI

on:
push:
# Only run when there are changes under proto dir
paths:
- "proto/**"
- ".github/workflows/**"
pull_request:
# Only run when there are changes under proto dir
paths:
- "proto/**"
- ".github/workflows/**"

jobs:
# Run buf's lint to check for errros
buf-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v4
- name: Install buf
run: |
# Installing buf
if [ "${{ env.buf_version }}" == "" ]; then
# Install latest version
sudo ./scripts/buf-installer.sh
else
# Install the defined version
sudo ./scripts/buf-installer.sh --version=${{ env.buf_version}}
fi
- name: Buf lint
uses: bufbuild/buf-lint-action@v1
with:
input: "proto"
# Push the draft branch to buf.build
bsr-push-draft:
runs-on: ubuntu-latest
needs: buf-lint
if: github.ref == 'refs/heads/draft'
environment: draft
steps:
- name: Checkout the repo
uses: actions/checkout@v4
- name: Install Buf
run: |
# Install Buf
if [ "${{ env.buf_version }}" == "" ]; then
# Install latest version
sudo ./scripts/buf-installer.sh
else
# Install the defined version
sudo ./scripts/buf-installer.sh --version=${{ env.buf_version}}
fi
- name: Push to buf.build
uses: bufbuild/buf-push-action@v1
with:
input: "proto"
draft: true
buf_token: ${{ secrets.BUF_BSR_TOKEN }}

# Generate and upload protodot diagrams
diagrams:
runs-on: ubuntu-latest
needs: buf-lint
if: github.ref == 'refs/heads/draft'
steps:
# Setup environment
- name: Checkout the repo
uses: actions/checkout@v4
- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@v1
- name: Install librsvg2-bin
run: sudo apt-get install -y librsvg2-bin

# Generate diagrams
- name: Generate Diagrams
run: |
# Install protodot
wget https://github.com/seamia/protodot/raw/master/binaries/protodot-linux-amd64
chmod +x protodot-linux-amd64
mkdir -v -p gen/bin
mv protodot-linux-amd64 gen/bin/protodot
export PATH=${PWD}/gen/bin:${PATH}

# Run generator script
bash scripts/generate_protodot.sh

# Remove .dot files, we do not need them.
find gen/diagrams -type f -name "*.dot" -exec rm -f {} +

# Show generated files
tree gen/diagrams

# Upload diagrams
- name: Cloud Authentication
id: auth
uses: "google-github-actions/auth@v1"
with:
credentials_json: "${{ secrets.GOOGLE_CREDENTIALS }}"

- name: Setup Cloud SDK
uses: google-github-actions/setup-gcloud@v1

- name: Upload Diagrams
run: |
# '-J' options is to set Content-Encoding to gzip
gsutil -m rsync -J -R -d gen/diagrams gs://docs-cmp-files/diagrams
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
gen
.vscode

37 changes: 37 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Generation Settings
GENERATED_DIR = gen
MODULLE_DIR = proto/cmp
PROTOC = protoc

# Protodot diagrams
PROTODOT = protodot
PROTODOT_DIR = diagrams

# Colors
GREEN=\033[92m
BLUE=\033[94m
RESET=\033[0m

# Default target
all: diagrams

# Generate protodot diagrams
diagrams: ${GENERATED_DIR}/${PROTODOT_DIR}
@echo "${GREEN}Generating Protodot Diagrams files${RESET}"
./scripts/generate_protodot.sh ${GENERATED_DIR} ${MODULLE_DIR} ${PROTODOT_DIR}

# Create necessary directories if they do not exist
${GENERATED_DIR}/${PROTODOT_DIR}:
mkdir -p $@

clean:
rm -rfv ${GENERATED_DIR}/*

sabledocs:
protoc proto/cmp/*/*.proto -o descriptor.pb --include_source_info
sabledocs
mv sabledocs_output ${GENERATED_DIR}/
rm -fv descriptor.pb

# Mark commands as phony so make knows they're not associated with files
.PHONY: all clean diagrams sabledocs
2 changes: 2 additions & 0 deletions buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ plugins:
opt: paths=source_relative
- plugin: buf.build/community/danielgtaylor-betterproto:v1.2.5
out: gen/python
- plugin: buf.build/protocolbuffers/python:v25.1
out: gen/pbpy
131 changes: 1 addition & 130 deletions proto/buf.md

Large diffs are not rendered by default.

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);
}
94 changes: 94 additions & 0 deletions proto/cmp/services/accommodation/v1alpha1/property_types.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
syntax = "proto3";

package cmp.services.accommodation.v1alpha1;

import "cmp/types/v1alpha1/address.proto";
import "cmp/types/v1alpha1/email.proto";
import "cmp/types/v1alpha1/location.proto";
import "cmp/types/v1alpha1/phone.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)
message Property {
// Ex: "2023-08-28T12:03:50",
google.protobuf.Timestamp last_modified = 1;

// Ex: "AESPMI1234"
string property_code = 2;

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

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

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

// Ex: "www.hotel.com"
string website = 11;

// Status of the property
// FIXME: Changed "deactivated" to "status". But we should still make this an enum. ??
string status = 12;

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

enum CategoryUnit {
CATEGORY_UNIT_UNSPECIFIED = 0;
CATEGORY_UNIT_STARS = 1;
CATEGORY_UNIT_PALMS = 2;
}
91 changes: 91 additions & 0 deletions proto/cmp/services/accommodation/v1alpha1/search.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
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.v1alpha1;

import "cmp/services/accommodation/v1alpha1/search_parameters_types.proto";
import "cmp/services/accommodation/v1alpha1/search_result_types.proto";
import "cmp/services/accommodation/v1alpha1/unit_types.proto";
import "cmp/types/v1alpha1/common.proto";
import "cmp/types/v1alpha1/search.proto";
import "cmp/types/v1alpha1/travel_period.proto";
import "cmp/types/v1alpha1/traveller.proto";

// ### Accommodation Search Request Message Type
//
// 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 the
// Unit 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 searches, so that several rooms or houses can be requested for the
// same dates and location or for the purpose of a tour or roadtrip, several
// accommodations for sequential dates and different locations.
//
// Developers leveraging this message type should ensure proper validation and
// handling, especially considering fields that are still under review, like
// `speech_request`.
message AccommodationSearchRequest {
// Message header. Contains API version, message info string and end-user wallet
// address
cmp.types.v1alpha1.Header header = 1;

// Search request metadata
cmp.types.v1alpha1.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;

// Accommodation specific search parameters Ex: Specific search parameters like
// geo location, meal plan, rate plan and rate rules.
AccommodationSearchParameters search_parameters_accommodation = 4;

// Travel period
cmp.types.v1alpha1.TravelPeriod travel_period = 5;

// Travellers
repeated cmp.types.v1alpha1.Traveller travellers = 6;

// Unit Types
repeated UnitType unit_types = 7;
}

// ### Accommodation Search Response
//
// 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.v1alpha1.Header header = 1;

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

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

// ### Accommodation Search Service definition
//
// ![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);
}
Loading
Loading