Skip to content

feat: scheduled reports, email preferences, activity analytics, and document expiration utilities - #1009

Merged
nanaf6203-bit merged 4 commits into
MettaChain:mainfrom
Nimatstar:Nimatstar/reports-email-activity-doc-expiry
Jul 28, 2026
Merged

feat: scheduled reports, email preferences, activity analytics, and document expiration utilities#1009
nanaf6203-bit merged 4 commits into
MettaChain:mainfrom
Nimatstar:Nimatstar/reports-email-activity-doc-expiry

Conversation

@Nimatstar

Copy link
Copy Markdown
Contributor

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.tsReportFrequency/ReportType enums, nextRunAt (daily / next-Monday / first-of-next-month, UTC), isReportDue, and RFC-4180 toCsvField/buildCsv for CSV attachments.

Email preference center + unsubscribe (#965)

src/users/email-preferences.util.tsEmailType enum, defaultEmailPreferences, mergePreferences, isEmailAllowed, and HMAC generateUnsubscribeToken / constant-time verifyUnsubscribeToken for one-click, per-type opt-out links.

Activity-log aggregation & analytics (#963)

src/users/activity-analytics.util.tsaggregateByType, activeUsers/dailyActiveUsers/weeklyActiveUsers, and retentionCutoff/partitionForRetention (default 90-day retention).

Document expiration workflow (#962)

src/documents/document-expiration.util.tsdaysUntilExpiry, isExpired, dueNotificationMilestone (30/14/7/1-day reminders), and shouldMarkExpired for 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

@drips-wave

drips-wave Bot commented Jul 28, 2026

Copy link
Copy Markdown

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

Learn more about application limits

@nanaf6203-bit nanaf6203-bit left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nanaf6203-bit
nanaf6203-bit merged commit 99c3961 into MettaChain:main Jul 28, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants