Страница профиля

This commit is contained in:
Халимов Рустам
2026-02-13 14:24:01 +03:00
parent b24b9d697f
commit 1e72d006c4
34 changed files with 1169 additions and 27 deletions
@@ -6,7 +6,17 @@ namespace Nashel.Modules.Identity.Application.Queries.GetProfile;
public record GetProfileQuery : IRequest<ProfileResponse>;
public record ProfileResponse(Guid Id, string Phone, List<string> Roles);
public record ProfileResponse(
Guid Id,
string Phone,
List<string> Roles,
string FirstName,
string LastName,
string? Patronymic,
string? CompanyName,
string FullName,
string? AvatarUrl,
List<string> Competencies);
public class GetProfileQueryHandler : IRequestHandler<GetProfileQuery, ProfileResponse>
{
@@ -33,9 +43,22 @@ public class GetProfileQueryHandler : IRequestHandler<GetProfileQuery, ProfileRe
throw new Exception("Account not found");
}
var fullName = $"{account.Profile.FirstName} {account.Profile.LastName}";
if (!string.IsNullOrEmpty(account.Profile.Patronymic))
{
fullName += $" {account.Profile.Patronymic}";
}
return new ProfileResponse(
account.Id,
account.Phone,
account.Roles.Select(r => r.ToString()).ToList());
account.Id,
account.Phone,
account.Roles.Select(r => r.ToString()).ToList(),
account.Profile.FirstName,
account.Profile.LastName,
account.Profile.Patronymic,
account.Profile.CompanyName,
fullName,
account.Profile.AvatarUrl,
account.Profile.Competencies.Select(c => c.Name).ToList());
}
}