feat(reports): implement recurring monitoring summaries with cron scheduling & email delivery#197
Open
Opulencechuks wants to merge 2 commits into
Open
feat(reports): implement recurring monitoring summaries with cron scheduling & email delivery#197Opulencechuks wants to merge 2 commits into
Opulencechuks wants to merge 2 commits into
Conversation
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.
This PR closes #128
Description
Implemented recurring monitoring summary reports with cron scheduling and email delivery. This adds daily and weekly security posture reports that are automatically generated and sent via SMTP, providing teams with regular visibility into security status.
Type of Change
Changes Made
src/modules/reports/reports.module.ts– registers report‑related providers and exports.src/modules/reports/report.service.ts– generates daily and weekly report contents.src/modules/reports/scheduler.service.ts– schedules report generation usingnode‑cron(daily at 08:00 UTC, weekly on Monday at 09:00 UTC).src/modules/reports/email.service.ts– sends reports vianodemailerusing environment variablesSMTP_HOST,SMTP_PORT,SMTP_USER,SMTP_PASS, andREPORT_RECIPIENT.src/modules/reports/dto/report.dto.ts– TypeScript interface for report data.src/modules/reports/report.service.spec.ts– unit tests for report generation and email delivery (4 passing tests).package.json– addednode-cronandnodemailer(and their typings) as dependencies.ReportsModuleinto the rootapps/backend/src/app.module.ts.Testing
bun test). All 4 report‑service tests pass.npm run lint).npm run format).npm run build).Checklist
Screenshots (if applicable)
(No UI changes – background services only.)
Additional Context
The new reporting module is designed to be extensible; future work can replace placeholder report content with real security metrics and enhance email formatting (HTML templates, attachments). Environment variables required for email delivery should be added to the project's
.envconfiguration.