Storefront has been decoupled into micro-frontends with a dedicated commerce app and shared shell.

Read the architecture guide →

Buyer

Represents a customer's ordering profile and delivery address within the Ordering bounded context.

Aggregate RootAggregate RootContains PII

Domain Role & Boundary

Buyer is an Aggregate Root in the OrderingDomainv1.0.0OrderingCreates durable Orders from a buyer's current basket, locks purchase-time pricing, and owns order lifecycle transitions ...Ownercommerce-fulfillment-teamDiagramOpen docs bounded context representing a customer’s ordering profile and delivery address. Owned by Order APIServicev1.0.0Order APIAuthenticated Ordering service for Buyer profiles and the Order lifecycle, creating Orders from baskets, snapshotting pr...PublishesGetBasketGrpc, GetBookGrpc +5SubscribesCreateOrder, CompleteOrder +11APIsOpenAPI, AsyncAPI, Carrier Service LevelsOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs, it links an authenticated customer identity to their placed OrderEntityv1.0.0OrderDurable purchase record owned by a Buyer, capturing immutable purchase-time line items and governing order lifecycle tra...Ownercommerce-fulfillment-teamOpen docs history. It explicitly does not own authentication credentials or roles (owned by Identity ProviderSystemv1.0.0Identity ProviderExternal identity infrastructure that authenticates BookWorm users and provides OAuth-compatible identity verification f...Ownerplatform-engineering-teamDiagramOpen docs) or pre-purchase shopping baskets (owned by ShoppingDomainv1.0.0ShoppingCoordinates the customer basket and pre-purchase checkout intent, from selecting books through handing an accepted purch...Ownercommerce-fulfillment-teamDiagramOpen docs).

Entity Profile

PropertyValue
Bounded Context / DomainOrderingDomainv1.0.0OrderingCreates durable Orders from a buyer's current basket, locks purchase-time pricing, and owns order lifecycle transitions ...Ownercommerce-fulfillment-teamDiagramOpen docs
Owning ServiceOrder APIServicev1.0.0Order APIAuthenticated Ordering service for Buyer profiles and the Order lifecycle, creating Orders from baskets, snapshotting pr...PublishesGetBasketGrpc, GetBookGrpc +5SubscribesCreateOrder, CompleteOrder +11APIsOpenAPI, AsyncAPI, Carrier Service LevelsOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs
DDD RoleAggregate Root
Identifier StrategyAuthenticated customer UUID
Persistence StoreOrdering relational database (buyers)
Deletion SemanticsHard-delete; clears buyerId to null on existing OrderEntityv1.0.0OrderDurable purchase record owned by a Buyer, capturing immutable purchase-time line items and governing order lifecycle tra...Ownercommerce-fulfillment-teamOpen docs records without deleting orders
Concurrency ControlBuyer-scoped distributed write locks during mutations
PII / Data ClassificationConfidential PII (name, address) — redacted from logs, events, and incident reports

Attributes & Constraints

NameTypeRequiredDescriptionReference
idUUIDrequiredIdentifier associated with the authenticated customer.—
namestringrequiredBuyer's display name (non-whitespace, up to 20 characters).—
addressobjectrequiredBuyer's delivery address value object.—
↳streetstringrequiredStreet address line (non-whitespace, up to 50 characters).—
↳citystringrequiredCity name (non-whitespace, up to 50 characters).—
↳provincestringrequiredProvince or state name (non-whitespace, up to 50 characters).—
AttributeBusiness Rule / ConstraintSensitivity / Notes
idRequired; derived from the authenticated customer identity.Internal/Customer identifier
nameRequired; non-whitespace, max 20 characters.PII — redact in structured logs
addressEmbedded value object (street, city, province each required, non-whitespace, max 50 chars).PII — redact in structured logs

Domain Invariants & Lifecycle

  • Required profile fields: Both the buyer’s name and all three delivery address components (street, city, province) must be non-whitespace; invalid inputs are rejected at creation and update.
  • Whole-address replacement: Updating a buyer’s delivery address replaces the entire address value object atomically rather than patching individual fields.
  • Order preservation on delete: Deleting a buyer removes the buyer profile while preserving historical OrderEntityv1.0.0OrderDurable purchase record owned by a Buyer, capturing immutable purchase-time line items and governing order lifecycle tra...Ownercommerce-fulfillment-teamOpen docs records with buyerId set to null.
Warning

name and address are Personal Identifiable Information (PII). Never emit raw buyer names or street addresses into structured application logs, integration events, or telemetry traces.

Relationships & Associated Operations

CategoryResourceRole / Interaction
Related EntitiesOrderEntityv1.0.0OrderDurable purchase record owned by a Buyer, capturing immutable purchase-time line items and governing order lifecycle tra...Ownercommerce-fulfillment-teamOpen docsOne buyer places zero or more orders
Mutating CommandsCreate buyerCommandv1.0.0Create buyerCreates a Buyer profile for the authenticated customer from the supplied address.Ownercommerce-fulfillment-teamSchemaDiagramOpen docs, Update buyer addressCommandv1.0.0Update buyer addressUpdates the authenticated Buyer's address using the supplied street, city, and province.Ownercommerce-fulfillment-teamSchemaDiagramOpen docs, Delete buyerCommandv1.0.0Delete buyerDeletes a Buyer profile by identifier; the operation is restricted to administrators.Ownercommerce-fulfillment-teamSchemaDiagramOpen docsRegister buyer profile, replace delivery address, or remove profile
Read QueriesGet buyerQueryv1.0.0Get buyerReturns the Buyer profile selected by identifier, subject to the caller's authorization.Ownercommerce-fulfillment-teamSchemaDiagramOpen docs, List buyersQueryv1.0.0List buyersReturns Buyer profiles with pagination.Ownercommerce-fulfillment-teamSchemaDiagramOpen docsRetrieve individual buyer details or paginated buyer lists