An agreement has been reached on the algorithm used when generating po_numbers. The new algorithm is based off a sequential counter ranging from 5-16 digits.
In order to avoid race conditions and duplicate generated values, we need to define a sequence in the database and an API for obtaining the next value in the sequence.
in POST /_/tenant:
CREATE SEQUENCE IF NOT EXISTS po_number START WITH 10000 MAXVALUE 9999999999999999 CACHE 1 NO CYCLE;
new endpoint: GET /orders-storage/po_number
- GET /orders-storage/po_number is defined (e.g. in RAML/ModuleDescriptor) and implemented (code and schema)
- returns an appliacation/json response with a single field "po_number" (status 200)
- tenant scripts (create the sequence if it doesn't exist)
- Unit tests