Merged
Conversation
Backend Test Results141 tests 135 ✅ 5s ⏱️ For more details on these failures and errors, see this check. Results for commit 9d95e24. ♻️ This comment has been updated with latest results. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the deviations backend with “details” retrieval (including comment log), comment creation, and a more general status update flow, backed by new persistence structures.
Changes:
- Added deviation details endpoint (
GET /api/deviations/{id}) returning aDeviationDetailsResponseincluding comment log andrelatedReadingId. - Added endpoints for status updates and adding comments, with corresponding service logic and DTOs.
- Extended the database schema with
related_reading_idondeviationsand introduced thedeviation_commentstable + indexes.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| backend/src/main/java/backend/fullstack/deviations/api/DeviationController.java | Adds deviation details/status/comment endpoints and security annotations |
| backend/src/main/java/backend/fullstack/deviations/application/DeviationService.java | Implements details retrieval, status transitions, and comment creation |
| backend/src/main/java/backend/fullstack/deviations/domain/Deviation.java | Adds related reading + comment relationship helpers |
| backend/src/main/java/backend/fullstack/deviations/domain/DeviationComment.java | New JPA entity for deviation comments |
| backend/src/main/java/backend/fullstack/deviations/infrastructure/DeviationCommentRepository.java | New repository for comment log queries |
| backend/src/main/java/backend/fullstack/deviations/api/dto/DeviationDetailsResponse.java | New response DTO for deviation details view |
| backend/src/main/java/backend/fullstack/deviations/api/dto/DeviationCommentRequest.java | New request DTO for comment creation |
| backend/src/main/java/backend/fullstack/deviations/api/dto/DeviationCommentResponse.java | New response DTO for comment log items |
| backend/src/main/java/backend/fullstack/deviations/api/dto/UpdateDeviationStatusRequest.java | New request DTO for general status updates |
| backend/src/main/resources/db/migration/V10__extend_deviation_domain.sql | Adds related reading FK + creates deviation_comments table and indexes |
| backend/src/test/java/backend/fullstack/deviations/application/DeviationServiceTest.java | Adds tests for new service behaviors (status, comments, details) |
| backend/src/test/java/backend/fullstack/deviations/api/DeviationControllerTest.java | Adds controller test for details endpoint response shape |
| backend/src/test/java/backend/fullstack/deviations/api/DeviationControllerSecurityAnnotationsTest.java | Adds security annotation assertions for new controller methods |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
backend/src/main/java/backend/fullstack/deviations/application/DeviationService.java
Show resolved
Hide resolved
backend/src/main/java/backend/fullstack/deviations/application/DeviationService.java
Outdated
Show resolved
Hide resolved
backend/src/main/java/backend/fullstack/deviations/api/DeviationController.java
Show resolved
Hide resolved
backend/src/main/java/backend/fullstack/deviations/api/DeviationController.java
Show resolved
Hide resolved
backend/src/main/java/backend/fullstack/deviations/domain/Deviation.java
Show resolved
Hide resolved
backend/src/test/java/backend/fullstack/deviations/application/DeviationServiceTest.java
Show resolved
Hide resolved
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.
Built the ramaining endpoints according to backend-krav.md