Files
semprini-domain-digital-dat…/data_model/entities/contact_address.md
T
paulandClaude Opus 5 aeba56e5f2 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>
2026-09-17 22:51:50 +12:00

5.5 KiB

Digital Core

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.

---
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>"]
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.
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.
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.

source: Contact Address
type: references
target: Address
cardinality: many-to-one
granularity: atomic
ownership: Contact Address