Brokerage rows, commission calculation and data room sync
The data model of the brokerage row, the pure commission rules, the shared internal path for closing a row and how data room access is built from the contract.
A brokerage row (contract_property) is one property in a brokerage contract. Closing a row goes through a single internal endpoint (contract/contract.closerow); data room access is built by the syncContract() process of the data room access service.
Data model
Table names carry the installation's own prefix in the database.
| Field | Meaning |
|---|---|
property_id | the property from master data |
deal_type | summary kind: sale, rent, share_sale, sale_rent (for legacy readers) |
deal_cases | comma-separated cases: sale, share_sale, rent_long, rent_short; if empty, deal_type decides |
commission_rate, commission_share_rate, commission_months, commission_rent_rate | commission per case |
date_from, date_to | window of the brokerage right (NULL = contract term) |
state | active, closed, ended |
end_reason | sold_by_other, rented_by_other, withdrawn, expired, manual, terminated |
closed_case | the concluded case on closing; the completion certificate calculates from it |
ended_by_company_id, ended_by_name | who sold it |
date_ended, doc_share_id, note, sort_order | end date, offering folder, note, order |
On a legacy row a case with value 0 is not brokered and does not appear in the document.
Commission calculation
- sale, business share, short lease: fee = base × % (clamped to 0–100), rounded to two decimals;
- long lease: fee = net monthly rent × months;
- the fee is due in proportion to the instalments actually paid, so a completion certificate is issued per payment.
Closing a row
- Manual: the "Status of the property in this brokerage" modal (
contract/contract.propertyclose,editpermission) with a date. - From a deal: saving a deal that refers to an active, concluded underlying contract closes the row once with the deal's case.
- Both paths call the internal
closerowendpoint: on success every other active row of the property ends (sold_by_otherorrented_by_other), the brokers get a case-specific e-mail, and the data room access of every affected contract is refreshed. - From the property list, with
masterdata/property+brokerend, the active rows of all contracts can be ended.
The offering folder of an ended or closed row remains available until the end of the day before the end date.
Data room access from the contract
- The agent party's persons flagged
dataroombecome users if they are not yet; on an e-mail match the name match is checked too. - The broker functions of the data room (
view,download,broker,terminate) are granted for the contract term (user_feature,source = order,origin = contract,source_ref = contract_id,access_mode = usable). - The offering folders are granted for the row window (
doc_share_user.source = contract,source_ref = contract_property_id). - The contract's own rows that are no longer wanted end; manual rows are not touched.
- Timeline events:
access_granted,access_changed,access_revoked. The login e-mail is not sent automatically.
The group of new data room users comes from the extension setting "Data room – group of new users"; without it no user is created and the error says where to set it.
Permissions
The data room sync runs with contract/contract + grantaccess; without it the contract is saved but no access is created. Closing a row requires edit and content scope.