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.
- POST:
property_id,reason(sold_by_other,rented_by_other,withdrawn),date. Without permissionerror_permission; unknown property:error_warning. With an invalid date the model uses today. contract/contract::endPropertyBrokerages()closes the activecontract_propertyrows (state = 'ended',end_reason,date_ended): for a sale or withdrawal every active row, for a letting only rows withdeal_type = 'rent'(asale_rentrow remains). If there was no such row: "This property has no active brokerage of the chosen kind."- For every affected contract
Dlbtroomaccess::syncContract(): the folder is not visible from the end date. Dlbtroomaccess::notifyEnded(): a system message to the brokers (template eventroom_property_withdrawn); mail errors are returned inwarning.- Log: a
dlbtloginfo 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.