Skip to content
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

Refactor pricing mechanics and move to plugins #8607

Open
matmair opened this issue Dec 1, 2024 · 0 comments
Open

Refactor pricing mechanics and move to plugins #8607

matmair opened this issue Dec 1, 2024 · 0 comments
Labels
Platform UI Related to the React based User Interface roadmap This is a roadmap feature with no immediate plans for implementation
Milestone

Comments

@matmair
Copy link
Member

matmair commented Dec 1, 2024

Problem statment

The current state of pricing is mostly coded into InvenTree's code base. This makes part pricing more complicated than necessary for hobby users and lacks the nuance needed for business users.

Vision

Plugins should be the primary way to handle prices. The default system should provide a simple pricing setup that only considers BoM part costs.

Breakdown

General goals:

  1. Pricing calculations should be passed through plugins
    a. Plugins should be able to add or subtract values and add metadata that can be added to reports, the UI etc.
    b. Plugins should be aware of currencies and time
  2. Move pricing calculations for parts into a plugin that can be disabled
    a. Move settings for internal pricing to plugin
    b. Move variant pricing overrides to the plugin
    c. Move supplier pricing to the plugin ([FR] Packaging and shipment cost #7765, [FR] Inbound shipping/logistics costs #3928, [FR] Assembly pricing calculation without consumables #7603)
  3. Add pricing calculations via plugins to orders
    a. Pass through metadata and part parameters
    b. Enable pricing customisable types via states (for example shipping, packaging, handling fees, taxes, discounts, allowance)
  4. Add cost to builds ([FR] Add build cost #7949, [FR] Support Actual Cost of Build Outputs based on Cost of Parts #7279, [FR] Add labor time for build orders #8530 (comment))
    a. BoM cost
    b. General Handling cost
    c. Per build order cost
    d. Per part cost
    e. Possibly depending on worker steps (could be very usable to asses currently sunken cost per build)
  5. Costs on tests?
  6. Add permissions to ensure that detailed breakdowns etc can be restricted ([FR] Permissions system for pricing #4022)
  7. Possibly add the option for plugins to require manual checks of prices

Plugin design ideas:

  • Make pricing composable
  • Make pricing runs repeatable (and time-fixed)
  • Fix plugin order
  • Store pricing runs and configurations in database

Open questions:

  • Data flow design
  • Python primitives
  • Plugin API
  • UI flow and integration

Warning

This is a draft and would be a major amount of work. This will probably require a major release and intense testing and UI/UX design. Do not expect this to be done fast.

@matmair matmair added Platform UI Related to the React based User Interface roadmap This is a roadmap feature with no immediate plans for implementation labels Dec 1, 2024
@SchrodingersGat SchrodingersGat added this to the horizon milestone Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform UI Related to the React based User Interface roadmap This is a roadmap feature with no immediate plans for implementation
Projects
None yet
Development

No branches or pull requests

2 participants