"""Standardized API response helpers."""

from fastapi.responses import JSONResponse


def error_response(code: str, message: str, status_code: int = 400) -> JSONResponse:
    """Return a standardized error response."""
    return JSONResponse({"error": {"code": code, "message": message}}, status_code=status_code)


def success_response(data: dict, status_code: int = 200) -> JSONResponse:
    """Return a standardized success response."""
    return JSONResponse(data, status_code=status_code)
