Skip to content

fix(transactions): cap analytics date range to 365 days and reject ov…#824

Open
dekaptain2 wants to merge 1 commit into
MettaChain:mainfrom
dekaptain2:fix/684-transaction-analytics-date-range-cap
Open

fix(transactions): cap analytics date range to 365 days and reject ov…#824
dekaptain2 wants to merge 1 commit into
MettaChain:mainfrom
dekaptain2:fix/684-transaction-analytics-date-range-cap

Conversation

@dekaptain2

Copy link
Copy Markdown

Pull Request: Cap Transaction Analytics Date Range

Summary

  • Add a hard limit to transaction analytics date queries in TransactionsService.getAnalytics
  • Reject requests where endDate - startDate > 365 days with a 400 Bad Request
  • Document the 365-day maximum window in TransactionAnalyticsQueryDto
  • Add a regression test for oversized date ranges

Files changed

  • src/transactions/transactions.service.ts
  • src/transactions/dto/transaction.dto.ts
  • src/transactions/transactions.service.spec.ts

Notes

  • This prevents long-running, unbounded Postgres analytics queries from pinning connections.

Closes #684

@drips-wave

drips-wave Bot commented Jun 27, 2026

Copy link
Copy Markdown

@dekaptain2 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

transactions.getAnalytics accepts unbounded date range — can pin Postgres connection

2 participants