ADM-009: Tablas Fiscales (IVA + IIBB) — append-only versioned ref data #22
@@ -0,0 +1,13 @@
|
|||||||
|
namespace SIGCM2.Domain.Exceptions;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Thrown when a PATCH request attempts to change the Alicuota of an IngresosBrutos.
|
||||||
|
/// Alicuota is immutable post-creation; use POST /iibb/{id}/nueva-version instead.
|
||||||
|
/// </summary>
|
||||||
|
public sealed class AlicuotaInmutableException : DomainException
|
||||||
|
{
|
||||||
|
public AlicuotaInmutableException()
|
||||||
|
: base("La alícuota de IngresosBrutos es inmutable. Creá una nueva versión vía POST /iibb/{id}/nueva-version.")
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
16
src/api/SIGCM2.Domain/Exceptions/DuplicateCodigoException.cs
Normal file
16
src/api/SIGCM2.Domain/Exceptions/DuplicateCodigoException.cs
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
namespace SIGCM2.Domain.Exceptions;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Thrown when a TipoDeIva with the same Codigo already exists for the same VigenciaDesde.
|
||||||
|
/// Maps to SQL unique constraint UQ_TipoDeIva_Codigo_Vigencia (SqlException 2627/2601).
|
||||||
|
/// </summary>
|
||||||
|
public sealed class DuplicateCodigoException : DomainException
|
||||||
|
{
|
||||||
|
public string Codigo { get; }
|
||||||
|
|
||||||
|
public DuplicateCodigoException(string codigo)
|
||||||
|
: base($"Ya existe un TipoDeIva con Codigo '{codigo}' en la misma vigencia.")
|
||||||
|
{
|
||||||
|
Codigo = codigo;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
using SIGCM2.Domain.Fiscal;
|
||||||
|
|
||||||
|
namespace SIGCM2.Domain.Exceptions;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Thrown when an IngresosBrutos entry for the same Provincia already exists for the same VigenciaDesde.
|
||||||
|
/// Maps to SQL unique constraint UQ_IIBB_Provincia_Vigencia (SqlException 2627/2601).
|
||||||
|
/// </summary>
|
||||||
|
public sealed class DuplicateProvinciaException : DomainException
|
||||||
|
{
|
||||||
|
public ProvinciaArgentina Provincia { get; }
|
||||||
|
|
||||||
|
public DuplicateProvinciaException(ProvinciaArgentina provincia)
|
||||||
|
: base($"Ya existe una entrada de IIBB para '{provincia}' en la misma vigencia.")
|
||||||
|
{
|
||||||
|
Provincia = provincia;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
namespace SIGCM2.Domain.Exceptions;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Thrown when a PATCH request attempts to change the Porcentaje of a TipoDeIva.
|
||||||
|
/// Porcentaje is immutable post-creation; use POST /iva/{id}/nueva-version instead.
|
||||||
|
/// </summary>
|
||||||
|
public sealed class PorcentajeInmutableException : DomainException
|
||||||
|
{
|
||||||
|
public PorcentajeInmutableException()
|
||||||
|
: base("El porcentaje de un TipoDeIva es inmutable. Creá una nueva versión vía POST /iva/{id}/nueva-version.")
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
namespace SIGCM2.Domain.Exceptions;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Thrown when attempting to create a new version from a predecessor that is already closed
|
||||||
|
/// (VigenciaHasta is not null). The predecessor must be open to generate a new version.
|
||||||
|
/// </summary>
|
||||||
|
public sealed class PredecesorYaCerradoException : DomainException
|
||||||
|
{
|
||||||
|
public int PredecesorId { get; }
|
||||||
|
|
||||||
|
public PredecesorYaCerradoException(int predecesorId)
|
||||||
|
: base($"La versión {predecesorId} ya está cerrada o inactiva. No puede generar nueva versión.")
|
||||||
|
{
|
||||||
|
PredecesorId = predecesorId;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user