Package dev.ucomprotocol.spi
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 Summary
Modifier and TypeMethodDescriptioncancelOrder(String orderId) Cancels an existing order.createOrder(String cartId) Creates an order from a cart.Retrieves an order by its ID.getOrdersByCustomer(String customerId) Retrieves all orders for a specific customer.
-
Method Details
-
createOrder
Creates an order from a cart.- Parameters:
cartId- the unique identifier of the cart to convert into an order- Returns:
- the created order
-
getOrder
Retrieves an order by its ID.- Parameters:
orderId- the unique identifier of the order- Returns:
- the requested order, or null if not found
-
getOrdersByCustomer
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
Cancels an existing order.- Parameters:
orderId- the unique identifier of the order to cancel- Returns:
- the updated order with cancelled status
-