Reservation
Reservation schemas for managing resource bookings including tables, rooms, and rentals. Includes reservation settings and reservable resources.
Source: src/core/business-mgt/reservation.schema.ts, src/core/business-mgt/reservation-resource.schema.ts
ReservationSettings​
Organization-level settings for reservation types.
Schema: ReservationSettingsSchema
Attributes​
| Attribute | Type | Required | Default | Description |
|---|---|---|---|---|
id | string | — | — | Unique identifier for the settings |
reservationType | enum | Yes | — | Resource type this setting applies to. One of ROOM, TABLE, RENTAL, or OTHER. |
settingType | enum | Yes | — | Configuration category. |
defaultReservationDuration | number | No | 1 | Standard reservation length |
defaultReservationDurationUnit | enum | No | HOURS | Time unit for duration. One of MINUTES, HOURS, or DAYS. |
isActive | boolean | No | false | Whether configuration is active |
createdAt | number | — | — | Unix timestamp when created |
updatedAt | number | — | — | Unix timestamp when last updated |
Resource​
Reservable resources (tables, rooms, rental items).
Schema: ResourceSchema
Attributes​
| Attribute | Type | Required | Default | Description |
|---|---|---|---|---|
id | string | — | — | Unique identifier for the resource |
resourceType | enum | Yes | — | Category of resource. One of ROOM, TABLE, RENTAL, or OTHER. |
name | string | Yes | — | Display name (e.g., Table 5, Room 101) |
description | string | No | — | Detailed description |
capacity | number | No | — | Maximum occupancy or party size |
isAvailable | boolean | No | true | Whether resource is available |
location | string | No | — | Physical location or placement |
amenities | array<string> | No | [] | Available features or amenities |
reservationDuration | number | null | No | — | Default reservation length |
reservationDurationUnit | enum | null | No | — | Time unit for duration. One of MINUTES, HOURS, or DAYS. |
calendarId | string | null | No | — | External calendar ID for sync |
syncEnabled | boolean | null | No | false | Whether calendar sync is active |
lastSyncAt | number | null | No | — | Last sync timestamp |
roomResource | RoomResource | null | No | — | Hotel/accommodation-specific fields |
rentalResource | RentalResource | null | No | — | Rental-specific fields |
metadata | object | No | — | Additional custom attributes |
createdAt | number | — | — | Unix timestamp when created |
updatedAt | number | — | — | Unix timestamp when last updated |
RoomResource Object​
| Attribute | Type | Default | Description |
|---|---|---|---|
roomNumber | string | — | Room identifier |
roomType | string | — | Room category (e.g., Deluxe King) |
pricePerNight | number | — | Nightly rate |
view | string | — | Room view classification |
bedType | string | — | Bed configuration |
isSmoking | boolean | false | Whether smoking is permitted |
accessibilityFeatures | string | — | ADA accommodations available |
RentalResource Object​
| Attribute | Type | Description |
|---|---|---|
itemType | string | Rental category or type |
pricePerHour | number | Hourly rental rate |
Reservation​
Individual reservation booking.
Schema: ReservationSchema
Attributes​
| Attribute | Type | Required | Default | Description |
|---|---|---|---|---|
id | string | — | — | Unique identifier for the reservation |
reservationType | enum | Yes | — | Category of reservation. One of ROOM, TABLE, RENTAL, or OTHER. |
resourceId | string | null | No | — | Specific resource being reserved |
customerId | string | Yes | — | References Customer |
startTime | number | Yes | — | Unix timestamp for start |
endTime | number | No | — | Unix timestamp for end |
duration | number | No | — | Reservation length in units |
personsNumber | number | No | — | Party size or occupancy |
totalPrice | number | No | — | Total reservation cost |
depositPaid | number | No | 0 | Deposit amount paid |
status | enum | No | PENDING | Current reservation status. One of PENDING, CONFIRMED, IN_PROGRESS, COMPLETED, CANCELLED, or NO_SHOW. |
notes | string | No | — | Special requests or notes |
cancelReason | string | null | No | — | Reason for cancellation |
isResourceReservation | boolean | No | false | Whether specific resource is assigned |
serviceConversationConfigId | string | null | No | — | AI service conversation config ID |
createdAt | number | — | — | Unix timestamp when created |
updatedAt | number | — | — | Unix timestamp when last updated |
Example​
Resource Example​
{
"id": "res_table5",
"resourceType": "TABLE",
"name": "Table 5",
"description": "Window table with city view",
"capacity": 4,
"isAvailable": true,
"location": "Window side, main dining area",
"amenities": ["wheelchair_accessible"],
"reservationDuration": 2,
"reservationDurationUnit": "HOURS",
"createdAt": 1709856000000,
"updatedAt": 1709856000000
}
Room Resource Example​
{
"id": "res_room101",
"resourceType": "ROOM",
"name": "Room 101",
"capacity": 2,
"isAvailable": true,
"location": "First floor",
"amenities": ["WiFi", "TV", "Mini-bar"],
"roomResource": {
"roomNumber": "101",
"roomType": "Deluxe King",
"pricePerNight": 199.00,
"view": "City View",
"bedType": "King",
"isSmoking": false,
"accessibilityFeatures": "Roll-in shower"
},
"createdAt": 1709856000000,
"updatedAt": 1709856000000
}
Reservation Example​
{
"id": "rsv_abc123",
"reservationType": "TABLE",
"resourceId": "res_table5",
"customerId": "cust_def456",
"startTime": 1709920800000,
"endTime": 1709928000000,
"duration": 2,
"personsNumber": 4,
"status": "CONFIRMED",
"notes": "Birthday celebration, please prepare dessert",
"isResourceReservation": true,
"createdAt": 1709856000000,
"updatedAt": 1709856000000
}
Create / Update Schemas​
| Schema | Description | Omits |
|---|---|---|
CreateResourceSchema | For creating resources | id, createdAt, updatedAt, lastSyncAt, syncEnabled |
UpdateResourceSchema | For updating resources | All fields optional except id |
CreateReservationSchema | For creating reservations | id, createdAt, updatedAt, status, cancelReason, serviceConversationConfigId |
UpdateReservationSchema | For updating reservations | All fields optional except id |
UpdateReservationSettingsSchema | For updating settings | All fields optional except id |