using System; using API.Entities.Interfaces; namespace API.Entities; /// /// Represents the progress a single user has on a given Chapter. /// public class AppUserProgress : IEntityDate { /// /// Id of Entity /// public int Id { get; set; } /// /// Pages Read for given Chapter /// public int PagesRead { get; set; } /// /// Volume belonging to Chapter /// public int VolumeId { get; set; } /// /// Series belonging to Chapter /// public int SeriesId { get; set; } /// /// Library belonging to Chapter /// public int LibraryId { get; set; } /// /// Chapter /// public int ChapterId { get; set; } /// /// For Book Reader, represents the nearest passed anchor on the screen that can be used to resume scroll point /// on next load /// public string? BookScrollId { get; set; } /// /// When this was first created /// public DateTime Created { get; set; } /// /// Last date this was updated /// public DateTime LastModified { get; set; } public DateTime CreatedUtc { get; set; } public DateTime LastModifiedUtc { get; set; } // Relationships /// /// Navigational Property for EF. Links to a unique AppUser /// public AppUser AppUser { get; set; } = null!; /// /// User this progress belongs to /// public int AppUserId { get; set; } public void MarkModified() { LastModified = DateTime.Now; LastModifiedUtc = DateTime.UtcNow; } }