20#ifndef ORES_TRADING_SERVICE_INSTRUMENT_SERVICE_HPP
21#define ORES_TRADING_SERVICE_INSTRUMENT_SERVICE_HPP
26#include "ores.logging/make_logger.hpp"
27#include "ores.database/domain/context.hpp"
28#include "ores.trading.api/domain/instrument.hpp"
29#include "ores.trading.api/domain/swap_leg.hpp"
30#include "ores.trading.core/repository/instrument_repository.hpp"
31#include "ores.trading.core/repository/swap_leg_repository.hpp"
33namespace ores::trading::service {
40 inline static std::string_view logger_name =
41 "ores.trading.service.instrument_service";
43 [[nodiscard]]
static auto& lg() {
45 static auto instance = make_logger(logger_name);
54 std::vector<domain::instrument> list_instruments();
56 std::vector<domain::instrument>
57 list_instruments(std::uint32_t offset, std::uint32_t limit);
59 std::uint32_t count_instruments();
61 std::optional<domain::instrument>
62 find_instrument(
const std::string&
id);
64 std::vector<domain::swap_leg>
65 get_legs(
const std::string& instrument_id);
70 const std::vector<domain::swap_leg>& legs);
72 void remove_instrument(
const std::string&
id);
74 std::vector<domain::instrument>
75 get_instrument_history(
const std::string&
id);
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Context for the operations on a postgres database.
Definition context.hpp:47
Parent instrument record holding economic terms for a trade.
Definition instrument.hpp:40
Reads and writes instruments to data storage.
Definition instrument_repository.hpp:35
Reads and writes swap legs to data storage.
Definition swap_leg_repository.hpp:35
Service for managing instruments.
Definition instrument_service.hpp:38