using System;
using System.Collections.Generic;
using API.DTOs.Metadata;
using API.DTOs.Person;
using API.Entities.Enums;
using API.Entities.Interfaces;
namespace API.DTOs;
#nullable enable
///
/// A Chapter is the lowest grouping of a reading medium. A Chapter contains a set of MangaFiles which represents the underlying
/// file (abstracted from type).
///
public class ChapterDto : IHasReadTimeEstimate, IHasCoverImage
{
///
public int Id { get; init; }
///
public string Range { get; init; } = default!;
///
[Obsolete("Use MinNumber and MaxNumber instead")]
public string Number { get; init; } = default!;
///
public float MinNumber { get; init; }
///
public float MaxNumber { get; init; }
///
public float SortOrder { get; set; }
///
public int Pages { get; init; }
///
public bool IsSpecial { get; init; }
///
public string Title { get; set; } = default!;
///
/// The files that represent this Chapter
///
public ICollection Files { get; init; } = default!;
///
/// Calculated at API time. Number of pages read for this Chapter for logged in user.
///
public int PagesRead { get; set; }
///
/// The last time a chapter was read by current authenticated user
///
public DateTime LastReadingProgressUtc { get; set; }
///
/// The last time a chapter was read by current authenticated user
///
public DateTime LastReadingProgress { get; set; }
///
public bool CoverImageLocked { get; set; }
///
public int VolumeId { get; init; }
///
public DateTime CreatedUtc { get; set; }
///
public DateTime LastModifiedUtc { get; set; }
///
public DateTime Created { get; set; }
///
public DateTime ReleaseDate { get; init; }
///
public string TitleName { get; set; } = default!;
///
public string Summary { get; init; } = default!;
///
public AgeRating AgeRating { get; init; }
///
public long WordCount { get; set; } = 0L;
///
/// Formatted Volume title ie) Volume 2.
///
/// Only available when fetched from Series Detail API
public string VolumeTitle { get; set; } = string.Empty;
///
public int MinHoursToRead { get; set; }
///
public int MaxHoursToRead { get; set; }
///
public float AvgHoursToRead { get; set; }
///
public string WebLinks { get; set; }
///
public string ISBN { get; set; }
#region Metadata
public ICollection Writers { get; set; } = new List();
public ICollection CoverArtists { get; set; } = new List();
public ICollection Publishers { get; set; } = new List();
public ICollection Characters { get; set; } = new List();
public ICollection Pencillers { get; set; } = new List();
public ICollection Inkers { get; set; } = new List();
public ICollection Imprints { get; set; } = new List();
public ICollection Colorists { get; set; } = new List();
public ICollection Letterers { get; set; } = new List();
public ICollection Editors { get; set; } = new List();
public ICollection Translators { get; set; } = new List();
public ICollection Teams { get; set; } = new List();
public ICollection Locations { get; set; } = new List();
public ICollection Genres { get; set; } = new List();
///
/// Collection of all Tags from underlying chapters for a Series
///
public ICollection Tags { get; set; } = new List();
public PublicationStatus PublicationStatus { get; set; }
///
public string? Language { get; set; }
///
public int Count { get; set; }
///
public int TotalCount { get; set; }
///
public bool LanguageLocked { get; set; }
///
public bool SummaryLocked { get; set; }
///
public bool AgeRatingLocked { get; set; }
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 ImprintLocked { get; set; }
///
public bool LettererLocked { get; set; }
///
public bool PencillerLocked { get; set; }
///
public bool PublisherLocked { get; set; }
///
public bool TranslatorLocked { get; set; }
///
public bool TeamLocked { get; set; }
///
public bool LocationLocked { get; set; }
///
public bool CoverArtistLocked { get; set; }
public bool ReleaseYearLocked { get; set; }
#endregion
///
public string? CoverImage { get; set; }
///
public string? PrimaryColor { get; set; } = string.Empty;
///
public string? SecondaryColor { get; set; } = string.Empty;
public void ResetColorScape()
{
PrimaryColor = string.Empty;
SecondaryColor = string.Empty;
}
}