Envelope API needs review
Hi,
I'm referring to ore::data::Envelope which changed to hold also a NettingSetDetails.
Now, both Envelope ctors that set additionalFields_ will initialize as nettingSetDetails_(NettingSetDetails()).
Then when you call this const string& nettingSetId() const { return nettingSetDetails_.nettingSetId(); it comes out empty.
At least this ctor needs changing:
//! Constructor with netting set / portfolio ids, with additional fields
Envelope(const string& counterparty, const string& nettingSetId, const map<string, string>& additionalFields,
const set<string>& portfolioIds = set<string>())
: counterparty_(counterparty), nettingSetId_(nettingSetId), nettingSetDetails_(NettingSetDetails()),
portfolioIds_(portfolioIds), additionalFields_(additionalFields) {}
.. change initialization to include nettingSetDetails_(NettingSetDetails(nettingSetId)).
In anycase, it doesn't seem to be a way to construct an envelope with additional fields and netting set id and later on to recover the netting set id..
Thanks, Laurentiu.
Hi Laurentiu,
Thanks for pointing this out. I will open an internal ticket to clean this up.
This was part of an effort to allow for netting sets within netting sets to support client requirements. We are leaning towards removing the use of nettingSetId_ altogether and replace it with nettingSetDetails_ (which, as you have pointed out, should default to NettingSetDetails(nettingSetId)).
Regards, Nathaniel
Hi Nathaniel,
Thanks for checking this out. There is another small issue with netting set lookup. Here for example NettingSetManager::get(const string& id) where a NettingSetDefinition is lookup by string. This is due to fail because definition includes other fields except for netting set id. We hacked this in commit https://github.com/OpenSourceRisk/Engine/commit/6de57c332e28094a0d2135afbf79a33daa8d67f4
Regards, Laurentiu.