Reservation Info text

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

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:

  1. 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.

 

  1. 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.

 

  1. 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.

 

  1. 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

  1. Retrieve the reservation and its reserved resources

  2. Get customer status and other contextual information

  3. Create search filters for each reserved resource

  4. Find applicable InfoTexts for each search filter

  5. Compare with existing InfoTextReservation links

  6. Create an action manager with create/update/delete operations

  7. Execute those operations on the database

  8. 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.

Looking for labels? They can now be found in the details panel on the floating action bar.