Add oven batch cost to AI Quick Quote (1 batch, DefaultOvenCycleMinutes or 50 min)

Previously the quick quote omitted the oven charge entirely, so saved quotes
were under-priced relative to full quotes from the same items.

Pricing: CalculatePricing now calculates ovenBatchCost = (cycleMin/60) × OvenOperatingCostPerHour
using DefaultOvenCycleMinutes (fallback 50 min), then adds it to the total as a quote-level
charge matching how PricingCalculationService handles oven costs.

Save path: SaveQuickQuoteRequest gains OvenBatchCost + OvenCycleMinutes; the Quote record
now stores OvenBatchCost, OvenCycleMinutes, and Total = ItemsSubtotal + OvenBatchCost.

Display: results card shows a sub-line under the estimate price:
"incl. oven 1 batch 50 min: $12.00"

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-06 15:20:10 -04:00
parent 9c4c20e8bd
commit 4d10175ce3
5 changed files with 34 additions and 9 deletions
@@ -257,9 +257,14 @@ When estimating from a verbal description:
subtotal = costs.ShopMinimumCharge;
var unitPrice = Math.Max(0, Math.Round(subtotal, 2));
var total = unitPrice * request.Quantity;
var markupAmount = (materialCost + consumablesSurcharge) * (costs.GeneralMarkupPercentage / 100m);
var ovenCycleMinutes = costs.DefaultOvenCycleMinutes > 0 ? costs.DefaultOvenCycleMinutes : 45;
// Oven batch charge: 1 batch, DefaultOvenCycleMinutes (fallback 50 min).
// Added at quote level (not baked into unitPrice) to match how the regular pricing engine works.
var ovenCycleMinutes = costs.DefaultOvenCycleMinutes > 0 ? costs.DefaultOvenCycleMinutes : 50;
var ovenBatchCost = Math.Round((ovenCycleMinutes / 60m) * costs.OvenOperatingCostPerHour, 2);
var total = unitPrice * request.Quantity + ovenBatchCost;
var breakdown = new AiPricingBreakdown
{
@@ -273,7 +278,7 @@ When estimating from a verbal description:
MinFloorApplied = false,
LaborCost = Math.Round(laborCost, 2),
OvenCycleMinutes = ovenCycleMinutes,
OvenCost = 0m,
OvenCost = ovenBatchCost,
RequiresPreheat = ai.RequiresPreheat,
PreheatMinutes = preheatMinutes,
PreheatCost = Math.Round(preheatCost, 2),