namespace Baya.Application.Contracts.Common;

/// <summary>
/// Ambient accessor for the authenticated caller, wrapping the HTTP context behind an Application
/// contract. Registered Scoped. A null-object implementation serves non-HTTP contexts (jobs, tests)
/// so the audit interceptor and handlers never depend on <c>IHttpContextAccessor</c> directly.
/// </summary>
public interface ICurrentUser
{
    int? UserId { get; }

    bool IsAuthenticated { get; }

    IReadOnlyList<string> Roles { get; }

    /// <summary>The caller's remote IP, when there is an HTTP request (session bookkeeping); else null.</summary>
    string IpAddress { get; }
}