const { PrismaClient } = require('@prisma/client');
const prisma = new PrismaClient();

async function test() {
  console.log('Attempting to create an AnalyticsEvent...');
  try {
    const event = await prisma.analyticsEvent.create({
      data: {
        type: 'TEST_MANUAL',
        path: '/test-script',
        label: 'Script Test',
        metadata: { source: 'script' }
      }
    });
    console.log('SUCCESS! Event created:', event.id);
  } catch (error) {
    console.error('FAILURE! Prisma Error:');
    console.error(error);
  } finally {
    await prisma.$disconnect();
  }
}

test();
