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

Read the architecture guide →

Basket

Customer-scoped, mutable pre-order collection of requested books and quantities managed prior to checkout.

Aggregate RootAggregate Root

Domain Role & Boundary

Basket is the Aggregate Root in the ShoppingDomainv1.0.0ShoppingCoordinates the customer basket and pre-purchase checkout intent, from selecting books through handing an accepted purch...Ownercommerce-fulfillment-teamDiagramOpen docs bounded context representing an authenticated customer’s mutable pre-purchase selection of books. Owned by Basket APIServicev1.0.0Basket APIInternal HTTP and gRPC service for managing customer-scoped shopping baskets, Catalog price enrichment, and post-checkou...PublishesGetBookGrpc, GetBooksGrpc +2SubscribesCreateBasket, UpdateBasket +4APIsOpenAPI, AsyncAPIOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs, it provides sub-millisecond read and write access during storefront browsing and supplies checkout snapshots to 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 explicitly does not own product pricing or availability (resolved dynamically from CatalogDomainv1.0.0CatalogCore BookWorm subdomain that makes books discoverable, purchasable, and consistently described across the customer journ...Ownercatalog-experience-teamDiagramOpen docs), inventory reservations, or accepted purchase records (owned by OrderingDomainv1.0.0OrderingCreates durable Orders from a buyer's current basket, locks purchase-time pricing, and owns order lifecycle transitions ...Ownercommerce-fulfillment-teamDiagramOpen docs).

Entity Profile

PropertyValue
Bounded Context / DomainShoppingDomainv1.0.0ShoppingCoordinates the customer basket and pre-purchase checkout intent, from selecting books through handing an accepted purch...Ownercommerce-fulfillment-teamDiagramOpen docs
Owning ServiceBasket APIServicev1.0.0Basket APIInternal HTTP and gRPC service for managing customer-scoped shopping baskets, Catalog price enrichment, and post-checkou...PublishesGetBookGrpc, GetBooksGrpc +2SubscribesCreateBasket, UpdateBasket +4APIsOpenAPI, AsyncAPIOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs
DDD RoleAggregate Root
Identifier StrategyAuthenticated customer ID (GUID-formatted string, derived from access token)
Persistence StoreShopping key-value store (basket:{customerId}, no SQL database)
Deletion SemanticsHard-delete (customer clear or idempotent post-checkout cleanup; no automatic TTL)
Concurrency ControlLast-write-wins with whole-set replacement; idempotent message handling on cleanup
PII / Data ClassificationInternal customer-scoped identifier (customerId only; no names or addresses stored)

Attributes & Constraints

NameTypeRequiredDescriptionReference
customerIdstringrequiredAuthenticated customer identifier scoping the basket (one active basket per customer).—
itemsbasket-item[]requiredRequested book entries, replaced atomically as a complete set on update.
basket-itemProperty: bookId
createdAtdatetimerequiredUTC timestamp when the basket was created.—
lastModifiedAtdatetimeoptionalUTC timestamp of the most recent basket update.—
AttributeBusiness Rule / ConstraintSensitivity / Notes
customerIdRequired; derived strictly from the authenticated customer token (one basket per customer).Customer-scoped key
itemsRequired; must contain at least one Basket ItemEntityv1.0.0Basket ItemChild entry within a Basket pairing a Catalog book identifier with a positive requested quantity.Ownercommerce-fulfillment-teamOpen docs on create and update at the API boundary.Whole-set replacement
createdAt, lastModifiedAtUTC audit timestamps serialized with the basket payload.Metadata

Domain Invariants & Lifecycle

Warning

A basket represents mutable shopping intent—never a confirmed order or an inventory hold. If a basket fails to delete after checkout, OrderingDomainv1.0.0OrderingCreates durable Orders from a buyer's current basket, locks purchase-time pricing, and owns order lifecycle transitions ...Ownercommerce-fulfillment-teamDiagramOpen docs compensates rather than allowing stale basket state to be misread as an active order.

Relationships & Associated Operations

CategoryResourceRole / Interaction
Related EntitiesBasket ItemEntityv1.0.0Basket ItemChild entry within a Basket pairing a Catalog book identifier with a positive requested quantity.Ownercommerce-fulfillment-teamOpen docsEmbedded collection of requested books and quantities
Cross-Context ReferencesBookEntityv1.0.0BookCanonical sellable title in the product catalog, encapsulating descriptive metadata, pricing, stock availability, taxono...Ownercatalog-experience-teamOpen docs, OrderEntityv1.0.0OrderDurable purchase record owned by a Buyer, capturing immutable purchase-time line items and governing order lifecycle tra...Ownercommerce-fulfillment-teamOpen docsItems reference Catalog books; checkout hands off to Ordering
Mutating CommandsCreate basketCommandv1.0.0Create basketCreates a basket containing the supplied item identifiers and quantities.Ownercommerce-fulfillment-teamSchemaDiagramOpen docs, Update basketCommandv1.0.0Update basketReplaces a basket's item collection with the supplied items.Ownercommerce-fulfillment-teamSchemaDiagramOpen docs, Delete basketCommandv1.0.0Delete basketDeletes the current basket.Ownercommerce-fulfillment-teamSchemaDiagramOpen docs, Place orderCommandv1.0.0Place orderShared Finance order-placement command consumed by Notification to render and submit a new-order email. Ownerplatform-engineering-teamSchemaDiagramOpen docsCreate, replace, or delete the customer’s basket
Read QueriesGet basketQueryv1.0.0Get basketReturns the current basket and its item details.Ownercommerce-fulfillment-teamSchemaDiagramOpen docs, Get basket over gRPCQueryv1.0.0Get basket over gRPCReturns the current basket through the basket.v1 gRPC contract.Ownercommerce-fulfillment-teamSchemaDiagramOpen docsEnriched storefront read and internal checkout snapshot
Emitted EventsBasket deletion completedEventv1.0.0Basket deletion completedIndicates that Basket successfully deleted the submitted basket during checkout cleanup. Ownercommerce-fulfillment-teamSchemaDiagramOpen docs, Basket deletion failedEventv1.0.0Basket deletion failedIndicates that Basket could not delete the submitted basket during checkout cleanup. Ownercommerce-fulfillment-teamSchemaDiagramOpen docsReport post-checkout cleanup outcome to Finance