-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
158 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
syntax = "proto3"; | ||
|
||
package cmp.services.book.v1alpha; | ||
|
||
import "cmp/types/v1alpha/common.proto"; | ||
import "cmp/types/v1alpha/language.proto"; | ||
import "cmp/types/v1alpha/payment.proto"; | ||
import "cmp/types/v1alpha/pubkey.proto"; | ||
import "cmp/types/v1alpha/token.proto"; | ||
import "cmp/types/v1alpha/traveller.proto"; | ||
import "google/protobuf/timestamp.proto"; | ||
|
||
message MintRequest { | ||
// Message header | ||
cmp.types.v1alpha.Header header = 1; | ||
|
||
string validation_id = 2; | ||
|
||
string external_session_id = 3; | ||
|
||
cmp.types.v1alpha.Language language = 4; | ||
|
||
string market = 5; | ||
|
||
string booking_reference = 6; | ||
|
||
repeated cmp.types.v1alpha.ExtensiveTraveller travellers = 7; | ||
|
||
// The comments field is meant to pass noncommittal remarks entered by the | ||
// end-consumer about the service reservation, like "non-smoking room please", | ||
// "top floor room please". | ||
string comment = 8; | ||
|
||
// Public keys that will be used to encrypt the private booking data | ||
repeated cmp.types.v1alpha.PublicKey public_keys = 9; | ||
|
||
// This field is only relevant for off chain virtual credit card payments. | ||
cmp.types.v1alpha.AdditionalPaymentInfo additional_payment_info = 10; | ||
} | ||
|
||
message MintResponse { | ||
// Message header | ||
cmp.types.v1alpha.Header header = 1; | ||
|
||
// This must be a UUID according to RFC 4122 | ||
string mint_id = 2; | ||
|
||
// This must be a UUID according to RFC 4122 | ||
string validation_id = 3; | ||
|
||
string provider_booking_reference = 4; | ||
|
||
// The token that represents the booking of the service | ||
cmp.types.v1alpha.BookingToken booking_token = 5; | ||
|
||
string mint_transaction_id = 6; | ||
|
||
google.protobuf.Timestamp booking_timestamp = 7; | ||
|
||
// Transaction ID of the buy operation. This field is populated by the distributor | ||
// (buyer) bot after the buy operation and passed to the distributor middleware | ||
// (partner plugin) in the mint response. | ||
string buy_transaction_id = 8; | ||
} | ||
|
||
// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/book/v1alpha/mint.proto.dot.xs.svg) | ||
// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/book/v1alpha/mint.proto.dot.svg) | ||
service MintService { | ||
rpc Mint(MintRequest) returns (MintResponse); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
syntax = "proto3"; | ||
|
||
package cmp.services.book.v1alpha; | ||
|
||
import "cmp/types/v1alpha/common.proto"; | ||
import "cmp/types/v1alpha/price.proto"; | ||
|
||
message ValidationRequest { | ||
// Message header | ||
cmp.types.v1alpha.Header header = 1; | ||
|
||
// Search ID that is returned in the search response message in the `metadata`` | ||
// (`SearchResponseMetadata`) field. | ||
string search_id = 2; | ||
|
||
// Result ID that is that is returned by `result_id` field of the search result | ||
// messages, for example: `AccommodationSearchResult`. | ||
int32 result_id = 3; | ||
} | ||
|
||
message ValidationResponse { | ||
// Message header | ||
cmp.types.v1alpha.Header header = 1; | ||
|
||
// Unique validation ID. This must be a UUID according to RFC 4122 | ||
string validation_id = 2; | ||
|
||
// Validation object | ||
ValidationObject validation_object = 3; | ||
} | ||
|
||
// Validation message that represents a single `result_id` from the search results | ||
// message. | ||
// | ||
// TODO: Better name? | ||
message ValidationObject { | ||
int32 result_id = 1; | ||
cmp.types.v1alpha.PriceDetail price_detail = 2; | ||
} | ||
|
||
// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/book/v1alpha/validate.proto.dot.xs.svg) | ||
// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/book/v1alpha/validate.proto.dot.svg) | ||
service ValidationService { | ||
rpc Validation(ValidationRequest) returns (ValidationResponse); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
syntax = "proto3"; | ||
|
||
package cmp.types.v1alpha; | ||
|
||
import "cmp/types/v1alpha/date.proto"; | ||
|
||
message CreditCard { | ||
// FIXME: Can we use an int64 to represent a credit card number? | ||
string number = 1; | ||
Date expiration_date = 2; | ||
int32 cvc = 3; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
syntax = "proto3"; | ||
|
||
package cmp.types.v1alpha; | ||
|
||
import "cmp/types/v1alpha/credit_card.proto"; | ||
|
||
// Additional payment info message with currently only a single field of | ||
// `CreditCard` message type. | ||
message AdditionalPaymentInfo { | ||
CreditCard credit_card = 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
syntax = "proto3"; | ||
|
||
package cmp.types.v1alpha; | ||
|
||
message PublicKey { | ||
string key = 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters