Implement overriding owner name with requisition field

This commit is contained in:
2023-04-18 08:58:36 +01:00
parent 7448c361bf
commit 495039e6a0
5 changed files with 29 additions and 1 deletions

View File

@@ -22,6 +22,12 @@ class AggregatorClient(ABC):
for bank, accounts in account_infos.items():
# Iterate the accounts
for index, account in enumerate(list(accounts)):
if account["ownerName"] is None:
requisition = self.instance.get_requisition(
account["requisition_id"]
)
if requisition is not None:
account["ownerName"] = requisition.owner_name
if "account_number" not in account:
account_infos[bank][index]["account_number"] = {}
fields = ["sort_code", "number", "iban"]