Skip to content

Conversation

@mdauwal
Copy link

@mdauwal mdauwal commented Jun 5, 2025

Summary

This PR introduces a new API endpoint under the currency-hub module that allows consumers to:

  • Search for currency records using full-text search across baseCurrencyCode, targetCurrencyCode, and provider fields
  • Paginate the search results using page and limit query parameters

This enhancement improves accessibility and scalability of the global fiat and cryptocurrency dataset for both internal use and external API consumers.


✨ New Features

  • ✅ Added GET /currency-hub/search endpoint
  • ✅ Search support via partial matches on currency codes and providers
  • ✅ Pagination support via page and limit query parameters
  • ✅ DTO validation using class-validator and class-transformer
  • ✅ Seamless integration into existing service and controller logic
  • ✅ Swagger auto-documentation compatible
  • ✅ Unit test coverage added for new service logic

📂 Affected Files

  • currency-hub.service.ts – Added searchAndPaginateCurrencies() method
  • currency-hub.controller.ts – Added searchWithPagination() route
  • dto/search-currency.dto.ts – New DTO for validating search input
  • currency-hub.service.spec.ts – Basic test case for search and pagination logic

✅ Testing Checklist

  • Search endpoint returns filtered results
  • Pagination respects page and limit parameters
  • Unit tests pass and maintain >90% coverage
  • Existing endpoints remain unaffected
  • Swagger documentation is updated automatically

🧪 How to Test

GET /currency-hub/search?search=usd&page=1&limit=10

closes #56 

@portableDD portableDD merged commit c7e0844 into Nexacore-Org:main Jun 5, 2025
3 checks passed
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.

3 participants