-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[WIP] Pricing plugin #10669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
[WIP] Pricing plugin #10669
Conversation
✅ Deploy Preview for inventree-web-pui-preview canceled.
|
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (73.33%) 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 #10669 +/- ##
==========================================
- Coverage 87.84% 87.64% -0.20%
==========================================
Files 1276 1279 +3
Lines 57478 57556 +78
Branches 2031 2031
==========================================
- Hits 50490 50446 -44
- Misses 6488 6610 +122
Partials 500 500
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Interesting approach; Regarding your questions:
For now, I think only having 1 plugin active will make things simpler
Maybe - this is mainly a thought experiment - developers could use inheritance? If the default plugin is split up enough in their function that should be reasonable On a more general note: I think this is a good step, but still not a stable footing that satisfied the request we are getting. Looking at #8607 . We definitely should think about changing calculations and changing the data structure we use to save prices and price calculations. We ignore time for example right now - time can be very important for price and cross-currency pricing |
|
Do you have any suggestions for specific changes to the data structure? |
|
I have not looked deeply into it as I am currently working on #4022, but I thought about it a bunch of the RFQ request. Currently, in my mind, the following fields would make sense in the DB; not all needed in the API:
These would ensure that faulty calculations can be identified and re-run and that we can try to get calculation stability |
This PR implements a plugin system for pricing integration.
Breaking Change
This PR introduces a breaking change - the existing global settings for adjusting pricing behavior have been moved to the (newly introduced) default pricing plugin. This means that if you have adjusted the default values of the pricing configuration settings, these settings will need to be re-adjusted against the new plugin.
Tasks
update_bom_costupdate_purchase_costupdate_internal_costupdate_supplier_costupdate_variant_costupdate_overall_costupdate_sale_costTalking Points
Can we (or should we) support having multiple pricing plugins operating, allowing a custom plugin to implement only a part of the functionality?
If not 1) then how to we support a custom plugin which only wants to make a "small" change. Does the plugin need to re-implement all functionality?