Type Alias: AppliedAction
type AppliedAction = {
action: PricingAction;
after_cents: number;
before_cents: number;
delta_cents: number;
level: PricingLevel;
phase: PricingCalculationPhase;
rule_id: string;
rule_identifier: string;
rule_name: string;
};Defined in: shared/pricing/types/calculation.ts:25
Per-action breakdown record produced by the calculator. Captures the
running-subtotal mutation an individual action caused so consumers
(invoice renderers, audit logs, refund engines) can re-derive the
line/order math without re-running calculatePrices.
before_cents/after_centsare the running subtotal at the moment this action was applied.after_centschains into the next applied action'sbefore_centswithin the same line/order — that self-chain is the verification surface.delta_centsis the actual signed money moved (after - before), already clamped at zero. Always prefer this over the rawaction.valuewhen computing impact:valuemay be a percent (formethod: "percentage") or a per-unit amount (forscaling: "per_unit"), neither of which equals dollars-moved.- For
non_compoundingactions on a line, every action'sbefore_centsis the samebase_cents(they apply independently against the base), but the recorded value is the running subtotal at the moment they landed, so the chain stays auditable.
Properties
action
action: PricingAction;Defined in: shared/pricing/types/calculation.ts:31
after_cents
after_cents: number;Defined in: shared/pricing/types/calculation.ts:33
before_cents
before_cents: number;Defined in: shared/pricing/types/calculation.ts:32
delta_cents
delta_cents: number;Defined in: shared/pricing/types/calculation.ts:34
level
level: PricingLevel;Defined in: shared/pricing/types/calculation.ts:30
phase
phase: PricingCalculationPhase;Defined in: shared/pricing/types/calculation.ts:29
rule_id
rule_id: string;Defined in: shared/pricing/types/calculation.ts:26
rule_identifier
rule_identifier: string;Defined in: shared/pricing/types/calculation.ts:27
rule_name
rule_name: string;Defined in: shared/pricing/types/calculation.ts:28