feat: scheduled reports, email preferences, activity analytics, and document expiration utilities - #1009
Merged
nanaf6203-bit merged 4 commits intoJul 28, 2026
Conversation
|
@Nimatstar 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.
Adds the core, unit-tested logic for four features on one branch. Each change is a small, self-contained, side-effect-free utility module (plus full unit tests), so the scheduled jobs, endpoints, and notification flows can build on tested primitives without a database. No schema or migration changes.
Scheduled report generation (#966)
src/reports/report-schedule.util.ts—ReportFrequency/ReportTypeenums,nextRunAt(daily / next-Monday / first-of-next-month, UTC),isReportDue, and RFC-4180toCsvField/buildCsvfor CSV attachments.Email preference center + unsubscribe (#965)
src/users/email-preferences.util.ts—EmailTypeenum,defaultEmailPreferences,mergePreferences,isEmailAllowed, and HMACgenerateUnsubscribeToken/ constant-timeverifyUnsubscribeTokenfor one-click, per-type opt-out links.Activity-log aggregation & analytics (#963)
src/users/activity-analytics.util.ts—aggregateByType,activeUsers/dailyActiveUsers/weeklyActiveUsers, andretentionCutoff/partitionForRetention(default 90-day retention).Document expiration workflow (#962)
src/documents/document-expiration.util.ts—daysUntilExpiry,isExpired,dueNotificationMilestone(30/14/7/1-day reminders), andshouldMarkExpiredfor the daily expiry cron. Fully covered by its spec, keeping the documents module coverage gate satisfied.All four modules ship with unit tests (36 tests). Lint (--max-warnings=0) and build pass.
closes #966
closes #965
closes #963
closes #962