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

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

#include <change_reason_category_repository.hpp>

Collaboration diagram for change_reason_category_repository:
Collaboration graph

Public Types

using context = ores::database::context
 

Public Member Functions

 change_reason_category_repository (context ctx)
 
std::string sql ()
 Returns the SQL created by sqlgen to construct the table.
 
std::vector< domain::change_reason_categoryread_latest (std::uint32_t offset, std::uint32_t limit)
 Reads latest change_reason_categories with pagination support.
 
std::uint32_t get_total_count ()
 Gets the total count of active change_reason_categories.
 
std::vector< domain::change_reason_categoryread_all (const std::string &code)
 Reads all historical versions of a change_reason_category by code.
 
void remove (const std::string &code)
 Deletes a change_reason_category by closing its temporal validity.
 
void write (const domain::change_reason_category &category)
 Writes change_reason_categories to database.
 
void write (const std::vector< domain::change_reason_category > &categories)
 
std::vector< domain::change_reason_categoryread_latest ()
 Reads latest change_reason_categories, possibly filtered by code.
 
std::vector< domain::change_reason_categoryread_latest (const std::string &code)
 

Detailed Description

Reads and writes change_reason_categories to data storage.

Member Function Documentation

◆ read_latest()

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

Reads latest change_reason_categories with pagination support.

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

◆ get_total_count()

std::uint32_t get_total_count ( )

Gets the total count of active change_reason_categories.

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

◆ read_all()

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

Reads all historical versions of a change_reason_category by code.

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