using XF.Domain.Authentications;

namespace Hotline.Authentications
{
    public class YbEnterpriseSessionContext : ISessionContext
    {
        public YbEnterpriseSessionContext()
        {
            UserId = "ce42562c-afc1-764b-1dc8-3a1177930346";
            UserName = "联系服务企业";
            OrgId = "001181";
            OrgName = "联系服务企业";
            OrgLevel = 1;
        }

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

        /// <summary>
        /// Id of current user or throw Exception for guest
        /// </summary>
        /// <exception cref="AuthenticationException"></exception>
        public string RequiredUserId => UserId ?? throw new ArgumentNullException();
        public string? UserName { get; }
        public string? Phone { get; }

        /// <summary>
        /// Roles
        /// </summary>
        public string[] Roles { get; }
        public string? OrgId { get; set; }
        public string RequiredOrgId => OrgId ?? throw new ArgumentNullException();
        public string? OrgName { get; set; }
        public int OrgLevel { get; set; }
        public string? OrgAreaCode { get; set; }
        public bool OrgIsCenter { get; set; }

        /// <summary>
        /// 部门行政区划名称
        /// </summary>
        public string? OrgAreaName { get; set; }
        public string? AreaId { get; }
        public string? ClientId { get; }

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