Parties and Party Relationships
Parties are the central building block of the PRM module. Every business entity that Raytio needs to know about — whether it is a company, a person, or a logical grouping — is stored as a party in the prm_parties view. The prm_party_relationships view then captures how those parties relate to each other.
Party types
Each party has a party_type that determines what kind of entity it represents:
| Type | Meaning | Example |
|---|---|---|
| ORGANIZATION | A legal entity such as a company or government body | Acme Corp, Ministry of Health |
| INDIVIDUAL | A natural person | Jane Smith, John Doe |
| GROUP | A logical collection of parties that is not a legal entity | "APAC Partners", "Gold Tier Vendors" |
The party type is set at creation and determines which attributes are meaningful. For example, an INDIVIDUAL party may carry personal name fields, while an ORGANIZATION party uses a legal name.
What a party record contains
A party record stores identity and lifecycle information:
- Name and description — the human-readable identity of the party
- Party type — ORGANIZATION, INDIVIDUAL, or GROUP
- Active flag — whether the party is currently active (soft delete)
- Start and end dates — optional validity period, useful for modelling relationships that are time-bounded (e.g. a contractor engaged for a fixed term)
- Audit columns — created_by, created_date, updated_by, updated_date, owned_by
Party relationships
The prm_party_relationships view models directed relationships between two parties. Each relationship has:
- from_party_id — the source party
- to_party_id — the target party
- relationship_type — a typed value describing the nature of the relationship
Because relationships are directed, "A is a subsidiary of B" and "B is a parent of A" are two distinct perspectives of the same real-world relationship. This directed-graph approach gives the model maximum flexibility — any kind of inter-entity relationship can be captured.
Common relationship patterns
The relationship_type field supports any value, but typical patterns include:
- Parent / Subsidiary — corporate ownership structures
- Partner — business partnerships and alliances
- Employer / Employee — linking an INDIVIDUAL party to an ORGANIZATION
- Member — group membership when a party belongs to a GROUP
Directionality matters
Because the relationship is directional (from → to), querying "all parties related to X" requires checking both directions. The model stores one row per direction — if both sides of a reciprocal relationship need to be visible, two rows are stored (one for each direction).
Validity and lifecycle
Like all PRM entities, party relationships carry start and end dates and an active flag. This means relationships can be:
- Time-bounded — a partnership agreement that runs from 2024-01-01 to 2025-12-31
- Open-ended — an ownership relationship with no end date
- Deactivated — soft-deleted without removing the historical record
How parties connect to other PRM entities
A party is the anchor point for most other PRM entities:
- Party Sites link a party to one or more physical locations
- Party Contact Points store phone numbers, emails, and URLs for a party
- Party Countries associate a party with one or more countries
- Party Brands link a party to the brands it carries or represents