pluto/handler/lib/serde/nordigen.py

105 lines
2.1 KiB
Python
Raw Normal View History

2022-03-25 18:09:32 +00:00
from serde import Model, fields
class Amount(Model):
amount: fields.Str()
currency: fields.Str()
class Transaction(Model):
bookingDate: fields.Date()
proprietaryBankTransactionCode: fields.Optional(fields.Str())
remittanceInformationUnstructured: fields.Optional(fields.Str())
transactionAmount: fields.Nested(Amount)
transactionId: fields.Str()
class Pending(Transaction):
pass
class Booked(Transaction):
pass
class Transactions(Model):
pending: fields.List(Pending)
booked: fields.List(Booked)
class TXRoot(Model):
transactions: fields.Nested(Transactions)
class AccessToken(Model):
access: fields.Str()
class Institution(Model):
id: fields.Str()
name: fields.Str()
bic: fields.Str()
transaction_total_days: fields.Str()
countries: fields.List()
logo: fields.Url()
class Institutions(Model):
institutions: fields.List(Institution)
class Agreement(Model):
id: fields.Str()
created: fields.DateTime()
redirect: fields.Url()
status: fields.Str()
institution_id: fields.Str()
agreement: fields.Str()
reference: fields.Str()
accounts: fields.List()
link: fields.Url()
ssn: fields.Literal(None) # ?
account_selection: fields.Bool()
redirect_immediate: fields.Bool()
class Requisitions(Model):
count: fields.Int()
next: fields.Literal(None) # wrong
previous: fields.Literal(None) # wrong
results: fields.List(Agreement)
class Account(Model):
resourceId: fields.Str()
iban: fields.Str()
bban: fields.Str()
currency: fields.Str()
ownerName: fields.Str()
status: fields.Str()
details: fields.Str()
class AccountDetails(Model):
account: fields.Nested(Account)
2022-04-09 18:59:22 +00:00
class AccountBalanceAmount(Model):
amount: fields.Str()
currency: fields.Str()
class AccountBalances(Model):
balanceAmount: fields.Nested(AccountBalanceAmount)
balanceType: fields.Str()
referenceDate: fields.Date()
class AccountBalancesRoot(Model):
balances = fields.List(AccountBalances)
class RequisitionResponse(Model):
summary: fields.Str()
detail: fields.Str()