RoomKitType Reference
Entity Types
Core entity interfaces used across the RoomKit library
LocationNode
Represents a node in the location hierarchy tree.
interface LocationNode {
id: string;
parentId: string | null;
type: LocationNodeType;
displayName: string;
path: string;
aliases: string[];
isActive: boolean;
metadata: string | null;
createdAt: Date;
updatedAt: Date;
}| Field | Type | Description |
|---|---|---|
id | string | Unique identifier |
parentId | string | null | Parent node ID (null for root nodes) |
type | LocationNodeType | Node type in the hierarchy |
displayName | string | Human-readable name |
path | string | Unique slug path (e.g., "hfu/campus-a/building-1") |
aliases | string[] | Alternative names for alias resolution |
isActive | boolean | Whether the node is active |
metadata | string | null | Arbitrary JSON metadata |
Room
Represents a bookable room linked to a location node.
interface Room {
id: string;
locationNodeId: string;
seatedCapacity: number;
examCapacity: number;
standingCapacity: number;
setupBufferMinutes: number;
teardownBufferMinutes: number;
isActive: boolean;
metadata: string | null;
createdAt: Date;
updatedAt: Date;
}| Field | Type | Description |
|---|---|---|
locationNodeId | string | The location node this room belongs to |
seatedCapacity | number | Standard seated capacity |
examCapacity | number | Capacity for exam layout (every-other-seat) |
standingCapacity | number | Standing-room capacity |
setupBufferMinutes | number | Buffer time before bookings |
teardownBufferMinutes | number | Buffer time after bookings |
RoomEquipment
interface RoomEquipment {
id: string;
roomId: string;
tag: string; // e.g., "projector", "whiteboard", "microphone"
}RoomAccessibility
interface RoomAccessibility {
id: string;
roomId: string;
attribute: string; // e.g., "wheelchair", "hearing_loop"
}RoomPartition
Represents a parent/child relationship between rooms (divisible spaces).
interface RoomPartition {
id: string;
parentRoomId: string;
childRoomId: string;
}OperatingHours
interface OperatingHours {
id: string;
locationNodeId: string;
dayOfWeek: number; // 0 = Sunday, 1 = Monday, ..., 6 = Saturday
opensAt: string; // "HH:MM" format
closesAt: string; // "HH:MM" format
}Booking
Represents a room booking with lifecycle state management.
interface Booking {
id: string;
roomId: string;
requesterId: string;
onBehalfOfId: string | null;
title: string;
description: string | null;
startsAt: Date;
endsAt: Date;
status: BookingStatus;
priority: number;
purposeType: string;
version: number;
idempotencyKey: string | null;
recurrenceRuleId: string | null;
recurrenceModType: RecurrenceModType | null;
metadata: string | null;
createdAt: Date;
updatedAt: Date;
}| Field | Type | Description |
|---|---|---|
requesterId | string | Who requested the booking |
onBehalfOfId | string | null | Delegate — the actual user |
status | BookingStatus | Current lifecycle state |
priority | number | Priority weight (higher = more important) |
purposeType | string | Purpose type (e.g., "LECTURE", "SEMINAR") |
version | number | Optimistic concurrency version |
idempotencyKey | string | null | Deduplication key |
recurrenceRuleId | string | null | Linked recurrence series |
recurrenceModType | RecurrenceModType | null | original, modified, or detached |
BookingStateTransition
Audit record of a booking status change.
interface BookingStateTransition {
id: string;
bookingId: string;
fromStatus: BookingStatus | null;
toStatus: BookingStatus;
triggeredBy: string;
reason: string | null;
timestamp: Date;
}RecurrenceRule
Defines a recurrence pattern for recurring bookings.
interface RecurrenceRule {
id: string;
frequency: RecurrenceFrequency;
daysOfWeek: number[];
calendarWeeks: number[] | null;
seriesStartsAt: Date;
seriesEndsAt: Date;
exceptionDates: Date[];
createdAt: Date;
updatedAt: Date;
}| Field | Type | Description |
|---|---|---|
frequency | RecurrenceFrequency | weekly, biweekly, or custom |
daysOfWeek | number[] | Days (0=Sunday, 1=Monday, ..., 6=Saturday) |
calendarWeeks | number[] | null | ISO calendar week numbers (for custom frequency) |
exceptionDates | Date[] | Dates excluded from the series |
BlackoutWindow
A time block where bookings are not allowed at a location scope.
interface BlackoutWindow {
id: string;
locationNodeId: string;
scope: BlackoutScope;
title: string;
reason: string | null;
startsAt: Date;
endsAt: Date;
isRecurring: boolean;
recurrenceRuleId: string | null;
createdAt: Date;
}ConflictRecord
Records a conflict between two bookings and its resolution.
interface ConflictRecord {
id: string;
bookingAId: string;
bookingBId: string;
resolutionType: ConflictResolutionType;
resolvedBy: string | null;
resolvedAt: Date | null;
createdAt: Date;
}ConfigEntry
A configuration key-value pair scoped to a location node.
interface ConfigEntry {
id: string;
locationNodeId: string | null;
key: string;
value: string;
inheritFromParent: boolean;
createdAt: Date;
updatedAt: Date;
}PriorityTier
interface PriorityTier {
id: string;
name: string;
weight: number;
createdAt: Date;
}ExamSession
interface ExamSession {
id: string;
bookingId: string;
cohortId: string;
layoutType: ExamLayoutType;
requiredCapacity: number;
supervisorIds: string[];
metadata: string | null;
createdAt: Date;
}BulkOperation
interface BulkOperation {
id: string;
type: BulkOperationType;
status: BulkOperationStatus;
totalItems: number;
processedItems: number;
conflictsDetected: number;
resultSummary: string | null;
triggeredBy: string;
createdAt: Date;
completedAt: Date | null;
}EventMetadata
Included with all events emitted by the EventBus.
interface EventMetadata {
triggeredBy: string;
correlationId?: string;
timestamp: Date;
}