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

Service for managing parties. More...

#include <party_service.hpp>

Collaboration diagram for party_service:
Collaboration graph

Public Types

using context = ores::database::context
 

Public Member Functions

 party_service (context ctx)
 Constructs a party_service with required repositories.
 
std::vector< domain::partylist_parties ()
 Lists all parties.
 
std::vector< domain::partylist_parties (std::uint32_t offset, std::uint32_t limit)
 Lists parties with pagination support.
 
std::uint32_t count_parties ()
 Gets the total count of active parties.
 
std::optional< domain::partyfind_party (const boost::uuids::uuid &id)
 Finds a party by its ID.
 
std::optional< domain::partyfind_party_by_code (const std::string &code)
 Finds a party by its code.
 
void save_party (const domain::party &party)
 Saves a party (creates or updates).
 
void save_parties (const std::vector< domain::party > &parties)
 Saves multiple parties (creates or updates).
 
void remove_party (const boost::uuids::uuid &id)
 Removes a party.
 
std::vector< domain::partyget_party_history (const boost::uuids::uuid &id)
 Gets the version history for a party.
 

Detailed Description

Service for managing parties.

This service provides functionality for:

Constructor & Destructor Documentation

◆ party_service()

party_service ( context  ctx)
explicit

Constructs a party_service with required repositories.

Parameters
ctxThe database context.

Member Function Documentation

◆ list_parties()

std::vector< domain::party > list_parties ( std::uint32_t  offset,
std::uint32_t  limit 
)

Lists parties with pagination support.

Parameters
offsetNumber of records to skip.
limitMaximum number of records to return.
Returns
Vector of parties for the requested page.

◆ count_parties()

std::uint32_t count_parties ( )

Gets the total count of active parties.

Returns
Total number of parties.

◆ save_party()

void save_party ( const domain::party party)

Saves a party (creates or updates).

Parameters
partyThe party to save

◆ save_parties()

void save_parties ( const std::vector< domain::party > &  parties)

Saves multiple parties (creates or updates).

Parameters
partiesThe parties to save

◆ remove_party()

void remove_party ( const boost::uuids::uuid &  id)

Removes a party.

Parameters
idThe ID of the party to remove

◆ get_party_history()

std::vector< domain::party > get_party_history ( const boost::uuids::uuid &  id)

Gets the version history for a party.

Parameters
idThe party ID
Returns
Vector of all versions, newest first