using Backend.Common;
using Backend.Contracts;
using Backend.Domain;

namespace Backend.Services;

public interface IUserSessionService
{
    Task<UserSession?> ResolveSessionAsync(HttpContext context, CancellationToken cancellationToken = default);
    Task<UserSession> CreateSessionAsync(string twitchUserId, string displayName, string role, RequestMetadata metadata, CancellationToken cancellationToken = default);
    Task<UserSession> CreateDevSessionAsync(LoginRequest request, RequestMetadata metadata, CancellationToken cancellationToken = default);
    Task<int> CountRecentSessionsFromIpAsync(string ipAddress, DateTimeOffset since, CancellationToken cancellationToken = default);
    Task<int> GetIdleTimeoutHoursAsync(CancellationToken cancellationToken = default);
    Task LogoutAsync(UserSession session, CancellationToken cancellationToken = default);
}
