feat(backend): soft-delete retention, notification DLQ, request sanit… - #1268
Merged
Ceejaytech25 merged 2 commits intoOct 1, 2026
Conversation
…ization, SEP OpenAPI specs - Add KycCustomer.deletedAt, filter soft-deleted rows from default reads via a Prisma query extension, soft-delete on SEP-12 DELETE, and purge records past the 7-year retention period with a daily cron job (ceejaylaboratory#1197) - Configure notification queue retries (3 attempts, exponential 1s backoff), route exhausted jobs to notification-dlq, and add admin endpoints to list and retry DLQ jobs (ceejaylaboratory#1199) - Sanitize query and route params in addition to the request body (ceejaylaboratory#1203) - Complete OpenAPI 3.0 annotations for SEP-6/12/24/31/38/40 routes, fix invalid YAML in existing blocks, and add a CI step validating the spec (ceejaylaboratory#1205) Closes ceejaylaboratory#1197 Closes ceejaylaboratory#1199 Closes ceejaylaboratory#1203 Closes ceejaylaboratory#1205 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@godamongstmen897 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! 🚀 |
Contributor
|
Nice implementation, LGTM! 🚀 Great work on this contribution — the approach is clean and well thought out. Thanks for contributing to AnchorPoint! |
…-delete-dlq-sanitize-swagger
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.
Overview
This Pull Request resolves four core backend data retention, messaging resilience, security sanitization, and API documentation issues in AnchorPoint:
req.body,req.query, andreq.params.Linked Issues
Summary of Changes
1. Soft-Delete Mechanism & 7-Year Retention Purge (#1197)
deletedAt DateTime?to the KYC customer record with dedicated migration and rollback scripts.backend/src/utils/soft-delete.ts). Added explicit checks to SEP-12GET /customerand KYC webhooks (returning 404 for deleted profiles). UpdatedDELETE /sep12/customer/:accountto flagdeletedAt = now()instead of executing a hard delete, and re-submitting KYC restores the profile.2. Notification Dead-Letter Queue (DLQ) & Admin Controls (#1199)
notification-dlqqueue withrouteFailedNotificationToDlqforwarding exhaustively failed jobs.GET /api/admin/queues/notification-dlq: Inspects failed jobs, error traces, and timestamps.POST /api/admin/queues/notification-dlq/:jobId/retry: Re-injects failed DLQ jobs back into the activenotificationqueue.3. Comprehensive Request Input Sanitization (#1203)
sanitizeRequestMiddleware) from body-only inspection to recursively sanitize string values acrossreq.body,req.query, and routereq.params(including nested router contexts).backend/src/index.tsto neutralize stored and reflected XSS payloads before route handlers execute.4. OpenAPI 3.0 SEP Specifications & Validation Gate (#1205)
PATCH /api/notifications/history), and corrected YAML indentation errors in SEP-24 routes.npm run swagger:validateutilizing@apidevtools/swagger-parserto validate schema compliance across 92 endpoints, integrating it into the CI verification pipeline.Verification Logs
npm run swagger:validatesuccessfully validated the complete OpenAPI 3.0 document across 92 paths with 0 syntax or reference errors.Notes for Maintainers
main:backend/prisma/schema.prismacontains duplicate models and unresolved git merge conflict artifacts (fix/issue-batch 1,=======). Testing was verified locally using a cleaned single-schema instance;deletedAtwas added across all model copies to maintain forward compatibility.sep24.controller.ts,sep31/service.ts,admin.schemas.ts,relayer.service.test.ts) and 48 legacy test suite failures exist on upstreammainand remain isolated from this branch's diff.routeFailedNotificationToDlqhandler is implemented and ready to be bound as thefailedlistener once the notification consumer worker is provisioned.