Add schemas for account balances

This commit is contained in:
Mark Veidemanis 2023-03-09 18:28:50 +00:00
parent 21c5150f6f
commit 5ae838b55f
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
2 changed files with 18 additions and 1 deletions

View File

@ -180,7 +180,7 @@ class NordigenClient(BaseClient, AggregatorClient):
""" """
path = f"accounts/{account_id}/balances" path = f"accounts/{account_id}/balances"
response = await self.call(path, schema="AccountBalance") response = await self.call(path, schema="AccountBalances")
total = 0 total = 0
currency = None currency = None

View File

@ -128,3 +128,20 @@ class AccountDetails(BaseModel):
AccountDetailsSchema = { AccountDetailsSchema = {
"account": "account", "account": "account",
} }
class AccountBalance(BaseModel):
balanceAmount: dict[str, str]
balanceType: str
referenceDate: str
class AccountBalances(BaseModel):
balances: list[AccountBalance]
summary: str | None
AccountBalancesSchema = {
"balances": "balances",
"summary": "summary",
}