20#ifndef ORES_REFDATA_CORE_SERVICE_BUSINESS_UNIT_SERVICE_HPP
21#define ORES_REFDATA_CORE_SERVICE_BUSINESS_UNIT_SERVICE_HPP
26#include <boost/uuid/uuid.hpp>
27#include "ores.logging/make_logger.hpp"
28#include "ores.database/domain/context.hpp"
29#include "ores.refdata.api/domain/business_unit.hpp"
30#include "ores.refdata.core/repository/business_unit_repository.hpp"
32namespace ores::refdata::service {
42 inline static std::string_view logger_name =
43 "ores.refdata.service.business_unit_service";
45 [[nodiscard]]
static auto& lg() {
47 static auto instance = make_logger(logger_name);
69 std::optional<domain::business_unit>
75 std::optional<domain::business_unit>
105 std::vector<domain::business_unit>
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Context for the operations on a postgres database.
Definition context.hpp:47
Internal organizational unit within a party.
Definition business_unit.hpp:37
Reads and writes business units to data storage.
Definition business_unit_repository.hpp:36
Service for managing business units.
Definition business_unit_service.hpp:40
std::vector< domain::business_unit > list_business_units()
Lists all business units.
Definition business_unit_service.cpp:35
std::optional< domain::business_unit > find_business_unit_by_code(const std::string &code)
Finds a business unit by its code.
Definition business_unit_service.cpp:51
std::vector< domain::business_unit > get_business_unit_history(const boost::uuids::uuid &id)
Gets the version history for a business unit.
Definition business_unit_service.cpp:91
void remove_business_unit(const boost::uuids::uuid &id)
Removes a business unit.
Definition business_unit_service.cpp:84
void save_business_units(const std::vector< domain::business_unit > &business_units)
Saves multiple business units (creates or updates).
Definition business_unit_service.cpp:71
std::optional< domain::business_unit > find_business_unit(const boost::uuids::uuid &id)
Finds a business unit by its ID.
Definition business_unit_service.cpp:41
void save_business_unit(const domain::business_unit &business_unit)
Saves a business unit (creates or updates).
Definition business_unit_service.cpp:60