/*
 * File: D:\shadowed-realms-mobile\ShadowedRealmsMobile\src\server\ShadowedRealms.Shared\DTOs\Common\ErrorResponseDto.cs
 * Created: 2025-10-19
 * Last Modified: 2025-10-19
 * Description: Standard error response DTO for consistent API error handling across all controllers
 * Last Edit Notes: Individual file implementation with validation error support and contextual error information
 */

using System.ComponentModel.DataAnnotations;

namespace ShadowedRealms.Shared.DTOs.Common
{
    /// <summary>
    /// Standard error response for all API endpoints
    /// </summary>
    public class ErrorResponseDto
    {
        /// <summary>
        /// Human-readable error message
        /// </summary>
        [Required]
        public string Message { get; set; } = string.Empty;

        /// <summary>
        /// Error code for client handling
        /// </summary>
        [Required]
        public string Code { get; set; } = string.Empty;

        /// <summary>
        /// Additional error details
        /// </summary>
        public Dictionary<string, object>? Details { get; set; }

        /// <summary>
        /// Validation errors from model binding
        /// </summary>
        public Dictionary<string, string[]>? ValidationErrors { get; set; }

        /// <summary>
        /// Timestamp when error occurred
        /// </summary>
        public DateTime Timestamp { get; set; } = DateTime.UtcNow;
    }
}