|
ORE Studio 0.0.4
|
Resolves trade status transitions via the FSM. More...
#include <trade_status_service.hpp>

Public Types | |
| using | context = ores::database::context |
Static Public Member Functions | |
| static boost::uuids::uuid | resolve_status (context ctx, const std::string &activity_type_code, std::optional< boost::uuids::uuid > current_status_id) |
| Resolves the new status_id for a trade. | |
Resolves trade status transitions via the FSM.
Given an activity_type_code and the trade's current status_id, determines the resulting status_id by looking up the FSM transition linked to the activity type. Throws std::logic_error if the transition is not allowed from the current status.
|
static |
Resolves the new status_id for a trade.
Given an activity_type_code and the trade's current status_id (std::nullopt for brand-new trades not yet in the database), returns the resulting status_id after applying the FSM transition linked to the activity type.
If the activity type has no linked FSM transition, the current status_id is returned unchanged (nil UUID for new trades).
| std::invalid_argument | if the activity_type_code is unknown. |
| std::logic_error | if the transition is invalid from the current status. |