using Predictalytics.Domain.Enums;

namespace Predictalytics.Domain.Entities;

/// <summary>
/// Represents a prediction market event, which can contain multiple Markets (Questions).
/// </summary>
public class Event
{
    public int Id { get; set; }

    /// <summary>Platform this event belongs to.</summary>
    public PlatformType Platform { get; set; }

    /// <summary>Platform-specific numeric identifier for the event.</summary>
    public long PlatformEventId { get; set; }

    /// <summary>URL-friendly slug for the event.</summary>
    public string Slug { get; set; } = string.Empty;

    /// <summary>Event title.</summary>
    public string Title { get; set; } = string.Empty;

    /// <summary>Detailed event description.</summary>
    public string? Description { get; set; }

    /// <summary>Event image URL.</summary>
    public string? ImageUrl { get; set; }

    /// <summary>The time when the event starts.</summary>
    public DateTime? StartDate { get; set; }

    /// <summary>The time when the event ends.</summary>
    public DateTime? EndDate { get; set; }

    /// <summary>Comma-separated tags (categories) associated with the event.</summary>
    public string Tags { get; set; } = string.Empty;

    /// <summary>Whether the event is currently active.</summary>
    public bool IsActive { get; set; }

    /// <summary>Whether the event is closed.</summary>
    public bool IsClosed { get; set; }

    /// <summary>When this event was created on the platform.</summary>
    public DateTime CreatedAt { get; set; }

    /// <summary>When this record was first saved to our database.</summary>
    public DateTime DbCreatedAt { get; set; } = DateTime.UtcNow;

    /// <summary>Last time event data was refreshed.</summary>
    public DateTime? LastUpdatedAt { get; set; }

    // Navigation
    public ICollection<Market> Markets { get; set; } = new List<Market>();
}
