import { NextResponse } from 'next/server';
import { withErrorHandler } from '@server/middleware/withErrorHandler';
import { withAuth, AuthedRequest } from '@server/middleware/withAuth';
import { listPlans } from '@server/services/billing.service';

export const GET = withErrorHandler(
  withAuth(async (_req: AuthedRequest) => {
    const plans = await listPlans();
    return NextResponse.json({ plans });
  })
);
