Add the Digital Core domain model from semprini-blog-dataproducts

The MD-DDL model (domain, entities, enums, the Canonical Party product
declaration) moves into its own repository, owned by the domain's modelling
team. Engineering teams consume its product declarations and generate products
from semprini-data-product-templates.

Adds the MD-DDL agent wrappers (md-ddl init), pyproject with md-ddl, and
README/CLAUDE.md describing the team split and the handoff interface.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
paulandClaude Opus 5 committed 2026-09-17 22:51:50 +12:00
commit aeba56e5f2
41 files changed
+3007

No files matched your search

+144
View File
@@ -0,0 +1,144 @@
# [Digital Core](../domain.md)
## Entities
### Account
An Account is the running record of what a Customer holds and owes. Balances live here and transactions move them.
Account is where a lot of businesses accidentally encode their product catalogue into a status column. Keeping the account generic and pushing the specifics onto Product and Agreement is what lets a new offering launch without a schema change.
```mermaid
---
config:
layout: elk
---
classDiagram
class Account{
* Account Identifier : string
Account Number : string
Account Type : enum~AccountType~
Account Status : enum~AccountStatus~
Opened Date : date
Closed Date : date
}
Customer "0..*" --> "0..*" Account : holds
Account "0..*" --> "1" Product : instance of
Account "0..*" --> "1" Currency : denominated in
ServiceLocation "1" --> "0..*" Account : serves
class AccountType["<a href='../enums.md#account-type'>Account Type</a>"]{<<enumeration>>}
class AccountStatus["<a href='../enums.md#account-status'>Account Status</a>"]{<<enumeration>>}
class Customer["<a href='./customer.md'>Customer</a>"]
class Product["<a href='./product.md'>Product</a>"]
class Currency["<a href='./currency.md'>Currency</a>"]
class ServiceLocation["<a href='./service-location.md'>Service Location</a>"]
```
```yaml
existence: independent
mutability: slowly_changing
temporal:
tracking: valid_time
description: >
Account status moves back and forth — Active to Suspended and back again — and the
dates of those moves matter. Valid time tracking supports questions like "was this
account suspended when that charge was applied?". Opened Date and Closed Date are the
outer boundaries of the account's life.
attributes:
Account Identifier:
type: string
identifier: primary
description: >
Globally unique identifier for this account. Immutable once assigned.
Account Number:
type: string
description: >
The account number as shown to the customer. Distinct from the identifier: this one
appears on statements and can change if the account is renumbered during a migration.
Account Type:
type: enum:Account Type
description: >
What the account is for — billing, subscription, prepaid, wallet and so on. Different
types behave differently: a prepaid account cannot go negative, a credit account can.
Account Status:
type: enum:Account Status
description: >
Current operational state. Suspension and closure are recorded with their effective
dates so that history can be reconstructed.
Opened Date:
type: date
description: >
Date the account was opened. Starts the account's valid time period and feeds
dormancy and tenure calculations.
Closed Date:
type: date
description: >
Date the account was permanently closed. Null means still open. Accounts are closed,
never deleted — a deleted account orphans every transaction that referenced it.
```
```yaml
constraints:
Closed Account Requires Closed Date:
check: >
Account Status != 'Closed'
OR Closed Date IS NOT NULL
description: >
An account with status Closed must record when it closed.
Closed Date After Opened Date:
check: "Closed Date IS NULL OR Closed Date > Opened Date"
description: >
An account's closure date must be later than its opening date.
```
```yaml
governance:
pii: false
classification: Confidential
retention: 7 years
retention_basis: Domain default
description: >
An account is not personal data in itself, but balances and holdings are commercially
sensitive and readily identify a customer through the holder relationship. Retained
for seven years after closure to cover billing disputes and tax records.
access_role:
- CUSTOMER_SERVICE
- DATA_ANALYST
```
## Relationships
### Account Holds Product
An Account is an instance of one Product definition.
```yaml
source: Account
type: references
target: Product
cardinality: many-to-one
granularity: atomic
ownership: Account
```
### Account Denominated In Currency
An Account is denominated in exactly one Currency. All balances and amounts on the account are expressed in it.
```yaml
source: Account
type: references
target: Currency
cardinality: many-to-one
granularity: atomic
ownership: Account
```
+119
View File
@@ -0,0 +1,119 @@
# [Digital Core](../domain.md)
## Entities
### Address
An Address is the canonical record of a location. It holds the structured components of the place itself and nothing else — no party, no purpose, no verification. Those belong on Contact Address.
Separating the two enables deduplication: one Address record serves every party at that location. Two households at the same building share a row rather than two near-identical strings that differ by a comma. It also makes the address itself reference data, which can be cleansed, geocoded and corrected once instead of everywhere.
Address records are not owned by any party and must not be edited when someone moves. Moving is a change to the *association*: the party's Contact Address is closed and a new one opened pointing at a different Address.
```mermaid
---
config:
layout: elk
---
classDiagram
class Address{
* Address Identifier : string
Address Type : enum~AddressType~
Address Line 1 : string
Address Line 2 : string
Suburb : string
City : string
State Or Region : string
Postcode : string
Country : string
}
ContactAddress "0..*" --> "1" Address : references
class AddressType["<a href='../enums.md#address-type'>Address Type</a>"]{<<enumeration>>}
class ContactAddress["<a href='./contact_address.md'>Contact Address</a>"]
```
```yaml
existence: independent
mutability: reference
attributes:
Address Identifier:
type: string
identifier: primary
description: >
Globally unique identifier for this location. Immutable once assigned. Many parties may reference the same identifier through their Contact Address records.
Address Type:
type: enum:Address Type
description: >
The structural type of the address. Determines which components apply — a PO Box has no street, and an overseas address may have no state or region.
Address Line 1:
type: string
description: >
The primary street line, typically number and street name. For a PO Box, the box number.
Address Line 2:
type: string
description: >
Secondary line for a unit, level, suite or building name.
Suburb:
type: string
description: >
The suburb or locality. Kept distinct from City because in Australia and New Zealand they are genuinely different things and merging them breaks delivery.
City:
type: string
description: >
The city or town.
State Or Region:
type: string
description: >
The state, territory, province or region, or the local equivalent.
Postcode:
type: string
description: >
The postal code. Held as a string to preserve leading zeros and to support formats that are not numeric.
Country:
type: string
description: >
ISO 3166-1 alpha-2 country code. Mandatory for every address type.
```
```yaml
constraints:
Country Required:
not_null: Country
description: >
Every address must have a country. Without one, the rest of the fields cannot be interpreted — postcode formats and address ordering are country-specific.
Street Address Requires Address Line 1:
check: >
Address Type != 'Street Address'
OR Address Line 1 IS NOT NULL
description: >
A street address must have at least Address Line 1 populated.
```
```yaml
governance:
pii: false
classification: Internal
retention: 7 years
retention_basis: Domain default
description: >
An address on its own identifies a place, not a person, so it is not personal data — the link to a party is, and that lives on Contact Address. Address records are treated as immutable: a corrected or renamed street produces a new record, leaving historical Contact Address references pointing at what was true at the time.
access_role:
- CUSTOMER_SERVICE
- DATA_ANALYST
```
## Relationships
No relationships are sourced directly from Address in the current domain model.
+81
View File
@@ -0,0 +1,81 @@
# [Digital Core](../domain.md)
## Entities
### Agreement
An Agreement is the contract behind a relationship: the terms binding one or more Party Roles to a Product.
It is the answer to "what did we actually promise?". Keeping it as a first-class entity rather than a few columns on Account means the terms can outlive any individual account and be pointed at from several places.
```mermaid
---
config:
layout: elk
---
classDiagram
class Agreement{
* Agreement Identifier : string
Agreement Number : string
Agreement Status : enum~AgreementStatus~
Effective Date : date
Maturity Date : date
}
PurchaseAgreement --|> Agreement
SubscriptionAgreement --|> Agreement
Agreement "1" --> "0..*" PartyRole : governs
class AgreementStatus["<a href='../enums.md#agreement-status'>Agreement Status</a>"]{<<enumeration>>}
class PurchaseAgreement["<a href='./purchase-agreement.md'>Purchase Agreement</a>"]
class SubscriptionAgreement["<a href='./subscription-agreement.md'>Subscription Agreement</a>"]
class PartyRole["<a href='./party_role.md'>Party Role</a>"]
```
```yaml
existence: independent
mutability: slowly_changing
attributes:
Agreement Identifier:
type: string
identifier: primary
description: Unique identifier of the agreement record.
Agreement Number:
type: string
description: Human-facing agreement reference quoted to customers.
Agreement Status:
type: enum:Agreement Status
description: >
Current lifecycle state. Active agreements govern current obligations; expired and
terminated ones are kept because disputes are usually about agreements that have ended.
Effective Date:
type: date
description: Date the agreement became enforceable.
Maturity Date:
type: date
description: Date the agreement is scheduled to end, if it has a fixed end.
```
```yaml
governance:
retention_basis: Inherited from the domain default of 7 years post relationship end
```
## Relationships
### Agreement Involves Party Roles
An Agreement governs one or more Party Roles participating in the contract.
```yaml
source: Agreement
type: governs
target: Party Role
cardinality: one-to-many
granularity: atomic
ownership: Agreement
```
+86
View File
@@ -0,0 +1,86 @@
# [Digital Core](../domain.md)
## Entities
### Company
A Company is an organisation with legal standing — a company, partnership, trust, cooperative, charity or public body. It specialises Party and carries the registration and structure attributes that only apply to organisations.
Legal structure is worth recording explicitly rather than inferring from the name. It determines who is allowed to sign, who is liable, what evidence the business needs on file, and how the organisation is taxed.
```mermaid
---
config:
layout: elk
---
classDiagram
class Company{
Company Registration Number : string
Incorporation Country : string
Incorporation Date : date
Legal Structure : enum~CompanyLegalStructure~
Tax Identifier : string
}
Company --|> Party
class CompanyLegalStructure["<a href='../enums.md#company-legal-structure'>Company Legal Structure</a>"]{<<enumeration>>}
class Party["<a href='./party.md'>Party</a>"]
```
```yaml
extends: Party
existence: independent
mutability: slowly_changing
attributes:
Company Registration Number:
type: string
description: >
The registration identifier issued by the relevant companies registry, such as an ACN in Australia, an NZBN in New Zealand or a Companies House number in the UK. The most reliable way to tell two similarly named organisations apart.
Incorporation Country:
type: string
description: >
ISO 3166-1 alpha-2 code for the country the organisation is incorporated in. Determines which registry the registration number belongs to, and which country's company law applies.
Incorporation Date:
type: date
description: >
Date the organisation was formally incorporated or registered.
Legal Structure:
type: enum:Company Legal Structure
description: >
The legal form the organisation takes. Determines signing authority, liability and the evidence required to establish who controls it.
Tax Identifier:
type: string
description: >
Tax registration number issued by the relevant revenue authority, such as an ABN, VAT number or EIN. Needed to invoice the organisation correctly.
```
```yaml
constraints:
Registration Number Required For Active Company:
not_null: Company Registration Number
lifecycle_stage: Onboarding
description: >
An organisation must have a registration number recorded before the relationship is activated, so that it can be identified unambiguously in any later dispute or reconciliation.
```
```yaml
governance:
pii: false
classification: Internal
retention: 7 years
retention_basis: Domain default
description: >
Company records describe organisations rather than individuals, so they carry no personal data of their own and are classified a step lower than Person. Note that a sole trader blurs this line: the organisation and the individual are the same legal person, and those records should be treated as personal data.
access_role:
- CUSTOMER_SERVICE
- DATA_ANALYST
```
## Relationships
No relationships are sourced directly from Company in the current domain model.
+144
View File
@@ -0,0 +1,144 @@
# [Digital Core](../domain.md)
## Entities
### Contact Address
A Contact Address is the link between a Party and an Address: what the address is used for, whether it has been confirmed, and the period it was in use. It is not the address itself — the location lives in the Address entity and is shared.
That separation buys two things. Deduplication: when two parties share a location, one Address record exists and both point at it, so "who else is at this address" is a join rather than a fuzzy string match. And time: because the association carries valid from and to dates, you can answer "where were we sending this customer's mail last March", which is exactly what you need when a delivery goes missing or a dispute is raised.
A Party *has* Contact Addresses — it owns them. A Party Role *uses* them: a role points at whichever of the party's addresses applies in its context. The same person might have a home address for identity and a separate billing address used by their Customer role.
```mermaid
---
config:
layout: elk
---
classDiagram
class ContactAddress{
* Contact Address Identifier : string
Address Purpose : enum~AddressPurpose~
Is Primary : boolean
Verification Status : enum~AddressVerificationStatus~
Verification Date : date
Verification Method : enum~VerificationMethod~
Valid From : date
Valid To : date
}
Party "1" --> "0..*" ContactAddress : has
PartyRole "0..*" --> "0..*" ContactAddress : uses
ContactAddress "0..*" --> "1" Address : references
class AddressPurpose["<a href='../enums.md#address-purpose'>Address Purpose</a>"]{<<enumeration>>}
class AddressVerificationStatus["<a href='../enums.md#address-verification-status'>Address Verification Status</a>"]{<<enumeration>>}
class VerificationMethod["<a href='../enums.md#verification-method'>Verification Method</a>"]{<<enumeration>>}
class Party["<a href='./party.md'>Party</a>"]
class PartyRole["<a href='./party_role.md'>Party Role</a>"]
class Address["<a href='./address.md'>Address</a>"]
```
```yaml
existence: associative
mutability: slowly_changing
temporal:
tracking: valid_time
description: >
Valid time is carried explicitly as Valid From and Valid To rather than left to generated columns. This allows a move to be recorded before it happens — a customer tells you in June that they move in July — and keeps point-in-time lookups honest.
attributes:
Contact Address Identifier:
type: string
identifier: primary
description: >
Globally unique identifier for this party-to-address association.
Address Purpose:
type: enum:Address Purpose
description: >
What the party uses this address for. A party can hold several addresses at once for different purposes — home, billing and delivery are frequently different places.
Is Primary:
type: boolean
default: false
description: >
Whether this is the party's main address for the given purpose. At most one address may be primary per purpose at any point in time.
Verification Status:
type: enum:Address Verification Status
description: >
Whether this address has been confirmed as real and current. Unverified addresses are usable but should not be relied on for anything expensive, such as a physical delivery.
Verification Date:
type: date
description: >
When the address was last confirmed. Verification ages: an address confirmed five years ago is weaker evidence than one confirmed last month.
Verification Method:
type: enum:Verification Method
description: >
How the address was confirmed. Recorded because the methods are not equally strong, and knowing which was used determines how much weight to put on the result.
Valid From:
type: date
description: >
The date the party started using this address for the stated purpose.
Valid To:
type: date
description: >
The date the party stopped using it. Null means still in use. Closed associations are kept rather than deleted, so historical lookups stay accurate.
```
```yaml
constraints:
One Primary Per Purpose:
check: >
COUNT(Contact Address WHERE Party == this.Party
AND Address Purpose == this.Address Purpose
AND Is Primary == true
AND (Valid To IS NULL OR Valid To >= Today)) <= 1
description: >
A party may have at most one primary Contact Address per purpose at any point in time. Two primary billing addresses is not a preference, it is a bug.
Valid To After Valid From:
check: "Valid To IS NULL OR Valid To > Valid From"
description: >
The end of the validity period must be later than the start.
Verification Date Required When Verified:
check: >
Verification Status != 'Verified'
OR Verification Date IS NOT NULL
description: >
An address marked Verified must record when it was verified, otherwise the status cannot be aged or trusted.
```
```yaml
governance:
pii: true
classification: Confidential
retention: 7 years
retention_basis: Domain default
description: >
A contact address ties a person to a location, which makes this association personal data even though the Address it points at is not. Records are closed via Valid To rather than deleted.
access_role:
- CUSTOMER_SERVICE
- PRIVACY_OFFICER
```
## Relationships
### Contact Address References Address
Each Contact Address references exactly one canonical Address record.
```yaml
source: Contact Address
type: references
target: Address
cardinality: many-to-one
granularity: atomic
ownership: Contact Address
```
+54
View File
@@ -0,0 +1,54 @@
# [Digital Core](../domain.md)
## Entities
### Currency
Currency is a monetary unit that amounts are expressed in. Reference data, shared by accounts, transactions and exchange rates.
```mermaid
---
config:
layout: elk
---
classDiagram
class Currency{
* Currency Code : string
Currency Name : string
Minor Unit : integer
}
ExchangeRate "0..*" --> "1" Currency : from
ExchangeRate "0..*" --> "1" Currency : to
class ExchangeRate["<a href='./exchange-rate.md'>Exchange Rate</a>"]
```
```yaml
existence: independent
mutability: reference
attributes:
Currency Code:
type: string
identifier: primary
description: ISO 4217 alphabetic currency code.
Currency Name:
type: string
description: Official display name of the currency.
Minor Unit:
type: integer
description: >
Number of decimal places the currency uses. Not universally two — the Japanese yen
uses none — which is why it is stored rather than assumed.
```
```yaml
governance:
retention_basis: Inherited from the domain default of 7 years post relationship end
```
## Relationships
No relationships are sourced directly from Currency in the current domain model.
@@ -0,0 +1,74 @@
# [Digital Core](../domain.md)
## Entities
### Customer Preferences
Customer Preferences captures how a customer wants to be contacted and what they have agreed to be contacted about.
Consent is worth modelling explicitly rather than as a flag buried in a marketing tool. It has to be honoured across every channel the business owns, it has to be provable after the fact, and it changes independently of everything else about the customer.
```mermaid
---
config:
layout: elk
---
classDiagram
class CustomerPreferences{
* Preference Identifier : string
Contact Preference : enum~ContactPreference~
Marketing Consent : boolean
Effective From : date
}
Customer "1" --> "0..1" CustomerPreferences : has
class ContactPreference["<a href='../enums.md#contact-preference'>Contact Preference</a>"]{<<enumeration>>}
class Customer["<a href='./customer.md'>Customer</a>"]
```
```yaml
existence: dependent
mutability: slowly_changing
attributes:
Preference Identifier:
type: string
identifier: primary
description: Unique identifier for the preference profile.
Contact Preference:
type: enum:Contact Preference
description: >
The channel the customer prefers for outbound contact. Honoured for everything except
messages the business is obliged to send, such as a service outage or a billing notice.
Marketing Consent:
type: boolean
description: >
Whether the customer has agreed to marketing communications. Separate from contact
preference: knowing how to reach someone is not permission to sell to them.
Effective From:
type: date
description: Date the current preference set took effect.
```
```yaml
governance:
pii: true
classification: Confidential
retention: 7 years
retention_basis: Domain default
description: >
Consent records are the evidence that outbound contact was permitted, so they are kept
for the full retention period even after a customer opts out. An opt-out is a change of
preference, never a deletion of the record that the preference changed.
access_role:
- CUSTOMER_SERVICE
- MARKETING
- PRIVACY_OFFICER
```
## Relationships
No relationships are sourced directly from Customer Preferences in the current domain model.
+89
View File
@@ -0,0 +1,89 @@
# [Digital Core](../domain.md)
## Entities
### Customer
A Customer is a Party Role representing an active or prospective commercial relationship — someone who buys, subscribes, or holds an account with the business.
Customer is a role, not a person. The same human being who is a customer today may also be a supplier, an employee, or the payer on someone else's account. Modelling Customer as a role rather than as the party itself is what makes those coexist without duplicate records.
```mermaid
---
config:
layout: elk
---
classDiagram
class Customer{
* Customer Number : string
Onboarding Date : date
Relationship Start Date : date
}
Customer --|> PartyRole
Customer "0..*" --> "0..*" Account : holds
Customer "1" --> "0..1" CustomerPreferences : has
class PartyRole["<a href='./party_role.md'>Party Role</a>"]
class Account["<a href='./account.md'>Account</a>"]
class CustomerPreferences["<a href='./customer-preferences.md'>Customer Preferences</a>"]
```
```yaml
extends: Party Role
existence: independent
mutability: slowly_changing
attributes:
Customer Number:
type: string
identifier: primary
description: >
The customer identifier quoted in correspondence and used by service and support staff. Unlike the Party Identifier, this one is meant to be readable aloud over the phone.
Onboarding Date:
type: date
description: Date the customer onboarding process was completed.
Relationship Start Date:
type: date
description: >
Date the customer relationship became effective. May precede the onboarding date where a relationship was migrated in from another system or acquired with another business.
```
```yaml
governance:
retention_basis: Inherited from the domain default of 7 years post relationship end
```
## Relationships
### Customer Holds Account
A Customer can hold one or more Accounts, and an Account can be held by more than one Customer. Joint accounts, business accounts with several authorised users, and family plans all need many-to-many — a shape that is painful to retrofit later, so it is declared up front.
```yaml
source: Customer
type: has
target: Account
cardinality: many-to-many
granularity: atomic
ownership: Customer
relationship_attributes:
- Holder Type (enum:Account Holder Type)
- Holder Start Date
- Holder End Date
- Is Primary Holder
```
### Customer Has Preferences
A Customer has at most one active Customer Preferences profile at a time.
```yaml
source: Customer
type: has
target: Customer Preferences
cardinality: one-to-one
granularity: atomic
ownership: Customer
```
+76
View File
@@ -0,0 +1,76 @@
# [Digital Core](../domain.md)
## Entities
### Exchange Rate
An Exchange Rate records the conversion between two currencies at a point in time. Append-only: rates observed in the past are facts, and a historical conversion must still reproduce the number that was actually used.
```mermaid
---
config:
layout: elk
---
classDiagram
class ExchangeRate{
* Exchange Rate Identifier : string
Rate Value : decimal
Effective Date Time : datetime
}
ExchangeRate "0..*" --> "1" Currency : base
ExchangeRate "0..*" --> "1" Currency : quote
class Currency["<a href='./currency.md'>Currency</a>"]
```
```yaml
existence: dependent
mutability: append_only
attributes:
Exchange Rate Identifier:
type: string
identifier: primary
description: Unique identifier for the rate observation.
Rate Value:
type: decimal
description: Conversion multiplier from the base currency to the quote currency.
Effective Date Time:
type: datetime
description: The moment this rate became effective.
```
```yaml
governance:
retention_basis: Inherited from the domain default of 7 years post relationship end
```
## Relationships
### Exchange Rate References Base Currency
Each Exchange Rate references one base Currency — the one being converted from.
```yaml
source: Exchange Rate
type: references
target: Currency
cardinality: many-to-one
granularity: atomic
ownership: Exchange Rate
```
### Exchange Rate References Quote Currency
Each Exchange Rate references one quote Currency — the one being converted to.
```yaml
source: Exchange Rate
type: references
target: Currency
cardinality: many-to-one
granularity: atomic
ownership: Exchange Rate
```
+82
View File
@@ -0,0 +1,82 @@
# [Digital Core](../domain.md)
## Entities
### Merchant
A Merchant is a Party Role that accepts payment for goods or services. In a marketplace or platform business the merchants are the sellers; in a payments business they are the businesses being paid.
```mermaid
---
config:
layout: elk
---
classDiagram
class Merchant{
* Merchant Identifier : string
Merchant Category Code : string
Settlement Account Identifier : string
}
Merchant --|> PartyRole
Merchant "1" --> "0..*" Transaction : processes
Merchant "0..*" --> "0..1" Account : settles into
class PartyRole["<a href='./party_role.md'>Party Role</a>"]
class Transaction["<a href='./transaction.md'>Transaction</a>"]
class Account["<a href='./account.md'>Account</a>"]
```
```yaml
extends: Party Role
existence: independent
mutability: slowly_changing
attributes:
Merchant Identifier:
type: string
identifier: primary
description: Unique identifier for the merchant role instance.
Merchant Category Code:
type: string
description: >
ISO 18245 Merchant Category Code describing what the merchant sells. Useful for
analytics and for the pricing and routing rules that vary by category.
Settlement Account Identifier:
type: string
description: The account takings are settled into.
```
```yaml
governance:
retention_basis: Inherited from the domain default of 7 years post relationship end
```
## Relationships
### Merchant Receives Payment
A Merchant receives value through one or more Transactions.
```yaml
source: Merchant
type: associates_with
target: Transaction
cardinality: one-to-many
granularity: atomic
ownership: Merchant
```
### Merchant Has Settlement Account
A Merchant may have a designated Account into which settlement is paid.
```yaml
source: Merchant
type: references
target: Account
cardinality: many-to-one
granularity: atomic
ownership: Merchant
```
+146
View File
@@ -0,0 +1,146 @@
# [Digital Core](../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
```
+159
View File
@@ -0,0 +1,159 @@
# [Digital Core](../domain.md)
## 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.
```mermaid
---
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>"]
```
```yaml
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.
```
```yaml
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.
```
```yaml
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.
```yaml
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.
```yaml
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.
```yaml
source: Party Role
type: snapshots
target: Party Role
cardinality: one-to-one
granularity: period
ownership: Party Role
self_referential: true
```
+47
View File
@@ -0,0 +1,47 @@
# [Digital Core](../domain.md)
## Entities
### Payee
A Payee is a Party Role representing the party value goes to in a transaction. Kept distinct from Merchant: every merchant being paid is a payee, but plenty of payees are not merchants — a refunded customer, an employee reimbursed, a partner receiving a share.
```mermaid
---
config:
layout: elk
---
classDiagram
class Payee{
* Payee Identifier : string
Beneficiary Reference : string
}
Payee --|> PartyRole
class PartyRole["<a href='./party_role.md'>Party Role</a>"]
```
```yaml
extends: Party Role
existence: independent
mutability: slowly_changing
attributes:
Payee Identifier:
type: string
identifier: primary
description: Unique identifier for the payee role instance.
Beneficiary Reference:
type: string
description: Reference identifying the beneficiary in payment instructions.
```
```yaml
governance:
retention_basis: Inherited from the domain default of 7 years post relationship end
```
## Relationships
No relationships are sourced directly from Payee. The canonical direction is Transaction-owned — see [Transaction Has Payee](transaction.md#transaction-has-payee).
+47
View File
@@ -0,0 +1,47 @@
# [Digital Core](../domain.md)
## Entities
### Payer
A Payer is a Party Role representing the party value comes from in a transaction. It is a separate role from Customer because they are frequently not the same party: a parent pays a student's bill, a company pays an employee's expenses, a sponsor pays for someone else entirely.
```mermaid
---
config:
layout: elk
---
classDiagram
class Payer{
* Payer Identifier : string
Funding Source Reference : string
}
Payer --|> PartyRole
class PartyRole["<a href='./party_role.md'>Party Role</a>"]
```
```yaml
extends: Party Role
existence: independent
mutability: slowly_changing
attributes:
Payer Identifier:
type: string
identifier: primary
description: Unique identifier for the payer role instance.
Funding Source Reference:
type: string
description: Reference to the account or instrument the money comes from.
```
```yaml
governance:
retention_basis: Inherited from the domain default of 7 years post relationship end
```
## Relationships
No relationships are sourced directly from Payer. The canonical direction is Transaction-owned — see [Transaction Has Payer](transaction.md#transaction-has-payer).
+49
View File
@@ -0,0 +1,49 @@
# [Digital Core](../domain.md)
## Entities
### Payment Initiator
A Payment Initiator is a Party Role representing whoever instructed a transaction, when that is not the payer themselves. A platform charging a saved card on a schedule, an accountant paying a client's invoices, an app initiating a payment through an open banking API — all are initiators acting on someone else's behalf.
Recording the initiator separately answers "who actually triggered this?", which matters when a payment is disputed.
```mermaid
---
config:
layout: elk
---
classDiagram
class PaymentInitiator{
* Payment Initiator Identifier : string
Initiation Channel : string
}
PaymentInitiator --|> PartyRole
class PartyRole["<a href='./party_role.md'>Party Role</a>"]
```
```yaml
extends: Party Role
existence: independent
mutability: slowly_changing
attributes:
Payment Initiator Identifier:
type: string
identifier: primary
description: Unique identifier for the payment initiator role instance.
Initiation Channel:
type: string
description: The channel or integration the instruction arrived through.
```
```yaml
governance:
retention_basis: Inherited from the domain default of 7 years post relationship end
```
## Relationships
No relationships are sourced directly from Payment Initiator. The canonical direction is Transaction-owned — see [Transaction Initiated By Payment Initiator](transaction.md#transaction-initiated-by-payment-initiator).
+79
View File
@@ -0,0 +1,79 @@
# [Digital Core](../domain.md)
## Entities
### Person
A Person is a human being. Person specialises Party, inheriting everything that is true of any party and adding what only applies to people.
The split matters because the questions you ask of a person and of an organisation are genuinely different. A person has a birthday and a name they prefer to be called; a company has a registration number and a legal structure. Forcing both into one record produces a table where most columns are empty most of the time.
```mermaid
---
config:
layout: elk
---
classDiagram
class Party{
<<abstract>>
}
class Person{
Date of Birth : date
Preferred Name : string
Country of Residence : string
}
Person --|> Party
class Party["<a href='./party.md'>Party</a>"]
```
```yaml
extends: Party
existence: independent
mutability: slowly_changing
attributes:
Date of Birth:
type: date
pii: true
description: >
The individual's date of birth. Used to confirm identity, to check age eligibility for age-restricted products, and to avoid confusing two people with the same name.
Preferred Name:
type: string
pii: true
description: >
What the person actually wants to be called, when that differs from their legal name. Used for greetings and correspondence. Getting this right is cheap and getting it wrong is conspicuous.
Country of Residence:
type: string
pii: true
description: >
ISO 3166-1 alpha-2 code for the country the individual currently lives in. Drives tax treatment, applicable consumer law, currency defaults and delivery options.
```
```yaml
constraints:
Date of Birth Not In Future:
check: "Date of Birth IS NULL OR Date of Birth <= Today"
description: >
A date of birth in the future is a data entry error, not a person.
```
```yaml
governance:
pii: true
classification: Confidential
retention: 7 years
retention_basis: Domain default
description: >
Person carries the domain's most sensitive personal data. Date of Birth is the attribute most often requested for masking by downstream products — consumer-aligned products that only need an age band should derive one rather than publish the raw date.
access_role:
- CUSTOMER_SERVICE
- PRIVACY_OFFICER
```
## Relationships
No relationships are sourced directly from Person in the current domain model.
+66
View File
@@ -0,0 +1,66 @@
# [Digital Core](../domain.md)
## Entities
### Product
A Product is something the business sells or provides. Accounts are instances of it, and its commercial terms come from an Agreement.
Product is deliberately thin here. The catalogue — pricing tiers, features, eligibility — is a domain of its own in most businesses; what the core needs is a stable identifier to hang accounts off.
```mermaid
---
config:
layout: elk
---
classDiagram
class Product{
* Product Identifier : string
Product Name : string
Product Category : string
}
Product "0..*" --> "1" Agreement : in terms of
Account "0..*" --> "1" Product : holds
class Agreement["<a href='./agreement.md'>Agreement</a>"]
class Account["<a href='./account.md'>Account</a>"]
```
```yaml
existence: independent
mutability: slowly_changing
attributes:
Product Identifier:
type: string
identifier: primary
description: Unique identifier of the product definition.
Product Name:
type: string
description: Business name of the product as customers see it.
Product Category:
type: string
description: Classification used for grouping and reporting.
```
```yaml
governance:
retention_basis: Inherited from the domain default of 7 years post relationship end
```
## Relationships
### Product In Terms Of Agreement
A Product is offered on the terms of an Agreement template.
```yaml
source: Product
type: references
target: Agreement
cardinality: many-to-one
granularity: atomic
ownership: Product
```
+53
View File
@@ -0,0 +1,53 @@
# [Digital Core](../domain.md)
## Entities
### Purchase Agreement
A Purchase Agreement is a specialised Agreement covering a one-off purchase of goods or services — an order, a booking, a single licence.
It contrasts with a Subscription Agreement: a purchase completes, whereas a subscription recurs. Both are Agreements, which is why they share status, effective dates and the roles they bind.
```mermaid
---
config:
layout: elk
---
classDiagram
class PurchaseAgreement{
Order Reference : string
Total Amount : decimal
Fulfilment Terms : string
}
PurchaseAgreement --|> Agreement
class Agreement["<a href='./agreement.md'>Agreement</a>"]
```
```yaml
extends: Agreement
existence: independent
mutability: slowly_changing
attributes:
Order Reference:
type: string
description: Customer-facing reference for the order this agreement covers.
Total Amount:
type: decimal
description: Total contracted amount for the purchase.
Fulfilment Terms:
type: string
description: How and when the goods or services are to be delivered.
```
```yaml
governance:
retention_basis: Inherited from the domain default of 7 years post relationship end
```
## Relationships
No relationships are sourced directly from Purchase Agreement in the current domain model.
+94
View File
@@ -0,0 +1,94 @@
# [Digital Core](../domain.md)
## Entities
### Service Agent
A Service Agent is a Party Role representing a staff member who serves customers — at a counter, on the phone, or in a chat window.
Agents are modelled as a role for the same reason customers are. An agent is a person, that person may also be a customer of the business, and treating them as one Party wearing two roles avoids the awkward duplicate that appears when staff buy their employer's products.
Recording which agent handled a transaction is what makes service quality measurable and gives every action an accountable human.
```mermaid
---
config:
layout: elk
---
classDiagram
class ServiceAgent{
* Service Agent Identifier : string
Employee Number : string
Assigned Location Identifier : string
}
ServiceAgent --|> PartyRole
ServiceAgent "1" --> "0..*" Transaction : processes
ServiceAgent "0..*" --> "1" ServiceLocation : assigned to
class PartyRole["<a href='./party_role.md'>Party Role</a>"]
class Transaction["<a href='./transaction.md'>Transaction</a>"]
class ServiceLocation["<a href='./service-location.md'>Service Location</a>"]
```
```yaml
extends: Party Role
existence: independent
mutability: slowly_changing
attributes:
Service Agent Identifier:
type: string
identifier: primary
description: Unique identifier for the service agent role instance.
Employee Number:
type: string
description: Internal staff identifier of the person acting as agent.
Assigned Location Identifier:
type: string
description: The service location the agent normally works from.
```
```yaml
governance:
pii: false
classification: Internal
retention: 7 years
retention_basis: Domain default
description: >
Agent records identify staff rather than customers, but they are still about people:
agent activity data should be used to improve service, not to build surveillance
metrics about individual employees.
access_role:
- SERVICE_MANAGER
- DATA_ANALYST
```
## Relationships
### Service Agent Processes Transaction
A Service Agent can handle one or more Transactions on a customer's behalf.
```yaml
source: Service Agent
type: associates_with
target: Transaction
cardinality: one-to-many
granularity: atomic
ownership: Service Agent
```
### Service Agent Assigned To Service Location
A Service Agent is assigned to a Service Location for operational purposes.
```yaml
source: Service Agent
type: assigned_to
target: Service Location
cardinality: many-to-one
granularity: atomic
ownership: Service Agent
```
+75
View File
@@ -0,0 +1,75 @@
# [Digital Core](../domain.md)
## Entities
### Service Location
A Service Location is somewhere the business delivers service: a store, a branch, a depot, a contact centre. It exists so that activity can be attributed to a place, which is what makes location-level performance and staffing analysis possible.
```mermaid
---
config:
layout: elk
---
classDiagram
class ServiceLocation{
* Service Location Identifier : string
Location Code : string
Location Name : string
}
ServiceLocation "1" --> "0..*" Account : serves
class Account["<a href='./account.md'>Account</a>"]
```
```yaml
existence: independent
mutability: reference
attributes:
Service Location Identifier:
type: string
identifier: primary
description: Unique identifier for the service location.
Location Code:
type: string
description: Short operational code used to refer to the location.
Location Name:
type: string
description: Human-readable name of the location.
```
```yaml
governance:
retention_basis: Inherited from the domain default of 7 years post relationship end
```
## Relationships
### Service Location Serves Account
A Service Location looks after one or more Accounts.
```yaml
source: Service Location
type: has
target: Account
cardinality: one-to-many
granularity: atomic
ownership: Service Location
```
### Service Location Transaction Summary
A Service Location has a grouped relationship to the Transactions handled through it. Declared at group granularity because the useful question is aggregate — how much went through this location this month — not which individual transaction.
```yaml
source: Service Location
type: associates_with
target: Transaction
cardinality: one-to-many
granularity: group
ownership: Service Location
```
@@ -0,0 +1,53 @@
# [Digital Core](../domain.md)
## Entities
### Subscription Agreement
A Subscription Agreement is a specialised Agreement covering a recurring service billed on a cycle — a streaming plan, a phone plan, a maintenance contract, a SaaS seat.
What distinguishes it from a one-off purchase is that it keeps charging until somebody stops it, so the cycle, the amount and any minimum term are the terms that matter.
```mermaid
---
config:
layout: elk
---
classDiagram
class SubscriptionAgreement{
Billing Cycle : string
Recurring Amount : decimal
Minimum Term Months : integer
}
SubscriptionAgreement --|> Agreement
class Agreement["<a href='./agreement.md'>Agreement</a>"]
```
```yaml
extends: Agreement
existence: independent
mutability: slowly_changing
attributes:
Billing Cycle:
type: string
description: How often the subscription is billed, such as monthly or annually.
Recurring Amount:
type: decimal
description: Amount charged each billing cycle.
Minimum Term Months:
type: integer
description: Minimum committed term in months, if any.
```
```yaml
governance:
retention_basis: Inherited from the domain default of 7 years post relationship end
```
## Relationships
No relationships are sourced directly from Subscription Agreement in the current domain model.
+219
View File
@@ -0,0 +1,219 @@
# [Digital Core](../domain.md)
## Entities
### Transaction
A Transaction is a movement of value between parties and accounts: the thing that actually happened. It carries the amount, the timing, the mechanism, and who was involved on each side.
Transaction is the busiest entity in the domain and the one most analytics is built on. It is append-only: a settled transaction is a historical fact and correcting it by editing the row destroys the audit trail. Reversals and adjustments are new transactions that reference the original.
```mermaid
---
config:
layout: elk
---
classDiagram
class Transaction{
* Transaction Identifier : string
Transaction Date Time : datetime
Settlement Date Time : datetime
Amount : decimal
Transaction Type : enum~TransactionType~
Transaction Channel : enum~TransactionChannel~
Transaction Status : enum~TransactionStatus~
Reference : string
}
Transaction "0..*" --> "1" Payer : has payer
Transaction "0..*" --> "1" Payee : has payee
Transaction "0..*" --> "0..1" PaymentInitiator : initiated by
Transaction "0..*" --> "1" Currency : denominated in
Transaction "0..*" --> "0..1" Account : debits
Transaction "0..*" --> "0..1" Account : credits
class TransactionType["<a href='../enums.md#transaction-type'>Transaction Type</a>"]{<<enumeration>>}
class TransactionChannel["<a href='../enums.md#transaction-channel'>Transaction Channel</a>"]{<<enumeration>>}
class TransactionStatus["<a href='../enums.md#transaction-status'>Transaction Status</a>"]{<<enumeration>>}
class Payer["<a href='./payer.md'>Payer</a>"]
class Payee["<a href='./payee.md'>Payee</a>"]
class PaymentInitiator["<a href='./payment_initiator.md'>Payment Initiator</a>"]
class Currency["<a href='./currency.md'>Currency</a>"]
class Account["<a href='./account.md'>Account</a>"]
```
```yaml
existence: dependent
mutability: append_only
temporal:
tracking: transaction_time
description: >
Transactions are append-only. Once settled they are never modified. Transaction time
records when the business captured the event. A reversal is a new record that references
the original identifier, so both the mistake and the correction remain visible.
attributes:
Transaction Identifier:
type: string
identifier: primary
description: >
Globally unique identifier for the transaction. Immutable once assigned. A reversal
carries its own identifier and names the original in its Reference.
Transaction Date Time:
type: datetime
description: >
When the transaction was initiated. This is the event time most reporting is grouped by.
Settlement Date Time:
type: datetime
description: >
When settlement actually completed. Often a different day from initiation, which is
why both are held — the gap between them is where reconciliation problems live.
Amount:
type: decimal
description: >
Value moved, in the denomination currency. Always positive: direction comes from the
payer and payee relationships, not from the sign. Signed amounts invite the bug where
a refund and a charge cancel out in a sum.
Transaction Type:
type: enum:Transaction Type
description: >
The mechanism the value moved by, such as card payment, direct debit or refund.
Transaction Channel:
type: enum:Transaction Channel
description: >
Where the transaction came from — web, mobile app, point of sale, contact centre.
Together with type this is the main dimension pair for behavioural analysis.
Transaction Status:
type: enum:Transaction Status
description: >
Current lifecycle state. Failed and cancelled transactions are retained: what did not
happen is often as informative as what did.
Reference:
type: string
description: >
Free-text reference supplied by the initiating party — an invoice number, a description,
or for a reversal, the identifier of the transaction being reversed.
```
```yaml
constraints:
Settlement After Initiation:
check: "Settlement Date Time IS NULL OR Settlement Date Time >= Transaction Date Time"
description: >
Settlement cannot precede initiation. Null settlement means the transaction has not
settled yet.
Settled Transaction Has Settlement Time:
check: >
Transaction Status != 'Settled'
OR Settlement Date Time IS NOT NULL
description: >
A transaction marked Settled must record when it settled.
Amount Must Be Positive:
check: "Amount > 0"
description: >
Amounts are always positive. Direction is carried by the payer and payee relationships.
```
```yaml
governance:
pii: false
classification: Confidential
retention: 7 years
retention_basis: Domain default
description: >
Transactions are not personal data on their own but reveal a great deal about a person
once joined to a party, so they are treated as confidential. Records are append-only and
are never modified or deleted; corrections are new records.
access_role:
- CUSTOMER_SERVICE
- DATA_ANALYST
- FINANCE
```
## Relationships
### Transaction Has Payer
A Transaction has one Payer: the party the value came from.
```yaml
source: Transaction
type: has
target: Payer
cardinality: one-to-many
granularity: atomic
ownership: Transaction
```
### Transaction Has Payee
A Transaction has one Payee: the party the value went to.
```yaml
source: Transaction
type: has
target: Payee
cardinality: one-to-many
granularity: atomic
ownership: Transaction
```
### Transaction Initiated By Payment Initiator
A Transaction may be initiated by a Payment Initiator acting on behalf of the payer.
```yaml
source: Transaction
type: references
target: Payment Initiator
cardinality: many-to-one
granularity: atomic
ownership: Transaction
```
### Transaction Denominated In Currency
A Transaction is denominated in exactly one Currency.
```yaml
source: Transaction
type: references
target: Currency
cardinality: many-to-one
granularity: atomic
ownership: Transaction
```
### Transaction Has Debit Account
The internal account value is taken from. Null when the paying side is external to the business.
```yaml
source: Transaction
type: references
target: Account
cardinality: many-to-one
granularity: atomic
ownership: Transaction
```
### Transaction Has Credit Account
The internal account value is paid into. Null when the receiving side is external to the business.
```yaml
source: Transaction
type: references
target: Account
cardinality: many-to-one
granularity: atomic
ownership: Transaction
```