/**
 * Resume an interrupted application workflow.
 *
 * POST /api/applications/:id/resume
 *
 * Resets interrupted steps to pending and re-runs the workflow
 * from where it left off. The agent SDK session is resumed with
 * the same conversation context.
 */
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 { id } = await params;
        const useCase = resolve('ResumeApplicationWorkflowUseCase');
        void useCase.execute({ applicationId: id });
        return NextResponse.json({ ok: true });
    }
    catch (error) {
        // eslint-disable-next-line no-console
        console.error('[POST /api/applications/:id/resume]', error);
        return NextResponse.json({ error: error instanceof Error ? error.message : 'Internal server error' }, { status: 500 });
    }
}
