using Books.Api.Domain.Invoices;
using EventFlow.Aggregates;

namespace Books.Api.Domain.Invoices.Events;

/// <summary>
/// Raised when an invoice is voided/cancelled.
/// If the invoice was already sent, a reversing ledger entry is created.
/// </summary>
public class InvoiceVoidedEvent(
    string reason,
    string? reversalLedgerTransactionId,
    string voidedBy,
    DateTimeOffset voidedAt) : AggregateEvent<InvoiceAggregate, InvoiceId>
{
    public string Reason { get; } = reason;
    public string? ReversalLedgerTransactionId { get; } = reversalLedgerTransactionId;
    public string VoidedBy { get; } = voidedBy;
    public DateTimeOffset VoidedAt { get; } = voidedAt;
}
