From fec536616da18fdebd9103278ce38a7f1f8d9da7 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Mon, 11 Apr 2022 20:55:50 +0100 Subject: [PATCH] Add extra Serde mappings for transaction data --- handler/lib/serde/nordigen.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/handler/lib/serde/nordigen.py b/handler/lib/serde/nordigen.py index b90e5aa..ca9513b 100644 --- a/handler/lib/serde/nordigen.py +++ b/handler/lib/serde/nordigen.py @@ -6,8 +6,29 @@ class Amount(Model): currency: fields.Str() +class TransactionBBAN(Model): + bban: fields.Str() + + +class ExchangeInstructedAmount(Model): + amount: fields.Str() + currency: fields.Str() + + +class TransactionCurrencyExchange(Model): + exchangeRate: fields.Str() + instructedAmount: fields.Nested(ExchangeInstructedAmount) + sourceCurrency: fields.Str() + targetCurrency: fields.Str() + unitCurrency: fields.Str() + + class Transaction(Model): bookingDate: fields.Date() + creditorAccount: fields.Optional(fields.Nested(TransactionBBAN)) + creditorName: fields.Optional(fields.Str()) + debtorName: fields.Optional(fields.Str()) + currencyExchange: fields.Optional(fields.Nested(TransactionCurrencyExchange)) proprietaryBankTransactionCode: fields.Optional(fields.Str()) remittanceInformationUnstructured: fields.Optional(fields.Str()) transactionAmount: fields.Nested(Amount)