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 Details

  • Method Details

    • placeOrder

      public OrderSummary placeOrder(OrderCommand command)
      Places a submitted order and publishes an order-created event after persistence.
      Specified by:
      placeOrder in interface OrderManagement
      Parameters:
      command - order placement command
      Returns:
      submitted order summary
    • getOrder

      @Transactional(readOnly=true) public OrderSummary getOrder(UUID orderId)
      Retrieves a persisted order summary.
      Specified by:
      getOrder in interface OrderManagement
      Parameters:
      orderId - order identifier
      Returns:
      submitted order summary
      Throws:
      ResourceNotFoundException - when the order does not exist