Skip to content

ARI + restrictions — proposed SSOT (draft) ​

ARI = Availability · Rates · Inventory (+ restrictions).

Live v1 winner stays availability/check (computed from rooms + overlapping bookings). Do not delete that playbook until an inventory folder is live.

Proposed SSOT ​

ConcernWriterNot SSOT
Sellable units / dayMiddleware inventory row per room×date (Core inventory entity optional)Google / GuestTraction / OTAs
BARSame row or rate-plan rules that write inventoryScraper prices
RestrictionsstopSell, minStay, maxStay, closedToArrival, closedToDepartureChannel dashboards
Booked countBooking create/cancel in the same Middleware transactionInbound OTA ARI

Channels are outbound. Inbound ARI must not overwrite SSOT without an audited import.

propertyId, roomId, date
baseRate, inventoryCount, bookedCount
stopSell, minStay, maxStay, CTA, CTD

Availability ≈ inventoryCount - bookedCount plus restrictions and rate-plan linkage.

Rooms stay a rooms resource (live: /api/v1/bookdirect/rooms). Do not collapse rooms into rates-packages.

Push (after SSOT exists) ​

MelonQ calendar edit → Middleware inventory write → debounce GuestTraction / Booklogic (room content, availability, restrictions, pricing, promotions including AI Rate Match). Horizon constant e.g. GOOGLE_ARI_PUSH_DAYS ≈ 330.

What must exist ​

  1. One write API used by MelonQ and booking side-effects
  2. Booking create increments bookedCount with the booking insert (oversell guard)
  3. Idempotent channel push + sync status
  4. Per room+ratePlan channel toggles
  5. No second “Google inventory” table

Core: optional inventory entity. No date-overlap engine in Laravel — Middleware owns the calendar math.

IDOR ​

Partner JWT for inventory writes. Availability reads return counts only. Channel creds stay on Middleware.

Acceptance ​

  • Min stay in MelonQ changes guest eligibility without opening Google
  • Channel disable stops push; SSOT still editable
  • Concurrent booking cannot oversell
  • AI Rate Match promotions use the same push pipeline

API-first. Middleware Backend wins over Core Backend when both exist.