Reservation Info text
API Documentation:
POST /api/v1/infotexts/links/reservations
Introduction
This endpoint is used to link or update valid info text based on configuration for complete Reservation. Considering, for requested show moment.
Reservation level
Accommodation type level
Add-on level
Offer level
Overview
This endpoint creates associations between InfoTexts and reservations. It handles the mapping between InfoTexts and reservation details, managing which InfoTexts should be displayed at different reservation show moments.
Request
Endpoint
POST /api/v1/infotexts/links/reservations
Request Body
{
"reservationId": 12345,
"showMomentId": 1,
"locale": "en"
}
Request Parameters
Parameter | Type | Required | Description |
---|---|---|---|
reservationId | Long | Yes | ID of the reservation to link InfoTexts to |
showMomentId | Long | Yes | ID representing when the InfoTexts should be displayed |
locale | String | No | Language code for InfoText localization |
Response
Success Response (200 OK)
{
"infoTexts": [
{
"infoTextId": 101,
"title": "Check-in Instructions",
"content": "Please check in at the reception desk...",
"infoTextType": "INFORMATION"
},
{
"infoTextId": 102,
"title": "Resort Amenities",
"content": "Our resort offers the following amenities...",
"infoTextType": "INFORMATION"
}
]
}
Implementation Details
The endpoint performs several operations:
Retrieves reservation details - Fetches the reservation and its associated reserved resources.
We need all the resources added to the reservation so that we can collect information on how they were added, such as subjects, offers, add-ons, etc.
Applies business rules - Determines which InfoTexts are applicable for the given reservation based on:
Reservation dates and stay period and booking date
Customer status
Reserved resource types ( like accommodation type, add-ons, offers, compositions)
Location/resort data
Show moment context.
Manages InfoTextReservation links - Creates, updates, and deletes associations between InfoTexts and reservations:
Creates new links for applicable InfoTexts
Updates existing links (e.g., changing display status)
Removes links are no longer applicable.
Returns filtered InfoTexts - Returns only the InfoTexts that should be displayed for the given show moment
Key Services and Their Roles
InfoTextSearchService
Finds applicable InfoTexts based on search criteria
Manages InfoTextReservation links (create/update/delete)
Provides query methods to retrieve existing InfoTextReservation links
ReservationDataService
Retrieves reservation details and reserved resources
Gets customer status information
Provides data about parent/child relationships between reserved resources
InfoTextReservationActionManager
Tracks changes needed to InfoTextReservation links
Maintains separate lists for create, update, and delete operations
Business Logic Flow
Retrieve the reservation and its reserved resources
Get customer status and other contextual information
Create search filters for each reserved resource
Find applicable InfoTexts for each search filter
Compare with existing InfoTextReservation links
Create an action manager with create/update/delete operations
Execute those operations on the database
Return the InfoTexts that should be displayed
This endpoint ensures that the correct InfoTexts are associated with reservations and displayed at the appropriate moments during the reservation lifecycle.