using EventFlow.Aggregates;

namespace Books.Api.Domain.JournalEntryDrafts.Events;

/// <summary>
/// Event emitted when a journal entry draft is posted to the ledger.
/// Includes PostedAt timestamp for audit trail compliance.
/// </summary>
public class JournalEntryDraftPostedEvent(
    string transactionId,
    string postedBy,
    DateTimeOffset postedAt) : AggregateEvent<JournalEntryDraftAggregate, JournalEntryDraftId>
{
    public string TransactionId { get; } = transactionId;
    public string PostedBy { get; } = postedBy;

    /// <summary>
    /// The exact timestamp when the draft was posted to the ledger.
    /// </summary>
    public DateTimeOffset PostedAt { get; } = postedAt;
}
