using CsvHelper.Configuration.Attributes;

namespace PowderCoating.Application.DTOs.Import;

/// <summary>
/// DTO for importing invoice line items from CSV. Column names match the native
/// invoice-items export (ExportInvoiceItemsCsv) for round-trip compatibility.
/// Line items are matched to their parent invoice by <c>InvoiceNumber</c>; the revenue
/// account is resolved from <c>RevenueAccountNumber</c> against Account.AccountNumber so the
/// invoice's revenue attribution survives an export/import round-trip.
/// </summary>
public class InvoiceItemImportDto
{
    [Name("InvoiceNumber")]
    public string? InvoiceNumber { get; set; }

    [Name("Description")]
    public string? Description { get; set; }

    [Name("Quantity")]
    public decimal Quantity { get; set; }

    [Name("UnitPrice")]
    public decimal UnitPrice { get; set; }

    [Name("TotalPrice")]
    public decimal TotalPrice { get; set; }

    [Name("ColorName")]
    public string? ColorName { get; set; }

    /// <summary>
    /// Account number (Chart of Accounts) of the revenue account this line posts to. Optional —
    /// a blank value means the line falls back to the company's default revenue account.
    /// </summary>
    [Name("RevenueAccountNumber")]
    public string? RevenueAccountNumber { get; set; }

    [Name("DisplayOrder")]
    public int DisplayOrder { get; set; }

    [Name("Notes")]
    public string? Notes { get; set; }
}
