Composite Room Types: Deriving Availability from Source Rooms
What Are Composite Room Types?
Not every room type in a hotel corresponds to a single physical room. Some room types are composites — they are assembled from one or more source room types according to a recipe. A common example is a Family Suite that consists of one King Room and one Twin Room connected by an adjoining door. The hotel does not have a separate inventory of Family Suites; instead, each Family Suite consumes one unit from each source type.
AvailVia handles composite room types as a first-class concept in the availability pipeline. Rather than requiring hotel administrators to manually calculate derived availability, the system automatically resolves composite availability at Stage 1.5, right after visibility windows are applied and before any downstream business rules take effect.
The Derivation Formula
The availability of a composite room type is determined by its most constrained source. If a Family Suite requires 1 King Room and 2 Twin Rooms, and there are 10 King Rooms available but only 7 Twin Rooms, the derived availability is:
derived = min(
floor(kingAvail / unitsRequired), // floor(10 / 1) = 10
floor(twinAvail / unitsRequired) // floor(7 / 2) = 3
)
// derived = min(10, 3) = 3
The result is then capped at the composite's configured maximum units. If the Family Suite has a compositeMaxUnits of 5, and the derived value is 3, the final derived availability is 3. If the derived value were 8, it would be capped at 5.
Dedicated Inventory Plus Derived
A composite room type can also have its own dedicated physical inventory. If the hotel has 2 actual Family Suite rooms in addition to the ability to assemble more from source rooms, the total availability is the sum of dedicated inventory and derived availability:
total = ownRoomCount + derived
// total = 2 + 3 = 5
This flexibility allows hotels to model both purpose-built suites and on-demand configurations within the same system. When the derived value is zero — because one or more source rooms are unavailable — the composite still shows its dedicated inventory.
Pipeline Behavior
Composite room types interact with the availability pipeline in specific ways that are important to understand. They skip two stages that apply only to physical room types:
-
Overbooking Cascade (Stage 2): Composites do not participate in cascade chains. Since their availability is derived from source rooms, cascading would double-count inventory. Only physical room types cascade.
-
Negative Closure Calculation (Stage 5): Composites are excluded from the hotel-wide availability calculation that determines whether a date should be closed. Including them would inflate the count with derived numbers and distort the closure threshold.
All other stages — display rules, agent allocation, availability labels, and the zero floor — apply to composites just as they do to physical room types.
When to Use Composites
Composite room types are most useful when a hotel offers configurable accommodations. Here are a few scenarios where they shine:
Adjoining rooms. Two standard rooms connected by a door become a family or group option. The composite tracks how many pairs are possible without manual intervention.
Suite configurations. A premium suite that requires a bedroom unit and a living area unit. As either source is sold, the suite availability decreases automatically.
Accessible combinations. An accessible room package that combines a wheelchair-accessible room with a companion room. The composite ensures both are available before showing the package.
Constraints and Limitations
There are a few rules that govern composite room types in v1 of the platform. Composites cannot be sources for other composites — there is no nesting. Each composite's derived availability is calculated independently, meaning two composites that share a source room do not deduct from each other. This keeps the calculation predictable and avoids complex dependency graphs. Finally, when any source room type has negative or zero availability, the derived component drops to zero, but the composite's own dedicated inventory is preserved.
Understanding composite room types is essential for hotels that offer flexible configurations. By letting the system derive availability automatically, chain administrators can focus on setting business rules rather than manually tracking which combinations are possible on any given day.