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.

TablePurposeMain fields
contract_personone person of a contract partyrole, is_contact, dataroom, contact_phone_ref, contact_email_ref, sort order
person_companyperson–company link, per companyposition, is_signatory, contact_phone_ref, contact_email_ref
person_objectthe person's contact detailstype (phone, e-mail, address), is_primary – one default per type
personthe person master recordlanguage_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.

ScopeRole codes
every typesignatory, 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 codesrepresentative (equivalent to signatory), administrator, other – can be saved, not offered for new rows

Saving rules

  1. Permission: add for a new contract, edit for an existing one; the party's company must be in the user's content scope.
  2. Too many persons with one role per party: error, nothing is saved; the message appears below the row and in the top alert.
  3. A role of another contract type: error ("The role … cannot be chosen for this contract type.").
  4. A missing expected role: warning, the contract is saved.
  5. A signatory without signing authority in the person_company row: warning.
  6. 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, edit and – for the data room flag – grantaccess function permissions.
  • Layer 3: content scope – only contracts and companies within the user's permitted companies can be edited.