import { apiGet } from "@/api/client";

export interface Money {
  amount: number;
  currency: string;
}

export interface MediaAsset {
  url: string;
  alt: string;
}

export interface CatalogProductSummary {
  id: string;
  slug: string;
  name: string;
  brand: string;
  category: string;
  status: string;
  short_description: string;
  hero_image: MediaAsset;
  price: Money;
  compare_at_price: Money | null;
  tags: string[];
  variant_count: number;
}

export function fetchCatalogProducts(accessToken?: string) {
  return apiGet<CatalogProductSummary[]>("/catalog/products", { accessToken });
}
