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

Imports domain objects from their ORE XML representation. More...

#include <importer.hpp>

Collaboration diagram for importer:
Collaboration graph

Static Public Member Functions

static std::string validate_currency (const refdata::domain::currency &currency)
 Validates a currency against XSD schema requirements.
 
static std::vector< refdata::domain::currencyimport_currency_config (const std::filesystem::path &path)
 
static std::string validate_trade (const trading::domain::trade &trade)
 Validates a trade against minimum import requirements.
 
static std::vector< trading::domain::tradeimport_portfolio (const std::filesystem::path &path)
 Imports trades from an ORE portfolio XML file.
 
static std::vector< trade_import_itemimport_portfolio_with_context (const std::filesystem::path &path)
 Imports trades from an ORE portfolio XML file with mapping context.
 

Detailed Description

Imports domain objects from their ORE XML representation.

Member Function Documentation

◆ validate_currency()

std::string validate_currency ( const refdata::domain::currency currency)
static

Validates a currency against XSD schema requirements.

Performs lightweight validation checking required fields per assets/xsds/currencyconfig.xsd without requiring external libraries.

Parameters
currencyCurrency to validate
Returns
Empty string if valid, otherwise error message describing issues
Here is the caller graph for this function:

◆ validate_trade()

std::string validate_trade ( const trading::domain::trade trade)
static

Validates a trade against minimum import requirements.

Checks that the trade has at least the fields that can be directly mapped from ORE XML: external_id and trade_type. Fields that require external mapping (book_id, counterparty_id, etc.) are not validated here.

Parameters
tradeTrade to validate
Returns
Empty string if valid, otherwise error message describing issues
Here is the caller graph for this function:

◆ import_portfolio()

std::vector< trade > import_portfolio ( const std::filesystem::path &  path)
static

Imports trades from an ORE portfolio XML file.

Parses the portfolio XML and maps each trade to the ORES trading domain. UUID fields that require external context (book_id, counterparty_id, portfolio_id, party_id) are left as nil and must be populated by the calling code.

Parameters
pathPath to the ORE portfolio XML file
Returns
Vector of partially-mapped trading domain trades

◆ import_portfolio_with_context()

std::vector< trade_import_item > import_portfolio_with_context ( const std::filesystem::path &  path)
static

Imports trades from an ORE portfolio XML file with mapping context.

Like import_portfolio() but also captures the raw ORE CounterParty string from each trade envelope so that callers can present a counterparty mapping dialog before resolving UUIDs.

Parameters
pathPath to the ORE portfolio XML file
Returns
Vector of trade_import_item, each pairing a partially-mapped trade with its ORE counterparty name (empty if not present)
Here is the caller graph for this function: