The remove-from-brokerage endpoint and its effects

Parameters and permissions of the brokerend endpoint, the contract model's closing method with filtering by reason, the data room sync, notifying brokers and logging.

The masterdata/property.brokerend endpoint (permission masterdata/property + brokerend, BASE) closes the active brokerage rows of all contracts from the property list through the contract model's public method; the property itself has no separate brokerage state field.

Process

Table names carry the installation's own prefix in the database.

  1. POST: property_id, reason (sold_by_other, rented_by_other, withdrawn), date. Without permission error_permission; unknown property: error_warning. With an invalid date the model uses today.
  2. contract/contract::endPropertyBrokerages() closes the active contract_property rows (state = 'ended', end_reason, date_ended): for a sale or withdrawal every active row, for a letting only rows with deal_type = 'rent' (a sale_rent row remains). If there was no such row: "This property has no active brokerage of the chosen kind."
  3. For every affected contract Dlbtroomaccess::syncContract(): the folder is not visible from the end date.
  4. Dlbtroomaccess::notifyEnded(): a system message to the brokers (template event room_property_withdrawn); mail errors are returned in warning.
  5. Log: a dlbtlog info entry. Success: the number of closed rows and contracts and the number of messages sent.

Interface

In the list's ⋮ menu the item appears only with brokerend and an active brokerage row (countActiveBrokerages() above zero). The modal (#modal-bkend, modal-fullscreen-md-down) offers button-style reasons and a date field (min 1900-01-01, max 9999-12-31); focus goes to the date.

Relation to the contract

The contract-side shared close (closerow) handles a deal concluded through the broker; the property-side removal handles sale or letting by a third party and withdrawal. Both use the same contract_property state and data room sync.