Parties and persons – data model and rules
How the persons of contracting parties are stored, the role limits per contract type, how contact details are resolved and how data room access is created.
Overview
Every party of a contract (client company, main partner, further parties) has person rows. A row links one person to the party with a role, a contact flag, a data room flag, the phone and e-mail reference used in this contract, and a sort order. The rows are written when the contract is saved, from the persons of the party's company.
Data model
Table names carry the installation's own prefix in the database.
| Table | Purpose | Main fields |
|---|---|---|
contract_person | one person of a contract party | role, is_contact, dataroom, contact_phone_ref, contact_email_ref, sort order |
person_company | person–company link, per company | position, is_signatory, contact_phone_ref, contact_email_ref |
person_object | the person's contact details | type (phone, e-mail, address), is_primary – one default per type |
person | the person master record | language_id – notification language, 0 = store default |
The reference fields point to the person_object identifier; 0 means the person's default contact detail. A person can belong to several companies, each with its own position, signing authority and contact details.
Roles per contract type
The available roles depend on the contract's main type and subtype; the contract model's getPersonRoles() method returns the list with the maximum per party and the expected flag.
| Scope | Role codes |
|---|---|
| every type | signatory, attorney – shown as signatories in the document |
| default | + contact, unlimited |
| real estate brokerage | + contact, at most 1 per party, expected |
| construction supervision | + contact, technical_contact, site_supervisor |
| works contract (all subtypes) | + contact, technical_contact, site_supervisor, site_manager (at most 1) |
| legacy codes | representative (equivalent to signatory), administrator, other – can be saved, not offered for new rows |
Saving rules
- Permission:
addfor a new contract,editfor an existing one; the party's company must be in the user's content scope. - Too many persons with one role per party: error, nothing is saved; the message appears below the row and in the top alert.
- A role of another contract type: error ("The role … cannot be chosen for this contract type.").
- A missing expected role: warning, the contract is saved.
- A signatory without signing authority in the
person_companyrow: warning. - Success is reported only for a contract that was read back; the person rows are written afterwards.
Contact detail resolution
For a new row the contract takes the phone and e-mail marked for the company in person_company; if that is 0, the person's default of that type. A reference changed on the contract applies to this contract only. Document generation and e-mails read the contract row.
How data room access is created
The dataroom flag is effective only on the agent's side of a real estate brokerage contract. After saving – if the user holds the contract's grantaccess permission – the central access service links a data room user to the marked person (creating it from the person if needed), grants folder access for the term of the contract and sends an activation e-mail through the central sending path of the Mail module, in the person's notification language. Clearing the flag revokes the access granted by the contract.
Permissions
- Layer 1: the base access and modify permission of the contract route.
- Layer 2: the contract's
add,editand – for the data room flag –grantaccessfunction permissions. - Layer 3: content scope – only contracts and companies within the user's permitted companies can be edited.