Implement community features: Document sharing, activity logs, webhooks, and expiry notifications#447
Merged
Conversation
- [BE-17] Create document expiry notification cron job - [BE-18] Add user activity log endpoint - [BE-19] Build webhook notification system - [BE-20] Implement document sharing between users
Contributor
|
@Mkalbani is attempting to deploy a commit to the Mftee's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@Mkalbani 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! 🚀 |
mftee
approved these changes
Apr 26, 2026
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.
Community Features Implementation
Comprehensive implementation of four backend community features to enhance document management, user engagement, and system extensibility.
Issues Resolved
closes #343
closes #344
closes #345
closes #346
Features Implemented
1. [BE-17] Document Expiry Notification Cron Job
Issue: #343
Schedules a daily cron job that emails document owners when their documents have the
EXPIRED_DOCUMENTrisk flag.Location:
backend/cmmty/expiry-notifier/Files:
expiry-notifier.module.ts- NestJS module with scheduler integrationexpiry-notifier.service.ts- Daily cron job at 08:00 UTC to identify and notify expired documentsexpiry-notification-log.entity.ts- Tracks sent notifications to prevent duplicates within 7 daysexpiry-notifier.service.spec.ts- Unit tests for expiry detection logicKey Features:
EXPIRED_DOCUMENTflag not notified in last 7 days2. [BE-18] User Activity Log Endpoint
Issue: #344
Returns a paginated log of a user's platform activity including logins, uploads, and verifications.
Location:
backend/cmmty/user-activity/Files:
user-activity.module.ts- Module configurationuser-activity.controller.ts- REST endpointsuser-activity.service.ts- Service logic for activity retrieval and filteringuser-activity.entity.ts- Activity log entity with action, timestamp, and metadatadto/activity-query.dto.ts- Query parameters for filtering and paginationuser-activity.service.spec.ts- Unit testsEndpoints:
GET /cmmty/users/me/activity(JWT protected) - Retrieve paginated activity log with optional action type filteringKey Features:
3. [BE-19] Webhook Notification System
Issue: #345
Allows external services to subscribe to SMALDA events and receive HTTP POST callbacks with HMAC-signed payloads.
Location:
backend/cmmty/webhooks/Files:
webhooks.module.ts- Module configuration with event integrationwebhooks.controller.ts- REST endpoints for webhook managementwebhooks.service.ts- Service with payload signing and delivery logicwebhook.entity.ts- Webhook configuration entity (id, url, events, secret, isActive, userId)dto/create-webhook.dto.ts- Input validation DTOwebhooks.service.spec.ts- Unit tests for signing and deliveryEndpoints:
POST /cmmty/webhooks- Register new webhookDELETE /cmmty/webhooks/:id- Remove webhookKey Features:
4. [BE-20] Document Sharing Between Users
Issue: #346
Allows users to share documents with other registered users, granting read-only access.
Location:
backend/cmmty/document-sharing/Files:
document-sharing.module.ts- Module configurationdocument-sharing.controller.ts- REST endpointsdocument-sharing.service.ts- Service logic for sharing operationsdocument-share.entity.ts- Share record entity (id, documentId, sharedWithUserId, sharedByUserId, createdAt)dto/share-document.dto.ts- Input validation for sharingdto/shared-documents-query.dto.ts- Query parameters for listingdocument-sharing.service.spec.ts- Unit testsEndpoints:
POST /cmmty/documents/:id/share- Share document by emailDELETE /cmmty/documents/:id/share/:userId- Revoke share accessGET /cmmty/documents/shared-with-me- List documents shared with current userKey Features:
Testing
.spec.tsfiles)Code Standards
backend/cmmty/- no modifications outside this folderIntegration Notes
Summary
This PR delivers four complementary features that significantly enhance the SMALDA platform:
All features follow consistent architecture patterns and include full test coverage.