|
ORE Studio 0.0.4
|
Reads and writes parties to data storage. More...
#include <party_repository.hpp>

Public Types | |
| using | context = ores::database::context |
Public Member Functions | |
| party_repository (context ctx) | |
| std::string | sql () |
| void | write (const domain::party &party) |
| void | write (const std::vector< domain::party > &parties) |
| std::vector< domain::party > | read_latest () |
| std::vector< domain::party > | read_latest (const boost::uuids::uuid &id) |
| std::vector< domain::party > | read_latest_by_code (const std::string &code) |
| std::vector< domain::party > | read_system_party (const std::string &tenant_id) |
| Reads the system party for a given tenant. | |
| std::vector< domain::party > | read_latest (std::uint32_t offset, std::uint32_t limit) |
| Reads latest parties with pagination support. | |
| std::uint32_t | get_total_party_count () |
| Gets the total count of active parties. | |
| std::vector< boost::uuids::uuid > | read_descendants (const boost::uuids::uuid &root_id) |
| Reads all parties in the subtree rooted at the given party. | |
| std::vector< domain::party > | read_all (const boost::uuids::uuid &id) |
| void | remove (const boost::uuids::uuid &id) |
Reads and writes parties to data storage.
| std::vector< domain::party > read_system_party | ( | const std::string & | tenant_id | ) |
Reads the system party for a given tenant.
Every tenant has exactly one system party (party_category='system') which serves as the root of the party hierarchy.
| tenant_id | The tenant identifier |
| std::vector< domain::party > read_latest | ( | std::uint32_t | offset, |
| std::uint32_t | limit | ||
| ) |
Reads latest parties with pagination support.
| offset | Number of records to skip |
| limit | Maximum number of records to return |
| std::uint32_t get_total_party_count | ( | ) |
Gets the total count of active parties.

| std::vector< boost::uuids::uuid > read_descendants | ( | const boost::uuids::uuid & | root_id | ) |
Reads all parties in the subtree rooted at the given party.
Uses a recursive CTE to traverse the party hierarchy via parent_party_id. Returns the root party plus all its descendants (active records only).
| root_id | The party to start from (included in result) |