using Books.Api.Domain.Invoices; using EventFlow.Aggregates; namespace Books.Api.Domain.Invoices.Events; /// /// Raised when a new invoice or credit note draft is created. /// At this point, the invoice/credit note number is assigned (Momsloven ยง52). /// public class InvoiceCreatedEvent( string companyId, string fiscalYearId, string customerId, string customerName, string customerNumber, string invoiceNumber, DateOnly invoiceDate, DateOnly dueDate, int paymentTermsDays, string currency, string? vatCode, string? notes, string? reference, string createdBy, InvoiceType type = InvoiceType.Invoice, string? originalInvoiceId = null, string? originalInvoiceNumber = null, string? creditReason = null, string? sellerCvr = null, string? sellerName = null, string? sellerAddress = null) : AggregateEvent { public string CompanyId { get; } = companyId; public string FiscalYearId { get; } = fiscalYearId; public string CustomerId { get; } = customerId; public string CustomerName { get; } = customerName; public string CustomerNumber { get; } = customerNumber; public string InvoiceNumber { get; } = invoiceNumber; public DateOnly InvoiceDate { get; } = invoiceDate; public DateOnly DueDate { get; } = dueDate; public int PaymentTermsDays { get; } = paymentTermsDays; public string Currency { get; } = currency; public string? VatCode { get; } = vatCode; public string? Notes { get; } = notes; public string? Reference { get; } = reference; public string CreatedBy { get; } = createdBy; /// /// Type of document: Invoice or CreditNote. /// public InvoiceType Type { get; } = type; /// /// For credit notes: Reference to the original invoice being credited. /// public string? OriginalInvoiceId { get; } = originalInvoiceId; /// /// For credit notes: The invoice number of the original invoice. /// public string? OriginalInvoiceNumber { get; } = originalInvoiceNumber; /// /// For credit notes: Reason for issuing the credit note. /// public string? CreditReason { get; } = creditReason; /// /// Seller CVR number (company registration number). /// public string? SellerCvr { get; } = sellerCvr; /// /// Seller company name. /// public string? SellerName { get; } = sellerName; /// /// Seller company address. /// public string? SellerAddress { get; } = sellerAddress; }