// MongoDB Order Model Schema
export interface Order {
  _id?: string;
  orderNumber: string; // Unique order number
  customer: {
    userId?: string; // If registered user
    name: string;
    email: string;
    phone?: string;
    address: {
      street: string;
      city: string;
      state?: string;
      zip: string;
      country: string;
    };
  };
  items: Array<{
    productId: string;
    title: string;
    sku: string;
    quantity: number;
    price: number;
    total: number;
    image?: string;
  }>;
  totals: {
    subtotal: number;
    tax: number;
    shipping: number;
    discount: number;
    total: number;
  };
  payment: {
    method: string; // "Credit Card", "PayPal", etc.
    status: string; // "pending", "paid", "failed", "refunded"
    transactionId?: string;
    paidAt?: Date;
  };
  shipping: {
    method: string; // "Standard", "Express"
    trackingNumber?: string;
    carrier?: string;
    estimatedDelivery?: Date;
  };
  status: string; // "pending", "processing", "shipped", "delivered", "cancelled", "refunded"
  notes?: string;
  createdAt: Date;
  updatedAt: Date;
}

