Package-level declarations

Types

Link copied to clipboard
data class Delivery(val productId: String, val quantity: Int)

A supplier's delivery to the warehouse: quantity units of the product productId.

Link copied to clipboard
@Description(value = "A product's stock: units on hand, and those reserved for orders")
class Stock(state: StockState)

A product's stock; its id is the product's id. The ordering context reserves units here for each order awaiting validation, commits the reservation once the order is shipped and releases it once the order is cancelled. Those commands come from another context, through this context's command topic.

Link copied to clipboard

The state of a Stock, changed in place by its events: the units onHand, those reserved for each order, and the units still available to reserve. Every property has a value before the first event.

Link copied to clipboard
fun interface SupplierDeliveries

The suppliers' delivery feed: what they delivered to the warehouse, day by day. A port of the SupplierDeliverySaga, which the server binds to the warehouse's receiving system and a test fakes.

Link copied to clipboard

Receives the suppliers' deliveries into stock once a day. Every morning at 06:00 UTC, the job reads the deliveries of the day before from SupplierDeliveries and sends a ReceiveStock to each delivered product's stock.