Kavita/Kavita.Models/Entities/User/AppUserTableOfContent.cs
Fesaa c62b20f54b
BE Tech Debt (#4497)
Co-authored-by: Joseph Milazzo <joseph.v.milazzo@gmail.com>
Co-authored-by: Joe Milazzo <josephmajora@gmail.com>
2026-03-07 10:04:08 -08:00

60 lines
1.8 KiB
C#

using System;
using Kavita.Models.Entities.Interfaces;
namespace Kavita.Models.Entities.User;
/// <summary>
/// A personal table of contents for a given user linked with a given book
/// </summary>
public class AppUserTableOfContent : IEntityDate
{
public int Id { get; set; }
/// <summary>
/// The page to bookmark
/// </summary>
public required int PageNumber { get; set; }
/// <summary>
/// The title of the bookmark. Defaults to Page {PageNumber} if not set
/// </summary>
public required string Title { get; set; }
/// <summary>
/// For Book Reader, represents the nearest passed anchor on the screen that can be used to resume scroll point. If empty, the ToC point is the beginning of the page
/// </summary>
public string? BookScrollId { get; set; }
/// <summary>
/// Text of the bookmark
/// </summary>
public string? SelectedText { get; set; }
/// <summary>
/// Title of the Chapter this PToC was created in
/// </summary>
/// <remarks>Taken from the ToC</remarks>
public string? ChapterTitle { get; set; }
public required int SeriesId { get; set; }
public virtual Series Series { get; set; }
public required int ChapterId { get; set; }
public virtual Chapter Chapter { get; set; }
public int VolumeId { get; set; }
public int LibraryId { get; set; }
public DateTime Created { get; set; }
public DateTime CreatedUtc { get; set; }
public DateTime LastModified { get; set; }
public DateTime LastModifiedUtc { get; set; }
// Relationships
/// <summary>
/// Navigational Property for EF. Links to a unique AppUser
/// </summary>
public AppUser AppUser { get; set; } = null!;
/// <summary>
/// User this table of content belongs to
/// </summary>
public int AppUserId { get; set; }
}