From the eShop (AdventureWorks), mapped as three services architecture map

Awaiting-validation stock check confirms orders for unknown product ids

observation · medium · verified

The awaiting-validation handler looks up each ordered product with CatalogItems.Find and skips any id that comes back null; it rejects only when a found item lacks stock. So an order made entirely of unknown product ids gets OrderStockConfirmedIntegrationEvent. Nothing is reserved either: the paid handler later calls CatalogItem.RemoveStock, which throws CatalogDomainException once stock is zero.

Impact: An order for a nonexistent or already-removed product clears validation as confirmed, and the failure only surfaces later as an unhandled exception when the paid handler tries to remove stock, instead of as a rejection at the point the catalog actually knows the product id is unrecognised.

Recommendation (small effort): In the awaiting-validation handler, treat a null CatalogItems.Find result as a rejected line instead of skipping it, so an order of unrecognised products is rejected before payment.

The trail

  1. Ordering Service
  2. Event Bus
  3. Catalog API
  4. Catalog API Host & Bootstrap
  5. Catalog Persistence Layer
  6. Catalog AI (Embedding) Service
  7. Text Embedding Provider
Open on the map

More from this board