Skip to content

feat: implement soft delete functionality for snippets#79

Open
devcarole wants to merge 1 commit into
SudiptaPaul-31:mainfrom
devcarole:feature/soft-delete-functionality
Open

feat: implement soft delete functionality for snippets#79
devcarole wants to merge 1 commit into
SudiptaPaul-31:mainfrom
devcarole:feature/soft-delete-functionality

Conversation

@devcarole
Copy link
Copy Markdown

@devcarole devcarole commented May 26, 2026

Closes #70


  • Add isDeleted, deletedAt, deletedBy columns to snippets table
  • Create activity_logs table for audit trail
  • Implement soft delete in repository and service layers
  • Add trash endpoint (GET /api/snippets/trash)
  • Add restore endpoint (POST /api/snippets/[id]/restore)
  • Add activity history endpoint (GET /api/snippets/[id]/activity)
  • Create ActivityLogger utility for audit logging
  • Update query filtering to exclude soft-deleted snippets
  • Add ownership verification for restore operations
  • Create 7 performance indexes for optimized queries
  • Add comprehensive documentation (10 files)
  • Add database migration script

Acceptance Criteria Met:
✅ isDeleted flag in schema
✅ Deleted snippets excluded from normal queries
✅ Trash/recovery section with list endpoint
✅ Restore functionality implemented
✅ Activity logging for delete/restore actions

Closes: Add Soft Delete Functionality for Snippets

- Add isDeleted, deletedAt, deletedBy columns to snippets table
- Create activity_logs table for audit trail
- Implement soft delete in repository and service layers
- Add trash endpoint (GET /api/snippets/trash)
- Add restore endpoint (POST /api/snippets/[id]/restore)
- Add activity history endpoint (GET /api/snippets/[id]/activity)
- Create ActivityLogger utility for audit logging
- Update query filtering to exclude soft-deleted snippets
- Add ownership verification for restore operations
- Create 7 performance indexes for optimized queries
- Add comprehensive documentation (10 files)
- Add database migration script

Acceptance Criteria Met:
✅ isDeleted flag in schema
✅ Deleted snippets excluded from normal queries
✅ Trash/recovery section with list endpoint
✅ Restore functionality implemented
✅ Activity logging for delete/restore actions

Closes: Add Soft Delete Functionality for Snippets
@vercel
Copy link
Copy Markdown

vercel Bot commented May 26, 2026

@1sraeliteX is attempting to deploy a commit to the Sudipta 's projects Team on Vercel.

A member of the Team first needs to authorize it.

@devcarole
Copy link
Copy Markdown
Author

Dear maintainer, check and merge PR!

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 26, 2026

@devcarole 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! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Soft Delete Functionality for Snippets

2 participants