using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace CouchLog.Data
{
    public class SharedListEntity
    {
        [Key]
        public int Id { get; set; }

        public bool Favorite { get; set; } = false;

        [MaxLength(1000)]
        public string? Description { get; set; }

        public int? Season { get; set; }

        public int? Episode { get; set; }

        [Required]
        public required DateTime CreationTime { get; set; }

        public DateTime? LastChange { get; set; }


        // --- Foreign Keys ---
        public int SharedListId { get; set; }

        public int GlobalEntityId { get; set; }

        public int? SharedWatchStatusId { get; set; }


        // --- Navigation Properties ---
        [ForeignKey(nameof(SharedListId))]
        public virtual SharedList SharedList { get; set; } = null!;

        [ForeignKey(nameof(GlobalEntityId))]
        public virtual GlobalEntity GlobalEntity { get; set; } = null!;

        [ForeignKey(nameof(SharedWatchStatusId))]
        public virtual SharedWatchStatus? SharedWatchStatus { get; set; }

        public virtual ICollection<LinkTableSharedLabel> LinkTableSharedLabels { get; set; } = new List<LinkTableSharedLabel>();

        public virtual ICollection<LinkTablePrivateStreamingPlatform> LinkTablePrivateStreamingPlatforms { get; set; } = new List<LinkTablePrivateStreamingPlatform>();
    }
}