Skip to content

feat(currency-hub): add pagination, filtering, and search support with Swagger docs#105

Closed
mdauwal wants to merge 1 commit intoNexacore-Org:mainfrom
mdauwal:feat/currency-hub-pagination-search
Closed

feat(currency-hub): add pagination, filtering, and search support with Swagger docs#105
mdauwal wants to merge 1 commit intoNexacore-Org:mainfrom
mdauwal:feat/currency-hub-pagination-search

Conversation

@mdauwal
Copy link

@mdauwal mdauwal commented May 31, 2025

🚀 Currency Hub: Paginated, Searchable Currency Data API

Summary

This PR enhances the currency-hub module with:

  • ✅ Pagination (page, limit)
  • 🔍 Search by base/target currency or provider
  • 🔄 Advanced filtering via QueryCurrencyHubDto
  • 📄 Swagger documentation via @ApiQuery, @ApiOperation

What's Included

  • QueryCurrencyHubDto — updated with page, limit, and search
  • currency-hub.service.ts — updated findAll method with full logic
  • currency-hub.controller.ts — updated with Swagger decorators and updated endpoint

How to Test

  • Visit GET /currency-hub
  • Try queries like:
    • ?page=1&limit=10
    • ?search=USD
    • ?baseCurrencyCode=USD&targetCurrencyCode=NGN

Closes

Closes #56

{ ...baseFilters, baseCurrencyCode: Like(`%${search}%`) },
{ ...baseFilters, targetCurrencyCode: Like(`%${search}%`) },
{ ...baseFilters, provider: Like(`%${search}%`) },
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this function, what happened to the?, please return them?

@mdauwal
Copy link
Author

mdauwal commented Jun 3, 2025

This update merges enhanced filtering, pagination, and search capabilities into the existing CurrencyHub service logic while retaining all operational methods such as:

  • findOne
  • convertCurrency
  • getBestProvider
  • getHistoricalTrend

✅ Preserves all existing business logic
✅ Adds paginated findAll with filters and search
✅ Maintains structure and testability for upcoming versioning

@portableDD portableDD closed this Jun 5, 2025
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.

Implement Global Currency Data API within Currency Hub Module

3 participants