ProcessOrderUseCase is responsible for receiving a new order and decomposing it into individual preparation tasks that are distributed across different kitchen stations.
Input Port
The use case implements theProcessOrderPort interface:
Implementation
ProcessOrderUseCase.java
Use Case Flow
Decompose into Tasks
The
TaskDecomposer analyzes the order’s products and groups them by station (BAR, HOT_KITCHEN, COLD_KITCHEN), creating one task per station.Example Usage
Dependencies
OrderRepository
Persistence port for storing orders
TaskDecomposer
Domain service that groups products by station
TaskRepository
Persistence port for storing tasks