20#ifndef ORES_REFDATA_SERVICE_COUNTRY_SERVICE_HPP
21#define ORES_REFDATA_SERVICE_COUNTRY_SERVICE_HPP
26#include "ores.database/domain/context.hpp"
27#include "ores.refdata/domain/country.hpp"
28#include "ores.refdata/repository/country_repository.hpp"
29#include "ores.logging/make_logger.hpp"
31namespace ores::refdata::service {
41 inline static std::string_view logger_name =
42 "ores.refdata.service.country_service";
44 [[nodiscard]]
static auto& lg() {
46 static auto instance = make_logger(logger_name);
99 std::optional<domain::country>
get_country(
const std::string& alpha2_code);
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Context for the operations on a postgres database.
Definition context.hpp:30
Represents a country using ISO 3166-1 standard codes.
Definition country.hpp:33
Reads and writes countries off of data storage.
Definition country_repository.hpp:35
Service for managing countries.
Definition country_service.hpp:39
std::vector< domain::country > get_country_history(const std::string &alpha2_code)
Retrieves all historical versions of a country.
Definition country_service.cpp:66
std::optional< domain::country > get_country(const std::string &alpha2_code)
Retrieves a single country by its alpha-2 code.
Definition country_service.cpp:56
void delete_country(const std::string &alpha2_code)
Deletes a country by its alpha-2 code.
Definition country_service.cpp:51
std::vector< domain::country > list_countries(std::uint32_t offset, std::uint32_t limit)
Lists countries with pagination support.
Definition country_service.cpp:31
void save_country(const domain::country &country)
Saves a country (creates or updates).
Definition country_service.cpp:43
std::uint32_t count_countries()
Gets the total count of active countries.
Definition country_service.cpp:38