Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
IDR Rate Aggregator
A Spring Boot REST API that fetches and serves IDR exchange rate data from the Frankfurter API.
Setup & Run
Prerequisites
Run the application
Run tests
./mvnw testEndpoint Usage
Base URL:
http://localhost:8080Personalization Note
GitHub Username:
FarizMRSpread Factor:
(763 % 1000) / 100_000.0= 0.00763Formula:
USD_BuySpread_IDR = (1 / Rate_USD) * (1 + 0.00763)Architectural Rationale
1. Strategy Pattern : Each resource type is handled by its own class. Adding a new resource only needs a new class, no changes to existing code. The controller picks the right handler from a map, no if/else needed.
2. FactoryBean : Keeps all WebClient setup (base URL, timeout) in one dedicated class instead of scattered across config.
3. ApplicationRunner : Runs after everything is ready, so all beans are available when data fetching starts.