"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>
4.3 KiB
4.3 KiB
Digital
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.
---
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>"]
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.
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.
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.
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.
source: Account
type: references
target: Currency
cardinality: many-to-one
granularity: atomic
ownership: Account