feat: add default author for private sources#51
Merged
MaGOs92 merged 3 commits intoJun 10, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for configuring a per-source “default author” (for PRIVATE sources) and uses it as a fallback email recipient when a report is processed/ignored.
Changes:
- Add
defaultAuthor(jsonb) toSource+ DB migration. - Add
PUT /sources/:idSourceendpoint with source-token ownership checks to updatenomand/ordefaultAuthor. - Update report notification logic to send emails to
author.emailorsource.defaultAuthor.email.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/modules/source/source.entity.ts | Adds defaultAuthor column to Source entity and sets it on PRIVATE creation. |
| src/modules/source/source.dto.ts | Adds DTO validation for defaultAuthor and introduces UpdateSourceDTO. |
| src/modules/source/source.service.ts | Updates token lookup selection + adds new updateOne(id, dto) method. |
| src/modules/source/source.controller.ts | Adds PUT /sources/:idSource endpoint. |
| src/modules/source/source.module.ts | Registers SourceMiddleware for PUT source route. |
| src/modules/source/source.middleware.ts | Adds PUT-specific ownership enforcement (idSource param). |
| src/common/base-report.service.ts | Adds fallback to defaultAuthor.email for notification emails. |
| src/migrations/index.ts | Registers new migration. |
| src/migrations/1781234567890-add-source-default-author.ts | Adds defaultAuthor jsonb column to sources table. |
| src/tests/source.spec.ts | Extends source tests for defaultAuthor + new PUT endpoint coverage. |
| src/tests/alert.spec.ts | Adjusts alert serialization expectations to ignore defaultAuthor on nested source. |
| src/tests/signalement.spec.ts | Adjusts signalement serialization expectations to ignore defaultAuthor on nested source. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.