acho que aqui podes omitir o when. I want a function that, given a draft invoice, it returns....