Feature/820 - #332
Open
Ollitod wants to merge 2 commits into
Open
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 35 |
| Duplication | 2 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
There was a problem hiding this comment.
Pull request overview
Introduces a new recognition bounded context in com.gepardec.mega.hexagon that lets internal employees submit recognition entries and sends a weekly digest email to active internal project leads, backed by persistence, OpenAPI docs, a Qute-based mail template, and tests/specs.
Changes:
- Add recognition entry submission endpoint (secured to internal
EMPLOYEEs) and domain/application services. - Add weekly digest flow (recipient resolution, mail dispatch, status transition) including scheduler + Qute-rendered email.
- Add persistence (Liquibase + JPA/Panache + MapStruct) and OpenAPI/spec documentation + test coverage.
Reviewed changes
Copilot reviewed 60 out of 60 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/test/resources/messages.properties | Adds test i18n key for digest mail subject (DE). |
| src/test/resources/messages_en.properties | Adds test i18n key for digest mail subject (EN). |
| src/test/java/com/gepardec/mega/hexagon/recognition/application/SubmitRecognitionEntryServiceTest.java | Unit tests for submission behavior (anonymous vs non-anonymous, validation). |
| src/test/java/com/gepardec/mega/hexagon/recognition/application/RecognitionDigestServiceTest.java | Unit tests for digest dispatch, empty state, failures, and attribution. |
| src/test/java/com/gepardec/mega/hexagon/recognition/adapter/outbound/RecognitionEntryMapperTest.java | Tests MapStruct mapping for submitter persistence behavior. |
| src/test/java/com/gepardec/mega/hexagon/recognition/adapter/outbound/QuarkusRecognitionMailAdapterTest.java | Quarkus mailer integration tests for digest rendering + inline logo. |
| src/test/java/com/gepardec/mega/hexagon/recognition/adapter/outbound/ProjectLeadDirectoryAdapterTest.java | Tests recipient resolution filtering (active/internal/role). |
| src/test/java/com/gepardec/mega/hexagon/recognition/adapter/inbound/rest/RecognitionResourceTest.java | REST endpoint tests for authz/authn, validation, and command forwarding. |
| src/main/resources/templates/recognition-digest.html | New Qute template for the weekly digest body. |
| src/main/resources/openapi/schemas/recognition.yaml | Adds OpenAPI schema for recognition submission. |
| src/main/resources/openapi/paths/recognition.yaml | Adds OpenAPI path for recognition submission endpoint. |
| src/main/resources/openapi/openapi.yaml | Registers Recognition tag, path, and schema in OpenAPI root. |
| src/main/resources/messages.properties | Adds runtime i18n key for digest mail subject (DE). |
| src/main/resources/messages_en.properties | Adds runtime i18n key for digest mail subject (EN). |
| src/main/resources/db/changelog/hexagon/015-recognition-entry.yaml | Liquibase changelog to create recognition_entry table + status index. |
| src/main/resources/db/changelog-master.xml | Includes new recognition-entry changelog. |
| src/main/java/com/gepardec/mega/hexagon/recognition/domain/port/outbound/RecognitionEntryRepository.java | Outbound port for saving and querying recognition entries by status. |
| src/main/java/com/gepardec/mega/hexagon/recognition/domain/model/RecognitionMailRecipient.java | Value object for digest recipients (email + first name). |
| src/main/java/com/gepardec/mega/hexagon/recognition/domain/model/RecognitionEntryStatus.java | Status enum (NEW, INCLUDED_IN_DIGEST). |
| src/main/java/com/gepardec/mega/hexagon/recognition/domain/model/RecognitionEntryId.java | Identifier type for recognition entries. |
| src/main/java/com/gepardec/mega/hexagon/recognition/domain/model/RecognitionEntry.java | Aggregate/root record with validation and lifecycle transition. |
| src/main/java/com/gepardec/mega/hexagon/recognition/domain/model/RecognitionCategory.java | Category enum (APPRECIATION, COURAGE). |
| src/main/java/com/gepardec/mega/hexagon/recognition/domain/error/RecognitionValidationException.java | Domain validation exception type. |
| src/main/java/com/gepardec/mega/hexagon/recognition/domain/error/RecognitionException.java | Base domain exception type for recognition BC. |
| src/main/java/com/gepardec/mega/hexagon/recognition/application/SubmitRecognitionEntryService.java | Application service for submitting entries with injected Clock. |
| src/main/java/com/gepardec/mega/hexagon/recognition/application/RecognitionDigestService.java | Application service assembling/sending digest + marking entries included. |
| src/main/java/com/gepardec/mega/hexagon/recognition/application/port/outbound/RecognitionSubmitterDirectoryPort.java | Port to resolve submitter display names in batch. |
| src/main/java/com/gepardec/mega/hexagon/recognition/application/port/outbound/RecognitionMailPort.java | Mail port for sending digest emails. |
| src/main/java/com/gepardec/mega/hexagon/recognition/application/port/outbound/ProjectLeadDirectoryPort.java | Port for resolving active internal project leads for a reference date. |
| src/main/java/com/gepardec/mega/hexagon/recognition/application/port/inbound/SubmitRecognitionEntryUseCase.java | Inbound use case interface for submissions. |
| src/main/java/com/gepardec/mega/hexagon/recognition/application/port/inbound/SubmitRecognitionEntryCommand.java | Command model for submission inputs (message/category/anonymous). |
| src/main/java/com/gepardec/mega/hexagon/recognition/application/port/inbound/SendRecognitionDigestUseCase.java | Inbound use case interface for sending digest. |
| src/main/java/com/gepardec/mega/hexagon/recognition/application/model/RecognitionDigestEntry.java | Display-ready digest projection (message/category/submitterName). |
| src/main/java/com/gepardec/mega/hexagon/recognition/adapter/outbound/RecognitionSubmitterDirectoryAdapter.java | Adapter resolving UserId -> displayName via UserRepository. |
| src/main/java/com/gepardec/mega/hexagon/recognition/adapter/outbound/RecognitionEntryRepositoryAdapter.java | Adapter implementing repository port using Panache + mapper. |
| src/main/java/com/gepardec/mega/hexagon/recognition/adapter/outbound/RecognitionEntryPanacheRepository.java | Panache repository for RecognitionEntryEntity. |
| src/main/java/com/gepardec/mega/hexagon/recognition/adapter/outbound/RecognitionEntryMapper.java | MapStruct mapper between JPA entity and domain model. |
| src/main/java/com/gepardec/mega/hexagon/recognition/adapter/outbound/RecognitionEntryEntity.java | JPA entity for recognition_entry. |
| src/main/java/com/gepardec/mega/hexagon/recognition/adapter/outbound/QuarkusRecognitionMailAdapter.java | Quarkus mail adapter using typed Qute template + inline logo + subject bundle. |
| src/main/java/com/gepardec/mega/hexagon/recognition/adapter/outbound/ProjectLeadDirectoryMapper.java | MapStruct mapper to recipient value object. |
| src/main/java/com/gepardec/mega/hexagon/recognition/adapter/outbound/ProjectLeadDirectoryAdapter.java | Adapter implementing recipient resolution via UserRepository. |
| src/main/java/com/gepardec/mega/hexagon/recognition/adapter/inbound/rest/RecognitionRestMapper.java | MapStruct mapper from generated DTO to command model. |
| src/main/java/com/gepardec/mega/hexagon/recognition/adapter/inbound/rest/RecognitionResource.java | REST resource implementing generated API + internal-only guard. |
| src/main/java/com/gepardec/mega/hexagon/recognition/adapter/inbound/rest/RecognitionDomainExceptionMapper.java | Maps recognition domain exceptions to HTTP 400 with ApiErrorDto. |
| src/main/java/com/gepardec/mega/hexagon/recognition/adapter/inbound/RecognitionDigestScheduler.java | Weekly cron scheduler triggering digest use case. |
| openspec/specs/recognition-weekly-digest/spec.md | Spec for weekly digest behavior/constraints. |
| openspec/specs/recognition-rest-api/spec.md | Spec for recognition submission REST API behavior. |
| openspec/specs/recognition-entry/spec.md | Spec for recognition entry domain rules. |
| openspec/changes/archive/2026-07-15-refactor-recognition-digest-qute-templating/tasks.md | Archived tasks for Qute templating refactor work. |
| openspec/changes/archive/2026-07-15-refactor-recognition-digest-qute-templating/specs/recognition-weekly-digest/spec.md | Archived delta spec focused on digest content/escaping/attribution. |
| openspec/changes/archive/2026-07-15-refactor-recognition-digest-qute-templating/proposal.md | Archived proposal describing templating refactor and attribution. |
| openspec/changes/archive/2026-07-15-refactor-recognition-digest-qute-templating/design.md | Archived design decisions/trade-offs for templating and attribution. |
| openspec/changes/archive/2026-07-15-refactor-recognition-digest-qute-templating/.openspec.yaml | Archived OpenSpec metadata for the refactor change. |
| openspec/changes/archive/2026-07-13-add-recognition-briefkasten/tasks.md | Archived tasks for initial recognition feature implementation. |
| openspec/changes/archive/2026-07-13-add-recognition-briefkasten/specs/recognition-weekly-digest/spec.md | Archived “added requirements” spec for digest. |
| openspec/changes/archive/2026-07-13-add-recognition-briefkasten/specs/recognition-rest-api/spec.md | Archived “added requirements” spec for REST API. |
| openspec/changes/archive/2026-07-13-add-recognition-briefkasten/specs/recognition-entry/spec.md | Archived “added requirements” spec for entry. |
| openspec/changes/archive/2026-07-13-add-recognition-briefkasten/proposal.md | Archived proposal for introducing the recognition BC. |
| openspec/changes/archive/2026-07-13-add-recognition-briefkasten/design.md | Archived design for BC boundaries, scheduling, persistence, and mail. |
| openspec/changes/archive/2026-07-13-add-recognition-briefkasten/.openspec.yaml | Archived OpenSpec metadata for the initial change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+8
to
+11
| message: | ||
| type: string | ||
| minLength: 1 | ||
| maxLength: 500 |
Comment on lines
+3
to
+14
| import java.util.UUID; | ||
|
|
||
| public record RecognitionEntryId(UUID value) { | ||
|
|
||
| public static RecognitionEntryId generate() { | ||
| return new RecognitionEntryId(UUID.randomUUID()); | ||
| } | ||
|
|
||
| public static RecognitionEntryId of(UUID value) { | ||
| return new RecognitionEntryId(value); | ||
| } | ||
| } |
Comment on lines
+37
to
+45
| @Override | ||
| public void sendDigest(RecognitionMailRecipient recipient, List<RecognitionDigestEntry> entries) { | ||
| String subject = subjectPrefix.orElse("") + ResourceBundle.getBundle( | ||
| "messages", | ||
| Locale.GERMAN, | ||
| ResourceBundle.Control.getNoFallbackControl(ResourceBundle.Control.FORMAT_PROPERTIES) | ||
| ) | ||
| .getString(SUBJECT_KEY); | ||
| List<RecognitionDigestEntry> digestEntries = entries == null ? List.of() : entries; |
Comment on lines
+30
to
+33
| return userRepository.findByRole(Role.PROJECT_LEAD).stream() | ||
| .filter(user -> user.roles().contains(Role.PROJECT_LEAD)) | ||
| .filter(user -> user.isActiveOn(referenceDate)) | ||
| .filter(user -> !user.isExternal()) |
Comment on lines
+81
to
+91
| @Test | ||
| void sendDigest_shouldHtmlEscapeEntryMessages() { | ||
| String message = "<strong>Danke & willkommen</strong>"; | ||
| adapter.sendDigest(new RecognitionMailRecipient(Email.of("lead@example.com"), "Ada"), List.of( | ||
| entry(message, RecognitionCategory.APPRECIATION) | ||
| )); | ||
|
|
||
| assertThat(capturedMail().getHtml()) | ||
| .contains("<strong>Danke & willkommen</strong>") | ||
| .doesNotContain(message); | ||
| } |
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.