export type OrderStatus =
  | "placed"
  | "confirmed"
  | "packed"
  | "shipped"
  | "out_for_delivery"
  | "delivered"
  | "completed"
  | "cancelled"
  | "disputed";

export type DisputeStatus = "open" | "under_review" | "resolved" | "rejected";
export type ShippingMethod = "standard" | "express" | "cod_pickup" | "self_pickup";

export interface TimelineEvent {
  status: OrderStatus;
  timestamp: string;
  description: string;
  actor: "seller" | "buyer" | "system";
}

export interface ShippingInfo {
  recipientName: string;
  address: string;
  city: string;
  pincode: string;
  phone: string;
  courierName?: string;
  trackingNumber?: string;
  estimatedDelivery?: string;
  shippingMethod: ShippingMethod;
  currentLocation?: string;
}

export interface DisputeInfo {
  reason: string;
  description: string;
  status: DisputeStatus;
  createdAt: string;
  resolution?: string;
}

export interface Order {
  id: string;
  paymentOrderId: string;
  listingId: string;
  listingSlug: string;
  listingTitle: string;
  listingImage: string;
  listingCondition: string;
  sellerId: string;
  sellerName: string;
  sellerAvatar: string;
  sellerVerified: boolean;
  sellerPhone: string;
  buyerId: string;
  buyerName: string;
  buyerAvatar: string;
  quantity: number;
  listingPrice: number;
  totalAmount: number;
  paymentMethod: "paypal" | "cod";
  paymentStatus: "paid" | "pending" | "refunded";
  status: OrderStatus;
  timeline: TimelineEvent[];
  shipping: ShippingInfo;
  dispute?: DisputeInfo;
  cancelReason?: string;
  createdAt: string;
  updatedAt: string;
}

export interface SellerOrderStats {
  total: number;
  pending: number;
  confirmed: number;
  packed: number;
  shipped: number;
  delivered: number;
  cancelled: number;
  revenue: number;
}
