import { NextRequest, NextResponse } from 'next/server';
import { PrismaClient } from '@prisma/client';

const prisma = new PrismaClient();

export async function POST(req: NextRequest) {
    try {
        // Delete all daily puzzles (activations)
        const result = await prisma.dailyPuzzle.deleteMany({});

        return NextResponse.json({
            success: true,
            message: `Successfully deleted ${result.count} daily puzzles (activations)`,
            count: result.count,
        });
    } catch (error) {
        console.error('Error resetting activations:', error);
        return NextResponse.json(
            { error: 'Failed to reset activations' },
            { status: 500 }
        );
    }
}
