/**
 * GET /api/billing/plans
 * -------------------------
 * Returns all active plans. No auth required — this is public data
 * used by the pricing page.
 *
 * To get the current user's subscription + usage, use GET /api/billing
 * (which requires admin/owner role).
 */

import { NextResponse } from "next/server";
import { getPlans } from "@/lib/services/billing";

export const dynamic = "force-dynamic";

export async function GET() {
  try {
    const plans = await getPlans();
    return NextResponse.json(plans);
  } catch {
    return NextResponse.json([]);
  }
}
