20#ifndef ORES_REFDATA_CORE_SERVICE_BUSINESS_CENTRE_SERVICE_HPP
21#define ORES_REFDATA_CORE_SERVICE_BUSINESS_CENTRE_SERVICE_HPP
26#include "ores.database/domain/context.hpp"
27#include "ores.refdata.api/domain/business_centre.hpp"
28#include "ores.refdata.core/repository/business_centre_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.business_centre_service";
44 [[nodiscard]]
static auto& lg() {
46 static auto instance = make_logger(logger_name);
62 std::uint32_t offset, std::uint32_t limit);
78 const std::vector<domain::business_centre>& business_centres);
93 std::optional<domain::business_centre>
99 std::vector<domain::business_centre>
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Context for the operations on a postgres database.
Definition context.hpp:47
Represents a business centre using FpML-style codes.
Definition business_centre.hpp:37
Reads and writes business centres off of data storage.
Definition business_centre_repository.hpp:35
Service for managing business centres.
Definition business_centre_service.hpp:39
std::optional< domain::business_centre > get_business_centre(const std::string &code)
Retrieves a single business centre by its code.
Definition business_centre_service.cpp:81
std::vector< domain::business_centre > get_business_centre_history(const std::string &code)
Retrieves all historical versions of a business centre.
Definition business_centre_service.cpp:91
void save_business_centres(const std::vector< domain::business_centre > &business_centres)
Saves a batch of business centres.
Definition business_centre_service.cpp:58
void delete_business_centres(const std::vector< std::string > &codes)
Deletes business centres by their codes.
Definition business_centre_service.cpp:76
std::vector< domain::business_centre > list_business_centres(std::uint32_t offset, std::uint32_t limit)
Lists business centres with pagination support.
Definition business_centre_service.cpp:35
void delete_business_centre(const std::string &code)
Deletes a business centre by its code.
Definition business_centre_service.cpp:71
void save_business_centre(const domain::business_centre &bc)
Saves a business centre (creates or updates).
Definition business_centre_service.cpp:47
std::uint32_t count_business_centres()
Gets the total count of active business centres.
Definition business_centre_service.cpp:42