using EventFlow.Aggregates;

namespace Books.Api.Domain.JournalEntryDrafts.Events;

/// <summary>
/// Event emitted when a new journal entry draft is created.
/// VoucherNumber is auto-generated and required by Bogføringsloven § 7, Stk. 4.
/// </summary>
public class JournalEntryDraftCreatedEvent(
    string companyId,
    string name,
    string createdBy,
    string voucherNumber,
    string? extractionData = null) : AggregateEvent<JournalEntryDraftAggregate, JournalEntryDraftId>
{
    public string CompanyId { get; } = companyId;
    public string Name { get; } = name;
    public string CreatedBy { get; } = createdBy;
    /// <summary>
    /// Bilagsnummer - unique document number per company, required by Danish accounting law.
    /// </summary>
    public string VoucherNumber { get; } = voucherNumber;
    /// <summary>
    /// Full AI extraction data as JSON string.
    /// Contains vendor CVR, amounts, VAT, due date, payment reference, line items, etc.
    /// </summary>
    public string? ExtractionData { get; } = extractionData;
}
