feat(backend): Add generic API helper for transitions - #12693
Conversation
✅ Deploy Preview for inventree-web-pui-preview canceled.
|
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (82.52%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## master #12693 +/- ##
==========================================
- Coverage 87.23% 87.17% -0.06%
==========================================
Files 1487 1488 +1
Lines 101393 101496 +103
Branches 11547 11524 -23
==========================================
+ Hits 88448 88481 +33
- Misses 12882 12953 +71
+ Partials 63 62 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
@SchrodingersGat @wolflu05 what do you think about this approach? I use it in some of my plugins, it was partially implemented automatically by Claude due to the high level of duplication in a model with a lot of transitions |
|
@SchrodingersGat ready for review |
SchrodingersGat
left a comment
There was a problem hiding this comment.
Can you also apply these helpers to the build model API endpoints?
…add-generic-transaction
this new generic approach only applies to DRF viewsets, not GenericViews and the build APIs are not on viewsets yet so that would expand the scope of the PR quite a bit |
|
i just found a potential information leak in this approach; must review options |
This PR adds a generic viewset mixin that enables writing much more concise APIs when using FSM transitions - follow up to #12317