|
ORE Studio 0.0.4
|
Service for managing countries. More...
#include <country_service.hpp>

Public Types | |
| using | context = ores::database::context |
Public Member Functions | |
| country_service (context ctx) | |
| Constructs a country_service with a database context. | |
| std::vector< domain::country > | list_countries (std::uint32_t offset, std::uint32_t limit) |
| Lists countries with pagination support. | |
| std::uint32_t | count_countries () |
| Gets the total count of active countries. | |
| void | save_country (const domain::country &country) |
| Saves a country (creates or updates). | |
| void | delete_country (const std::string &alpha2_code) |
| Deletes a country by its alpha-2 code. | |
| std::optional< domain::country > | get_country (const std::string &alpha2_code) |
| Retrieves a single country by its alpha-2 code. | |
| std::vector< domain::country > | get_country_history (const std::string &alpha2_code) |
| Retrieves all historical versions of a country. | |
Service for managing countries.
Provides a higher-level interface for country operations, wrapping the underlying repository.
|
explicit |
Constructs a country_service with a database context.
| ctx | The database context for operations. |
| std::vector< domain::country > list_countries | ( | std::uint32_t | offset, |
| std::uint32_t | limit | ||
| ) |
Lists countries with pagination support.
| offset | Number of records to skip. |
| limit | Maximum number of records to return. |
| std::uint32_t count_countries | ( | ) |
Gets the total count of active countries.
| void save_country | ( | const domain::country & | country | ) |
Saves a country (creates or updates).
| country | The country to save. |
| std::exception | on failure. |
| void delete_country | ( | const std::string & | alpha2_code | ) |
Deletes a country by its alpha-2 code.
| alpha2_code | The alpha-2 code of the country to delete. |
| std::exception | on failure. |
| std::optional< domain::country > get_country | ( | const std::string & | alpha2_code | ) |
Retrieves a single country by its alpha-2 code.
| alpha2_code | The alpha-2 code of the country. |
| std::vector< domain::country > get_country_history | ( | const std::string & | alpha2_code | ) |
Retrieves all historical versions of a country.
| alpha2_code | The alpha-2 code of the country. |