ORE Studio 0.0.4
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
change_reason_repository Class Reference

Reads and writes change_reasons to data storage. More...

#include <change_reason_repository.hpp>

Collaboration diagram for change_reason_repository:
Collaboration graph

Public Types

using context = ores::database::context
 

Public Member Functions

 change_reason_repository (context ctx)
 
std::string sql ()
 Returns the SQL created by sqlgen to construct the table.
 
std::vector< domain::change_reasonread_latest (std::uint32_t offset, std::uint32_t limit)
 Reads latest change_reasons with pagination support.
 
std::vector< domain::change_reasonread_latest_by_category (const std::string &category_code)
 Reads latest change_reasons by category code.
 
std::uint32_t get_total_count ()
 Gets the total count of active change_reasons.
 
std::vector< domain::change_reasonread_all (const std::string &code)
 Reads all historical versions of a change_reason by code.
 
void remove (const std::string &code)
 Deletes a change_reason by closing its temporal validity.
 
void write (const domain::change_reason &reason)
 Writes change_reasons to database.
 
void write (const std::vector< domain::change_reason > &reasons)
 
std::vector< domain::change_reasonread_latest ()
 Reads latest change_reasons, possibly filtered by code.
 
std::vector< domain::change_reasonread_latest (const std::string &code)
 

Detailed Description

Reads and writes change_reasons to data storage.

Member Function Documentation

◆ read_latest()

std::vector< domain::change_reason > read_latest ( std::uint32_t  offset,
std::uint32_t  limit 
)

Reads latest change_reasons with pagination support.

Parameters
offsetNumber of records to skip
limitMaximum number of records to return
Returns
Vector of reasons within the specified range

◆ get_total_count()

std::uint32_t get_total_count ( )

Gets the total count of active change_reasons.

Returns
Total number of reasons with valid_to == max_timestamp
Here is the caller graph for this function:

◆ read_all()

std::vector< domain::change_reason > read_all ( const std::string &  code)

Reads all historical versions of a change_reason by code.

Parameters
codeThe change reason code to look up
Returns
Vector of all versions, ordered by version descending
Here is the caller graph for this function: