using EventFlow.Aggregates;

namespace Books.Api.Domain.Orders.Events;

/// <summary>
/// Raised when an order is cancelled.
/// Can only cancel orders that have not been invoiced.
/// </summary>
public class OrderCancelledEvent(
    string reason,
    string cancelledBy,
    DateTimeOffset cancelledAt) : AggregateEvent<OrderAggregate, OrderId>
{
    public string Reason { get; } = reason;
    public string CancelledBy { get; } = cancelledBy;
    public DateTimeOffset CancelledAt { get; } = cancelledAt;
}
