Canonical transaction
Broker-onafhankelijke vorm van transactie.
CanonicalTx is onze interne broker-agnostic representatie van een transactie. Elke broker-specific adapter map zijn raw data naar deze vorm.
Velden:
- type (BUY, SELL, DEPOSIT, WITHDRAWAL, FEE, DIVIDEND, etc.)
- date_utc
- security (SecurityKey: ISIN, name, symbol, currency)
- quantity
- price_local (instrument-ccy prijs)
- amount_eur (cash impact in EUR, signed)
- fx_rate
- fee_kind (AUTOFX, TRANSACTION, etc.)
- external_ref (broker's ID)
- raw (orig data preserved)
Voorbeeld T212 → Canonical:
T212 order in API met walletImpact.netValue=485.7, side=SELL →
CanonicalTx( type='SELL', amount_eur=+485.7, quantity=30, ... )
Nu kan onze portfolio-logica dit uniform behandelen — doesn't matter welke broker het was.