room-allocation-engine
v1.0.0
Published
Core room allocation engine for hotel PMS and booking systems
Maintainers
Readme
Room Allocation Engine
A logic-only, deterministic room allocation core for hotel PMS and booking systems.
This package focuses on correctness around date overlaps, maintenance rooms, and future availability — without UI or database assumptions.
Why this exists
Hotel booking systems need bulletproof room allocation logic. Double-bookings cost money, maintenance rooms must be respected, and availability must be calculated correctly across date ranges.
Install
npm install room-allocation-engineUsage
import { allocateRoom } from "room-allocation-engine"
const result = allocateRoom(
[{ id: "101", type: "DELUXE", status: "AVAILABLE" }],
[], // existing bookings
{ roomType: "DELUXE", from: "2026-01-01", to: "2026-01-02" }
)
console.log(result) // { success: true, roomId: "101" }What it does
✅ Date overlap detection - Prevents double-booking ✅ Maintenance awareness - Respects unavailable rooms ✅ Type matching - Allocates by room category ✅ Pure functions - No side effects, fully testable
What it does NOT do
❌ No database operations ❌ No UI components ❌ No pricing logic ❌ No external API calls
Philosophy
Logic-only, deterministic, reusable core. Built for composition, not consumption. Testable, auditable, and maintainable.
