Address (v1.0.0)

Represents shipping and billing addresses for customers and orders.

Overview

The Address entity stores shipping and billing addresses for customers, orders, and payments. It supports address validation, geocoding, and delivery instructions to ensure accurate order fulfillment.

Entity Properties

NameTypeRequiredDescription
addressIdUUIDRequiredUnique identifier for the address
customerIdUUIDOptionalCustomer this address belongs to
typestringRequiredType of address
firstNamestringRequiredFirst name of the recipient
lastNamestringRequiredLast name of the recipient
companystringOptionalCompany name if applicable
addressLine1stringRequiredPrimary address line (street address)
addressLine2stringOptionalSecondary address line (apartment, suite, etc.)
citystringRequiredCity name
statestringRequiredState or province
postalCodestringRequiredPostal or ZIP code
countrystringRequiredCountry code (ISO 3166-1 alpha-2)
phonestringOptionalPhone number for delivery contact
isDefaultbooleanRequiredWhether this is the default address for the customer
isValidatedbooleanRequiredWhether the address has been validated
validationDetailsobjectOptionalAddress validation details
geocoordinatesobjectOptionalGeographic coordinates for the address
deliveryInstructionsstringOptionalSpecial delivery instructions
ordersarrayOptionalOrders using this address
paymentsarrayOptionalPayments using this as billing address
createdAtDateTimeRequiredDate and time when the address was created
updatedAtDateTimeOptionalDate and time when the address was last updated

Relationships

  • Customer: An address can belong to one Customer (identified by customerId).
  • Order: An address can be used by multiple Order entities for shipping.
  • Payment: An address can be used by multiple Payment entities for billing.

Address Types

  • Billing: Used for payment processing and invoicing
  • Shipping: Used for order delivery
  • Both: Can be used for both billing and shipping

Examples

  • Address #1: John Doe’s home address - default shipping and billing address.
  • Address #2: Corporate office address - billing only, validated with high confidence.
  • Address #3: Gift recipient address - shipping only, with special delivery instructions.

Business Rules

  • Each customer can have only one default address per type
  • Addresses must be validated before being marked as default
  • International addresses require country-specific validation
  • Geocoordinates are automatically populated when available
  • Address changes should create new versions for audit trail
  • PO Box addresses may have shipping restrictions
  • Address validation improves delivery success rates