Enhance user management and billing integration
- Updated the `UserSummaryDto` to include `BillingEnabled` and `BillingPaidUntil` properties, allowing for better tracking of user billing status. - Refactored the `IdentityService` to populate the new billing fields when retrieving user summaries. - Modified the dashboard and admin user management components to display billing information, including a link to the billing page and a badge for billing status. - Added internationalization support for new billing-related labels in both English and Russian. - Ensured frontend components reflect the updated user data structure, enhancing user experience with billing visibility.
This commit is contained in:
@@ -34,7 +34,9 @@ public sealed record UserSummaryDto(
|
||||
string Role,
|
||||
bool IsActivated,
|
||||
bool IsBlocked,
|
||||
DateTimeOffset? ActivatedAt
|
||||
DateTimeOffset? ActivatedAt,
|
||||
bool BillingEnabled,
|
||||
DateTimeOffset? BillingPaidUntil
|
||||
);
|
||||
|
||||
public sealed record UserStatsDto(int Total, int Activated);
|
||||
|
||||
@@ -269,15 +269,17 @@ internal sealed class IdentityService(
|
||||
var items = new List<UserSummaryDto>(users.Count);
|
||||
foreach (var user in users)
|
||||
{
|
||||
var roleName = await GetPrimaryRoleNameAsync(user);
|
||||
var role = await GetPrimaryRoleAsync(user);
|
||||
items.Add(
|
||||
new UserSummaryDto(
|
||||
user.Id,
|
||||
user.UserName!,
|
||||
roleName,
|
||||
role.Name!,
|
||||
user.IsActivated,
|
||||
user.IsBlocked,
|
||||
user.ActivatedAt
|
||||
user.ActivatedAt,
|
||||
role.BillingEnabled,
|
||||
user.BillingPaidUntil
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user