export type AdminOrderStatus = 'pending' | 'processing' | 'shipped' | 'delivered' | 'cancelled' | 'refunded';
export type AdminOrderPaymentStatus = 'unpaid' | 'paid' | 'refund_requested' | 'refunded';

export interface AdminOrderCustomer {
  name: string;
  email: string;
  phone: string;
}

export interface AdminOrderPayment {
  method: string;
  status: AdminOrderPaymentStatus;
  amount: number;
  currency: string;
}

export interface AdminOrderShipping {
  address: string;
  method: string;
  trackingNumber: string;
}

export interface AdminOrderItem {
  productId: string;
  name: string;
  quantity: number;
  price: number;
}

export type AdminOrderTimelineEventKey = 'created' | 'statusChanged' | 'refundRequested';

export interface AdminOrderTimelineEntry {
  status: AdminOrderStatus;
  timestamp: string;
  eventKey: AdminOrderTimelineEventKey;
}

export interface AdminOrder {
  id: string;
  orderNumber: string;
  status: AdminOrderStatus;
  customer: AdminOrderCustomer;
  payment: AdminOrderPayment;
  shipping: AdminOrderShipping;
  items: AdminOrderItem[];
  total: number;
  currency: string;
  notes: string;
  internalNotes: string;
  timeline: AdminOrderTimelineEntry[];
  archived: boolean;
  createdAt: string;
  updatedAt: string;
}

export interface AdminOrderListFilters {
  search: string;
  status: 'all' | AdminOrderStatus;
  page: number;
  pageSize: number;
}

export interface AdminOrdersListResult {
  items: AdminOrder[];
  total: number;
  page: number;
  pageSize: number;
}
