Gottox / lexoffice

Typesafe rust interface to the lexoffice public api.
GNU Affero General Public License v3.0
0 stars 1 forks source link

Creating a new voucher #1

Open jkaessens opened 2 years ago

jkaessens commented 2 years ago

To circumvent lexoffice's inability to create invoices for custom templates, I'm pulling invoice drafts from the API, use the invoice data to create a PDF and upload the PDF back to lexoffice as a file. With the crate, I created a new Voucher but I cannot POST it to the API. The very last step would be the removal of the invoice draft.

It looks like Voucher would need a Storable impl and Invoice would need a Deletable impl for this workflow.

I'll try to implement it on my own and make a PR but maybe you can give a few hints.

Also, thanks for all the work!

Gottox commented 2 years ago

You're right, Voucher is missing both the Storable and the Updatable trait. But at least according to the API docs, there's no way to delete an invoice.

Gottox commented 2 years ago

Adding the such traits is pretty simple if the implementation is the default one. The generic example is the "Contacts" implementation. For most cases, adding an empty impl for the trait is enough.