/**
 * Mark chat as read API.
 *
 * POST /api/interactive/chat/[featureId]/mark-read
 *
 * Clears the 'unread' turn status to 'idle'. Called when the user
 * opens/views the chat tab for a feature.
 */
import { NextResponse } from 'next/server';
import { resolve } from '../../../../../../lib/server-container.js';
export const dynamic = 'force-dynamic';
export async function POST(_request, { params }) {
    try {
        const { featureId } = await params;
        const service = resolve('IInteractiveSessionService');
        await service.markRead(featureId);
        return NextResponse.json({ ok: true });
    }
    catch (error) {
        // eslint-disable-next-line no-console
        console.error('[POST /api/interactive/chat/:featureId/mark-read]', error);
        return NextResponse.json({ error: error instanceof Error ? error.message : 'Internal server error' }, { status: 500 });
    }
}
