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

Unexpected responses from GET /patron/account/<id> WRT the includeCharges query arg

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • P2
    • Resolution: Duplicate
    • 4.2.0
    • None
    • folio-testing, fameflower production envs

    • Prokopovych - Sprint 121, Prokopovych - Sprint 122, Prokopovych - Sprint 123
    • Prokopovych
    • MO State, Okanagan College

    Description

      Overview:
      When calling GET /patron/account/<id>?includeCharges=true, a 404 is returned. If includeCharges is omitted or set to false, the call succeeds.

      NOTE that even when omitting or explicitly setting includeCharges=false, the response includes the total charge information.

      Steps to Reproduce:

      1. Log into folio-testing
      2. Find a user w/o any charges
      3. Call mod-patron w/ includeCharges=true for that user
      4. Add a fee/fine to that user
      5. Repeat the call to mod-patron

      Expected Results:

      user has charges includeCharges charges shown in response
      yes omitted no
      yes true yes
      yes false no

      Actual Results:

      user has charges includeCharges charges shown in response
      yes omitted no
      yes true 404 not found
      yes false no

      Additional Information:

      $ curl $OKAPI/patron/account/c0d4a2da-7c38-46f4-869c-797bb083ee2d -H "X-Okapi-Token: $TOKEN" -w'\n'
      {
        "totalCharges" : {
          "amount" : 50.0,
          "isoCurrencyCode" : "USD"
        },
        "totalChargesCount" : 1,
        "totalLoans" : 0,
        "totalHolds" : 0,
        "charges" : [ ],
        "holds" : [ ],
        "loans" : [ ]
      }
      
      $ curl $OKAPI/patron/account/c0d4a2da-7c38-46f4-869c-797bb083ee2d?includeCharges=false -H "X-Okapi-Token: $TOKEN" -w'\n'
      {
        "totalCharges" : {
          "amount" : 50.0,
          "isoCurrencyCode" : "USD"
        },
        "totalChargesCount" : 1,
        "totalLoans" : 0,
        "totalHolds" : 0,
        "charges" : [ ],
        "holds" : [ ],
        "loans" : [ ]
      }
      
      $ curl $OKAPI/patron/account/c0d4a2da-7c38-46f4-869c-797bb083ee2d?includeCharges=true -H "X-Okapi-Token: $TOKEN" -w'\n'
      Not Found
      

      This issue must also account for the following:

      • Make the "itemId" returned by fees/fines optional instead of using a "0" to indicate the field is not in use. Since an item is not required in the charge schema, the code may just work. The goal would be to have charges with no itemId return without the item field set and the other fields set if in use by FOLIO.

      URL:
      Interested parties:
      magdaz, Anya N. Arnold, sekjal, mtraneis

      TestRail: Results

        Attachments

          1. MODPATRON-40.docx
            578 kB
          2. MODPATRON-40-1.docx
            578 kB
          3. mtsu-1.png
            mtsu-1.png
            59 kB

          Issue Links

            Activity

              People

                felkerk Kyle Felker
                cmcnally Craig McNally
                Votes:
                0 Vote for this issue
                Watchers:
                10 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases