Follow the order

The customer finds a product in the storefront, places it in a cart, checks out, and receives an order record. Inventory, payment, and fulfilment responsibilities are kept explicit rather than folded into one screen.

  1. 01Catalogue
  2. 02Cart & stock
  3. 03Order & payment
  4. 04Fulfilment
Logical customer-to-fulfilment flow. Implementation responsibilities span separate services.

The data behind the screen

The catalogue records products and variants. Inventory records stock quantity and reserved quantity. The order domain records item quantities, money values, shipping, and discounts.

  • Catalogue: product, variant, category, image and channel context
  • Inventory: warehouse, stock level and reservation quantities
  • Order: line items, payment state, totals and lifecycle
  • Customer: account and order history
  • Notifications: events consumed and delivered through the configured channels

Business rules expressed in code

These formulas map directly to domain methods, rather than being decorative examples.

Available stock

Available = Quantity − Reserved

StockLevel.Available subtracts reserved quantity from the total. IsAvailable compares that result with the requested quantity.

Reservation utilization

Utilization = Reserved / Quantity × 100

StockLevel.UtilizationRate returns 0 when total quantity is zero, avoiding division by zero.

Order total

Total = max(0, Subtotal + Shipping − Discount + Tax)

CalculateOrderTotal uses currency-aware money operations, returns currency errors, and clamps a negative total to zero. The cart currently supplies zero tax to this calculation.

Keep the implementation claims honest

The store remains in development. The first channel workflow uses manual listing, and automated synchronization is disabled by default. Configured payment credentials are still necessary for provider-backed checkout.

The useful case study is the system and its decisions. We have not added invented customers, sales figures, or conversion improvements to this page.