import { db } from './src/lib/db';

async function checkServices() {
  try {
    const services = await db.serviceLink.findMany({
      where: { parentId: null },
      orderBy: { order: 'asc' }
    });
    
    console.log('=== MAIN SERVICES ===');
    services.forEach(service => {
      console.log(`ID: ${service.id}`);
      console.log(`Title: ${service.title}`);
      console.log(`Icon File: ${service.iconFile || 'NULL'}`);
      console.log(`Icon URL: ${service.iconUrl || 'NULL'}`);
      console.log('---');
    });

    const subServices = await db.serviceLink.findMany({
      where: { parentId: { not: null } },
      orderBy: { order: 'asc' }
    });
    
    console.log('\n=== SUB SERVICES ===');
    subServices.forEach(service => {
      console.log(`ID: ${service.id}`);
      console.log(`Title: ${service.title}`);
      console.log(`Parent ID: ${service.parentId}`);
      console.log(`Link Page: ${service.linkPage || 'NULL'}`);
      console.log('---');
    });

  } catch (error) {
    console.error('Error:', error);
  } finally {
    await db.$disconnect();
  }
}

checkServices();