Interface IProfileService
- Namespace
- Builvero.Application.Services
- Assembly
- Builvero.Application.dll
Defines the contract for user profile management operations.
public interface IProfileService
Remarks
This interface provides methods for retrieving and updating user profiles, including education, experience, skills, and builder tags. Profile photo URLs are automatically converted to presigned URLs for secure access.
Methods
GetProfileAsync(Guid, CancellationToken)
Retrieves the complete profile for a specified user.
Task<ProfileDto> GetProfileAsync(Guid userId, CancellationToken cancellationToken = default)
Parameters
userIdGuidThe unique identifier of the user whose profile should be retrieved.
cancellationTokenCancellationTokenCancellation token to cancel the operation.
Returns
- Task<ProfileDto>
A ProfileDto containing the user's profile information.
Remarks
If the user doesn't have a profile yet, returns an empty profile DTO to allow profile completion. Profile photo URLs are mapped using environment-aware logic (presigned URLs in production, object keys in test).
Exceptions
- Exception
Thrown when the user is not found or user email is missing.
UpdateProfileAsync(Guid, UpdateProfileRequest, CancellationToken)
Updates a user's profile information including personal details, education, experience, skills, and builder tags.
Task<ProfileDto> UpdateProfileAsync(Guid userId, UpdateProfileRequest request, CancellationToken cancellationToken = default)
Parameters
userIdGuidThe unique identifier of the user whose profile should be updated.
requestUpdateProfileRequestThe profile update request containing fields to modify.
cancellationTokenCancellationTokenCancellation token to cancel the operation.
Returns
- Task<ProfileDto>
A ProfileDto representing the updated profile.
Remarks
This method performs a full profile update:
- Updates basic profile information (name, summary, location, contact)
- Replaces education entries with the provided list
- Replaces experience entries with the provided list
- Replaces skills and builder tags with the provided lists
- Updates profile photo URL (supports S3 object keys or external URLs)
- Recalculates profile completion status
If a profile doesn't exist, it will be created. Skills and builder tags are validated to ensure they exist before association. The operation is transactional - all updates succeed or fail together.
Exceptions
- Exception
Thrown when the user is not found, validation fails, or related entities (skills, tags) are invalid.