Buyer
Represents a customer's ordering profile and delivery address within the Ordering bounded context.
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
| Property | Value |
|---|---|
| Bounded Context / Domain | OrderingDomainv1.0.0OrderingCreates durable Orders from a buyer's current basket, locks purchase-time pricing, and owns order lifecycle transitions ...Ownercommerce-fulfillment-teamDiagramOpen docs |
| Owning Service | 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 |
| DDD Role | Aggregate Root |
| Identifier Strategy | Authenticated customer UUID |
| Persistence Store | Ordering relational database (buyers) |
| Deletion Semantics | Hard-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 Control | Buyer-scoped distributed write locks during mutations |
| PII / Data Classification | Confidential PII (name, address) — redacted from logs, events, and incident reports |
Attributes & Constraints
| Name | Type | Required | Description | Reference |
|---|---|---|---|---|
| id | UUID | required | Identifier associated with the authenticated customer. | — |
| name | string | required | Buyer's display name (non-whitespace, up to 20 characters). | — |
| address | object | required | Buyer's delivery address value object. | — |
| ↳street | string | required | Street address line (non-whitespace, up to 50 characters). | — |
| ↳city | string | required | City name (non-whitespace, up to 50 characters). | — |
| ↳province | string | required | Province or state name (non-whitespace, up to 50 characters). | — |
| Attribute | Business Rule / Constraint | Sensitivity / Notes |
|---|---|---|
id | Required; derived from the authenticated customer identity. | Internal/Customer identifier |
name | Required; non-whitespace, max 20 characters. | PII — redact in structured logs |
address | Embedded 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
addressvalue 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
buyerIdset to null.
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
| Category | Resource | Role / Interaction |
|---|---|---|
| Related Entities | OrderEntityv1.0.0OrderDurable purchase record owned by a Buyer, capturing immutable purchase-time line items and governing order lifecycle tra...Ownercommerce-fulfillment-teamOpen docs | One buyer places zero or more orders |
| Mutating Commands | Create 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 docs | Register buyer profile, replace delivery address, or remove profile |
| Read Queries | Get 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 docs | Retrieve individual buyer details or paginated buyer lists |