Skip to content

feat: implement IDR rate aggregator#201

Open
ramaaufadha wants to merge 3 commits into
allobankdev:mainfrom
ramaaufadha:feat/idr-rate-aggregator
Open

feat: implement IDR rate aggregator#201
ramaaufadha wants to merge 3 commits into
allobankdev:mainfrom
ramaaufadha:feat/idr-rate-aggregator

Conversation

@ramaaufadha
Copy link
Copy Markdown

📌 Overview

This PR implements a backend service to provide IDR-based financial data using the Frankfurter API.

The solution follows clean architecture principles and applies several design patterns to ensure scalability, maintainability, and performance.


⚙️ Key Features

  • Strategy Pattern to eliminate conditional logic
  • FactoryBean for WebClient configuration
  • In-memory caching with preloaded data
  • Global exception handling
  • Unit testing

🧠 Architectural Rationale

1. Why Strategy Pattern?

Strategy Pattern is used to avoid conditional logic (if/switch) and make the system easily extensible. New resource types can be added without modifying existing code.


2. Why FactoryBean?

FactoryBean encapsulates WebClient creation logic, making configuration centralized, reusable, and more flexible.


3. Why preload data at startup?

Data is fetched once at application startup to improve performance, reduce external API calls, and ensure faster response times.


🧪 Testing

  • Unit tests implemented for SpreadCalculator
  • Basic validation for strategy logic

💡 Notes

  • All endpoints are working correctly
  • Data is stored in memory using immutable structure
  • Designed for scalability and maintainability

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