DMP-4846: When case is expired and CaseExpiryDeletion job runs, the hearing_media_ae record is not deleted #2659
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.
Links
Change description
Summary of Git Diff
This Git diff introduces enhancements and modifications to the media repository and related services in the codebase, focusing on the handling of media links associated with hearings and court cases. Key changes include the addition of new methods for retrieving media entities by case ID, updates to existing test cases, and the removal of obsolete API interfaces related to hearings.
Highlights
New Test Method: Added a test method
findByCaseIdWithMediaList_shouldReturnCorrectData
inMediaRepositoryIntTest
to verify correct media retrieval based on case ID.Repository Updates:
findByCaseIdWithMediaList(Integer caseId)
method inMediaRepository
for fetching media entities linked to a specific court case.findByCaseIdWithMediaList(Integer caseId)
fromHearingRepository
.Service Layer Changes:
removeMediaLinkToHearing
inHearingsServiceImpl
to utilize the new media repository method, improving the logic for removing media links from hearings based on case expiration.API Interface Removal: Eliminated the
HearingApi
andHearingApiImpl
classes as their functionality has been migrated to the service layer.Test Suite Adjustments: Updated unit tests in
HearingsServiceImplTest
andCaseExpiryDeletionAutomatedTaskTest
to reflect changes in repository and service method calls, ensuring consistency and correctness in the testing logic.Transactional Changes: Added transactional annotations where necessary to ensure data consistency during media link removals and other operations.
These modifications enhance the codebase's ability to manage media links associated with legal cases, streamline interactions between repositories and services, and ensure robust testing practices are maintained.
Does this PR introduce a breaking change? (check one with "x")