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>
120 lines
3.8 KiB
Markdown
120 lines
3.8 KiB
Markdown
# [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.
|