using IamService.Domain.SeedWork;

namespace IamService.Domain.AggregatesModel.RoleAggregate;

/// <summary>
/// EN: Repository interface for ApplicationRole aggregate.
/// VI: Interface repository cho ApplicationRole aggregate.
/// </summary>
public interface IRoleRepository : IRepository<ApplicationRole>
{
    /// <summary>
    /// EN: Find role by name.
    /// VI: Tìm role theo tên.
    /// </summary>
    Task<ApplicationRole?> FindByNameAsync(string name, CancellationToken cancellationToken = default);

    /// <summary>
    /// EN: Find role by ID.
    /// VI: Tìm role theo ID.
    /// </summary>
    Task<ApplicationRole?> FindByIdAsync(Guid id, CancellationToken cancellationToken = default);

    /// <summary>
    /// EN: Get all roles.
    /// VI: Lấy tất cả roles.
    /// </summary>
    Task<IEnumerable<ApplicationRole>> GetAllAsync(CancellationToken cancellationToken = default);

    /// <summary>
    /// EN: Add new role.
    /// VI: Thêm role mới.
    /// </summary>
    ApplicationRole Add(ApplicationRole role);

    /// <summary>
    /// EN: Update existing role.
    /// VI: Cập nhật role hiện có.
    /// </summary>
    void Update(ApplicationRole role);

    /// <summary>
    /// EN: Delete role.
    /// VI: Xóa role.
    /// </summary>
    void Delete(ApplicationRole role);
}
