Repository navigation
feat: standardize exception handling, settlement approval, and key ro… - #609
Merged
martinzhames merged 2 commits intoOct 23, 2026
Conversation
…tation (dupdab#442 dupdab#444 dupdab#445 dupdab#446) dupdab#442 Standardize exception handling - Add custom business-logic exception hierarchy (BusinessLogicException, PaymentExpiredException, InsufficientFundsException) in src/common/exceptions - Replace service-layer throw new Error() with NestJS HTTP exceptions (BadRequestException/NotFoundException/ConflictException) so clients receive 400/404 instead of 500 - Implement global AllExceptionsFilter that logs all unhandled errors to Sentry and returns sanitized, stable error contracts; register it globally via APP_FILTER dupdab#444 Encryption key rotation for Stellar wallet keys - Add keyVersion column to blockchain_wallets (+ migration) - Support ENCRYPTION_KEY_PREVIOUS fallback decryption and re-encryption in EncryptionService; new wallets are provisioned with current keyVersion - Add re-encryptWallets() to BlockchainWalletService - Add POST /api/v1/admin/encryption/rotate-key (SUPERADMIN) with audit log - Document rotation procedure in RECOVERY_DRILL.md dupdab#445 Settlement approval workflow for large settlements - Implement SettlementsService.approveSettlement() / rejectSettlement() with audit log entry and merchant email notification on every decision - Add POST /admin/settlements/:id/approve and /reject (SUPERADMIN only) - Add paginated GET /admin/settlements list endpoint with Swagger docs dupdab#446 Admin cron job management endpoints - CronJobRegistry now tracks schedules; listJobs returns name, schedule, next run, and last run; getHistory returns paginated run logs (status, duration) persisted in CronJobLog; Swagger docs present Closes dupdab#442 Closes dupdab#444 Closes dupdab#445 Closes dupdab#446
…ception-handling-and-settlement-workflow # Conflicts: # src/app.module.ts
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.
#442 Standardize exception handling
#444 Encryption key rotation for Stellar wallet keys
#445 Settlement approval workflow for large settlements
#446 Admin cron job management endpoints
Closes #442
Closes #444
Closes #445
Closes #446