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

Service for managing business units. More...

#include <business_unit_service.hpp>

Collaboration diagram for business_unit_service:
Collaboration graph

Public Types

using context = ores::database::context
 

Public Member Functions

 business_unit_service (context ctx)
 Constructs a business_unit_service with required repositories.
 
std::vector< domain::business_unitlist_business_units ()
 Lists all business units.
 
std::optional< domain::business_unitfind_business_unit (const boost::uuids::uuid &id)
 Finds a business unit by its ID.
 
std::optional< domain::business_unitfind_business_unit_by_code (const std::string &code)
 Finds a business unit by its code.
 
void save_business_unit (const domain::business_unit &business_unit)
 Saves a business unit (creates or updates).
 
void save_business_units (const std::vector< domain::business_unit > &business_units)
 Saves multiple business units (creates or updates).
 
void remove_business_unit (const boost::uuids::uuid &id)
 Removes a business unit.
 
std::vector< domain::business_unitget_business_unit_history (const boost::uuids::uuid &id)
 Gets the version history for a business unit.
 

Detailed Description

Service for managing business units.

This service provides functionality for:

Constructor & Destructor Documentation

◆ business_unit_service()

business_unit_service ( context  ctx)
explicit

Constructs a business_unit_service with required repositories.

Parameters
ctxThe database context.

Member Function Documentation

◆ save_business_unit()

void save_business_unit ( const domain::business_unit business_unit)

Saves a business unit (creates or updates).

Parameters
business_unitThe business unit to save

◆ save_business_units()

void save_business_units ( const std::vector< domain::business_unit > &  business_units)

Saves multiple business units (creates or updates).

Parameters
business_unitsThe business units to save

◆ remove_business_unit()

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

Removes a business unit.

Parameters
idThe ID of the business unit to remove

◆ get_business_unit_history()

std::vector< domain::business_unit > get_business_unit_history ( const boost::uuids::uuid &  id)

Gets the version history for a business unit.

Parameters
idThe business unit ID
Returns
Vector of all versions, newest first