The purpose of this project is to meet the challenge of the company JAYA
This WEB API was developed in .NET 5 using the IDE Microsoft Visual Studio Community 2019, with the in-memory database and EntityFramework to save all transactions performed, the unit and integration tests, xUnit was used with FluentAssertions and Mock, as it was a challenge for the company and for me, I decided to use frameworks I wasn't familiar with, like .NET 5, Swagger, xUnit, FluentAssertions and Serilog
CreateTransaction : Creates a new currency conversion transaction according to source currency to destination currency
GetAllTransactionsByUserId : Fetch all transactions for a given user
You will need .NET 5 and Visual Studio Community 2019
Select the CurrencyConverterAPI project and run it as CurrencyConverterAPI, it will automatically open the browser according to the port marked in Properties/launchSettings.json
https://localhost:5001/swagger/index.html
It can also be run by IIS, it will also automatically open the browser according to the port marked in Properties/launchSettings.json
https://localhost:44339/swagger/index.html
As this project needs an External API to fetch currency quotes, where you can easily create a free account and get the access token at https://exchangeratesapi.io/
Once the account is created on the External API website, change the configuration in appsettings.json/appsettings.Development.json
Change the value of the "ACCESS_KEY" property to your new access token as shown in the image above
CurrencyConverterAPI requires currencies to be passed with ISO 4217 standard code at ISO_2417 and may return some fault codes such as:
- 1001 - User does not exist
- 1002 - Exchangeratesapi API error (used to fetch factors)
- 1003 - Field {field} must be greater than 0
- 1004 - Need to inform a currency of origin/destination
- 1005 - Invalid currency(s) for conversion {currency}