Conversation
Create a /request-anonymization/{request UUID} Post API for anonymizing one a single closed request
Requirements/Scope:
Verify that the user has the UI-Requests Request-Anonymize Single Execute capability
Anonymizes request as described in https://folio-org.atlassian.net/browse/CIRC-2292
Returns an error message if anonymization fails
Acceptance Criteria:
Post API for single request anonymization by UUID is created
…ate wiring, update tests.
src/main/java/org/folio/circulation/infrastructure/storage/requests/RequestRepository.java
Outdated
Show resolved
Hide resolved
src/main/java/org/folio/circulation/resources/RequestAnonymizationResource.java
Outdated
Show resolved
Hide resolved
src/main/java/org/folio/circulation/services/EventPublisher.java
Outdated
Show resolved
Hide resolved
src/main/java/org/folio/circulation/services/RequestAnonymizationService.java
Show resolved
Hide resolved
src/test/java/org/folio/circulation/domain/anonymization/AnonymizeRequestTests.java
Outdated
Show resolved
Hide resolved
OleksandrVidinieiev
requested changes
Nov 20, 2025
src/main/java/org/folio/circulation/resources/RequestAnonymizationResource.java
Show resolved
Hide resolved
src/main/java/org/folio/circulation/services/RequestAnonymizationService.java
Outdated
Show resolved
Hide resolved
src/main/java/org/folio/circulation/services/RequestAnonymizationService.java
Outdated
Show resolved
Hide resolved
src/test/java/api/requests/RequestAnonymizationServiceTest.java
Outdated
Show resolved
Hide resolved
src/test/java/api/requests/RequestAnonymizationServiceTest.java
Outdated
Show resolved
Hide resolved
src/test/java/api/requests/RequestAnonymizationServiceTest.java
Outdated
Show resolved
Hide resolved
Contributor
|
@yuntianhu In the future, please mention Jira ticket name in your commit messages: |
Contributor
Author
|
@OleksandrVidinieiev Thank you for the reminder, I will surely remember to do it 😄 |
- Add permissionsRequired and modulePermissions for /request-anonymization/{requestId} handler in ModuleDescriptor-template.json
- Use UuidUtil.isUuid in RequestAnonymizationService and return failed validation when requestId is invalid
- Simplify fetchRequest to delegate to requestRepository.getById without extra failWhen logic
- Change scrubPii to return Request instead of Result and call it via mapResult
- Simplify publishLog to return Result<Void> from eventPublisher without remapping
- Fix Result chain to use flatMapResult for validateStatus and after(...) for async update/log
- Remove unused validationError helper that relied on old ValidationError constructor
- Update RequestAnonymizationServiceTest to inject mocks via constructor (remove reflection)
- Adjust not-found test to return failed RecordNotFoundFailure instead of succeeded(null)
- Reorder imports in tests to follow mod-circulation import order convention
remove a unused line
src/main/java/org/folio/circulation/services/RequestAnonymizationService.java
Outdated
Show resolved
Hide resolved
src/main/java/org/folio/circulation/services/RequestAnonymizationService.java
Outdated
Show resolved
Hide resolved
src/test/java/api/requests/RequestAnonymizationServiceTest.java
Outdated
Show resolved
Hide resolved
src/test/java/api/requests/RequestAnonymizationServiceTest.java
Outdated
Show resolved
Hide resolved
OleksandrVidinieiev
approved these changes
Nov 24, 2025
src/main/java/org/folio/circulation/services/EventPublisher.java
Outdated
Show resolved
Hide resolved
Fix displayName/description wording: "anonymize request" instead of "anonymize requests". Update permission name to modperms.circulation.requests.anonymize.single. Remove redundant modulePermission already included in anonymize.single. Inline RequestRepository.using(...) initializer into single line. Condense ValidationErrorFailure.failedValidation(...) into one line. Add UUID format validation to requestId in anonymize-single-request-response.json. Remove extra spacing alignment in EventPublisher .put() calls. Replace wildcard imports in RequestAnonymizationServiceTest with explicit imports. Reorder imports to follow mod-circulation import convention. Adjust permission naming to follow FOLIO scope convention (item vs collection).
|
alexanderkurash
approved these changes
Nov 24, 2025
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.



CIRC-2364-Anonymize Single Request Post API #1632
Ticket Description
Purpose/Overview:
Create a /request-anonymization/{request UUID} Post API for anonymizing one a single closed request
Requirements/Scope:
Verify that the user has the UI-Requests Request-Anonymize Single Execute capability
Anonymizes request as described in https://folio-org.atlassian.net/browse/CIRC-2292
Returns an error message if anonymization fails
Acceptance Criteria:
Post API for single request anonymization by UUID is created
Summary of Work Completed for Request Anonymization (CIRC-2364 / CIRC-2292)
I implemented backend support for manual single-request anonymization in mod-circulation, including all core API logic, data scrubbing, integration with storage, permissions, event publishing, and automated tests. This work completes a brand-new FOLIO circulation feature.
Approach for Single Request Anonymization