MODINVOICE-33 implemented the basic delete invoice endpoint which simply proxied the response to the storage module. This story builds upon that and also removes all associated invoiceLines before removing the invoice.
If one of the invoiceLines cannot be removed, leave the invoice in place and return an appropriate error.
Perform the related record deletions in a database transaction until DELETE CASCADE functionality has been added to RMB. See https://wiki.folio.org/display/FOLIJET/Working+with+transactions+in+modules+based+on+RMB
- invoiceLines associated with an invoice are removed upon invoice removal
- exception handling is implemented as described above
- Unit tests are updated
- API tests are updated