Files
Dhananjaya99 15832d1ae3 Decouple UserType, add Role entity and management
Removed all UserType logic and references, replacing them with a new Role model and management system. Introduced RoleManager service, repository, and API endpoint for role CRUD operations. Updated user flows and JWT claims to use RoleCode. Removed admin-only user CRUD endpoints. Updated DI, documentation, and error handling for consistency. Appsettings and DTOs now reflect the new role-based approach.
2026-10-19 12:57:07 +05:30

39 lines
1.3 KiB
C#

using System.Data;
namespace AuthHex.Models
{
public class User
{
public Guid Id { get; set; } = Guid.NewGuid();
public string? FullName { get; set; }
public string? UserName { get; set; }
public string? Nic { get; set; }
public string? Address { get; set; }
public string? Optional1 { get; set; } //in gym case use in secondary contact number
public bool? Optional1Verified { get; set; } = false;
public string? Optional2 { get; set; }
public string? PasswordHash { get; set; }
public string? Email { get; set; }
public bool? EmailVerified { get; set; } = false;
public string? MobileNumber { get; set; }
public bool? MobileNumberVerified { get; set; } = false;
public bool? IsActive { get; set; } = true;
public bool? IsLocked { get; set; } = false;
public DateTime? DeletedAt { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
//2FA
public bool IsMfaEnabled { get; set; }
public UserMfa? UserMfa { get; set; }
//User Role and Type
public string? RoleCode { get; set; }
public ICollection<UserSession>? Sessions { get; set; }
public ICollection<UserProvider>? Providers { get; set; }
}
}