62 lines
2.3 KiB
C#
62 lines
2.3 KiB
C#
namespace MidrandBooks.Models;
|
|
|
|
public class BookModel
|
|
{
|
|
public string Id { get; set; } = string.Empty;
|
|
public string Title { get; set; } = string.Empty;
|
|
public string Author { get; set; } = string.Empty;
|
|
public string AuthorId { get; set; } = string.Empty;
|
|
public string Description { get; set; } = string.Empty;
|
|
public double Price { get; set; }
|
|
public string Category { get; set; } = "Fiction";
|
|
public string? CoverUrl { get; set; }
|
|
public string CoverColor { get; set; } = "from-indigo-900 to-purple-950";
|
|
public string Type { get; set; } = "ebook"; // "ebook", "audiobook", "both"
|
|
public string Status { get; set; } = "published"; // "published", "converting", "pending_review", "rejected", "taken_down"
|
|
public string? ModerationFeedback { get; set; }
|
|
public double Rating { get; set; } = 4.5;
|
|
public int ReviewsCount { get; set; } = 12;
|
|
public bool Bestseller { get; set; }
|
|
public bool Trending { get; set; }
|
|
public string? PdfUrl { get; set; }
|
|
public string? PdfName { get; set; }
|
|
public string? AudioName { get; set; }
|
|
public string? AudioUrl { get; set; }
|
|
public int PublishedYear { get; set; } = 2026;
|
|
public int? PagesCount { get; set; }
|
|
public string? AudioDuration { get; set; }
|
|
public string? Narrator { get; set; }
|
|
public List<string> FullText { get; set; } = new();
|
|
public List<ModerationHistoryEntry> ModerationHistory { get; set; } = new();
|
|
}
|
|
|
|
public class ModerationHistoryEntry
|
|
{
|
|
public string Status { get; set; } = string.Empty;
|
|
public string Date { get; set; } = string.Empty;
|
|
public string Feedback { get; set; } = string.Empty;
|
|
}
|
|
|
|
public class CartItem
|
|
{
|
|
public BookModel Book { get; set; } = new();
|
|
public string Format { get; set; } = "ebook"; // "ebook", "audiobook"
|
|
public double Price => Format == "audiobook" ? Book.Price * 1.25 : Book.Price;
|
|
}
|
|
|
|
public class PurchaseRecord
|
|
{
|
|
public string BookId { get; set; } = string.Empty;
|
|
public string Format { get; set; } = "ebook";
|
|
public int CurrentPage { get; set; } = 0;
|
|
public int Progress { get; set; } = 0;
|
|
}
|
|
|
|
public class LibraryItem
|
|
{
|
|
public BookModel Book { get; set; } = new();
|
|
public string Format { get; set; } = "ebook";
|
|
public int CurrentPage { get; set; } = 0;
|
|
public int Progress { get; set; } = 0;
|
|
}
|