feat(domain): Rubro entity + domain exceptions (CAT-001)
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
namespace SIGCM2.Domain.Exceptions;
|
||||
|
||||
/// <summary>
|
||||
/// Thrown when attempting to soft-delete a Rubro that still has active children. → HTTP 409
|
||||
/// </summary>
|
||||
public sealed class RubroTieneHijosActivosException : DomainException
|
||||
{
|
||||
public int Id { get; }
|
||||
public int Count { get; }
|
||||
|
||||
public RubroTieneHijosActivosException(int id, int count)
|
||||
: base($"El rubro con id '{id}' tiene {count} subrubros activos.")
|
||||
{
|
||||
Id = id;
|
||||
Count = count;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user