Call the base class from TrueLayer with our fetched transactions

This commit is contained in:
Mark Veidemanis 2022-03-07 20:10:59 +00:00
parent cbb7294f23
commit aefa6c58a4
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
2 changed files with 16 additions and 1 deletions

View File

@ -8,6 +8,7 @@ import sinks.fidor
import sinks.nordigen import sinks.nordigen
import sinks.truelayer import sinks.truelayer
import util import util
from db import r
class Sinks(util.Base): class Sinks(util.Base):
@ -24,3 +25,16 @@ class Sinks(util.Base):
def got_transactions(self, bank, account_id, transactions): def got_transactions(self, bank, account_id, transactions):
print("GOT transactions", bank, account_id, transactions) print("GOT transactions", bank, account_id, transactions)
transaction_ids = [x["transaction_id"] for x in transactions]
print("IDS", transaction_ids)
new_key_name = f"new.transactions.{bank}.{account_id}"
old_key_name = f"transactions.{bank}.{account_id}"
r.sset(new_key_name, transaction_ids)
difference = r.sdiff(new_key_name, old_key_name)
print("difference", difference)
# Rename the new key to the old key so we can run the diff again
r.rename(new_key_name, old_key_name)
# self.transactions.transaction(transactions)

View File

@ -462,7 +462,8 @@ class IRCCommands(object):
if length == 2: if length == 2:
account = spl[1] account = spl[1]
accounts = tx.sinks.truelayer.get_accounts(account) accounts = tx.sinks.truelayer.get_accounts(account)
msg(dumps(accounts)) for account in accounts["results"]:
msg(f"{account['account_id']} {account['display_name']} {account['currency']}")
class transactions(object): class transactions(object):
name = "transactions" name = "transactions"