import { apiRequest } from "@/services/apiClient";
import type { PlanCatalogId } from "@/lib/planCatalogs";
import type { Plan } from "@/types/plan";

export const plansService = {
  async listPublic(catalog?: PlanCatalogId, token?: string | null) {
    const qs = catalog ? `?catalog=${encodeURIComponent(catalog)}` : "";
    const res = await apiRequest<Plan[]>(`/plans${qs}`, { token });
    return res.data;
  },
};
