I have a summary root of Order, and it has a number of methods on it that internally set its Status field:
The available actions depend on the current state of the order (for example, it cannot be put on hold if it is already on hold). The problem is that I need to provide a request to tell the user interface which commands are available, so I can hide operations that would otherwise throw InvalidOperationException.
InvalidOperationException
How to do this with minimal DRY violation?
- / .
: PlaceOnHoldCommand OrderPlacedOnHoldEvent, ( EventStore) OrderTransitionsEventHandler, DB, Order. ( sth.)
PlaceOnHoldCommand
OrderPlacedOnHoldEvent
OrderTransitionsEventHandler
, , . , , . CQRS , , DRY.