namespace SIGCM2.Domain.Exceptions;

/// <summary>
/// Thrown when a (MedioId, NumeroAFIP) combination already exists in the system.
/// Enforced by UNIQUE(MedioId, NumeroAFIP) in DB as safety net (REQ-PDV-003).
/// </summary>
public sealed class NumeroAFIPDuplicadoException : DomainException
{
    public int MedioId { get; }
    public short NumeroAFIP { get; }

    public NumeroAFIPDuplicadoException(int medioId, short numeroAFIP)
        : base($"El número AFIP '{numeroAFIP}' ya existe para el medio {medioId}.")
    {
        MedioId = medioId;
        NumeroAFIP = numeroAFIP;
    }
}
