"Digital Core" is to be the name of a canonical data product the domain will run, so the domain itself is Digital: its title, description and owner address in domain.md, the back-link heading of every entity, enum and product file, and the README, CLAUDE.md, Copilot instructions and package description. A breaking change by MD-DDL's test: a product generated from 1.0.0, such as Canonical Party, names its domain, and would come out different now. So version 2.0.0. v1.0.0 is tagged on the commit Canonical Party was generated from, which was never tagged. Lint: no findings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
147 lines
4.8 KiB
Markdown
147 lines
4.8 KiB
Markdown
# [Digital](../domain.md)
|
|
|
|
## Entities
|
|
|
|
### Party
|
|
|
|
A Party is any individual or organisation the business has, or may have, a relationship with. It is the foundational abstract concept of the domain — it carries only what is true of *every* party, whoever they are.
|
|
|
|
A Party does not do anything directly. It acts through a Party Role: the same Party can be a Customer on one product, a Merchant taking payments, and the Payer on somebody else's bill, all at once. Keeping identity separate from role is what stops a model from sprouting a new "customer" table every time the business finds a new way to deal with people.
|
|
|
|
Specialisations of Party — Person and Company — carry the attributes specific to a human being or an organisation.
|
|
|
|
```mermaid
|
|
---
|
|
config:
|
|
layout: elk
|
|
---
|
|
classDiagram
|
|
class Party{
|
|
<<abstract>>
|
|
* Party Identifier : string
|
|
Legal Name : string
|
|
Also Known As : string
|
|
Party Status : enum~PartyStatus~
|
|
}
|
|
|
|
class Person
|
|
|
|
class Company{
|
|
}
|
|
|
|
Person --|> Party
|
|
Company --|> Party
|
|
Party "1" --> "0..*" PartyRole
|
|
Party "1" --> "0..*" ContactAddress
|
|
|
|
class PartyStatus["<a href='../enums.md#party-status'>Party Status</a>"]{<<enumeration>>}
|
|
|
|
class Person["<a href='./person.md'>Person</a>"]
|
|
class Company["<a href='./company.md'>Company</a>"]
|
|
class PartyRole["<a href='./party_role.md'>Party Role</a>"]
|
|
class ContactAddress["<a href='./contact_address.md'>Contact Address</a>"]
|
|
```
|
|
|
|
```yaml
|
|
existence: independent
|
|
mutability: slowly_changing
|
|
temporal:
|
|
tracking: bitemporal
|
|
description: >
|
|
Valid time captures when the party information was true in the real world — a name change takes effect on the day it happened, not the day it was typed in. Transaction time captures when the business recorded it. Both are needed to answer "what did we believe about this party at the time we acted?", which is the question every audit and every dispute eventually asks.
|
|
attributes:
|
|
Party Identifier:
|
|
type: string
|
|
identifier: primary
|
|
description: >
|
|
Globally unique identifier for this party across all systems. Immutable once assigned.
|
|
|
|
Legal Name:
|
|
type: string
|
|
pii: true
|
|
description: >
|
|
The party's full name as it appears on official documentation. For an individual this is the full given and family name; for an organisation it is the registered name.
|
|
|
|
Also Known As:
|
|
type: string
|
|
pii: true
|
|
description: >
|
|
Alternative names: trading names, former names, maiden names, or the name a person actually goes by. People and businesses accumulate names, and searching only the legal one finds nobody. Several names are held in the one field, separated by semicolons, rather than as a repeating attribute — see the type mapping note in template/README.md.
|
|
|
|
Party Status:
|
|
type: enum:Party Status
|
|
description: >
|
|
Where the party sits in its lifecycle with the business. Controls whether new relationships may be established.
|
|
```
|
|
|
|
```yaml
|
|
constraints:
|
|
Legal Name Required:
|
|
not_null: Legal Name
|
|
description: >
|
|
Every party must have a name. A party record with no name cannot be matched, contacted, or reconciled against anything.
|
|
```
|
|
|
|
```yaml
|
|
governance:
|
|
pii: true
|
|
classification: Confidential
|
|
retention: 7 years
|
|
retention_basis: Domain default
|
|
description: >
|
|
Party records are retained for seven years after the relationship ends, then deleted. Party is the anchor for personal data in this domain — a deletion request resolves to a Party Identifier and cascades from here.
|
|
access_role:
|
|
- CUSTOMER_SERVICE
|
|
- DATA_ANALYST
|
|
- PRIVACY_OFFICER
|
|
```
|
|
|
|
## Relationships
|
|
|
|
### Party Assumes Roles
|
|
|
|
A Party can assume one or more Party Roles across different business contexts.
|
|
|
|
```yaml
|
|
source: Party
|
|
type: has
|
|
target: Party Role
|
|
cardinality: one-to-many
|
|
granularity: atomic
|
|
ownership: Party
|
|
```
|
|
|
|
### Party Has Contact Addresses
|
|
|
|
A Party can have one or more contact addresses for different purposes.
|
|
|
|
```yaml
|
|
source: Party
|
|
type: has
|
|
target: Contact Address
|
|
cardinality: one-to-many
|
|
granularity: atomic
|
|
ownership: Party
|
|
```
|
|
|
|
### Party Related To Party
|
|
|
|
A Party may be related to other Parties through ownership, control, employment, household or family ties. This self-referential relationship is what turns a list of parties into a graph — it answers "who owns this company", "who else lives at this address", "which accounts belong to this household".
|
|
|
|
A relationship instance is directional and named: "Director of", "Parent Organisation of", "Partner of". The same pair of parties may hold several associations of different types at once.
|
|
|
|
```yaml
|
|
source: Party
|
|
type: related_to
|
|
target: Party
|
|
cardinality: many-to-many
|
|
granularity: atomic
|
|
ownership: Party
|
|
self_referential: true
|
|
relationship_attributes:
|
|
- Association Type (enum:Association Type)
|
|
- Association Start Date
|
|
- Association End Date
|
|
- Verified
|
|
```
|