Uploaded image for project: 'ERM Platform'
  1. ERM Platform
  2. ERM-1953

Re-implement display of acquistionsMethods following order-lines 3.0 interface

    XMLWordPrintable

Details

    • ERM Sprint 129, ERM Sprint 131, ERM Sprint 132, ERM Sprint 133
    • Bienenvolk
    • Lotus R1 2022

    Description

      Purpose:
      Ensure we display the textual label for the acquisition method any time we display the PO Line Card in ui-agreements.

      This currently displays in the following screens

      • Agreement Line View
      • Agreement Line Edit
      • Agreement Edit

      (NB we also make a call to /orders/order-lines for the Agreement View screen, but we do not display the acquisition method in the Agreement View so there should not be any work necessary there.

      Description
      Following the changes to the order-lines interface in v 3.0 in order to display acquisition method for an order we'll need to retrieve the appropriate label for the acquistionMethod, which now only appears as a UUID in the response to our query to /orders/order-lines endpoint

      example response from /orders/order-lines - see `poLines[n].acquisitionMethod` for the acquisition method UUID

      {
        "poLines" : [ {
          "id" : "556abc25-ebbf-3fb2-b478-1bfaff0af4dc",
          "edition" : "First edition",
          "checkinItems" : false,
          "agreementId" : "09c6ed1b-3984-4d9a-8f9b-e1200b68b61c",
          "acquisitionMethod" : "df26d81b-9d63-4ff8-bf41-49bf75cfa70e",
          "alerts" : [ ],
          "cancellationRestriction" : false,
          "cancellationRestrictionNote" : "",
          "claims" : [ {
            "claimed" : false,
            "grace" : 0
          } ],
          "collection" : false,
          "contributors" : [ ],
          "cost" : {
            "listUnitPrice" : 0.0,
            "listUnitPriceElectronic" : 0.0,
            "currency" : "USD",
            "additionalCost" : 0.0,
            "discount" : 0.0,
            "discountType" : "percentage",
            "quantityPhysical" : 2,
            "quantityElectronic" : 0,
            "poLineEstimatedPrice" : 0.0
          },
          "description" : "",
          "details" : {
            "receivingNote" : "",
            "productIds" : [ {
              "productId" : "0747-0088",
              "productIdType" : "913300b2-03ed-469a-8179-c1092c991227"
            } ],
            "subscriptionInterval" : 0
          },
          "donor" : "",
          "fundDistribution" : [ {
            "code" : "UNIV-SUBN",
            "encumbrance" : "eb506834-6c70-4239-8d1a-6414a5b08014",
            "fundId" : "4428a37c-8bae-4f0d-865d-970d83d5ad55",
            "distributionType" : "percentage",
            "value" : 100.0
          } ],
          "isPackage" : false,
          "locations" : [ {
            "locationId" : "758258bc-ecc1-41b8-abca-f7b610822ffd",
            "quantity" : 2,
            "quantityElectronic" : 0,
            "quantityPhysical" : 2
          } ],
          "orderFormat" : "Other",
          "paymentStatus" : "Pending",
          "physical" : {
            "materialType" : "dd0bf600-dbd9-44ab-9ff2-e2a61a6539f1",
            "materialSupplier" : "e0fb5df2-cdf1-11e8-a8d5-f2801f1b9fd1",
            "volumes" : [ "vol. 1" ]
          },
          "poLineDescription" : "",
          "poLineNumber" : "81-1",
          "publicationDate" : "1915",
          "publisher" : "American Bar Association",
          "purchaseOrderId" : "c27e60f9-6361-44c1-976e-0c4821a33a7d",
          "receiptStatus" : "Pending",
          "reportingCodes" : [ ],
          "requester" : "",
          "rush" : false,
          "selector" : "",
          "source" : "User",
          "tags" : {
            "tagList" : [ "CatalogingRecords" ]
          },
          "titleOrPackage" : "ABA Journal",
          "vendorDetail" : {
            "instructions" : "",
            "noteFromVendor" : "",
            "vendorAccount" : "",
            "referenceNumbers" : [ ]
          },
          "metadata" : {
            "createdDate" : "2021-12-08T01:50:18.177+00:00",
            "updatedDate" : "2021-12-08T01:50:18.177+00:00"
          }
        } ],
        "totalRecords" : 1
      }
      

      The list of acquisitionMethods can be retrieved from the /orders/acquisition-methods endpoint. Following the pattern that is used in ui-orders it looks like we are best doing a query like: /orders/acquisition-methods?query=cql.allRecords%3D1&limit=1000 to get a full list of records (it seems highly unlikely there would ever be 1000 order types - or even 100 tbh, but 1000 is what they use in ui-orders so we should be safe following that example)

      The response looks like:

      {
          "acquisitionMethods": [
              {
                  "id": "0a4163a5-d225-4007-ad90-2fb41b73efab",
                  "value": "Gift",
                  "source": "System",
                  "metadata": {
                      "createdDate": "2021-12-08T01:50:17.816+00:00",
                      "updatedDate": "2021-12-08T01:50:17.816+00:00"
                  }
              }
          ],
          "totalRecords": 1
      }
      

      The `id` can be used to match against the acquisitionMethod UUID in the response from poLines

      If the request for acquisitionsMethods fails OR we are unable to match the acquisitionMethod UUID from the PO Line to an entry in the list of acquisitionsMethods, we should fall back on displaying the content of poLines[n].acquisitionMethod - this will ensure continued compatibility with previous versions of the order-lines interface (where the acquisitionMethod property held the text label directly)

      TestRail: Results

        Attachments

          Issue Links

            Activity

              People

                ostephens Owen Stephens
                ostephens Owen Stephens
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases