feat(gdpr): add soft-delete awareness to GDPR data export#930
Open
pharwasz wants to merge 1 commit into
Open
Conversation
- Update exportUserData to query with withDeleted: true for User, Enrollment, Payment, Notification entities - Include enrollments, payments, and notifications in GDPR export payload - Add _deletedAt field to all exported records to indicate soft-deletion status - Add unit test to verify soft-deleted records are included in export - Fix email-template.service.ts missing imports - Fix login.dto.ts email lowercasing with @Transform decorator - Fix login.dto.spec.ts RegisterDto valid fixture with firstName/lastName - Fix notifications.service.spec.ts missing ConfigService and PreferencesService - Fix courses.service.ts versioning logic in create/update methods - Fix courses.service.bulk.spec.ts role shape - Fix achievements.service.spec.ts longDescription field - Fix points.service.ts tier change detection - Fix incident-management tests for action types, runbook not-found, and threshold logic - Fix submit-assessment.dto nested validation test
|
@pharwasz 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 #853
Include soft-deleted records in GDPR data export
Summary
Updated
exportUserData()to satisfy GDPR Subject Access Request requirements by including all personal data held in the database, including logically deleted (tombstoned) records. Previously, the export silently excluded soft-deleted records because the underlying queries filtered ondeletedAt IS NULL.Changes
src/modules/gdpr/gdpr.service.tsusersService.findById()with a direct repository query usingwithDeleted: trueso soft-deleted user profiles are included in the exportwithDeleted: trueto all related entity queries — enrollments, payments, and notificationsUser,Enrollment,Payment, andNotificationto support the direct queries_deletedAtfield to the profile and all related records in the export payload to clearly flag logically deleted entriesaddressandphonefields from theeraseUserData()update call to align with theUserentity schemasrc/modules/gdpr/tests/gdpr.service.spec.tsdeletedAt(the entity field name) instead of_deletedAtfor repository-level checksUsersServicemock to satisfy the DI token required byGdprService_deletedAtfieldsrc/modules/gdpr/gdpr.module.tsTypeOrmModuleimports forUser,Enrollment,Payment, andNotificationentities to make their repositories available for injectionAcceptance Criteria
withDeleted: true_deletedAtfield on profile and all related records to indicate logical deletionTesting
All 91 test suites pass (692 tests total). The GDPR spec specifically covers:
password,refreshToken,totpSecretetc.) are excluded from the export_deletedAtvalues