using IRaCIS.Application.Contracts;
using IRaCIS.Core.Domain.Share;

namespace IRaCIS.Core.Application.Auth
{
    public class IRaCISClaims
    {
        public Guid Id { get; set; }
        public string FullName { get; set; } = String.Empty;
        public string Code { get; set; } = String.Empty;
        public string RealName { get; set; } = String.Empty;

        public string UserTypeShortName { get; set; } = String.Empty;

        public UserTypeEnum UserTypeEnum { get; set; }

        public string PermissionStr { get; set; } = String.Empty;

        public Guid UserTypeId { get; set; }

        public int IsAdmin { get; }

        public bool IsTestUser { get; set; }

        public string Phone { get; set; } = String.Empty;

        public static IRaCISClaims Create(UserBasicInfo user)
        {
            return new IRaCISClaims
            {
                Id = user.Id,
                FullName = user.UserName,
                RealName = user.RealName,
                UserTypeEnum=user.UserTypeEnum,
                UserTypeId=user.UserTypeId,
                IsTestUser=user.IsTestUser,
                Code = user.Code,
                PermissionStr = user.PermissionStr,

                UserTypeShortName = user.UserTypeShortName
            };
        }
        public static IRaCISClaims Create(DoctorAccountDTO doctor)
        {
            return new IRaCISClaims
            {
                Id = doctor.Id,
                FullName = doctor.FirstName + doctor.LastName,
                Phone = doctor.Phone,               
            };
        }
    }
}