return new OrderDeletedEvent(deleteOrderEvent.getKey(), order.toOrderDetails());
}
@Override
public OrderStatusEvent requestOrderStatus(RequestOrderStatusEvent requestOrderDetailsEvent) {
Order order = orderRepository.findById(requestOrderDetailsEvent.getKey());
if (order == null) {
return OrderStatusEvent.notFound(requestOrderDetailsEvent.getKey());
}
return new OrderStatusEvent(requestOrderDetailsEvent.getKey(), order.getStatus().toStatusDetails());
}