Uh oh!
There was an error while loading. Please reload this page.
feat: implement idempotent soft delete for Books - #4
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR implements idempotent soft delete functionality for the Book resource following TDD principles. The implementation marks books as deleted rather than physically removing them, supporting audit requirements and data recovery needs.
Key Changes:
- Added
deleteBookByIdmethod with idempotent behavior ensuring repeated deletions don't trigger unnecessary database writes - Comprehensive test coverage including success, not found, and idempotency scenarios
- Custom
ResourceNotFoundExceptionto handle business logic failures distinct from framework exceptions
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/com/codesungrape/hmcts/bookapi/service/BookService.java | Implements soft delete with @Transactional annotation and idempotent logic |
| src/test/java/com/codesungrape/hmcts/bookapi/BookServiceTest.java | Adds unit tests covering successful deletion, not found exception, and idempotency |
| src/main/java/com/codesungrape/hmcts/bookapi/exception/ResourceNotFoundException.java | New custom runtime exception for resource not found scenarios |
| build.gradle | Enhances JaCoCo report output with file path printing |
| README.md | Updates JaCoCo report file path to reflect actual location |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This PR implements the "Soft Delete" functionality for the Book resource using a TDD approach. It ensures data is marked as deleted rather than physically removed, supporting audit requirements and data recovery.
Changes:
Technical Decisions: