in-house material needs #3

Merged
cheapnud merged 11 commits from d/sp2-materials into master 2026-08-12 01:57:08 +00:00
Owner

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.

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 find stock is null, insert two rows, and hit the unique index on the second SaveChanges. 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 null PinnedCatalogueVersion are silently dropped (the group.Key is null guard), whereas ApplyBackflushAsync throws 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 MaterialKind enum split from FabricMaterialKind is 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

## 🤖 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 find `stock is null`, insert two rows, and hit the unique index on the second `SaveChanges`. 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 null `PinnedCatalogueVersion` are silently dropped (the `group.Key is null` guard), whereas `ApplyBackflushAsync` throws 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 `MaterialKind` enum split from `FabricMaterialKind` is 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*
cheapnud merged commit 7ca22f06b5 into master 2026-08-12 01:57:08 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
cheapnud/CheapFurniturePlanner!3
No description provided.