Overview
As a Trippins administrator, you have oversight of all reservations in the system. This includes viewing complete reservation details, modifying bookings, managing the valorated (review) status, and canceling reservations when necessary.Admin-level access is required to view and manage all reservations. Regular users can only see their own bookings.
Reservation Entity Structure
The Reservation entity manages the booking lifecycle from creation through checkout and review.Key Fields
Auto-generated unique identifier for the reservation
The reservation start date (guest arrival)
The reservation end date (guest departure)
Indicates whether the guest has left a review for this stay. Set to
false by default.Many-to-one relationship with the User entity representing the guest
Many-to-one relationship with the Housing entity representing the booked property
Admin Workflows
Viewing All Reservations
Administrators can retrieve a complete list of all reservations across the platform.Viewing a Specific Reservation
Retrieve detailed information about a single reservation by its ID.Returns
200 OK with the reservation details, or 404 Not Found if the reservation doesn’t existFiltering Unreviewed Reservations
Track which guests haven’t yet left reviews for their stays using thevalorated filter.
Creating a Reservation (Admin Override)
Administrators can create reservations on behalf of users, useful for phone bookings or special arrangements.Gather Required Information
Collect the client DNI, housing code, check-in date, and check-out date.
Modifying an Existing Reservation
Update reservation details such as dates, housing, or review status.Marking a Reservation as Reviewed
When a guest completes a review, update thevalorated flag to track completion.
This flag helps track engagement metrics and can trigger automated follow-up workflows
Canceling a Reservation
Remove a reservation from the system when canceled by the guest or admin.Returns
204 No Content on successful deletion. This operation is permanent.User-Specific Reservations
Viewing Reservations by Client
Retrieve all reservations for a specific user by their DNI.- Customer support inquiries
- Analyzing booking patterns
- Resolving disputes or issues
- Generating user activity reports
Reservation Lifecycle
Reservation Creation
Guest selects housing, check-in/check-out dates, and confirms booking.
valorated is set to false.Active Reservation
Guest checks in on the
check_in date. Reservation is active until check_out date.Data Initialization
The system includes a reservation initializer for development and testing:ReservationService.java
This method is called during application startup via
@PostConstruct or similar initialization hooksSecurity and Permissions
Admin-Only Access
Reservation management endpoints require theADMIN role:
SecurityConfiguration.java
JWT Authentication
All operations require a valid JWT token with admin privileges:API Reference
Reservation Management Endpoints
Retrieve all reservations in the systemSecurity: Requires
ADMIN roleResponse: 200 OK with array of ReservationDTO objectsGet a specific reservation by IDSecurity: Requires
ADMIN roleParameters:id(path) - Reservation ID (e.g., 1)
200 OK with ReservationDTO objectCreate a new reservationSecurity: Requires
ADMIN roleBody: ReservationDTO object (ID is auto-generated)Response: 201 Created with created ReservationDTOUpdate an existing reservationSecurity: Requires
ADMIN roleParameters:id(path) - Reservation ID to update
200 OK with updated ReservationDTOCancel and delete a reservationSecurity: Requires
ADMIN roleParameters:id(path) - Reservation ID to delete
204 No ContentBest Practices
Validate Date Ranges
Validate Date Ranges
Always ensure
check_out is after check_in. Implement validation logic to prevent invalid date ranges.Check Housing Availability
Check Housing Availability
Before creating or modifying reservations, verify the housing is available for the requested dates.
Track Valorated Status
Track Valorated Status
Monitor the
valorated flag to identify guests who haven’t left reviews. Use this for engagement campaigns.Maintain Data Integrity
Maintain Data Integrity
When deleting a reservation, consider the impact on reviews and payment records. Archive instead of delete when possible.
Audit Trail
Audit Trail
Log all admin modifications to reservations for accountability and dispute resolution.
Troubleshooting
404 Not Found for Reservation
404 Not Found for Reservation
Cause: The reservation ID doesn’t exist in the databaseSolution: Verify the ID is correct using the GET all reservations endpoint
Invalid Client DNI or Housing Code
Invalid Client DNI or Housing Code
Cause: Referenced client or housing doesn’t existSolution: Ensure the
clientDni and housingCode correspond to existing User and Housing recordsCannot Update Valorated Status
Cannot Update Valorated Status
Cause: Review hasn’t been submitted yetSolution: Only set
valorated = true after the corresponding review is created in the Review entityDate Format Errors
Date Format Errors
Cause: Incorrect date format in API requestsSolution: Use ISO 8601 date format:
YYYY-MM-DD (e.g., “2026-03-19”)Reporting and Analytics
Key Metrics to Track
Total Reservations
Monitor overall booking volume
Pending Reviews
Track reservations with
valorated = falseAverage Stay Duration
Calculate
check_out - check_in across bookingsTop Properties
Identify housing with most reservations
