Restore IncludePrepCost pricing for catalog items with abnormal prep

The flag should default off (catalog DefaultPrice used as-is) but remain
functional so users can opt in when a job needs exceptional prep time
(e.g. 120-min outgassing vs. the typical 30 min baked into the catalog price).

Previous commit removed this entirely — restoring with correct default behavior.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-06 16:47:48 -04:00
parent 9292f3169c
commit 8c30d5bf5a
@@ -391,8 +391,17 @@ public class PricingCalculationService : IPricingCalculationService
baseSubtotal = baseUnitPrice * item.Quantity;
_logger.LogInformation("Catalog base: ${Price} × {Qty} = ${Base}", baseUnitPrice, item.Quantity, baseSubtotal);
// Catalog DefaultPrice is always the base — prep service labor is never added on top.
// PrepServices on catalog items are used for scheduling only, not pricing.
// Optionally add prep service labor for catalog items when the job requires abnormal
// prep time (e.g. 120-min outgassing on a part that normally takes 30). The flag
// defaults to false so the DefaultPrice is used as-is for typical jobs.
if (!item.IsAiItem && item.IncludePrepCost && item.PrepServices != null && item.PrepServices.Any())
{
var totalPrepMinutes = item.PrepServices.Sum(ps => ps.EstimatedMinutes);
var prepLaborCost = (totalPrepMinutes / 60m) * costs.StandardLaborRate;
baseSubtotal += prepLaborCost;
totalLaborCost += prepLaborCost;
_logger.LogInformation("Catalog item extra prep: {Min} min × ${Rate}/hr = ${Cost}", totalPrepMinutes, costs.StandardLaborRate, prepLaborCost);
}
// Custom (non-inventory) powder coats must be purchased separately — add their material
// cost on top of the catalog base price. Inventory powder is assumed baked into DefaultPrice.