Initial commit
This commit is contained in:
parent
a1b141d5b3
commit
28a6fbb8f1
9 changed files with 1260 additions and 0 deletions
29
src/currencyservice/proto/currency_service.proto
Normal file
29
src/currencyservice/proto/currency_service.proto
Normal file
|
@ -0,0 +1,29 @@
|
|||
syntax = "proto3";
|
||||
package hipstershop;
|
||||
|
||||
message Empty {}
|
||||
|
||||
service CurrencyService {
|
||||
rpc GetSupportedCurrencies(Empty) returns (GetSupportedCurrenciesResponse) {}
|
||||
rpc Convert(CurrencyConversionRequest) returns (Money) {}
|
||||
}
|
||||
// Describes a money amount without currency. For example, decimal=2 and
|
||||
// fractional=500 (or fractional=5) makes up 2.5 units.
|
||||
message MoneyAmount {
|
||||
uint32 decimal = 1;
|
||||
uint32 fractional = 2;
|
||||
}
|
||||
message Money {
|
||||
// The 3-letter currency code defined in ISO 4217.
|
||||
string currency_code = 1;
|
||||
MoneyAmount amount = 2;
|
||||
}
|
||||
message GetSupportedCurrenciesResponse {
|
||||
// The 3-letter currency code defined in ISO 4217.
|
||||
repeated string currency_codes = 1;
|
||||
}
|
||||
message CurrencyConversionRequest {
|
||||
Money from = 1;
|
||||
// The 3-letter currency code defined in ISO 4217.
|
||||
string to_code = 2;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue