Overview
TheOrderRepository interface defines the contract for all order data operations in the application layer. It provides methods for retrieving order lists, updating order statuses, and fetching detailed order information.
Source: application/order/order-repository.ts
Interface Definition
Methods
listBoard()
Retrieves the list of all orders for the order board display.Returns
A promise that resolves to an array of order list DTOs.
OrderListDto Structure
Unique identifier for the order
Name of the partner/restaurant
URL to the partner’s image
Human-readable order number for display
Current status of the order (RECEIVED, CONFIRMED, PREPARING, READY, PICKED_UP, DELIVERED, CANCELLED)
Order priority level (NORMAL or HIGH)
Active timer value for the order
Name of the assigned courier
Example
updateStatus()
Updates the status of a specific order.Parameters
The unique identifier of the order to update
The new status to set for the order. Must be one of:
RECEIVEDCONFIRMEDPREPARINGREADYPICKED_UPDELIVEREDCANCELLED
Returns
A promise that resolves when the status update is complete
Example
Status transitions should follow the natural order flow. Attempting invalid status transitions may result in errors depending on the implementation.
getDetail()
Retrieves detailed information about a specific order.Parameters
The unique identifier of the order to retrieve
Returns
A promise that resolves to the order detail DTO
OrderDetailDto Structure
Name of the customer who placed the order
Phone number of the customer
Delivery address for the order
Special instructions or notes for the order
Name of the assigned courier
Example
Type Definitions
OrderStatus
OrderPriority
Implementation Notes
The
OrderRepository is an interface and requires a concrete implementation. The actual data source (HTTP API, local storage, etc.) is determined by the implementation class.Related
- OrderRealtime - Real-time order event handling
- useOrderDetail Hook - React hook for fetching order details