From spree upgrade phase 2 issue #2918, I realized this feature has not been used in the last 2 years. Last invoices on live databases are from 2016.
There’s some effort involved in making this work in v2. I estimate 3 dev days.
This estimate is based on two problems that need to be addressed:
- account invoices are based on orders without line items which is no longer possible in spree v2, I believe we would need to create some sort of product to include in these orders…
- account invoices have code to move the order workflow and that code needs to be adapted to spree v2 (basically, setting shipping method only when order.state is delivery)
- I am not sure this list is complete, maybe there are more things that need to be fixed, including verifying and validating the feature is currently working in v1 (the most recent invoices in UK live DB do not have a linked order id which indicates there’s a problem at least in this instance, this can be just a configuration problem).
This part of the code makes use of OFN orders in an un-ortodox way where we have an order without products and with a custom distributor, shipping method and payment method. It’s a bad use of the spree model for other means…
I believe this part of the code should be external to OFN, not part of the OFN code base.
I recommend we delete this code until we decide to use this feature again, when we decide that, this feature should be moved to a separate engine at least, if not to an external software component all together.
This PR deletes the feature: https://github.com/openfoodfoundation/openfoodnetwork/pull/3321
This is a significant part of the OFN complexity, 4000 lines of smart code, so deleting this and forcing it out of the code base into an engine is a great step towards making OFN more simple and clean.
Releasing v2 with these specs commented out is not an option, I think we either fix it or delete it. This PR can be reverted easily later and the existing code fully re-used when/if we decide to make it work (in v2.1 for example).
So, the only alternative to deleting the feature is to fix it before releasing v2.
Releasing OFN v2 with this feature broken and commented specs is not a valid option.
From what I read in slack this is really a dead feature, I think we should delete this and any other feature that is not being used and is not at the top of our priorities.
- extra features and dead features are muda - “one of the three types of deviation from optimal allocation of resources”
Postponing the deleting of waste is wasteful itself.
Thoughts? Votes? Concerns?