namespace RacePlannerApi.DTOs;

public class OrganizerDashboardDto
{
    public int TotalEvents { get; set; }
    public int PublishedEvents { get; set; }
    public int DraftEvents { get; set; }
    public int TotalRegistrations { get; set; }
    public int PendingRegistrations { get; set; }
    public int ConfirmedRegistrations { get; set; }
    public int CancelledRegistrations { get; set; }
    public decimal TotalRevenue { get; set; }
    public List<EventSummaryDto> UpcomingEvents { get; set; } = new();
    public List<EventCapacityDto> EventsNearCapacity { get; set; } = new();
}

public class EventSummaryDto
{
    public Guid Id { get; set; }
    public string Name { get; set; } = string.Empty;
    public DateTime EventDate { get; set; }
    public string Location { get; set; } = string.Empty;
    public int RegistrationCount { get; set; }
    public int? MaxParticipants { get; set; }
}

public class EventCapacityDto
{
    public Guid Id { get; set; }
    public string Name { get; set; } = string.Empty;
    public DateTime EventDate { get; set; }
    public int RegistrationCount { get; set; }
    public int? MaxParticipants { get; set; }
    public double CapacityPercentage => MaxParticipants.HasValue && MaxParticipants.Value > 0
        ? (double)RegistrationCount / MaxParticipants.Value * 100
        : 0;
}

public class ParticipantDashboardDto
{
    public int TotalRegistrations { get; set; }
    public int UpcomingEvents { get; set; }
    public int CompletedEvents { get; set; }
    public int CancelledRegistrations { get; set; }
    public List<RegistrationSummaryDto> MyRegistrations { get; set; } = new();
    public List<UpcomingEventDto> UpcomingEventList { get; set; } = new();
}

public class RegistrationSummaryDto
{
    public Guid Id { get; set; }
    public Guid EventId { get; set; }
    public string EventName { get; set; } = string.Empty;
    public DateTime EventDate { get; set; }
    public string Status { get; set; } = string.Empty;
    public DateTime RegisteredAt { get; set; }
}

public class UpcomingEventDto
{
    public Guid Id { get; set; }
    public string Name { get; set; } = string.Empty;
    public DateTime EventDate { get; set; }
    public string Location { get; set; } = string.Empty;
    public int DaysUntil => (EventDate - DateTime.UtcNow).Days;
}