Repository created to keep track of requested task implementation.
For problem requirements check description.
Parser is a console application, but its logic can be extracted to controller logic if needed. Only pure Scala with ScalaTest is used to solve given problem.
Flow is as follows:
- Load CSV file to memory.
- Parse file so each record represents daily view of Currency Exchange where for one date we can see all currency exchange rates.
- Load records to memory (in-memory repository us used).
- Make necessary calculations to serve requested operations.
- Allows an API caller to retrieve the reference rate data for a given Date for all available Currencies.
- Given a Date, source Currency (eg. JPY), target Currency (eg. GBP), and an Amount, returns the Amount given converted from the first to the second Currency as it would have been on that Date (assuming zero fees).
- Given a start Date, an end Date and a Currency, return the highest reference exchange rate that the Currency achieved for the period.
- Given a start Date, an end Date and a Currency, determine and return the average reference exchange rate of that Currency for the period.