Kaizen
Browse modulesPricingpricing/sharedTypes

Type Alias: CapacityRule

type CapacityRule = z.infer<typeof CapacityRule>;

Defined in: shared/pricing/types/tier-form.ts:150

A single capacity constraint — the Figma "Capacity" section's repeatable "Capacity is [operator] N (and M) attendees" row (PLA-139 Facility variant). Like membership/residency, each rule is a requirement: the consumer turns it into one GROUP_SIZE condition ({ field, min?, max? }, both bounds INCLUSIVE) via ConditionService.create and references it by id in addRateTier / updateRateTierRequirements's requirementConditionIds.

The operator is kept explicit (not pre-collapsed to min/max) so a UI value round-trips without an off-by-one at the boundary. The consumer maps:

  • between → { min: value, max: secondValue }
  • less_than → { max: value - 1 } (exclusive "less than" → inclusive)
  • greater_than → { min: value + 1 } (exclusive "greater than" → inclusive)

secondValue is the upper bound, present only for between (null otherwise).