using System;
using System.Collections.Generic;
using API.Entities.Metadata;
using API.Services.Plus;
using Microsoft.EntityFrameworkCore;
namespace API.Entities;
/// 
/// Represents a user entered field that is used as a tagging and grouping mechanism
/// 
[Obsolete("Use AppUserCollection instead")]
[Index(nameof(Id), nameof(Promoted), IsUnique = true)]
public class CollectionTag
{
    public int Id { get; set; }
    /// 
    /// Visible title of the Tag
    /// 
    public required string Title { get; set; }
    /// 
    /// Absolute path to the (managed) image file
    /// 
    /// The file is managed internally to Kavita's APPDIR
    public string? CoverImage { get; set; }
    /// 
    /// Denotes if the CoverImage has been overridden by the user. If so, it will not be updated during normal scan operations.
    /// 
    public bool CoverImageLocked { get; set; }
    /// 
    /// A description of the tag
    /// 
    public string? Summary { get; set; }
    /// 
    /// A normalized string used to check if the tag already exists in the DB
    /// 
    public required string NormalizedTitle { get; set; }
    /// 
    /// A promoted collection tag will allow all linked seriesMetadata's Series to show for all users.
    /// 
    public bool Promoted { get; set; }
    public ICollection SeriesMetadatas { get; set; } = null!;
    /// 
    /// Is this Collection tag managed by another system, like Kavita+
    /// 
    //public bool IsManaged { get; set; } = false;
    /// 
    /// The last time this Collection was Synchronized. Only applicable for Managed Tags.
    /// 
    //public DateTime LastSynchronized { get; set; }
    /// 
    /// Who created this Collection (Kavita, or external services)
    /// 
    //public ScrobbleProvider Provider { get; set; } = ScrobbleProvider.Kavita;
    /// 
    /// Not Used due to not using concurrency update
    /// 
    public uint RowVersion { get; private set; }
    /// 
    /// Not Used due to not using concurrency update
    /// 
    public void OnSavingChanges()
    {
        RowVersion++;
    }
}