using MealPlan.Api.DTOs.Auth;

namespace MealPlan.Api.Services;

public interface IAuthService
{
    Task<AuthResult> RegisterAsync(RegisterRequestDto request, CancellationToken ct = default);

    Task<AuthResult> LoginAsync(LoginRequestDto request, CancellationToken ct = default);

    /// <summary>Validates and rotates a refresh token, issuing a fresh token pair.</summary>
    Task<AuthResult> RefreshAsync(string refreshToken, CancellationToken ct = default);

    /// <summary>Revokes the supplied refresh token. Idempotent.</summary>
    void Logout(string refreshToken);

    Task<UserInfoDto?> GetUserInfoAsync(string userId, CancellationToken ct = default);
}
