feat(udt-001): domain layer with Usuario entity

This commit is contained in:
2026-04-13 21:36:00 -03:00
parent 88ecaa2c7f
commit 2111070c77
3 changed files with 57 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
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;
}
}

View File

@@ -0,0 +1,11 @@
namespace SIGCM2.Domain.Exceptions;
/// <summary>
/// Thrown when login credentials are invalid (user not found, wrong password, or inactive).
/// Deliberately vague to prevent user enumeration.
/// </summary>
public sealed class InvalidCredentialsException : Exception
{
public InvalidCredentialsException()
: base("Credenciales inválidas") { }
}

View File

@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>SIGCM2.Domain</RootNamespace>
</PropertyGroup>
</Project>