namespace SIGCM2.Domain.Entities; public sealed class Usuario { public int Id { get; } public string Username { get; } public string PasswordHash { get; } public string Nombre { get; } public string Apellido { get; } public string? Email { get; } public string Rol { get; } public string PermisosJson { get; } public bool Activo { get; } public Usuario( int id, string username, string passwordHash, string nombre, string apellido, string? email, string rol, string permisosJson, bool activo) { Id = id; Username = username; PasswordHash = passwordHash; Nombre = nombre; Apellido = apellido; Email = email; Rol = rol; PermisosJson = permisosJson; Activo = activo; } /// /// Factory for creating a new user (no Id — DB assigns via IDENTITY). /// Defaults: Activo=true, PermisosJson="[]". /// public static Usuario ForCreation( string username, string passwordHash, string nombre, string apellido, string? email, string rol) { return new Usuario( id: 0, username: username, passwordHash: passwordHash, nombre: nombre, apellido: apellido, email: email, rol: rol, permisosJson: "[]", activo: true); } }