Stock
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.
A short stock is a rejection (Rejections.INSUFFICIENT): nothing is written, and the rejection goes back to the ordering saga that sent the reservation, as a receipt. Every command for one order is idempotent by the order's id, besides the kernel's de-duplication by request id: reserving again for an order already reserved, and releasing a reservation that is not there, change nothing.
A product's stock belongs to its tenant (Ownership.TENANT): the order-process saga reserves it in the scope of the buyer whose order it handles, which the stock does not check.
Types
The codes the aggregate rejects a command with, by their local names: the compiler and the kernel name them <context>.stock.<code>, as its peers read them from the api's generated contract.