Skip to content

Commerce domain

The merchant-native Seams Pantry model for catalog, inventory, selling, orders, and fulfillment.

Commerce domain ​

Pantry models a café and bakery as a merchant operation rather than as a set of provider payloads. Provider shapes end at adapters. The internal domain keeps products, offers, stock, orders, payment, preparation, fulfillment, and shipping on separate lifecycles.

Plans 22 and 23 define the accepted café, patisserie, packaged-goods, and flavored export paths. The full authoritative model remains in docs/commerce-domain-architecture.md.

Domain principles ​

  1. Each active organisation selects exactly one commerce authority for a resource.
  2. Every durable fact has one named writer.
  3. Inventory movements and allocations are authoritative; balances are derived transactionally.
  4. Mutable buyer intent ends at checkout. The order stores an immutable commercial snapshot.
  5. Fulfillment method determines the valid fulfillment lifecycle.
  6. Provider capability gaps remain explicit typed branches.
  7. Read projections are rebuildable from ordered provider observations.

Commerce layers ​

mermaid
flowchart TB
    Catalog["Catalog and offers"] --> Selling["Menus, storefront, and checkout"]
    Inventory["Inventory, receiving, and production"] --> Selling
    Selling --> Order["Order and payment"]
    Order --> Fulfillment["Pickup, shipping, and tracking"]
    Authority["Commerce engine or Shopify authority"] --> Observations["Signed observations"]
    Observations --> Projections["Pantry projections"]
    Projections --> Cases["Cases and governed actions"]
    Cases --> Authority

Core aggregates ​

AggregateOwns
LocationOperational identity, roles, address facts, and lifecycle
ProductDescriptive catalog content and lifecycle
Sellable variantOne purchasable configuration and merchant code
OfferVariant, channel, market, price, scope, validity, and lifecycle
Inventory positionMovements, allocations, lots, and derived balance for an item and location
MenuSections, entries, modifier bindings, and publication revision
Recipe revisionImmutable inputs, output policy, and activation lifecycle
Preparation ticketOrder-specific preparation and measured consumption
Production batchInputs, actual yield, output lot, and measured movements
CartMutable buyer selections
CheckoutQuote, stock allocations, and protected delivery reference
OrderImmutable commercial agreement and lifecycle
PaymentProvider transactions for one tender lineage
FulfillmentMethod-specific allocation of order lines
ShipmentOne package and its carrier events

An aggregate is the smallest state unit that requires one transactional invariant. Cross-aggregate effects use idempotent commands and confirming observations.

Café and patisserie ​

The café path combines prepared products, menus, modifiers, recipes, preparation tickets, pickup, payment, and inventory movements. It keeps finished goods and their ingredients separate so a production movement can be measured and reconciled.

Online export ​

The export path adds a first-party storefront, one-package shipping, destination-specific customs facts, carrier rates, tax and duty quotes, label purchase, and tracking. Flavored products preserve the product and variant identity while binding packaging and customs requirements to the export offer.

See Commerce operations for the operating view of these aggregates.