Skip to main content

Availability & Nightly Rates

Data Source

Nightly rates come from the channel_rate table (synced from PMS/channel manager):

ColumnTypeDescription
property_idstringProperty identifier
channel_idstringSales channel
datedateSpecific night
nightly_ratedoubleBase rate for that night
inventoryintAvailable units on that night

Resolution Flow

resolveAllAsync(propertyIds, checkIn, checkOut)

Query all rates for all properties in date range

Group by propertyId

For each property:
if nights_with_rates < total_nights_needed → UNAVAILABLE
minInventory = min(inventory across all nights)
if minInventory <= 0 → UNAVAILABLE
else → AVAILABLE with minInventory units and sorted nightly rates

PropertyAvailability

PropertyAvailability {
availableUnits: 4, // minimum inventory across all nights
nightlyRates: [
{ date: "2026-05-15", rate: 8500.0 },
{ date: "2026-05-16", rate: 9000.0 }
]
}

How It Affects Property Selection

  • Properties with availability.isAvailable() == false are filtered out before strategy runs
  • availableUnits caps the maximum quantity the strategy can pick
  • Nightly rates are used for per-night price calculation (instead of static base price)

No Dates = No Availability Check

When no check-in/check-out dates are provided:

  • All properties are treated as available
  • Static base price is used instead of nightly rates
  • No inventory check