Skip to content

CIRC-2550 Fix circulation log showing incorrect source for loan renewals#1663

Open
zakletskyi-epam wants to merge 3 commits intomasterfrom
CIRC-2550
Open

CIRC-2550 Fix circulation log showing incorrect source for loan renewals#1663
zakletskyi-epam wants to merge 3 commits intomasterfrom
CIRC-2550

Conversation

@zakletskyi-epam
Copy link
Contributor

@zakletskyi-epam zakletskyi-epam commented Mar 3, 2026

CIRC-2550

Purpose

When a loan was renewed by one staff member but originally checked out by another, the Circulation Log incorrectly displayed the checkout staff as the source of the renewal action. This happened because the renewal event was published using the loan's metadata.updatedByUserId (set at checkout time) rather than the ID of the staff member who actually performed the renewal.

Approach

Instead of reusing the existing publishDueDateChangedEvent (which reads the source from loan metadata), a dedicated publishRenewedEvent method was introduced. This method explicitly passes the loggedInUserId from the RenewalContext as the updatedByUserId in the log record, ensuring the Circulation Log reflects the staff member who performed the renewal. A unit test was added to verify that the renewal log entry carries the renewal staff ID and not the checkout staff ID.

TODOS and Open Questions

  • Check logging
  • Use GitHub checklists. When solved, check the box and explain the answer.

Learning

@zakletskyi-epam zakletskyi-epam marked this pull request as ready for review March 3, 2026 11:20
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 3, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants