Implement the code for the feature UXPROD-5054

Description

UXPROD-5054 - Support DCB Requests on Unavailable Items

Current Behavior:
Currently, a Page request is always created in the LENDER role, assuming the item's status is always available. mod-circ will throw error if the item status is not available

Expected Behavior:
Before creating a request in the LENDER role, the item's status must be checked:

  • If the item status is Available, create a Page request.

  • If the item status is Checked out, Paged, In transit, Awaiting pickup, or Awaiting delivery, create a Hold request.

  • For all other statuses, throw an exception.

Implementation Progress:
The above changes have been implemented, but the flow has not been fully tested. Multiple test cases are required for the same role:

  1. Flow 1: Create a transaction when the item status is Available and complete the status transition as per the state transition diagram.

  2. Flow 2: Create a transaction when the item already has one or more requests (resulting in a Hold request) and complete the status transition as per the state transition diagram.

Anticipated Issue:
Consider a scenario where an item is checked out already(Item status will be Checked out in this case) and a transaction is created. The transaction status will be set to Created. If the patron later returns the item, the existing loan will close, triggering an event (as the system listens for loan events in the LENDER role). There is a possibility that the code could update the transaction status from Created to Closed, which is not the expected behavior.

Proposed Solution:
Currently, when a loan event is received, the transaction is fetched based on itemId and a transactionStatus that is not Closed. For the LENDER role, an additional check needs to be added before updating the transaction status. Specifically, ensure that the transaction status is not Created before making the status change.

This solution needs thorough testing to ensure that it does not introduce other issues or unexpected behavior.

You can find the draft code change below, this doesnt have the fix of the above mentioned issue

Environment

None

Potential Workaround

None

Attachments

2

relates to

Checklist

hide

Activity

Show:

Polina UstimenkoJanuary 20, 2025 at 2:02 PM

Checked on Eureka ECS bugfest

JenkinsNotificationsJanuary 17, 2025 at 6:25 PM

Deployed to the Ramsons bf env. Moved status to In bugfix review from status Awaiting deployment. Please proceed with the verification.

Polina UstimenkoJanuary 16, 2025 at 7:57 AM

Tested full flow on Volaris rancher 2, works as expected.

Polina UstimenkoJanuary 15, 2025 at 8:37 AM
Edited

Tested on Volaris rancher 2, smoke functionality works as expected:

Have to conduct some investigation and check a couple of additional scenarios.

cc:

Done

Details

Assignee

Reporter

Priority

Story Points

Sprint

Development Team

Volaris

Fix versions

Release

Ramsons (R2 2024) Bug Fix

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs

Created December 9, 2024 at 7:05 AM
Updated March 14, 2025 at 8:41 AM
Resolved January 10, 2025 at 6:08 AM
TestRail: Cases
TestRail: Runs