Implement removing accounts from Nordigen

This commit is contained in:
2022-04-09 20:18:23 +01:00
parent a7a2bb729c
commit f85342dc2e
3 changed files with 87 additions and 2 deletions

View File

@@ -586,6 +586,32 @@ class IRCCommands(object):
reference = transaction["reference"]
msg(f"{timestamp} {txid} {amount}{currency} {reference}")
class nreqs(object):
name = "nreqs"
authed = True
helptext = "Get a list of requisitions from Nordigen."
@staticmethod
def run(cmd, spl, length, authed, msg, agora, tx, ux):
reqs = tx.sinks.nordigen.get_requisitions()
for req in reqs:
id = req["id"]
institution_id = req["institution_id"]
redirect = req["link"]
msg(f"{id} {institution_id} {redirect}")
class ndelreq(object):
name = "ndelreq"
authed = True
helptext = "Delete a requisition from Nordigen."
@staticmethod
def run(cmd, spl, length, authed, msg, agora, tx, ux):
if length == 2:
requisition_id = spl[1]
rtrn = tx.sinks.nordigen.delete_requisition(requisition_id)
msg(f"{rtrn['summary']}")
class mapaccount(object):
name = "mapaccount"
authed = True
@@ -605,7 +631,7 @@ class IRCCommands(object):
class nmapaccount(object):
name = "nmapaccount"
authed = True
helptext = "Enable an account_id at a bank for use in Nordigen. Usage: nmapaccount <bank> <account_id>"
helptext = "Enable an account_id at a bank for use in Nordigen. Usage: nmapaccount <account_id>"
@staticmethod
def run(cmd, spl, length, authed, msg, agora, tx, ux):
@@ -617,6 +643,18 @@ class IRCCommands(object):
return
msg(f"Mapped account ID {account_id} to {account_name}")
class nunmapaccount(object):
name = "nunmapaccount"
authed = True
helptext = "Disable an account_id at a bank for use in Nordigen. Usage: nunmapaccount <account_id>"
@staticmethod
def run(cmd, spl, length, authed, msg, agora, tx, ux):
if length == 2:
account_id = spl[1]
tx.sinks.nordigen.unmap_account(account_id)
msg(f"Unmapped account ID {account_id}")
class unmapped(object):
name = "unmapped"
authed = True