Trade Finance
Proposal to create a new service that consumes Trade Finance data and shares it with Quantum.
Problem Description
Currently Ebury has the ability to create loans to our clients.
Trade Finance loan is currently held in SalesForce and the information is not shared with Quantum (our Treasury Management System).
Background
A Trade Finance loan can be in multiple statuses and can be updated multiple times during its lifecycle. Each time we consume trade finance data, we need to calculate its current status so that Quantum can be updated.
The solution presented here is based on the architecture defined in the later stages of the Broker Deal Entity Branch RFC.
Solution
Either:
1) The data team will produce a daily report that shows all trade finance loans which a service will consume.
Or
2) We will use the Salesforce REST API to fetch trade finance loan data.
We will add a Salesforce proxy to read that report and emit events for the Quantum gateway to consume.

New loans and updates to existing loads will be published as events, and consumed by the Quantum gateway, where they will be packaged in QXT files or sent using the Quantum API.
In the case of reading a report from data:
The proxy needs to keep track of the previous and new states of each loan
when it reads the report, because we need to trigger an event when a loan
is overdue, by comparing the current date to the Repayment Due date.
In the case of using the REST API:
The proxy will obtain a delta of information similar to how BOS fetches accounts. See option 4 in this document. We will need some local state to keep track of what updates we need to send. It's possible we can query for overdue loans, and then record locally that the overdue state has been processed and published as an event.
The decision of which option we choose will be based on the engineering availability of SF and Data teams.
Alternatives
The data team could compute the statuses for us as part of the report, so that the status logic is kept with the report.
Or
The statuses could be computed and kept in Salesforce, and fetched by the proxy.
Caveats
N/A
Operation
The service is only for internal operation.
Security Impact
The service will potentially consume sensitive data.
A spike will be done to determine audit requirements.
Performance Impact
N/A
Developer Impact
N/A
Data Consumer Impact
N/A
Deployment
DevOps will need to roll out the new instance to run the service, and configure access to the generated trade finance report.
Dependencies
The format of the trade finance report will need to be agreed with the data team.