|
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 | save_currencies (const std::vector< domain::currency > ¤cies) |
| Saves a batch of currencies atomically (all or nothing). | |
| void | delete_currency (const std::string &iso_code) |
| Deletes a currency by its ISO code. | |
| void | delete_currencies (const std::vector< std::string > &iso_codes) |
| Deletes currencies by their ISO codes. | |
| 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. | |
| std::vector< domain::currency > | list_currencies_for_party (const boost::uuids::uuid &party_id, std::uint32_t offset, std::uint32_t limit) |
| Lists currencies visible to a specific party, with pagination. | |
| std::uint32_t | count_currencies_for_party (const boost::uuids::uuid &party_id) |
| Gets the total count of currencies visible to a specific party. | |
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 save_currencies | ( | const std::vector< domain::currency > & | currencies | ) |
Saves a batch of currencies atomically (all or nothing).
| currencies | The currencies 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, modified_by, and recorded_at metadata. Versions are ordered from newest to oldest.
| iso_code | The ISO code of the currency. |
| std::vector< domain::currency > list_currencies_for_party | ( | const boost::uuids::uuid & | party_id, |
| std::uint32_t | offset, | ||
| std::uint32_t | limit | ||
| ) |
Lists currencies visible to a specific party, with pagination.
Uses the party_currencies junction to filter the full currency list to only those the given party is permitted to see.
| party_id | The UUID of the party. |
| offset | Number of records to skip. |
| limit | Maximum number of records to return. |
| std::uint32_t count_currencies_for_party | ( | const boost::uuids::uuid & | party_id | ) |
Gets the total count of currencies visible to a specific party.
| party_id | The UUID of the party. |