import { ShopifyProductService } from '../src/lib/shopify/product-service';
import { db } from '../src/db/client';

async function test() {
  const shop = await db.getDefaultShop();
  console.log('Shop:', shop?.id, shop?.shopify_domain);

  const res = await ShopifyProductService.fetchProductsPaginated({
    shopDomain: shop?.shopify_domain,
    query: 'CBD',
    page: 1,
    limit: 20
  });

  console.log('Paginated products for CBD:');
  for (const p of res.products) {
    console.log(`- ID: ${p.id} | Title: ${p.title}`);
  }
}

test().catch(console.error);
