Understanding the 9-Stage Availability Pipeline
From Raw Data to Agent-Ready Numbers
At the heart of AvailVia is an 8-stage availability pipeline. Every time an agent queries room availability, the system runs raw inventory data through a strict sequence of transformations. Each stage takes the output of the previous one and applies a specific business rule. The order is fixed and intentional — changing it would produce incorrect results.
This design might seem rigid, but it is precisely that rigidity that makes the platform trustworthy. When a hotel chain admin sets a display rule or allocation model, they know exactly where in the pipeline it takes effect. There are no hidden interactions, no ambiguous precedence, and no surprises.
The Nine Stages
Stage 0 — Raw Data. The pipeline begins with the most recent snapshot of room availability. This data comes from PMS integrations or CSV uploads and represents the ground truth: how many rooms of each type are physically available on each date.
Stage 1 — Visibility Window. Not every agent should see availability for the same date range. A chain might allow preferred partners to book 180 days out while restricting newer agents to 30 days. This stage zeroes out any dates that fall outside the agent's configured window.
Stage 1.5 — Composite Resolution. Some room types are composites — they derive availability from a recipe of source rooms. A Family Suite might require one King Room and one Twin Room. This stage calculates derived availability using the formula min(floor(sourceAvail / unitsRequired)) for each source, then caps it at the composite's maximum units.
Stage 2 — Overbooking Cascade. When a room type is overbooked, the excess can cascade to linked room types. The system uses topological sorting (Kahn's algorithm) to process cascade chains in the correct order, ensuring that downstream room types absorb overflow without circular dependencies.
Stage 3 — Display Rules. Chain admins can apply three types of display rules per room type: flat caps (show at most N rooms), percentage limits (show X% of actual availability), and threshold cutoffs (if availability drops below a minimum, show zero). Thresholds are checked first — they act as circuit breakers.
Stage 4 — Agent Allocation. This is where availability is divided among agent groups. Two models are supported: flat withholding (subtract a fixed number from displayed availability) and percentage allocation (give the agent a percentage of what is displayed). The formula for flat allocation is max(0, displayedAvailability - flatNumber).
Stage 4.5 — Availability Labels. After allocation, each room-date combination receives a semantic label: OPEN_SALE, ON_REQUEST, SOLD_OUT, or a custom label. These labels give agents a quick visual indicator of booking status without needing to interpret raw numbers.
Stage 5 — Negative Closure. This final stage looks at the raw (Stage 0) availability for the entire hotel on each date. If overall availability drops below a configured threshold, the date is automatically closed for all room types. Importantly, OPEN_SALE labels survive this stage — they represent manual overrides that take priority over automated closure. Any values that would be negative are floored to zero as a safety net.
Why Order Matters
Consider what would happen if allocation (Stage 4) ran before display rules (Stage 3). An agent group with a 50% allocation on a room type with 20 available rooms would receive 10. But if a display rule caps that room type at 8, the agent should see max(0, 8 - flatNumber) or floor(8 * percentage) — not 10. Running display rules first ensures the allocation operates on the correct base number.
Similarly, negative closure (Stage 5) must run after allocation because it examines raw availability, not allocated availability. Running it earlier would close dates before agents have had their allocations calculated.
A Worked Example
Here is a simplified trace through the pipeline for a single room type on a single date:
Stage 0: Raw availability = 25 rooms
Stage 1: Agent's visibility window includes this date → 25
Stage 1.5: Not a composite room → 25 (pass-through)
Stage 2: No overbooking cascade → 25
Stage 3: Display rule = PERCENTAGE 80% → floor(25 * 0.80) = 20
Stage 4: Agent allocation = FLAT withholding of 5 → max(0, 20 - 5) = 15
Stage 4.5: 15 > 0, no special label → AVAILABLE
Stage 5: Hotel-wide raw availability above threshold → no closure
Final: Agent sees 15 rooms available
Building Trust Through Transparency
The pipeline approach means that every number has a provenance. If an agent questions why they see 15 rooms instead of 25, the chain admin can walk through each stage and point to the exact rule that shaped the result. This level of transparency is rare in hotel distribution, and it is the foundation on which AvailVia is built.
In future articles, we will dive deeper into individual stages — especially composite resolution, cascade mechanics, and the interaction between labels and negative closure. For now, understanding the overall flow is the key takeaway: raw data goes in, business rules are applied in a fixed order, and a trustworthy number comes out.