Currently Nfe_ServiceInvoice extends APIResource to make requests to the API.
And APIResource extends Nfe_Object to use random utility methods.
This makes the code very hard to understand, change and maintain.
The Service Invoice is not an API caller, it should use an API caller to send requests. So it should use composition.
The first task I would start would be: Refactor APIResource to be used as composition instead of inheritance.
Error reported here: https://github.com/nfe/woocommerce-nfe/issues/3
Currently Nfe_ServiceInvoice extends APIResource to make requests to the API. And APIResource extends Nfe_Object to use random utility methods. This makes the code very hard to understand, change and maintain.
The Service Invoice is not an API caller, it should use an API caller to send requests. So it should use composition. The first task I would start would be: Refactor APIResource to be used as composition instead of inheritance.
Some reference about composition over inheritance: https://www.thoughtworks.com/insights/blog/composition-vs-inheritance-how-choose https://en.wikipedia.org/wiki/Composition_over_inheritance