using Meezi.Core.Entities;
using Meezi.Core.Enums;

namespace Meezi.API.Services;

public interface IJwtTokenService
{
    string CreateAccessToken(Employee employee, Cafe cafe);

    /// <summary>
    /// Issue a token scoped to an active branch. The <paramref name="effectiveRole"/>
    /// is the role the employee holds in <paramref name="activeBranchId"/> (or their
    /// café-wide role when <paramref name="activeBranchId"/> is null).
    /// </summary>
    string CreateAccessToken(Employee employee, Cafe cafe, EmployeeRole effectiveRole, string? activeBranchId);

    string CreateConsumerAccessToken(ConsumerAccount account, string language = "fa");
    string CreateRefreshToken();
    DateTime GetAccessTokenExpiry();
}

public record TokenPair(string AccessToken, string RefreshToken, DateTime AccessTokenExpiresAt);
