Overview: The invoice needs a human readable number that uniques it in the system. This will be known as the FOLIO invoice number and is separate from the UUID of the invoice record.
FOLIO Invoice Number
- System Generated
- Should be unique
- Should be sequential
- Should not be editable
- Min and number of digits is irrelevant to the user
- Max number of digits should be 40
- Presence of alphas in this number is irrelevant to the user
- Create a sequence in the database during tenant setup. Example:
- The GET /invoice-storage/invoice-number API would simply get and return the next value in this sequence. e.g. SELECT nextval('invoice_number')
NOTE: The default maximun value for a sequence in postgres is 2^63-1, which is much shorter than the 40 characters mentioned in the requirements (only 19 digits at most). However, the likelihood of ever reaching this number of invoices is very low, even when considering the arbitrary start value of 10000.
- Unit test coverage is at or above 80% on new code
- Raml/Module descriptor are updated