feat(domain): Product entity + 5 domain exceptions (PRD-002)

This commit is contained in:
2026-04-19 12:59:58 -03:00
parent 0462970ea1
commit 16197cf242
8 changed files with 530 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
namespace SIGCM2.Domain.Exceptions;
/// <summary>
/// Thrown when attempting to create/update a Product referencing an inactive Rubro. → HTTP 422
/// </summary>
public sealed class RubroInactivoException : DomainException
{
public int RubroId { get; }
public RubroInactivoException(int rubroId)
: base($"El rubro con id={rubroId} está inactivo y no puede asignarse a un producto.")
{
RubroId = rubroId;
}
}