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

Build API for PO line numbers

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Closed (View Workflow)
    • Priority: P3
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 3.0.0
    • Labels:
      None
    • Template:
    • Sprint:
      ACQ Sprint 56, ACQ Sprint 57
    • Story Points:
      5
    • Development Team:
      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

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

                  Dates

                  Created:
                  Updated:
                  Resolved:

                    TestRail: Runs

                      TestRail: Cases