Kaizen
Browse modulesCheckoutcheckout/sharedFunctions

Function: toPricedCart()

function toPricedCart<T extends PriceableLineItem>(
   calculation: PricingCalculation<T>, 
   classify: ClassifyAdjustment, 
   meta: PricedCartMeta
): PricedCart;

Defined in: shared/checkout/priced-cart.ts:172

Maps a PricingCalculation (the existing pricing engine's output) to the PricedCart seam DTO. Step 3 of the consumer's priceCart pipeline: build context → evaluatePricing → toPricedCart.

  • Each LineCalculation → PricedLineItem (pre-adjustment subtotal).
  • Each FEE/DISCOUNT AppliedAction → PricedAdjustment (scope = level, amountCents = delta_cents, signed). BASE_PRICE actions are skipped — they establish the base already inside base_cents, they are not adjustments.
  • Party totals are computed from the classified adjustments (NOT copied from the engine's total_cents), applying the inclusive-tax exclusion NOT (kind=tax ∧ taxInclusive), so the priceCart side and the createOrder side can never disagree.

Type Parameters

Type Parameter
T extends PriceableLineItem

Parameters

ParameterType
calculationPricingCalculation<T>
classifyClassifyAdjustment
metaPricedCartMeta

Returns

PricedCart

On this page