CONNECTIVITY API

Disconnect Property Channel Manager API

Technical documentation for the method that disconnects a property from Channel Manager by removing connectivity preferences and the first related connectivity history entry.

Description

This endpoint receives a SendDTO payload, checks whether a property ID is provided, and disconnects the property from Channel Manager by removing its connectivity preferences and deleting the first connectivity history entry found for that property.

Endpoint

POST /diconnectPropertyChannelManager

Request

Content-Type: application/json

Authorization: Bearer <token>

Field Type Description
Id Long Property identifier
Request Body Example
{
  "id": 123
}

Processing Flow

  • Read id from the SendDTO request body.
  • If id is null, return false immediately.
  • Load the Property entity from the database using propertyRepository.findById(...).orElse(null).
  • If the property exists, load its connectivity preferences list.
  • Iterate through each ConnectivityPreferences record linked to the property.
  • Detach each preference from the property, remove it from the collection, and delete it from the database.
  • Load connectivity history records using connectivityHistoryRepository.findByPropertyId(id).
  • If history entries exist, delete only the first record from the list.
  • Return true when an id is provided, even if no property was found.

Example Response

true

Business Result

The property itself is not deleted. The endpoint only clears the connectivity relationship data that is associated with Channel Manager for the given property.

Notes

  • This endpoint returns a successful response whenever the request contains a valid identifier, meaning the response does not guarantee that any data has actually been removed.
  • Only the first connectivity history record is deleted. If multiple history entries exist, the remaining records are not affected and will continue to exist in the database.
  • If the specified property does not exist, the endpoint may still return a successful response because the identifier validation is considered sufficient.
  • Using a transactional approach for this operation would improve reliability and make the deletion process safer and easier to maintain.
  • For better clarity and readability, a more descriptive endpoint name is recommended, such as disconnectPropertyFromChannelManager.