in-house material needs #3
Loading…
Reference in a new issue
No description provided.
Delete branch "d/sp2-materials"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Splits production per model into in-house and outsourced, adds a bom-driven material forecast with stock and material purchase orders with partial receipts, and a finishing scan that backflushes stock symmetrically with undo.
🤖 Claude AI Code Review
1. Summary
Adds in-house material forecasting, material purchase orders with partial receipts, and a finishing scan that backflushes stock symmetrically. Well-structured, heavily tested, mirrors existing purchasing patterns.
2. Code Quality
⭐⭐⭐⭐⭐
Exceptional test coverage and thoughtful invariant documentation; the three-state resolution rule (dropship/mapped/in-house/unresolved) is consistently enforced across sweep, forecast, and finish paths, and the backflush symmetry regression tests are thorough.
3. Issues
🟢
MaterialOrderService.ReceiveAsync/ProductionUnitService.ApplyBackflushAsync— Stock upsert reads-then-writes without a unique-constraint retry. Two concurrent receipts/finishes for the same(Kind, Code, HardnessCode)could both findstock is null, insert two rows, and hit the unique index on the secondSaveChanges. Given the desktop/single-writer nature of this app this is likely acceptable, but worth confirming the concurrency model.🟢
MaterialNeedsService.ComputeAsync— Units on in-house lines with a nullPinnedCatalogueVersionare silently dropped (thegroup.Key is nullguard), whereasApplyBackflushAsyncthrows on the same condition. This divergence is already self-flagged in TODO.md, so no action needed beyond acknowledging it's tracked.4. Verdict
APPROVE
The
MaterialKindenum split fromFabricMaterialKindis a clean breaking rename handled consistently, the new migration matches the model, and role gating/tests are solid. The two issues above are minor and (for concurrency) likely out of scope given the app's single-user desktop model.📊 Tokens: 149031 input + 624 output | 💰 Cost: ~$0.7608
Generated by Claude Opus 4.8 via Gitea Actions