diff --git a/proto/cmp/services/book/v1alpha/mint.proto b/proto/cmp/services/book/v1alpha/mint.proto new file mode 100644 index 0000000..3a9fae6 --- /dev/null +++ b/proto/cmp/services/book/v1alpha/mint.proto @@ -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); +} diff --git a/proto/cmp/services/book/v1alpha/validate.proto b/proto/cmp/services/book/v1alpha/validate.proto new file mode 100644 index 0000000..5dfc573 --- /dev/null +++ b/proto/cmp/services/book/v1alpha/validate.proto @@ -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); +} diff --git a/proto/cmp/types/v1alpha/credit_card.proto b/proto/cmp/types/v1alpha/credit_card.proto new file mode 100644 index 0000000..afed2ce --- /dev/null +++ b/proto/cmp/types/v1alpha/credit_card.proto @@ -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; +} diff --git a/proto/cmp/types/v1alpha/payment.proto b/proto/cmp/types/v1alpha/payment.proto new file mode 100644 index 0000000..0bc410c --- /dev/null +++ b/proto/cmp/types/v1alpha/payment.proto @@ -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; +} diff --git a/proto/cmp/types/v1alpha/pubkey.proto b/proto/cmp/types/v1alpha/pubkey.proto new file mode 100644 index 0000000..33a9fbc --- /dev/null +++ b/proto/cmp/types/v1alpha/pubkey.proto @@ -0,0 +1,7 @@ +syntax = "proto3"; + +package cmp.types.v1alpha; + +message PublicKey { + string key = 1; +} diff --git a/proto/cmp/types/v1alpha/token.proto b/proto/cmp/types/v1alpha/token.proto index d617712..d42aaf3 100644 --- a/proto/cmp/types/v1alpha/token.proto +++ b/proto/cmp/types/v1alpha/token.proto @@ -9,3 +9,13 @@ package cmp.types.v1alpha; message TokenCurrency { string contract_address = 1; } + +// Booking token that represents to access to the service +message BookingToken { + // Contract address of the smart contract or the address of natively implemented + // asset on-chain. + string contract = 1; + + // Token ID + int32 token_id = 2; +} diff --git a/proto/cmp/types/v1alpha/traveller.proto b/proto/cmp/types/v1alpha/traveller.proto index 38b5420..c765493 100644 --- a/proto/cmp/types/v1alpha/traveller.proto +++ b/proto/cmp/types/v1alpha/traveller.proto @@ -10,7 +10,6 @@ import "cmp/types/v1alpha/document.proto"; // // ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1alpha/traveller.proto.dot.xs.svg) // [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1alpha/traveller.proto.dot.svg) - message BasicTraveller { // Guest number, the lowest number is the lead-pax. This ID is also used for // referencing services linked to specific participants, like baggage. @@ -64,9 +63,9 @@ message ExtensiveTraveller { // into first_name: John, first_name: Roger, surname: Stephens, surname: Legend. repeated string first_names = 3; repeated string surnames = 4; - string phone_number = 6; - string email = 7; - repeated cmp.types.v1alpha.Document documents = 8; + string phone_number = 5; + string email = 6; + repeated cmp.types.v1alpha.Document documents = 7; } // Gender Type