Client Orders

The system receives all incoming orders from the clients; each incoming order line specifies a product and the required quantity. Moreover, the incoming order contains information about the client, the expected delivery date and the delivery location. Finally, each order is identified by a unique ID in order to allow order tracking.

After an order is received it has to be priced: a priced order has the same structure of an incoming order but each order line also specifies the total price, which is obtained from the pricing subdomain. The priced order also specifies the total price which is obtained from the sum of the lines' prices.

After the order is priced it considered in progress, and it is the operator's job to palletize the products needed for each order. The order is considered incomplete until all the required products are palletized.

When an order is completed by the operator (i.e. all the products are taken from the stock and palletized) it is weighted; then, the operator prints the order's transport document and attach it to the pallet which is loaded onto a truck. A notification is sent to the client notifying them the order has been shipped.

Ubiquitous Language

Term Definition
Incoming order A set of order lines with their respective quantity (e.g. 1000 ricotte of 0.5kg, 50 squacqueroni of 1 kg), it also contains data about the client, an expected delivery date and the delivery location.
Incoming order line A product with its ordered quantity.
Client A physical or legal entity that places orders.
Location The location where an order has to be shipped to.
Priced order An order where each line has an associated price and, optionally, an applied discount. It also has the total price. Its structure resembles the incoming order's with the difference that each line has been priced.
Priced order line A product with its quantity and a price.
In progress order An order that is being fulfilled by an operator. Its structure resembles the priced order's with the difference that each line can specify whether it is fulfilled or not.
In progress order line A product with its quantity and a price. It may be in two different states: complete if the product has already been palletized and is ready in the required quantity; incomplete if the product is not present in the required quantity.
Completed order An order that has been fulfilled by the operator and is ready to be shipped.
Complete order line A product with its quantity, a price.
Transport document A document that has to specify: a delivery location, a shipping location, the client's info, the shipping date, the total weight of the pallet, and a list of transport document lines.
Transport document line A product with its respective shipped quantity.

Domain Events

Incoming Events

Term Definition
Order received An event which is received when an order is made.
Product palletized for order An event received when an operator takes a product from the stock and palletizes it for the given order.
Order completed An event received when an order in progress is marked as ready to be shipped.

Outgoing Events

Term Definition
Order processed An event emitted when a new incoming order is received and processed.
Generated byscaladoc
Made with ❤ by Giacomo, Nicolas, Nicolò, Linda
Mode
Back to top
In this article