using SIGCM2.Domain.Exceptions;

namespace SIGCM2.Domain.Pricing.Exceptions;

/// <summary>
/// PRC-001 — Thrown when attempting to schedule a new price with a ValidFrom that is
/// not strictly greater than the currently active row's ValidFrom. → HTTP 409
/// </summary>
public sealed class ChargeableCharConfigForwardOnlyException : DomainException
{
    public int? ProductTypeId { get; }
    public string Symbol { get; }
    public DateOnly NewValidFrom { get; }
    public DateOnly ActiveValidFrom { get; }

    public ChargeableCharConfigForwardOnlyException(
        int? productTypeId,
        string symbol,
        DateOnly newValidFrom,
        DateOnly activeValidFrom)
        : base($"El nuevo ValidFrom ({newValidFrom:yyyy-MM-dd}) debe ser estrictamente mayor al ValidFrom del activo ({activeValidFrom:yyyy-MM-dd}).")
    {
        ProductTypeId = productTypeId;
        Symbol = symbol;
        NewValidFrom = newValidFrom;
        ActiveValidFrom = activeValidFrom;
    }
}
