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_calendar_adjustment (const refdata::domain::calendar_adjustment &ca)
 Validates a calendar adjustment entry.
 
static std::vector< refdata::domain::calendar_adjustmentimport_calendar_adjustments (const std::filesystem::path &path)
 Imports calendar adjustments from an ORE calendaradjustment XML file.
 
static domain::mapped_conventions import_conventions (const std::filesystem::path &path)
 Imports all recognised conventions from an ORE conventions XML file.
 
static std::string validate_trade (const trading::domain::trade &trade)
 Validates a trade against minimum import requirements.
 
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_calendar_adjustment()

std::string validate_calendar_adjustment ( const refdata::domain::calendar_adjustment ca)
static

Validates a calendar adjustment entry.

Parameters
caCalendar adjustment to validate
Returns
Empty string if valid, otherwise error message

◆ import_calendar_adjustments()

std::vector< refdata::domain::calendar_adjustment > import_calendar_adjustments ( const std::filesystem::path &  path)
static

Imports calendar adjustments from an ORE calendaradjustment XML file.

Reads additional holidays and business day overrides for named ORE calendars. The file format is defined by calendaradjustment.xsd.

Parameters
pathPath to the calendaradjustment.xml file
Returns
Vector of calendar adjustments, one per <Calendar> element
Here is the caller graph for this function:

◆ import_conventions()

domain::mapped_conventions import_conventions ( const std::filesystem::path &  path)
static

Imports all recognised conventions from an ORE conventions XML file.

Parses the ORE conventions.xml and maps the nine supported convention categories (Zero, Deposit, Swap, OIS, FRA, IborIndex, OvernightIndex, FX, CDS) to ORES refdata domain types. Additional ORE convention types (AverageOIS, TenorBasisSwap, CrossCurrencyBasis, InflationSwap, etc.) are present in the file but are not yet modelled and are silently skipped.

Parameters
pathPath to the conventions.xml file
Returns
mapped_conventions struct containing one vector per convention type
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_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.

Parses the portfolio XML, maps each trade to the ORES trading domain, and captures the raw ORE CounterParty string from each trade envelope. All UUID fields (trade.id, instrument_id, book_id, etc.) are left nil; the caller (e.g. ore_import_planner) is responsible for minting UUIDs via trading::domain::stamp_ids and populating context fields.

Parameters
pathPath to the ORE portfolio XML file
Returns
Vector of trade_import_item with product_type set, all UUIDs nil
Here is the caller graph for this function: