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

async function checkContactsData() {
  console.log('🔍 Checking contact_submissions in Prisma database...\n');

  const prismaContacts = await prisma.contact_submissions.findMany({
    orderBy: { created_at: 'desc' },
    take: 10,
    select: {
      id: true,
      name: true,
      email: true,
      status: true,
      created_at: true,
    },
  });

  console.log(`📊 Found ${prismaContacts.length} contacts in Prisma database`);

  if (prismaContacts.length > 0) {
    console.log('\n✅ Sample data:');
    prismaContacts.forEach((contact, i) => {
      console.log(`${i + 1}. ${contact.name} (${contact.email}) - ${contact.status} - ${contact.created_at}`);
    });
  } else {
    console.log('\n⚠️  No contacts found in Prisma database');
    console.log('💡 Data may only exist in Supabase. Run sync script to copy data from Supabase to Prisma.');
  }

  await prisma.$disconnect();
}

checkContactsData().catch(console.error);
