currency.proto
path protobuffet/example/currency/v1/currency.proto
package protobuffet.example.currency.v1
Messages
CurrencyConversionRequest
Request for converting a given amount to a different currency.
| Name | Type | Description |
|---|---|---|
from | protobuffet.example.common.types.v1.Money | Money that should be converted. |
to_code | string | The 3-letter currency code defined in ISO 4217. |
Empty
Represents successful response with no data required.
| Name | Type | Description |
|---|
GetSupportedCurrenciesResponse
Response containing supported currencies.
| Name | Type | Description |
|---|---|---|
currency_codes | repeated string | The 3-letter currency code defined in ISO 4217. |
Services
CurrencyService
Currency management service. Keep currency calculations encapsulated within this service to avoid this complexity leaking to other domains.
GetSupportedCurrencies
| Method | GetSupportedCurrencies |
|---|---|
| Request | Empty |
| Response | GetSupportedCurrenciesResponse |
| Description | Fetch all supported currencies. |
Convert
| Method | Convert |
|---|---|
| Request | CurrencyConversionRequest |
| Response | Money |
| Description | Convert an amount to a different currency. |