Create an API end point to generate PO line number suffixes as detailed here:
- 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
- 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.
- 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