[UXPROD-4347] 'Borrower.' filter is not working in API calls Created: 12/Jun/23  Updated: 30/Nov/23

Status: Open
Project: UX Product
Components: None
Affects versions: None
Fix versions: TBD

Type: New Feature Priority: P3
Reporter: Sandhya Sharma Assignee: Stephanie Buck
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original estimate: Not Specified

Attachments: PNG File MicrosoftTeams-image (6).png     PNG File MicrosoftTeams-image (7).png    
Release: Not Scheduled
Development Team: Vega
PO Rank: 0

 Description   

Overview: Query in circulation/loans does not work correctly when making a query in the API 'circulation/loans'.
Steps to Reproduce:

• Follow the persistent link

https://okapi-bugfest-nolana.int.aws.folio.org/circulation/loans?query=(checkoutServicePointId=97cbff79-97e9-4cb2-b8c9-fb4fc584c66d)&(borrower.firstName=Claudia)

• When we use 'borrower.firstName' as 2nd filter in the API call, it just returns the result for the first filter API call alone.

• When we use 'borrower.firstName' as 1st filter in the API call, it just returns zero results.

Expected Results:

Api call should return the result with both the filters applied.
Actual Results: 

• When we use 'borrower.firstName' as 2nd filter in the API call, it just returns the result for the first filter API call alone.

• When we use 'borrower.firstName' as 1st filter in the API call, it just returns zero results.

Additional Information:  This issue persist in Orchid and Nolana bugfest also.
Interested parties: Mamidi Likhitha 



 Comments   
Comment by Stephanie Buck [ 12/Jun/23 ]

Sandhya Sharma and Mamidi Likhitha, how often is this query run? What is the impact to daily operations?

Comment by Mamidi Likhitha [ 12/Jun/23 ]

Hi Stephanie Buck, library use this query often as they check the records of specific users with specific Service Points.

Comment by Roman Barannyk [ 12/Jun/23 ]

Sandhya Sharma, please try to use the next query:

/circulation/loans?query=checkoutServicePointId=97cbff79-97e9-4cb2-b8c9-fb4fc584c66d and borrower.firstName=Claudia
Comment by Oleksandr Vidinieiev [ 13/Jun/23 ]

Sandhya Sharma, you can't search loans by borrower's name because loans stored in the DB (in mod-circulation-storage) do not have the "borrower" property. When you call "GET circulation/loans?query=..." mod-circulation does the following:

  • immediately passes your query to mod-circulation-storage (where loans do not contain a "borrower" object)
  • takes the response and extends every loan in it with additional properties (including "borrower")
  • returns the response back to the caller

We have faced a very similar issue recently while working on UXPROD-4061 Closed . We solved it by adding a new property "searchIndex" to every request object, and copying over missing data to it. If you decide to go the same route, be aware that this search index needs to be kept up-to-date at all times. For example, if a borrower's last name is changed in mod-users, you need to also change it in your search index to maintain data integrity. We solved that with Kafka events, check out BE stories in UXPROD-4061 Closed .

Stephanie Buck I'd say it's not a bug.

Comment by Stephanie Buck [ 13/Jun/23 ]

This change is feature level work and not a bug. Searching by borrower hasn't been implemented yet. I'll move this to a feature, but am unable to say when this work could be done. 

cc: Sandhya Sharma, Mamidi Likhitha 

Generated at Fri Feb 09 00:39:12 UTC 2024 using Jira 1001.0.0-SNAPSHOT#100246-sha1:7a5c50119eb0633d306e14180817ddef5e80c75d.