Add planned builds (reserve part stock for future project builds) - #1567
Open
kernchen-brc wants to merge 2 commits into
Open
kernchen-brc wants to merge 2 commits into
kernchen-brc wants to merge 2 commits into
Conversation
…Authored-By: Claude Sonnet 5.5)
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #1567 +/- ##
============================================
+ Coverage 62.97% 63.26% +0.28%
- Complexity 10071 10358 +287
============================================
Files 748 762 +14
Lines 32315 33194 +879
============================================
+ Hits 20351 20999 +648
- Misses 11964 12195 +231 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds planned builds: a way to reserve the parts a project needs for a future build, without removing them from the inventory yet. Reserved stock is excluded from what can be withdrawn, moved or used by other builds, until the plan is built or cancelled.
Stock is now tracked as Total = Available + Reserved per lot and per part. This is shown on the part page, can be shown as table columns (
Reserved,Available) and is part of the API (reserved_amount,available_amounton part lots).How it works
planned_projects.built_parts).Changes to existing behaviour
parts.editnow also sets the newparts_stock.reserve/releasepermissions.Database / permissions
Version20260929120000createsplanned_projectsandpart_lot_reservations(MySQL, SQLite, PostgreSQL).Version20260929130000copies existingprojectspermissions to the newplanned_projectspermission, andparts_stock.withdraw/addto the newparts_stock.reserve/release, so existing installs and admins see the feature right away. The permission presets for new installs are updated too.planned_projects(read/edit/create/delete/show_history/revert_element/import),parts_stock.reserve,parts_stock.release.Other
LogTargetType,ElementTypes,EntityURLGenerator, the log filter and the cache invalidation listener, so logging, history links and the sidebar work.docs/usage/planned_builds.md. English translations are added tomessages.en.xlf/validators.en.xlf(other languages are left to Crowdin).Testing
composer phpstan(level 5),lint:twig,lint:yamlanddoctrine:schema:validate --skip-syncpass. The migrations run from scratch on SQLite; I did not run them on MySQL or PostgreSQL.PlannedProjectentity, sidebar tree builder, and a functional controller test (parts without lots are listed, sorting, building keeps the plan, active reservations block part deletion and manual withdrawal).PartLot/withdraw tests are extended, and the new pages are added to the availability tests.Notes for reviewers
built_partssnapshot, so it does not block deleting parts, lots or projects and does not slow down the stock calculations.ON DELETE CASCADE.🤖 Generated with Claude Code