Kaizen
Browse modulesPricingpricing/sharedTypes

Type Alias: SubUnit

type SubUnit = {
  anchor?: string;
  index: number;
  narrowing_unit?: string;
  pricing_unit: string;
};

Defined in: shared/pricing/types/sub-unit.ts:19

One unit-of-decomposition within a line item. A 3-night campsite reservation enumerates to 3 sub-units (one per night); an atomic pricing_unit: "unit" ticket enumerates to a single sub-unit.

Sub-units are the granularity at which the qualification pass re-evaluates per-sub-unit-variable conditions (currently DATE_INCLUDES) so that per-unit actions on a partially-overlapping condition scale only by the sub-units that actually qualify.

anchor is the canonical start timestamp of the sub-unit in UTC, for time-shaped decompositions (night, day, hour, month, year). The default enumerator emits the start of the sub-unit's calendar window in context.timezone, expressed as UTC ISO 8601. Consumer resolvers MAY omit anchor for non-time decompositions (e.g. one sub-unit per person on a roster). A consumer override for a date-varying two-axis line MUST provide a valid UTC ISO anchor on every sub-unit.

Properties

anchor?

optional anchor?: string;

Defined in: shared/pricing/types/sub-unit.ts:23

UTC ISO 8601 timestamp anchoring the sub-unit, when applicable.


index

index: number;

Defined in: shared/pricing/types/sub-unit.ts:21

Stable index in the line's enumerated sub-unit list.


narrowing_unit?

optional narrowing_unit?: string;

Defined in: shared/pricing/types/sub-unit.ts:37

Time cadence used to narrow anchor for a built-in two-axis decomposition. Omitted when it is the same as pricing_unit. Consumer metadata is ignored on two-axis lines; the base price's per axis is authoritative.


pricing_unit

pricing_unit: string;

Defined in: shared/pricing/types/sub-unit.ts:30

Pricing unit this sub-unit represents. Always equal to the line's pricing_unit for the built-in enumerator; consumer resolvers MAY set it to a different value if they're decomposing along a custom axis.

On this page