Refactor: Web Consolidation and Identity Stabilization #40
@@ -1,24 +1,32 @@
|
||||
using NexusReader.Application.Constants;
|
||||
|
||||
namespace NexusReader.Application.DTOs.User;
|
||||
|
||||
public record UserProfileDto
|
||||
{
|
||||
public string Email { get; init; } = string.Empty;
|
||||
public int AITokensUsed { get; init; }
|
||||
public Guid TenantId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Relational data for the current subscription plan.
|
||||
/// </summary>
|
||||
public SubscriptionPlanDto Plan { get; init; } = new();
|
||||
|
||||
public int AverageQuizScore { get; init; }
|
||||
public int AITokensUsed { get; init; }
|
||||
public string[] Roles { get; init; } = Array.Empty<string>();
|
||||
|
||||
/// <summary>
|
||||
/// Summary of the last read book.
|
||||
/// </summary>
|
||||
// Statistics for Dashboard
|
||||
public int TotalBooksRead { get; init; }
|
||||
public int AverageQuizScore { get; init; }
|
||||
public LastReadBookDto? LastReadBook { get; init; }
|
||||
|
||||
public string[] Roles { get; init; } = Array.Empty<string>();
|
||||
// UI Helpers
|
||||
public string CurrentPlan => Plan.Name ?? PlanConstants.Free;
|
||||
public int AITokenLimit => Plan.AITokenLimit > 0 ? Plan.AITokenLimit : PlanConstants.GetTokenLimit(CurrentPlan);
|
||||
public string LastReadBookTitle => LastReadBook?.Title ?? "Brak aktywności";
|
||||
}
|
||||
|
||||
public record SubscriptionPlanDto
|
||||
{
|
||||
public int Id { get; init; }
|
||||
public string Name { get; init; } = string.Empty;
|
||||
public int AITokenLimit { get; init; }
|
||||
public decimal MonthlyPrice { get; init; }
|
||||
}
|
||||
|
||||
public record LastReadBookDto
|
||||
@@ -27,7 +35,13 @@ public record LastReadBookDto
|
||||
public string Title { get; init; } = string.Empty;
|
||||
public AuthorDto Author { get; init; } = new();
|
||||
public string? CoverUrl { get; init; }
|
||||
public double Progress { get; init; }
|
||||
public string? LastChapter { get; init; }
|
||||
public int Progress { get; init; }
|
||||
public string LastChapter { get; init; } = string.Empty;
|
||||
public int LastChapterIndex { get; init; }
|
||||
}
|
||||
|
||||
public record AuthorDto
|
||||
{
|
||||
public Guid Id { get; init; }
|
||||
public string Name { get; init; } = string.Empty;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user