Overview
src/modules/gdpr/gdpr.service.ts eraseUserData() nulls profile fields but does not delete or anonymize payments, enrollments, audit logs, or active sessions. This creates orphaned financial records referencing a deleted profile and leaves active sessions usable after erasure.
Specifications
Features:
- Erasure must anonymize/delete all PII across related tables within a database transaction.
- All active sessions must be revoked on erasure.
Tasks:
- Wrap the erasure in a TypeORM transaction.
- Anonymize
Payment, Enrollment, AuditLog, Notification records tied to the user.
- Call
SessionService.deleteAllUserSessions(userId) to revoke sessions.
- Add a
GdprErasureJob for async cascade processing with idempotency.
- Add integration tests verifying no PII remains after erasure.
Impacted Files:
src/modules/gdpr/gdpr.service.ts
src/session/session.service.ts
Acceptance Criteria
- No PII remains in any table after erasure.
- Active sessions are immediately invalidated.
- Repeated erasure calls are idempotent (no errors on second run).
Overview
src/modules/gdpr/gdpr.service.tseraseUserData()nulls profile fields but does not delete or anonymize payments, enrollments, audit logs, or active sessions. This creates orphaned financial records referencing a deleted profile and leaves active sessions usable after erasure.Specifications
Features:
Tasks:
Payment,Enrollment,AuditLog,Notificationrecords tied to the user.SessionService.deleteAllUserSessions(userId)to revoke sessions.GdprErasureJobfor async cascade processing with idempotency.Impacted Files:
src/modules/gdpr/gdpr.service.tssrc/session/session.service.tsAcceptance Criteria