feat: Add Currency Exchange API and React UI#140
Open
devin-ai-integration[bot] wants to merge 3 commits into
Open
feat: Add Currency Exchange API and React UI#140devin-ai-integration[bot] wants to merge 3 commits into
devin-ai-integration[bot] wants to merge 3 commits into
Conversation
- Create currency and currency_rate database tables with seed data (Flyway V3)
- Add GET /currency endpoint listing all currencies
- Add GET /exchange-rate/{fromCur}/{toCur} endpoint for exchange rates
- Add JUnit tests for CurrencyApi and CurrencyService (6 tests)
- Create React UI with currency list table and exchange rate calculator
- Add Jest/RTL tests for CurrencyList and ExchangeRateCalculator (9 tests)
- Configure Jest with Babel for frontend testing
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
- Clear stale exchange rate result when validation errors occur - Renumber Flyway migrations: currency tables are now V2, seed data is V3 so that spring.flyway.target=2 correctly skips seed data in tests
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.
Summary
Implements a full-stack currency exchange feature:
Backend (Spring Boot)
currencyandcurrency_ratetables with seed data (6 currencies, 6 exchange rate pairs)/currency: Returns all currencies keyed by currency code with country name, currency code, and currency name/exchange-rate/{fromCur}/{toCur}: Returns the exchange rate between two currencies (404 if pair not found)CurrencyandCurrencyRateinio.spring.core.currencyCurrencyMapperwith XML mappings for database queriesCurrencyServicewith business logicBackend Tests (JUnit 5)
CurrencyApiTest— 3 tests: list all currencies, get exchange rate, 404 for unknown pairCurrencyServiceTest— 3 tests: service returns currency map, exchange rate, null for unknown pairFrontend (React/Next.js)
/currencyroute integrating both componentsFrontend Tests (Jest + React Testing Library)
CurrencyList.test.tsx— 4 tests: renders table, headers, empty state, correct row countExchangeRateCalculator.test.tsx— 5 tests: form rendering, validation errors, successful rate display, API error handlingUI Screenshot
Migration Ordering
spring.flyway.target=2to skip V3 seed dataReview & Testing Checklist for Human
./gradlew bootRun) and verifyGET /currencyreturns all 6 currenciesGET /exchange-rate/USD/INRreturns{"fromCurrencyCode":"USD","toCurrencyCode":"INR","exchangeRate":"80.08"}cd frontend && NODE_OPTIONS=--openssl-legacy-provider npm run dev) and visithttp://localhost:3000/currencyNotes
gradle.propertieswas added with JVM args to fix Spotless/google-java-format compatibility with Java 17babel.jest.config.js) so it doesn't interfere with Next.jsLink to Devin session: https://partner-workshops.devinenterprise.com/sessions/994d158e00714fad9f07f37b78f0297a