Description
Implement right-to-erasure that hard-deletes user data where lawful and crypto-shreds where retention is mandated by financial regulation. Must honor active legal holds.
Requirements and context
- Must be secure, tested, and documented
- Should be efficient and easy to review
- Relevant code:
src/db/repositories/userRepository.ts, src/security/audit.ts
- Legal hold must block erasure with explicit reason
Suggested execution
- Fork the repo and create a branch
git checkout -b feat/gdpr-erasure
- Implement changes
- Add
erasure_requests and legal_holds tables
- Implement worker that deletes or crypto-shreds
- Emit audit log with category and outcome
- Validate security and correctness assumptions
Test and commit
- Run tests
- Cover edge cases
- Hold added mid-flow, partial child-record retention, double request
- Include test output and notes
Example commit message
feat: GDPR erasure with legal-hold and crypto-shred
Guidelines
- Minimum 95 percent test coverage
- Clear documentation
- Timeframe: 96 hours
Description
Implement right-to-erasure that hard-deletes user data where lawful and crypto-shreds where retention is mandated by financial regulation. Must honor active legal holds.
Requirements and context
src/db/repositories/userRepository.ts,src/security/audit.tsSuggested execution
git checkout -b feat/gdpr-erasureerasure_requestsandlegal_holdstablesTest and commit
npm testExample commit message
feat: GDPR erasure with legal-hold and crypto-shredGuidelines