using System.Security.Claims;
using Baya.Application.Models.Jwt;
using Baya.Domain.Entities.User;

namespace Baya.Application.Contracts;

public interface IJwtService
{
    Task<AccessToken> GenerateAsync(User user);
    Task<ClaimsPrincipal> GetPrincipalFromExpiredToken(string token);
    Task<AccessToken> GenerateByPhoneNumberAsync(string phoneNumber);
    Task<AccessToken> RefreshToken(Guid refreshTokenId);

    /// <summary>
    /// Mints a JWE access token only — no refresh-token bookkeeping. The REST auth flow (b2) pairs it
    /// with a <c>user_sessions</c> row; the legacy <see cref="GenerateAsync"/> keeps feeding the gRPC
    /// path its <c>UserRefreshTokens</c> row.
    /// </summary>
    Task<JweAccessToken> GenerateAccessTokenAsync(User user);
}