20#ifndef ORES_REFDATA_SERVICE_CURRENCY_SERVICE_HPP
21#define ORES_REFDATA_SERVICE_CURRENCY_SERVICE_HPP
26#include "ores.database/domain/context.hpp"
27#include "ores.refdata/domain/currency.hpp"
28#include "ores.refdata/domain/currency_version_history.hpp"
29#include "ores.refdata/repository/currency_repository.hpp"
30#include "ores.logging/make_logger.hpp"
32namespace ores::refdata::service {
42 inline static std::string_view logger_name =
43 "ores.refdata.service.currency_service";
45 [[nodiscard]]
static auto& lg() {
47 static auto instance = make_logger(logger_name);
100 std::optional<domain::currency>
get_currency(
const std::string& iso_code);
120 std::optional<domain::currency_version_history>
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 currency with its metadata and formatting rules.
Definition currency.hpp:33
Reads and writes currencies off of data storage.
Definition currency_repository.hpp:35
Service for managing currencies.
Definition currency_service.hpp:40
void delete_currency(const std::string &iso_code)
Deletes a currency by its ISO code.
Definition currency_service.cpp:51
std::vector< domain::currency > list_currencies(std::uint32_t offset, std::uint32_t limit)
Lists currencies with pagination support.
Definition currency_service.cpp:31
std::vector< domain::currency > get_currency_history(const std::string &iso_code)
Retrieves all historical versions of a currency.
Definition currency_service.cpp:66
std::optional< domain::currency_version_history > get_currency_version_history(const std::string &iso_code)
Retrieves currency version history with version metadata.
Definition currency_service.cpp:73
std::uint32_t count_currencies()
Gets the total count of active currencies.
Definition currency_service.cpp:38
void save_currency(const domain::currency ¤cy)
Saves a currency (creates or updates).
Definition currency_service.cpp:43
std::optional< domain::currency > get_currency(const std::string &iso_code)
Retrieves a single currency by its ISO code.
Definition currency_service.cpp:56