Hotel Object
The Hotel object is the root structure that contains all hotel information, rooms, and reservations.The name of the hotel (e.g., “Hotel Keepcoding”)
Array of Room objects representing all rooms in the hotel
Array of active Reservation objects (confirmed or checked-in status)
Array of completed Reservation objects (checked-out or cancelled status)
Example Hotel Object
The
reservations array contains only active reservations, while history stores all past reservations for reporting and guest history.Room Object
Each room in the hotel has a specific structure that defines its type, pricing, status, and features.Unique room number identifier (e.g., 101, 201, 302)
Room type:
"single", "double", or "suite"Price per night in euros based on room type:
- Single: €50
- Double: €80
- Suite: €150
Current room status:
"available", "occupied", or "maintenance"Array of strings listing room amenities (e.g.,
["wifi", "tv", "minibar"])Real Examples from rooms.json
Single Room (Room 101)
Single Room (Room 101)
Double Room (Room 201)
Double Room (Room 201)
Suite (Room 301)
Suite (Room 301)
Room Types
The system supports three room types, each with different pricing and features:| Type | Price per Night | Common Features |
|---|---|---|
| Single | €50 | wifi, tv |
| Double | €80 | wifi, tv, minibar |
| Suite | €150 | wifi, tv, minibar, jacuzzi |
Reservation Object
Reservations track guest bookings, including guest information, dates, pricing, and extras.Unique reservation identifier (e.g., “RES-001”)
The room number assigned to this reservation
Guest information object containing:
name: Full name of the guestemail: Email address (validated with regex)phone: Phone number in format “+34 612345678” (validated with regex)dni: Spanish ID in format “12345678A” (validated with regex)
Check-in date in ISO format (YYYY-MM-DD)
Check-out date in ISO format (YYYY-MM-DD)
Number of nights (automatically calculated from check-in and check-out dates)
Total price in euros, including base room cost and extras
Reservation status:
"confirmed", "checked-in", "checked-out", or "cancelled"Array of extra services. Each extra has:
name: Service name (e.g., “Breakfast”, “Parking”)price: Price per unit in eurosquantity: Number of units
Real Examples from reservations.json
Reservation with Multiple Extras (RES-001)
Reservation with Multiple Extras (RES-001)
Reservation with Late Checkout (RES-003)
Reservation with Late Checkout (RES-003)
Reservation without Extras (RES-004)
Reservation without Extras (RES-004)
Guest Object Structure
The guest object within each reservation contains validated personal information:Full name of the guest
Email address (must match pattern:
^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$)Phone number (must match pattern:
^(\+?\d{1,3})?[\s.-]?\d{9}$)Spanish ID number (must match pattern:
^\d{1,8}[A-Za-z]$)Extras Array Structure
Each item in theextras array represents an additional service:
The
totalPrice field in the reservation includes both the base room cost (nights × pricePerNight) and all extras (sum of price × quantity for each extra).