Skip to content

SIP2-313: Add automated patron blocks support to patron status/information response - #254

Merged
zakletskyi-epam merged 7 commits into
masterfrom
SIP2-313
Jun 30, 2026
Merged

SIP2-313: Add automated patron blocks support to patron status/information response#254
zakletskyi-epam merged 7 commits into
masterfrom
SIP2-313

Conversation

@zakletskyi-epam

@zakletskyi-epam zakletskyi-epam commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Purpose

Patron status and patron information responses now reflect automated patron blocks (from /automated-patron-blocks) alongside existing manual blocks. Previously only manual blocks affected SIP2 patron status flags and screen messages

Approach

  • Added getAutomatedBlocksByUserId() to FeeFinesRepository — fetches /automated-patron-blocks?query=userId==...; logs a warning and gracefully returns null on failure so a down endpoint never surfaces as a SIP2 error
  • Both validPatron(PatronStatusRequest) and validPatron(PatronInformation) in PatronRepository now fetch manual and automated blocks in parallel via Future.all(), then merge the resulting EnumSet flags (union) and concatenate screen messages
  • Block-to-flag mapping mirrors manual block logic: blockBorrowing → all 14 flags, blockRenewals → RENEWAL_PRIVILEGES_DENIED, blockRequests → HOLD_PRIVILEGES_DENIED + RECALL_PRIVILEGES_DENIED
  • Tests: 3 new FeeFinesRepositoryTests, 7 new PatronRepositoryTests (including partial-block and merge scenarios), 1 new PatronStatusIT, 1 new PatronInformationIT

Changes Checklist

  • API Changes: Document any API paths, methods, request or response bodies changed, added, or removed.
  • Database Schema Changes: Indicate any database schema changes and their impact. Confirm that migration scripts were created.
  • Interface Version Changes: Indicate any changes to interface versions.
  • Interface Dependencies: Document added or removed dependencies.
  • Permissions: Document any changes to permissions.
  • Logging: Confirm that logging is appropriately handled.
  • Unit Testing: Confirm that changed classes were covered by unit tests.
  • Integration Testing: Confirm that changed logic was covered by integration tests.
  • Manual Testing: Confirm that changes were tested on local or dev environment.
  • NEWS: Confirm that the NEWS file is updated with relevant information about the changes made in this pull request.

Related Issues

SIP2-313

Learning and Resources (if applicable)

Discuss any research conducted during the development of this pull request. Include links to relevant blog posts, patterns, libraries, or addons that were used to solve the problem.

Screenshots (if applicable)

If this pull request involves any visual changes or new features, consider including screenshots or GIFs to illustrate the changes.

@zakletskyi-epam
zakletskyi-epam requested a review from a team as a code owner June 25, 2026 10:22
Comment thread src/main/java/org/folio/edge/sip2/repositories/FeeFinesRepository.java Outdated
Comment thread src/main/java/org/folio/edge/sip2/repositories/FeeFinesRepository.java Outdated
Comment thread src/main/java/org/folio/edge/sip2/repositories/PatronRepository.java Outdated
Comment thread src/main/java/org/folio/edge/sip2/repositories/PatronRepository.java Outdated
Comment thread src/main/java/org/folio/edge/sip2/repositories/PatronRepository.java Outdated
Comment thread src/main/java/org/folio/edge/sip2/repositories/PatronRepository.java Outdated
Comment thread src/main/java/org/folio/edge/sip2/repositories/PatronRepository.java Outdated
Comment thread src/main/java/org/folio/edge/sip2/repositories/PatronRepository.java Outdated
Comment thread src/main/java/org/folio/edge/sip2/repositories/PatronRepository.java Outdated
# Conflicts:
#	NEWS.md
@sonarqubecloud

Copy link
Copy Markdown

@zakletskyi-epam
zakletskyi-epam merged commit d1f2771 into master Jun 30, 2026
16 checks passed
@zakletskyi-epam
zakletskyi-epam deleted the SIP2-313 branch June 30, 2026 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants