import { NextResponse } from "next/server"
import { getUserTags } from "@/services/rfm-engine"

export async function GET(req: Request) {
  const url = new URL(req.url)
  const userId = url.searchParams.get("user_id")
  if (!userId) {
    return NextResponse.json({ success: false, error: "missing user_id" }, { status: 400 })
  }
  const data = getUserTags(userId)
  return NextResponse.json({ success: true, data })
}
