diff --git a/src/NexusReader.Application/DTOs/User/UserProfileDto.cs b/src/NexusReader.Application/DTOs/User/UserProfileDto.cs index 2918c92..9d40c11 100644 --- a/src/NexusReader.Application/DTOs/User/UserProfileDto.cs +++ b/src/NexusReader.Application/DTOs/User/UserProfileDto.cs @@ -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; } - - /// - /// Relational data for the current subscription plan. - /// public SubscriptionPlanDto Plan { get; init; } = new(); - - public int AverageQuizScore { get; init; } + public int AITokensUsed { get; init; } + public string[] Roles { get; init; } = Array.Empty(); - /// - /// Summary of the last read book. - /// + // 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(); + // 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; +}