You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 17, 2023. It is now read-only.
The Order Aggregate-Root should have more sample domain logic, invariants and business rules validations so it makes sense to use the DDD Aggregate-Root pattern.
We actually just have the AddOrderItem(OrderItem item) method in here but with almost no domain logic or business validations.
I know that this is a simple example and not a real e-Commerce, but in this case, we need to show where to implement the business/domain logic --> in the Aggregate-Roots methods.
So, we need to add more domain logic here. It is actually too poor in regards domain logic.
For instance, you might get the same product item as multiple AddOrderItem(params) invocations. In this method, you could check that out and consolidate the same product items in a single OrderItem with several units (2, 3, 5, whatever the number of units), plus, if there are different amounts of discounts per prouct but the product Id is the same, you should apply the higher discount.., or any other domain logic to be applied.
Anyone reading this issue (Jimmy?), please, can you confirm the approach and suggest interesting domain rules/logic to add to the Order Aggregate-Root?