Interface OrderAdapter


public interface OrderAdapter
Adapter interface for order management operations.

Implement this interface to connect to a commerce platform's order processing system.

  • Method Details

    • createOrder

      Order createOrder(String cartId)
      Creates an order from a cart.
      Parameters:
      cartId - the unique identifier of the cart to convert into an order
      Returns:
      the created order
    • getOrder

      Order getOrder(String orderId)
      Retrieves an order by its ID.
      Parameters:
      orderId - the unique identifier of the order
      Returns:
      the requested order, or null if not found
    • getOrdersByCustomer

      List<Order> getOrdersByCustomer(String customerId)
      Retrieves all orders for a specific customer.
      Parameters:
      customerId - the unique identifier of the customer
      Returns:
      a list of the customer's orders, or an empty list if none found
    • cancelOrder

      Order cancelOrder(String orderId)
      Cancels an existing order.
      Parameters:
      orderId - the unique identifier of the order to cancel
      Returns:
      the updated order with cancelled status