Kaizen
Browse modulesPricingpricing/sharedTypes

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_cents are the running subtotal at the moment this action was applied. after_cents chains into the next applied action's before_cents within the same line/order — that self-chain is the verification surface.
  • delta_cents is the actual signed money moved (after - before), already clamped at zero. Always prefer this over the raw action.value when computing impact: value may be a percent (for method: "percentage") or a per-unit amount (for scaling: "per_unit"), neither of which equals dollars-moved.
  • For non_compounding actions on a line, every action's before_cents is the same base_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

On this page