using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using API.Entities.Enums; using API.Entities.Interfaces; using Microsoft.EntityFrameworkCore; namespace API.Entities.Metadata; [Index(nameof(Id), nameof(SeriesId), IsUnique = true)] public class SeriesMetadata : IHasConcurrencyToken { public int Id { get; set; } public string Summary { get; set; } = string.Empty; public ICollection CollectionTags { get; set; } public ICollection Genres { get; set; } = new List(); public ICollection Tags { get; set; } = new List(); /// /// All people attached at a Series level. /// public ICollection People { get; set; } = new List(); /// /// Highest Age Rating from all Chapters /// public AgeRating AgeRating { get; set; } /// /// Earliest Year from all chapters /// public int ReleaseYear { get; set; } /// /// Language of the content (BCP-47 code) /// public string Language { get; set; } = string.Empty; /// /// Total number of issues/volumes in the series /// public int TotalCount { get; set; } = 0; /// /// Max number of issues/volumes in the series (Max of Volume/Issue field in ComicInfo) /// public int MaxCount { get; set; } = 0; public PublicationStatus PublicationStatus { get; set; } // Locks public bool LanguageLocked { get; set; } public bool SummaryLocked { get; set; } /// /// Locked by user so metadata updates from scan loop will not override AgeRating /// public bool AgeRatingLocked { get; set; } /// /// Locked by user so metadata updates from scan loop will not override PublicationStatus /// public bool PublicationStatusLocked { get; set; } public bool GenresLocked { get; set; } public bool TagsLocked { get; set; } public bool WriterLocked { get; set; } public bool CharacterLocked { get; set; } public bool ColoristLocked { get; set; } public bool EditorLocked { get; set; } public bool InkerLocked { get; set; } public bool LettererLocked { get; set; } public bool PencillerLocked { get; set; } public bool PublisherLocked { get; set; } public bool TranslatorLocked { get; set; } public bool CoverArtistLocked { get; set; } public bool ReleaseYearLocked { get; set; } // Relationship public Series Series { get; set; } public int SeriesId { get; set; } /// [ConcurrencyCheck] public uint RowVersion { get; private set; } /// public void OnSavingChanges() { RowVersion++; } }