using EventFlow.Aggregates;

namespace Books.Api.Domain.JournalEntryDrafts.Events;

/// <summary>
/// Event emitted when a journal entry draft is updated (auto-save).
/// Includes VAT codes per line and attachment references.
/// </summary>
public class JournalEntryDraftUpdatedEvent(
    string? name,
    DateOnly? documentDate,
    string? description,
    string? fiscalYearId,
    List<DraftLine> lines,
    List<string>? attachmentIds = null) : AggregateEvent<JournalEntryDraftAggregate, JournalEntryDraftId>
{
    public string? Name { get; } = name;
    /// <summary>
    /// Bilagsdato - the date of the transaction/document (e.g., invoice date).
    /// </summary>
    public DateOnly? DocumentDate { get; } = documentDate;
    public string? Description { get; } = description;
    public string? FiscalYearId { get; } = fiscalYearId;
    public List<DraftLine> Lines { get; } = lines;
    /// <summary>
    /// References to attached documents (Bilag) - required by Bogføringsloven § 6.
    /// </summary>
    public List<string> AttachmentIds { get; } = attachmentIds ?? [];
}
