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

async function main() {
    const followupId = "ca96fb96-a274-452b-b850-c9e20c0c57bd";
    const followup = await prisma.followup.findUnique({
        where: { id: followupId },
        include: { opportunity: true, client: true }
    });

    console.log("FOLLOWUP:", JSON.stringify(followup, null, 2));

    if (followup && followup.clientId) {
        const opps = await prisma.opportunity.findMany({
            where: { clientId: followup.clientId }
        });
        console.log("CLIENT OPPORTUNITIES:", JSON.stringify(opps, null, 2));
    }
}

main()
    .catch(console.error)
    .finally(() => prisma.$disconnect());
