POC for an invoice finalizer in scala