// pkg/utils/response.go (дополнение)
package utils

import (
	"encoding/json"
	"net/http"
)

// RespondWithValidationError отправляет ответ с ошибками валидации
func RespondWithValidationError(w http.ResponseWriter, validationError error) {
	w.Header().Set("Content-Type", "application/json")
	w.WriteHeader(http.StatusBadRequest)

	response := map[string]interface{}{
		"error":   "Validation failed",
		"details": GetValidationErrors(validationError),
	}

	json.NewEncoder(w).Encode(response)
}
