// تایپ‌های اصلی برند
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 ProductImage {
  cover: string;
  list: string[];
}

export interface ProductSpecification {
  title: string;
  values: string[];
}

export interface ProductBrand {
  _id: string;
  status: string;
  title_en: string;
  title_fa: string;
  images: string[];
  logoUrl: string;
}

export interface ProductCategory {
  _id: string;
  title_fa: string;
  title_en: string;
  icon: string;
  imageUrl: string;
  theme: string;
  description: string;
  leaf: boolean;
  parent: string;
}

export interface ProductPrice {
  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;
}

export interface Shop {
  _id: string;
  shopName: string;
  shopCode: number;
  owner: string;
  shopDescription: string;
  telephoneNumber: string;
  isChatActive: boolean;
  shopPostalCode: string;
  logo: string;
}

export interface ShipmentMethod {
  _id: number;
  name: string;
  description: string;
  deliveryTime: number;
  deliveryType: string;
}

export interface Warranty {
  _id: number;
  duration: string;
  logoUrl: string;
  name: string;
}

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

export interface ProductVariant {
  _id: string;
  market_status: string;
  price: ProductPrice;
  stock: number;
  postingTime: number;
  isFreeShip: boolean;
  isWholeSale: boolean;
  shop: Shop;
  shipmentMethod: ShipmentMethod[];
  warranty: Warranty;
  meterage: Meterage;
}

export interface Product {
  _id: number;
  url: string;
  title_fa: string;
  title_en: string;
  seoTitle: string;
  seoDescription: string | null;
  source: string;
  description: string;
  metaDescription: string;
  tags: string[];
  advantages: string[];
  disAdvantages: string[];
  imagesUrl: ProductImage;
  isFake: string;
  isWished: boolean | null;
  specifications: ProductSpecification[];
  brand: ProductBrand;
  category: ProductCategory;
  default_variant: ProductVariant;
  variants: ProductVariant[];
}

// تایپ‌های فیلتر
export interface PriceRange {
  minPrice: number;
  maxPrice: number;
}

export interface Filters {
  priceRange: PriceRange;
}

// تایپ‌های دسته‌بندی
export interface CategoryVariant {
  _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;
  url: string;
  children: CategoryVariant[];
}

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 | null;
  deleted: boolean;
  createdAt: string;
  updatedAt: string;
  url: string;
  children: CategoryVariant[];
}

// تایپ‌های پاژینیشن
export interface Pager {
  page: number;
  limit: number;
  totalItems: number;
  totalPages: number;
  prevPage: boolean;
  nextPage: boolean;
}

// تایپ اصلی پاسخ API
export interface BrandResponse {
  status: number;
  success: boolean;
  results: {
    brand: Brand;
    products: Product[];
    filters: Filters;
    category: Category;
    pager: Pager;
  };
}

// تایپ‌های پارامترهای درخواست
export interface BrandParams {
  id: string;
  page?: number;
  limit?: number;
  sort?: number;
  priceMin?: number;
  priceMax?: number;
  category?: string;
}

// تایپ پارامترهای hook برای دریافت محصولات برند
export interface BrandProductsParams {
  brandId: string;
  page?: number;
  limit?: number;
  sort?: number;
  priceMin?: number;
  priceMax?: number;
  category?: string;
}
