Party Relationship Schema
Felder
Party Relationship Schema
Schema for modeling labeled edges between PERSON and ORGANIZATION parties
personPartyId
ID of the PERSON party
organizationPartyId
ID of the ORGANIZATION party
function
Function/role at this organization (e.g. IT-Leiter, Geschäftsführer)
functionRoles
Structured function/role slugs from FUNCTION_ROLES taxonomy. Enables recipient-resolver for campaigns (e.g. "IT_LEAD", "MANAGING_DIRECTOR"). Free-text "function" field remains for descriptive context.
functionRoleCustom
Free-text role description used when functionRoles contains "OTHER".
marketingConsent
DSGVO/§7 UWG marketing consent on the contact-relationship level. Required for newsletter and sales-outreach campaigns.
status
NONEGRANTEDREVOKEDgrantedAt
grantedBy
User ID who recorded the consent
source
MANUALDOUBLE_OPT_INCONTRACTIMPORTFORMlegalBasis
CONSENTLEGITIMATE_INTERESTEXISTING_CUSTOMERnotes
Free-text documentation (e.g. "Verbally confirmed on 2026-04-17 call")
revokedAt
revokedReason
channels
categories
email
Organization-specific email address
phoneLandline
Organization-specific landline phone number
phoneMobile
Organization-specific mobile phone number
isPrimary
Whether this is the primary organization for this person
isEmergencyContact
Whether this person is an emergency contact for the organization
isActive
Whether this contact relationship is still active. Set to false when the person has left the organization ("ausgetreten"): the contact is greyed out with an "inactive" badge in the CRM and is no longer offered in contact pickers, so it cannot be linked to new tickets/activities. Existing links are untouched. Runtime fallback: a missing field counts as active (isActive !== false) — no backfill needed for pre-existing relationships.
emergencyPhone
Emergency phone number
roleSlug
Role slug determining permissions for this person at this organization
shopRoleId
Optional FK to shop_roles. Determines which customer-portal capabilities and product visibility this person has at this organization.
notes
Free-text notes about this relationship
noteSeverity
Traffic-light importance of the contact note (`notes`). NONE = neutral grey italic (default, matches the rendering before this field existed), GREEN = uncritical, YELLOW = attention, RED = important. Drives the colour of the note on the contact card and in the "important contacts" hero cards. Runtime fallback: a missing or null field counts as NONE — no backfill needed for pre-existing relationships.
NONEGREENYELLOWREDnoteValidFrom
Optional start of the contact note's validity window (YYYY-MM-DD, inclusive — same semantics as party.notices[].validFrom). Before this date the note is hidden on the contact card and the "important contacts" hero cards; the edit dialogs always show it. Missing/null = valid immediately — no backfill needed for pre-existing relationships.
noteValidUntil
Optional end of the contact note's validity window (YYYY-MM-DD, inclusive). After this date the note disappears from the display surfaces automatically without anyone having to clear it (e.g. "on parental leave until …"). Missing/null = valid indefinitely — no backfill needed.
invitationOnly
True when this relationship was created solely as part of a portal-invite flow and the user never accepted. Used by the revoke handler to soft-delete the stub when the pending invitation gets cancelled, so cancelled invites do not leave orphan CRM contacts in the Portal-Zugänge list.
customerOrgUnitId
FK to a customer_org_unit. Only valid when organizationPartyId references a customer ORGANIZATION party — the referenced OU must have customerOrgUnit.customerPartyId === organizationPartyId. Used by the customer org chart and the CUSTOMER_OU_HEAD approver-DSL node (ADR 0130a).
workAddressId
Site the contact actually works at: the `_id` of an entry in the ORGANIZATION party's `addresses[]` (same id space as `ticket.partyAddressId`). Independent of `workLocationMode` — a contact can be assigned to "Niederlassung Berlin" and still work HOME_OFFICE most of the time. Runtime fallback: missing/null = unknown site, the contact card simply shows no site chip — no backfill needed.
workLocationMode
Where the contact primarily works: ON_SITE (at `workAddressId`), HOME_OFFICE (predominantly from home), HYBRID (split between site and home), REMOTE (mobile / no fixed site). Runtime fallback: missing/null = no statement made — no backfill needed.
ON_SITEHOME_OFFICEHYBRIDREMOTEnullreportsToPersonPartyId
PERSON party-id of the disciplinary manager inside the same customer organization. The referenced person must have an active party_relationship with the same organizationPartyId. Used by the CUSTOMER_MANAGER approver-DSL node (ADR 0130a). Self-reference is rejected; cycles are detected at resolve time, not on write.
Keine Felder passen zum Filter.
Standard-Endpoints
Diese Resource folgt dem generischen CRUD-Vertrag der Plattform. Lesen Sie die Konventionen für Pagination, Idempotenz, Optimistic Locking und Audit. Die wichtigsten Endpoints:
GET /api/v1/party_relationships— Liste, paginiert + filterbarGET /api/v1/party_relationships/<id>— Einzelne EntityPOST /api/v1/party_relationships— AnlegenPATCH /api/v1/party_relationships/<id>— Teil-UpdateDELETE /api/v1/party_relationships/<id>— Soft-DeleteGET /api/v1/party_relationships/<id>/timeline— Audit + Aktivitäten