20#ifndef ORES_DQ_REPOSITORY_CODING_SCHEME_AUTHORITY_TYPE_REPOSITORY_HPP
21#define ORES_DQ_REPOSITORY_CODING_SCHEME_AUTHORITY_TYPE_REPOSITORY_HPP
25#include <sqlgen/postgres.hpp>
26#include "ores.logging/make_logger.hpp"
27#include "ores.database/domain/context.hpp"
28#include "ores.dq/domain/coding_scheme_authority_type.hpp"
30namespace ores::dq::repository {
37 inline static std::string_view logger_name =
38 "ores.dq.repository.coding_scheme_authority_type_repository";
40 [[nodiscard]]
static auto& lg() {
42 static auto instance = make_logger(logger_name);
61 void write(
const std::vector<domain::coding_scheme_authority_type>& authority_types);
68 std::vector<domain::coding_scheme_authority_type>
read_latest();
69 std::vector<domain::coding_scheme_authority_type>
read_latest(
const std::string& code);
75 std::vector<domain::coding_scheme_authority_type>
76 read_latest(std::uint32_t offset, std::uint32_t limit);
86 std::vector<domain::coding_scheme_authority_type>
read_all(
const std::string& code);
91 void remove(
const std::string& code);
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Context for the operations on a postgres database.
Definition context.hpp:30
Classifies coding schemes by the type of authority that defines them.
Definition coding_scheme_authority_type.hpp:40
Reads and writes coding_scheme_authority_types to data storage.
Definition coding_scheme_authority_type_repository.hpp:35
void remove(const std::string &code)
Deletes a coding_scheme_authority_type by closing its temporal validity.
Definition coding_scheme_authority_type_repository.cpp:147
std::vector< domain::coding_scheme_authority_type > read_all(const std::string &code)
Reads all historical versions of a coding_scheme_authority_type by code.
Definition coding_scheme_authority_type_repository.cpp:132
void write(const domain::coding_scheme_authority_type &authority_type)
Writes coding_scheme_authority_types to database.
Definition coding_scheme_authority_type_repository.cpp:43
std::vector< domain::coding_scheme_authority_type > read_latest()
Reads latest coding_scheme_authority_types, possibly filtered by code.
Definition coding_scheme_authority_type_repository.cpp:62
std::uint32_t get_total_count()
Gets the total count of active coding_scheme_authority_types.
Definition coding_scheme_authority_type_repository.cpp:109
std::string sql()
Returns the SQL created by sqlgen to construct the table.
Definition coding_scheme_authority_type_repository.cpp:36