Uploaded image for project: 'mod-patron'
  1. mod-patron
  2. MODPATRON-104

Requests placed via mod-patron using the title-level request endpoint do not create title-level requests when TLR is enabled in the tenant

    XMLWordPrintable

Details

    • EPAM-Veg Sprint 134, EPAM-Veg Sprint 135, EPAM-Veg Sprint 136
    • 3
    • Vega
    • Lotus (R1 2022) Bug Fix
    • Incomplete/missing requirements

    Description

      Overview:

      When attempting to create a request via edge/mod-patron using the /patron/account/<patronId>/instance/<instanceId>/hold endpoint with TLR enabled, a true title-level request should be created (requestLevel="Title"). Instead, every request made via this endpoint results in an item-level request (TLR-lite).

      Steps to Reproduce:

      1. Log into folio-snapshot
      2. Enable TLR
      3. Attempt to place a request via the edge/mod-patron endpoint:
        • curl --location --request POST 'https://folio-snapshot.dev.folio.org:8000/patron/account/24601/instance/30fcc8e7-a019-43f4-b642-2edc389f4501/hold?apikey=<edge-api-key>' \
          --header 'Content-Type: application/json' \
          --data-raw '{
              "requestDate": "2022-02-08T22:16:06.686Z",
              "pickupLocationId": "3a40852d-49fd-4df2-a1f9-6e2641a6e91f"
          }'
          

      Expected Results:

      Title level request created successfully in FOLIO.

      Actual Results:

      Item level request created in FOLIO.

       

      Additional Information:

      I did some additional digging into the APIs, and I think the root cause of this issue is that while the mod-circulation endpoint used by mod-patron (/circulation/requests/instances) requires an "instanceLevel" attribute in its JSON payload, it doesn't appear that it actually works if you specify "Title" as the level. You receive the following error:

      Failed to place a request for the instance. Reasons: 
      validation failure:
      reason: "Attempt to create TLR request linked to an item", parameters: key: itemId, value: 1714f71f-b845-444b-a79e-a577487a6f7d%nkey: holdingsRecordId, value: 133a7916-f05e-4df4-8f7f-09eb2a7076d1%nvalidation failure:
      reason: "Attempt to create TLR request linked to an item", parameters: key: itemId, value: 1714f71f-b845-444b-a79e-a577487a6f7d%nkey: holdingsRecordId, value: 133a7916-f05e-4df4-8f7f-09eb2a7076d1%nvalidation failure:
      reason: "Attempt to create TLR request linked to an item", parameters: key: itemId, value: 1714f71f-b845-444b-a79e-a577487a6f7d%nkey: holdingsRecordId, value: 133a7916-f05e-4df4-8f7f-09eb2a7076d1%nvalidation failure:
      reason: "Attempt to create TLR request linked to an item", parameters: key: itemId, value: 1714f71f-b845-444b-a79e-a577487a6f7d%nkey: holdingsRecordId, value: 133a7916-f05e-4df4-8f7f-09eb2a7076d1%nvalidation failure:
      reason: "Attempt to create TLR request linked to an item", parameters: key: itemId, value: 1714f71f-b845-444b-a79e-a577487a6f7d%nkey: holdingsRecordId, value: 133a7916-f05e-4df4-8f7f-09eb2a7076d1%nvalidation failure:
      reason: "Attempt to create TLR request linked to an item", parameters: key: itemId, value: 1714f71f-b845-444b-a79e-a577487a6f7d%nkey: holdingsRecordId, value: 133a7916-f05e-4df4-8f7f-09eb2a7076d1
      

      My guess is that mod-patron is always passing "Item" as the "requestLevel" and we haven't run into this bug yet because of it.

      URL:
      Interested parties:

      TestRail: Results

        Attachments

          Issue Links

            Activity

              People

                mykyta_varenyk Mykyta Varenyk
                brookstravis Brooks Travis
                Stephanie Buck Stephanie Buck
                Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases