Details
-
Story
-
Status: Closed (View Workflow)
-
P3
-
Resolution: Done
-
None
-
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
- blocks
-
MODORDERS-93 po_line_number isn't set when creating a new po_line
-
- Closed
-
-
UIOR-111 Adjustments to PO Line number field on create/edit PO Line forms
-
- Closed
-
- relates to
-
MODORDSTOR-46 Create RAML/modDescriptor for po_line_number
-
- Closed
-
-
UXPROD-1388 Create New Purchase Order Lines
-
- Closed
-
-
MODINVOSTO-7 Implement the invoice-line-number API
-
- Closed
-
-
MODORDSTOR-34 Spike: unique po_line_number generation
-
- Closed
-