Class OrderApplicationService
java.lang.Object
com.example.orderplatform.orders.application.OrderApplicationService
- All Implemented Interfaces:
OrderManagement
@Service
@Transactional
public class OrderApplicationService
extends Object
implements OrderManagement
Application service that coordinates customer lookup, pricing, order persistence and order events.
-
Constructor Summary
ConstructorsConstructorDescriptionOrderApplicationService(CustomerDirectory customers, PricingService pricing, OrderStore orders, org.springframework.context.ApplicationEventPublisher events) -
Method Summary
Modifier and TypeMethodDescriptionRetrieves a persisted order summary.placeOrder(OrderCommand command) Places a submitted order and publishes an order-created event after persistence.
-
Constructor Details
-
OrderApplicationService
public OrderApplicationService(CustomerDirectory customers, PricingService pricing, OrderStore orders, org.springframework.context.ApplicationEventPublisher events)
-
-
Method Details
-
placeOrder
Places a submitted order and publishes an order-created event after persistence.- Specified by:
placeOrderin interfaceOrderManagement- Parameters:
command- order placement command- Returns:
- submitted order summary
-
getOrder
Retrieves a persisted order summary.- Specified by:
getOrderin interfaceOrderManagement- Parameters:
orderId- order identifier- Returns:
- submitted order summary
- Throws:
ResourceNotFoundException- when the order does not exist
-