Skip to content

feat: implement exchange rate service with spread calculationFeat/idr rate aggregator#225

Open
mikleo04 wants to merge 33 commits into
allobankdev:mainfrom
mikleo04:feat/idr-rate-aggregator
Open

feat: implement exchange rate service with spread calculationFeat/idr rate aggregator#225
mikleo04 wants to merge 33 commits into
allobankdev:mainfrom
mikleo04:feat/idr-rate-aggregator

Conversation

@mikleo04
Copy link
Copy Markdown

🚀 Exchange Rate Service Implementation

📌 Overview

This pull request implements a Spring Boot service that fetches exchange rate data from an external API and calculates a spread factor based on the GitHub username.


⚙️ Features

  • Fetch latest exchange rates (IDR base)
  • Fetch historical exchange rates (IDR to USD)
  • Fetch available currencies
  • Calculate spread using username-based formula
  • In-memory data storage
  • Retry mechanism and error handling for external API
  • Unit and integration tests included

🧮 Spread Calculation

GitHub Username: mikleo04

Formula:
spread = (sum ASCII username % 1000) / 100000

Result:
0.00741 (~0.741%)


🏗️ Architecture

  • Strategy Pattern for handling different resource types
  • FactoryBean for RestTemplate configuration
  • ApplicationRunner for data initialization at startup

🧪 Testing

  • Unit tests for service, client, and datastore
  • Integration tests for:
    • External API
    • ApplicationRunner startup behavior

📡 External API

Uses:
https://api.frankfurter.app


✅ Notes

  • Project is fully runnable
  • All endpoints tested via cURL
  • README includes setup, usage, and detailed explanation

mikleo04 added 30 commits April 19, 2026 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant