Skip to content

Orders

Source: pharmanet-web/src/pages/Orders/Orders.jsx

Overview

Sellers manage incoming customer orders with full lifecycle support.

Components

Component File Description
OrderFilters components/orders/OrderFilters.jsx Status filter
OrderList components/orders/OrderList.jsx Paginated table
OrderDetailsModal components/orders/OrderDetailsModal.jsx Full order detail
OrderStatusUpdate components/orders/OrderStatusUpdate.jsx Status change form
OrderTimeline components/orders/OrderTimeline.jsx Status history

Service

Source: pharmanet-web/src/services/orders.js

Function Description
getOrders({page, limit, search, status}) Seller's incoming orders
getOrderById(id) Full detail with items
updateOrderStatus(id, status, trackingData) Change status + notify customer
updatePrescriptionStatus(id, status) Verify/reject Rx

Order Status Flow

pending → confirmed → processing → shipped → delivered
  ↓          ↓
cancelled  cancelled

Notifications

When a seller updates an order status, a notification is sent to the customer:

await notificationService.createNotification({
  user_id: order.user_id,
  type: 'order_status',
  title: 'Order Updated',
  message: `Order #${orderNumber} is now ${newStatus}`,
  relatedId: orderId,
  relatedType: 'order',
});