|
ORE Studio 0.0.4
|
Service for managing currencies. More...
#include <currency_service.hpp>

Public Types | |
| using | context = ores::database::context |
Public Member Functions | |
| currency_service (context ctx) | |
| Constructs a currency_service with a database context. | |
| std::vector< domain::currency > | list_currencies (std::uint32_t offset, std::uint32_t limit) |
| Lists currencies with pagination support. | |
| std::uint32_t | count_currencies () |
| Gets the total count of active currencies. | |
| void | save_currency (const domain::currency ¤cy) |
| Saves a currency (creates or updates). | |
| void | delete_currency (const std::string &iso_code) |
| Deletes a currency by its ISO code. | |
| std::optional< domain::currency > | get_currency (const std::string &iso_code) |
| Retrieves a single currency by its ISO code. | |
| std::vector< domain::currency > | get_currency_history (const std::string &iso_code) |
| Retrieves all historical versions of a currency. | |
| std::optional< domain::currency_version_history > | get_currency_version_history (const std::string &iso_code) |
| Retrieves currency version history with version metadata. | |
Service for managing currencies.
Provides a higher-level interface for currency operations, wrapping the underlying repository.
|
explicit |
Constructs a currency_service with a database context.
| ctx | The database context for operations. |
| std::vector< domain::currency > list_currencies | ( | std::uint32_t | offset, |
| std::uint32_t | limit | ||
| ) |
Lists currencies with pagination support.
| offset | Number of records to skip. |
| limit | Maximum number of records to return. |
| std::uint32_t count_currencies | ( | ) |
Gets the total count of active currencies.
| void save_currency | ( | const domain::currency & | currency | ) |
Saves a currency (creates or updates).
| currency | The currency to save. |
| std::exception | on failure. |
| void delete_currency | ( | const std::string & | iso_code | ) |
Deletes a currency by its ISO code.
| iso_code | The ISO code of the currency to delete. |
| std::exception | on failure. |
| std::optional< domain::currency > get_currency | ( | const std::string & | iso_code | ) |
Retrieves a single currency by its ISO code.
| iso_code | The ISO code of the currency. |
| std::vector< domain::currency > get_currency_history | ( | const std::string & | iso_code | ) |
Retrieves all historical versions of a currency.
| iso_code | The ISO code of the currency. |
| std::optional< domain::currency_version_history > get_currency_version_history | ( | const std::string & | iso_code | ) |
Retrieves currency version history with version metadata.
Converts raw currency records to currency_version objects with version numbers, recorded_by, and recorded_at metadata. Versions are ordered from newest to oldest.
| iso_code | The ISO code of the currency. |