hardening and polish sweep #4
Loading…
Reference in a new issue
No description provided.
Delete branch "d/hd1-hardening"
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?
Closes the pricing engine audit stack and the module polish backlog: code validation, resolve guards, rounding coverage, a default-address backstop index, and assorted small fixes across purchasing, planning, addresses, export and materials.
🤖 Claude AI Code Review
Summary
Well-scoped hardening sweep adding validation guards, warning surfacing, a filtered unique index backstop, and extensive test coverage across pricing, purchasing, planning, and addresses.
Code Quality ⭐⭐⭐⭐⭐
Exceptionally thorough — every change is backed by tests and reasoned comments, and the
SetDefaultDeliveryAddressAsyncordering fix shows real care against the new index.Issues
🟢
MaterialResolution.cs—Enum.IsDefined(priceGroup.Kind)uses the object overload, which boxes on every call. Minor allocation in a pricing hot path; use the genericEnum.IsDefined<FabricMaterialKind>(...)if targeting .NET 5+.🟢
PartyService.SetDefaultDeliveryAddressAsync— the two-save-within-a-transaction workaround relies on EF change-tracker flush order being "load order," which is not a documented contract. It works and is now transactional, but a cleaner approach would be a singleExecuteUpdateto clear siblings. Not blocking.Solid, test-backed sweep with no correctness or safety concerns. The migration correctly reconfigures the existing index, and the address-default ordering bug fix is a genuine catch.
📊 Tokens: 81382 input + 473 output | 💰 Cost: ~$0.4187
Generated by Claude Opus 4.8 via Gitea Actions