Streaming Audit Export GET /transactions/export#432
Merged
Devsol-01 merged 8 commits intoDevsol-01:mainfrom Mar 26, 2026
Merged
Streaming Audit Export GET /transactions/export#432Devsol-01 merged 8 commits intoDevsol-01:mainfrom
Devsol-01 merged 8 commits intoDevsol-01:mainfrom
Conversation
…lorer links - Add TransactionFormattingInterceptor for global response formatting - Format amounts with proper precision and currency symbols - Generate Stellar Expert explorer links for transactions and assets - Update transaction DTO and module configuration - Include PR documentation in interceptor README
…matting and explorer links ## Summary Implemented transaction response enrichment interceptor that formats raw database amounts into user-friendly displays and adds Stellar Expert exploration links. ## Changes - **New Interceptor**: `TransactionFormattingInterceptor` in `common/interceptors/` - Formats amounts: `"100000000"` → `"$100.00"` with proper USDC precision (7 decimals) - Generates Stellar Expert links from transaction hashes - Configurable asset mapping system - **Module Updates**: - `transactions.module.ts`: Added global interceptor provider - `transaction-response.dto.ts`: Added `amountFormatted` and `explorerLinks` fields - `transactions.service.ts`: Added asset ID extraction logic ## Acceptance Criteria ✅ - ✅ Construct explicit formatter logic attaching asset mapping symbols - ✅ Evaluate Stellar contract precision parameters intelligently - ✅ Render UI outputs exactly (e.g., `amountFormatted.display: "$500.00"`) - ✅ Dynamically attach canonical Stellar Expert exploration links ## Files Changed - `backend/src/common/interceptors/transaction-formatting.interceptor.ts` (new) - `backend/src/modules/transactions/transactions.module.ts` - `backend/src/modules/transactions/dto/transaction-response.dto.ts` - `backend/src/modules/transactions/transactions.service.ts` - `backend/src/common/interceptors/TRANSACTION_FORMATTING_README.md` (new) ## Testing - ✅ `npm run build` passes - ✅ TypeScript compilation successful - ✅ Interceptor integration verified
…into feat/Transfer
- Add amountFormatted and assetId fields to TransactionResponseDto mock - Fix ESLint error in transaction-formatting.interceptor.ts (use Object.hasOwn) - Resolves TypeScript compilation error in transactions.controller.spec.ts - Ensures CI tests pass after transaction enrichment implementation
- Add RolesGuard and @roles decorators to admin.controller.ts - Enforce ADMIN role requirement for KYC management endpoints - Complement existing JwtAuthGuard with role-based authorization - AdminSavingsController already properly protected with RBAC - User entity already has role column (USER/ADMIN) with proper defaults Acceptance Criteria: ✅ Create a RolesGuard complementing the JwtAuthGuard ✅ Expose @roles('ADMIN') decorators for sensitive endpoints ✅ Add role column (USER/ADMIN) to the existing User TypeORM entity Tests: ✅ RBAC tests passing
- New endpoint GET /transactions/export in TransactionsController - Streams query-filtered transaction data by chunk to keep memory usage low - Uses @fast-csv/format for reliable CSV generation - Response headers set: Content-Type and Content-Disposition - Includes CSV-ready fields with safe metadata JSON fallback - Keeps existing pagination/query behavior in service query builder
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@OthmanImam 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! 🚀 |
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.
Closes: #309
Summary
GET /transactions/export.@fast-csv/formatfor incremental CSV row writing.TransactionQueryDtoconditions and increments with pagination settings to avoid large memory peaks.Functional behavior
limit/skip) using same query builder logic.Content-Type: text/csvContent-Disposition: attachment; filename="nestera_history.csv"Files Changed
backend/src/modules/transactions/transactions.controller.tsbackend/src/modules/transactions/transactions.service.tsbackend/package.jsonbackend/pnpm-lock.yamlValidation
npm run buildpasses