RoomKitType Reference
Result Types
Domain result types returned by RoomKit services
AvailabilityResult
Returned by AvailabilityService.search().
interface AvailabilityResult {
items: AvailabilityResultItem[];
nextCursor?: string;
totalMatching: number;
}
interface AvailabilityResultItem {
room: Room & { equipment: RoomEquipment[]; accessibility: RoomAccessibility[] };
score: number;
availableSlots?: TimeSlot[];
}| Field | Type | Description |
|---|---|---|
items | AvailabilityResultItem[] | Scored rooms matching the search |
nextCursor | string? | Cursor for the next page |
totalMatching | number | Total number of matching rooms |
room | Room & { equipment, accessibility } | Room with equipment and accessibility |
score | number | Match score (higher is better) |
availableSlots | TimeSlot[]? | Open time slots within the search window |
ConflictCheckResult
Returned by ConflictService.checkConflicts().
interface ConflictCheckResult {
hasConflict: boolean;
directConflicts: Booking[];
partitionConflicts: { roomId: string; booking: Booking }[];
}| Field | Type | Description |
|---|---|---|
hasConflict | boolean | true if any conflicts were found |
directConflicts | Booking[] | Overlapping bookings in the same room |
partitionConflicts | { roomId, booking }[] | Overlapping bookings in partition-related rooms |
AlternativeSuggestion
Returned by ConflictService.suggestAlternatives().
interface AlternativeSuggestion {
type: "same_room_different_time" | "different_room_same_time";
room: Room | null;
startsAt: Date;
endsAt: Date;
score: number;
}| Field | Type | Description |
|---|---|---|
type | string | Either same room at a different time, or different room at the same time |
room | Room | null | The alternative room (null for same-room suggestions) |
startsAt | Date | Suggested start time |
endsAt | Date | Suggested end time |
score | number | Relevance score (1.0 = same room, 0.5-0.9 = different room) |
ConflictResolution
Returned by ConflictService.resolveByPriority().
interface ConflictResolution {
winner: "existing" | "new";
action: "reject_new" | "displace_existing";
alternatives: AlternativeSuggestion[];
}TravelTimeValidationResult
Returned by TravelTimeService.validatePersonSchedule().
interface TravelTimeValidationResult {
valid: boolean;
violations: TravelTimeViolation[];
}
interface TravelTimeViolation {
fromCampus: string;
toCampus: string;
requiredMinutes: number;
availableMinutes: number;
conflictingBookingId: string;
}| Field | Type | Description |
|---|---|---|
valid | boolean | true if no travel time violations |
violations | TravelTimeViolation[] | Details of each violation |
fromCampus | string | Campus display name of the preceding booking |
toCampus | string | Campus display name of the next booking |
requiredMinutes | number | Minimum travel time from matrix |
availableMinutes | number | Actual gap between bookings |
conflictingBookingId | string | ID of the conflicting existing booking |
TimeSlot
A time range used in availability results and scheduling.
interface TimeSlot {
startsAt: Date;
endsAt: Date;
}SemesterImportPayload
Input for BulkOperationService.semesterImport().
interface SemesterImportPayload {
entries: {
roomId: string;
startsAt: Date;
endsAt: Date;
requesterId: string;
purposeType: string;
title: string;
recurrence?: Omit<RecurrenceRule, 'id' | 'createdAt' | 'updatedAt'>;
}[];
}Pagination
Cursor-based pagination parameters.
interface Pagination {
cursor?: string;
limit: number;
}
interface PaginatedResult<T> {
items: T[];
nextCursor?: string;
}ApiResponse
Standard API response wrapper.
type ApiResponse<T> = {
data: T;
error?: string;
};