Open pfalcon opened 3 days ago
Example of the XML diff, based on the included kommer example:
@@ -553,23 +553,23 @@
<updatedAt>2024-02-16T07:17:00.710324Z</updatedAt>
<type>BUY</type>
</portfolio-transaction>
- <portfolio-transaction>
+ <portfolio-transaction id="26">
<uuid>68448a62-ab45-4233-abc3-cae984c05f6a</uuid>
<date>2019-01-07T00:00</date>
<currencyCode>EUR</currencyCode>
<amount>133025</amount>
- <security reference="../../../../../../../../../securities/security[5]"/>
- <crossEntry class="buysell">
- <portfolio reference="../../../.."/>
- <portfolioTransaction reference="../.."/>
- <account reference="../../../../../../../.."/>
- <accountTransaction>
+ <security reference="6"/>
+ <crossEntry class="buysell" id="27">
+ <portfolio reference="24"/>
+ <portfolioTransaction reference="26"/>
+ <account reference="20"/>
+ <accountTransaction id="28">
<uuid>ff6462ad-dd45-4bd6-a8c2-3806ab449ed4</uuid>
<date>2019-01-07T00:00</date>
<currencyCode>EUR</currencyCode>
<amount>133025</amount>
This patchset implements supports for XML serialization format using 'id' attributes to encode references, as discussed in https://github.com/portfolio-performance/portfolio/issues/3417 . To summarize discussion in that ticket, the main motivation for supporting this format is enabling easy interoperability with 3rd-party tools.
What this patch implements is:
<price>
element. But again, I went as far as diffing original XPath XML vs id XML produced from it, to make sure that diff doesn't have spurious id's on elements which can't really be referenced. Perhaps the only exception is<watchlist>
. These don't have uuid in PP model, effectively name is an ID, but for external tools, it's useful to have some formal ID for them, so XML id attr is produced.