using System.Security.Authentication;

namespace XF.Domain.Authentications;

public interface ISessionContext
{
    /// <summary>
    /// Id of current tenant or null for host
    /// </summary>
    string? UserId { get; init; }

    /// <summary>
    /// Id of current user or throw Exception for guest
    /// </summary>
    /// <exception cref="AuthenticationException"></exception>
    string RequiredUserId { get; }

    string? UserName { get; init;}

    string? Phone { get;init; }

    /// <summary>
    /// Roles
    /// </summary>
    string[] Roles { get;init; }

    string? OrgId { get;init; }
    string RequiredOrgId { get; }

    string? OrgName { get; init; }
    int OrgLevel { get; init; }
    string? OrgAreaCode { get; init; }
    bool OrgIsCenter { get; init; }

    /// <summary>
    /// 部门行政区划名称
    /// </summary>
    string? OrgAreaName { get; init; }

    string? AreaId { get; init; }

    string? ClientId { get; init; }

    /// <summary>
    /// 工号
    /// </summary>
    string? StaffNo { get; init; }

    /// <summary>
    /// 第三方平台用户唯一标识
    /// 例如: 微信的OpenId
    /// </summary>
    string? OpenId { get; init; }

}