export interface Product {
  _id: number;
  url: string;
  title_fa: string;
  title_en: string;
  seoTitle?: string;
  seoDescription?: string;
  source: string;
  description: string;
  metaDescription?: string;
  tags: string[];
  advantages: string[];
  disAdvantages: string[];
  imagesUrl: {
    cover: string;
    list: string[];
  };
  isFake: string;
  isWished: boolean | null;
  specifications: Array<{
    title: string;
    values: string[];
  }>;
  brand: {
    _id: string;
    status: string;
    title_en: string;
    title_fa: string;
    images: string[];
    logoUrl: string;
  };
  category: {
    _id: string;
    title_fa: string;
    title_en: string;
    icon: string;
    imageUrl: string;
    theme: string;
    description: string;
    leaf: boolean;
    parent: string;
  };
  default_variant?: ProductVariant;
  variants: ProductVariant[];
}

export interface ProductVariant {
  _id: string;
  market_status: string;
  price: {
    order_limit: number;
    retailPrice: number;
    selling_price: number;
    is_specialSale: boolean;
    discount_percent: number;
    specialSale_order_limit: number | null;
    specialSale_quantity: number | null;
    specialSale_endDate: string | null;
  };
  stock: number;
  postingTime: number;
  isFreeShip: boolean;
  isWholeSale: boolean;
  shop: {
    _id: string;
    shopName: string;
    shopCode: number;
    owner: string;
    shopDescription: string;
    telephoneNumber: string;
    isChatActive: boolean;
    shopPostalCode: string;
    logo: string;
  };
  shipmentMethod: Array<{
    _id: number;
    name: string;
    description: string;
    deliveryTime: number;
    deliveryType: string;
  }>;
  warranty: {
    _id: number;
    duration: string;
    logoUrl: string;
    name: string;
  };
  meterage?: {
    _id: number;
    value: string;
  };
  size?: {
    _id: number;
    value: string;
  };
}

export interface Category {
  _id: string;
  title_fa: string;
  title_en: string;
  icon: string;
  imageUrl?: string;
  description: string;
  variants: number[];
  hierarchy: string[];
  leaf: boolean;
  parent: string;
  deleted: boolean;
  createdAt: string;
  updatedAt: string;
  theme?: string;
  url: string;
  children: Category[];
}

export interface Brand {
  _id: string;
  title_fa: string;
  title_en: string;
  category: string;
  status: string;
  description: string;
  logoUrl: string;
  images: string[];
  deleted: boolean;
  createdAt: string;
  updatedAt: string;
  url: string;
}

export interface FilterAttribute {
  _id: number;
  title: string;
  hint: string;
  type: string;
  multiple: boolean;
  required: boolean;
  values: Array<{
    _id: number;
    attribute: number;
    text: string;
    createdAt: string;
    updatedAt: string;
    __v: number;
  }>;
}

export interface PriceRange {
  minPrice: number;
  maxPrice: number;
}

export interface Size {
  _id: number;
  value: string;
}

export interface Meterage {
  _id: number;
  value: string;
}

export interface Breadcrumb {
  _id: string;
  title_fa: string;
  title_en: string;
  icon: string;
  imageUrl: string;
  description: string;
  leaf: boolean;
  parent: string | null;
}

export interface Pager {
  page: number;
  limit: number;
  totalItems: number;
  totalPages: number;
  prevPage: boolean;
  nextPage: string | null;
}

export interface ProductsResponse {
  status: number;
  success: boolean;
  results: {
    category: Category;
    brands: Brand[];
    products: Product[];
    filters: {
      attributes: FilterAttribute[];
      priceRange: PriceRange;
      sizes: Size[];
      meterages: Meterage[];
    };
    breadcrumb: Breadcrumb[];
    pager: Pager;
  };
}
