Interface IUserSearchService
- Namespace
- Builvero.Application.Services
- Assembly
- Builvero.Application.dll
Defines the contract for user search operations with role-based access control.
public interface IUserSearchService
Remarks
This interface provides methods for searching and retrieving user profiles with support for:
- Text, category, and skills-based search with pagination
- Role-based data filtering (admins can see sensitive information)
- Environment-aware profile photo URL mapping
Methods
GetUserProfileAsync(Guid, string?, CancellationToken)
Retrieves a specific user's profile by ID.
Task<UserSearchResultDto?> GetUserProfileAsync(Guid userId, string? requestingUserRole = null, CancellationToken cancellationToken = default)
Parameters
userIdGuidThe unique identifier of the user whose profile should be retrieved.
requestingUserRolestringOptional role of the requesting user. If "Admin", sensitive information (email, phone) is included in results.
cancellationTokenCancellationTokenCancellation token to cancel the operation.
Returns
- Task<UserSearchResultDto>
The user profile DTO if found; otherwise, null.
SearchUsersAsync(UserSearchRequest, string?, CancellationToken)
Searches for users matching the specified criteria with pagination support.
Task<(List<UserSearchResultDto> Users, int TotalCount)> SearchUsersAsync(UserSearchRequest request, string? requestingUserRole = null, CancellationToken cancellationToken = default)
Parameters
requestUserSearchRequestThe search request containing text, category, skills, and pagination parameters.
requestingUserRolestringOptional role of the requesting user. If "Admin", sensitive information (email, phone) is included in results.
cancellationTokenCancellationTokenCancellation token to cancel the operation.
Returns
- Task<(List<UserSearchResultDto> Users, int TotalCount)>
A tuple containing the list of matching users and the total count of matching users.