using IamService.Domain.SeedWork;

namespace IamService.Domain.AggregatesModel.AccessRequestAggregate;

/// <summary>
/// EN: Repository interface for AccessRequest aggregate.
/// VI: Interface repository cho AccessRequest aggregate.
/// </summary>
public interface IAccessRequestRepository : IRepository<AccessRequest>
{
    AccessRequest Add(AccessRequest request);
    
    void Update(AccessRequest request);
    
    Task<AccessRequest?> GetByIdAsync(Guid id, CancellationToken cancellationToken = default);
    
    Task<AccessRequest?> GetByIdWithApproversAsync(Guid id, CancellationToken cancellationToken = default);
    
    Task<IEnumerable<AccessRequest>> GetByRequesterIdAsync(Guid requesterId, CancellationToken cancellationToken = default);
    
    Task<IEnumerable<AccessRequest>> GetPendingByApproverIdAsync(Guid approverId, CancellationToken cancellationToken = default);
    
    Task<IEnumerable<AccessRequest>> GetExpiredRequestsAsync(CancellationToken cancellationToken = default);
}
