"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>
5.3 KiB
Digital
Entities
Party Role
A Party Role is the capacity in which a Party acts. It separates who someone is from what they are doing — the single most useful distinction in the whole model.
The same person may be a Customer on a subscription, the Payer on a family member's bill, and a Service Agent employed by the business, all at the same time. Model those as three roles against one Party and the business can answer "how many customers do we have" and "is this the same human being" as separate questions, which they are.
Party Role is abstract and is never instantiated directly. Every role is one of its specialisations: Customer, Merchant, Payer, Payee, Service Agent, Payment Initiator.
---
config:
layout: elk
---
classDiagram
class PartyRole{
<<abstract>>
* Role Identifier : string
Role Status : enum~PartyRoleStatus~
Role Start Date : date
Role End Date : date
}
class Customer
class Merchant
class Payee
class Payer
class ServiceAgent
class PaymentInitiator
Customer --|> PartyRole
Merchant --|> PartyRole
Payee --|> PartyRole
Payer --|> PartyRole
ServiceAgent --|> PartyRole
PaymentInitiator --|> PartyRole
PartyRole "1" <-- "0..*" Party : assumes
PartyRole "0..*" --> "0..*" ContactAddress : uses
PartyRole "0..*" --> "0..1" Agreement : governed by
class PartyRoleStatus["<a href='../enums.md#party-role-status'>Party Role Status</a>"]{<<enumeration>>}
class Customer["<a href='./customer.md'>Customer</a>"]
class Merchant["<a href='./merchant.md'>Merchant</a>"]
class Payee["<a href='./payee.md'>Payee</a>"]
class Payer["<a href='./payer.md'>Payer</a>"]
class ServiceAgent["<a href='./service-agent.md'>Service Agent</a>"]
class PaymentInitiator["<a href='./payment_initiator.md'>Payment Initiator</a>"]
class Party["<a href='./party.md'>Party</a>"]
class ContactAddress["<a href='./contact_address.md'>Contact Address</a>"]
class Agreement["<a href='./agreement.md'>Agreement</a>"]
existence: independent
mutability: slowly_changing
temporal:
tracking: bitemporal
description: >
Bitemporal tracking captures both when the role was actually in effect (valid time, via Role Start Date and Role End Date) and when the business knew about it (transaction time). This supports point-in-time questions such as "was this party a customer when that order was placed?" while still allowing corrections that arrive late to be recorded without rewriting history.
attributes:
Role Identifier:
type: string
identifier: primary
description: >
Globally unique identifier for this role instance. Distinct from the Party Identifier — one party holding two roles has two Role Identifiers.
Role Status:
type: enum:Party Role Status
description: >
The current lifecycle status of this role. Controls whether the role confers its business permissions.
Role Start Date:
type: date
description: >
The date this role became effective.
Role End Date:
type: date
description: >
The date this role ceased to be effective. Null means the role is still open. Roles are closed rather than deleted, so that history stays intact.
constraints:
Role End After Start:
check: "Role End Date IS NULL OR Role End Date > Role Start Date"
description: >
A role's end date must be later than its start date. A null end date indicates the role is currently open.
Closed Role Requires End Date:
check: >
Role Status != 'Closed'
OR Role End Date IS NOT NULL
description: >
A role with a status of Closed must have a Role End Date recorded, so the valid time period is always closed correctly.
governance:
pii: false
classification: Internal
retention: 7 years
retention_basis: Domain default
description: >
Role records carry no personal data themselves — they point at a Party, which does. Roles must never be deleted; closing them with an end date is the only permitted termination, because a deleted role silently rewrites what the business was entitled to do at a past moment.
access_role:
- CUSTOMER_SERVICE
- DATA_ANALYST
Relationships
Party Role Uses Contact Addresses
A Party Role may use one or more Contact Addresses owned by the underlying Party. The Party owns its addresses; a role picks which of them applies in its context.
source: Party Role
type: associates_with
target: Contact Address
cardinality: many-to-many
granularity: atomic
ownership: Party Role
Party Role Governed By Agreement
A Party Role may be governed by a specific Agreement that sets out its obligations and permissions.
source: Party Role
type: references
target: Agreement
cardinality: many-to-one
granularity: atomic
ownership: Party Role
Party Role At Point In Time
Captures the state of a Party Role as it stood on a given date. Reporting usually needs the state as at the end of a period rather than the state right now — how many active customers did we have on 30 June, not how many do we have today.
Party Role is declared bitemporal; this period-granularity relationship makes the snapshot pattern explicit so that generated physical models can materialise it.
source: Party Role
type: snapshots
target: Party Role
cardinality: one-to-one
granularity: period
ownership: Party Role
self_referential: true