Uploaded image for project: 'mod-orders-storage'
  1. mod-orders-storage
  2. MODORDSTOR-45

Build API for PO line numbers

    XMLWordPrintable

Details

    • Story
    • Status: Closed (View Workflow)
    • P3
    • Resolution: Done
    • None
    • 3.0.0
    • None
    • ACQ Sprint 56, ACQ Sprint 57
    • 5
    • Thunderjet

    Description

      Create an API end point to generate PO line number suffixes as detailed here:

      https://wiki.folio.org/display/FOLIJET/Postgres+SEQUENCEs+for+generating+po_line_number+suffixes

      Requirements:

      • create a SEQUENCE in the DB when a PO is created w/ name 'polNumber_<uuid of po>'
        • this is done from POST /orders-storage/purchase-orders
      • return the NEXTVAL() from the SEQUENCE when called
        • this is done in GET /orders-storage/po-line-number
        • returns a json response conforming to the "sequence_number" schema (see MODORDSTOR-46)
      • delete the SEQUENCE from the DB when PO status moves to 'Open' or 'Closed'
        • this is done in PUT /orders-storage/puchase-orders
        • probably safer/more efficient to always attempt to remove the sequence if the workflow status is OPEN or CLOSED. You may need to check if it exists beforehand, or simply handle any errors thrown when trying to remove a non-existent sequence gracefully.

      NOTE this story involves updating the purchase_order API as well as implementing a new API: GET /orders-storage/po-line-number?purchaseOrderId=<UUID of PO>.
      NOTE padding of the poline number is outside the scope of this work. This should be handled in the business logic module, along with incorporating the po_number prefix. In other words we're just returning the sequence value.

      Acceptance Criteria:

      • the API is implemented as per the requirements above
      • unit test coverage of 80%+

      We may want to split this up into subtasks...

      The Orders API Listing document has been updated to include the new endpoint: https://docs.google.com/spreadsheets/d/1se-a2owRfHLG5eaAZglx4vLvRClCKGp2wZCfD39ZJRY/edit?usp=sharing

      TestRail: Results

        Attachments

          Issue Links

            Activity

              People

                cmcnally Craig McNally
                johnkomick John Komick (Inactive)
                Craig McNally Craig McNally
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases