import { NextResponse } from 'next/server'; import { getAddigyClient } from '@/lib/services/addigy-factory'; export async function GET(request: Request) { try { const addigyClient = getAddigyClient(); const policies = await addigyClient.getAllPolicies(); return NextResponse.json({ success: true, data: policies, count: policies.length, }); } catch (error) { console.error('Error fetching Addigy policies:', error); return NextResponse.json( { success: false, error: error instanceof Error ? error.message : 'Unknown error', }, { status: 500 } ); } }