/**
 * Error Handler Utilities
 *
 * Standardized error and success response formats for API endpoints
 */

/**
 * Standard error response format
 *
 * @param code - Error code identifier (e.g., 'UNAUTHORIZED', 'INVALID_API_KEY')
 * @param message - Human-readable error message
 * @returns Standard error response object
 */
export function errorResponse(code: string, message: string) {
  return {
    success: false,
    error: { code, message },
    timestamp: new Date().toISOString(),
  };
}

/**
 * Standard success response format
 *
 * @param data - Response data payload
 * @returns Standard success response object
 */
export function successResponse(data: any) {
  return {
    success: true,
    data,
    timestamp: new Date().toISOString(),
  };
}
