Closed SchrodingersGat closed 1 year ago
I'm working on a PR for these:
The testing is proving to be a bit finicky, it's hard to know what the status is, especially when running the tests several times consecutively.
Also, the names of the functions/API endpoints is not consistent. I'm not working on the 'complete' API endpoint, as this is for completing outputs, not the total order - which is called finish.
@miggland if you have suggestions for better names we are very open for that. The easier to understand the better as a German would say ;-)
The testing is proving to be a bit finicky, it's hard to know what the status is, especially when running the tests several times consecutively.
Try to ensure that each unit test can run "atomically" - i.e. set the state of the items under test to a known state at the start of the test. This way, other tests won't get in the way.
The unit test ensures that the new categories created are unique, by not hard-coding the names of the categories.
@miggland if you have suggestions for better names we are very open for that. The easier to understand the better as a German would say ;-)
There's only a few which have different names, as below. Changing these would make things more consistent. But, it would also break things..
Action | Current API name | Suggestion |
---|---|---|
Cancel build order | cancel | |
Complete build order | finish | complete |
Complete build output | complete | complete-output |
Cancel purchase order | cancel | |
Complete purchase order | complete | |
Issue purchase order | issue | |
Cancel sales order | cancel | |
Complete sales order | complete | |
Ship sales order | ship | complete |
@miggland great suggestions here. The collisions are hard to solve - would need to be a major release for sure. @SchrodingersGat would you be interested in a renaming initiative or would you prefer to do other stuff first? I know we are spread thin.
@miggland I'd rather not rename any API endpoints, as this will break existing code. We can improve the documentation around the functionality, but I think we are stuck with them.
Note that you can call the python functions something more sensible, and just point to the poorly-named endpoints
Currently, I have added aliases, eg so that 'finish' and 'complete' on a build-order does the same thing. Once I get around to it I'll have another go at the tests (as you suggest, I'll have to make them atomic - just that requires adding an order, parts, assigning, shipping, and then completing the order..
Many database actions have now been migrated to the API:
https://github.com/inventree/InvenTree/issues/2253
Some (many) of these could now be supported directly by the Python bindings: