using SocialService.Domain.SeedWork;

namespace SocialService.Domain.AggregatesModel.UserProfileAggregate;

/// <summary>
/// EN: Repository interface for UserProfile aggregate.
/// VI: Interface repository cho UserProfile aggregate.
/// </summary>
public interface IUserProfileRepository : IRepository<UserProfile>
{
    /// <summary>
    /// EN: Add a new user profile.
    /// VI: Thêm một hồ sơ user mới.
    /// </summary>
    UserProfile Add(UserProfile profile);

    /// <summary>
    /// EN: Update an existing user profile.
    /// VI: Cập nhật một hồ sơ user đã tồn tại.
    /// </summary>
    UserProfile Update(UserProfile profile);

    /// <summary>
    /// EN: Get user profile by ID.
    /// VI: Lấy hồ sơ user theo ID.
    /// </summary>
    Task<UserProfile?> GetByIdAsync(Guid id);

    /// <summary>
    /// EN: Get user profile by user ID from IAM.
    /// VI: Lấy hồ sơ user theo user ID từ IAM.
    /// </summary>
    Task<UserProfile?> GetByUserIdAsync(Guid userId);

    /// <summary>
    /// EN: Get multiple user profiles by user IDs.
    /// VI: Lấy nhiều hồ sơ user theo danh sách user IDs.
    /// </summary>
    Task<IEnumerable<UserProfile>> GetByUserIdsAsync(IEnumerable<Guid> userIds);

    /// <summary>
    /// EN: Search user profiles by display name.
    /// VI: Tìm kiếm hồ sơ user theo tên hiển thị.
    /// </summary>
    Task<IEnumerable<UserProfile>> SearchByDisplayNameAsync(string searchTerm, int skip = 0, int take = 20);

    /// <summary>
    /// EN: Check if user profile exists.
    /// VI: Kiểm tra hồ sơ user có tồn tại không.
    /// </summary>
    Task<bool> ExistsAsync(Guid userId);
}
