Group currency list by requisition
This commit is contained in:
@@ -124,7 +124,7 @@ class NordigenClient(BaseClient, AggregatorClient):
|
||||
# ownernames = loads(settings.Nordigen.OwnerNames)
|
||||
# return ownernames
|
||||
|
||||
async def get_account(self, account_id):
|
||||
async def get_account(self, req_id, account_id):
|
||||
"""
|
||||
Get details of an account.
|
||||
:param account_id: account ID"""
|
||||
@@ -148,6 +148,7 @@ class NordigenClient(BaseClient, AggregatorClient):
|
||||
# Let's add the account ID so we can reference it later
|
||||
parsed["account_id"] = account_id
|
||||
parsed["aggregator_id"] = str(self.instance.id)
|
||||
parsed["requisition_id"] = str(req_id)
|
||||
return parsed
|
||||
|
||||
async def get_all_account_info(self, requisition=None, store=False):
|
||||
@@ -157,10 +158,11 @@ class NordigenClient(BaseClient, AggregatorClient):
|
||||
else:
|
||||
requisitions = [await self.get_requisition(requisition)]
|
||||
|
||||
print("REQS", requisitions)
|
||||
for req in requisitions:
|
||||
accounts = req["accounts"]
|
||||
for account_id in accounts:
|
||||
account_info = await self.get_account(account_id)
|
||||
account_info = await self.get_account(req["id"], account_id)
|
||||
if not account_info:
|
||||
continue
|
||||
if req["institution_id"] in to_return:
|
||||
|
||||
Reference in New Issue
Block a user