Call the base class from TrueLayer with our fetched transactions
This commit is contained in:
parent
cbb7294f23
commit
aefa6c58a4
|
@ -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)
|
||||||
|
|
|
@ -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"
|
||||||
|
|
Loading…
Reference in New Issue