Beneficiary filters improvements

Problem Description

Cloud Pay and Santander are asking for improvements in the beneficiary query functionality of the public API. The exact change they are asking for is the inclusion of the capability for filtering beneficiaries by external reference, IBAN, account_number and bank_identifier in the /beneficiaries API endpoint.

Background

The public API is a thin layer on top of the backend services, especially BOS. Most of the logic is in the upstream services, that is the reason why most of the time adding new functionality to the API requires to implement those changes in the backend services.

Solution

Extend the existing BOS endpoints to include the missing filters. This a quick and easy way to get the functionality in the hands of our clients, which would be a boost to their confidence since we will deliver the feature fast.

Alternatives

Migrate the API beneficiaries queries to use the Beneficiary Query Service (BQS) and extend it with the new parameters if needed.

This approach is risky because the BQS final testing and deployment into production would run parallel to the development of the API improvements. On top of that we will need to modify the API beneficiary functionality to use BQS instead of BOS, which is an epic by itself and not feasible in the timeframe we committed to.

Performance Impact

We don't expect any significant performance impact. The main change will consist in extending the current database query used by the /client/beneficiaries BOS endpoint. Said query already supports filtering by active beneficiaries and bank account currency symbol. Those filters mean that the query needs to use the Beneficiary, BankAccount and Currency models.

All the new filters relate with those already in use models.

Filter Model
reference_external Beneficiary
IBAN BankAccount
account_number BankAccount
bank_identifier BankAccount

We will also update the view and its controller to include the new parameters for the filters and pass their values down to the query. Which shouldn't have any performance impact either.