using CsvHelper.Configuration.Attributes;

namespace PowderCoating.Application.DTOs.Import;

/// <summary>
/// DTO for importing vendor bill headers from CSV. Column names match the native bills export
/// (ExportBillsCsv) for round-trip compatibility. The vendor is resolved by name and the AP account
/// by number so accounting linkages survive. Line items import separately via BillLineItemImportDto.
/// </summary>
public class BillImportDto
{
    [Name("BillNumber")]
    public string? BillNumber { get; set; }

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

    /// <summary>Vendor company name, matched against Vendor.CompanyName.</summary>
    [Name("VendorName")]
    public string? VendorName { get; set; }

    /// <summary>AP account number (Chart of Accounts) this bill posts to.</summary>
    [Name("APAccountNumber")]
    public string? APAccountNumber { get; set; }

    [Name("BillDate")]
    public DateTime BillDate { get; set; }

    [Name("DueDate")]
    public DateTime? DueDate { get; set; }

    [Name("Status")]
    public string Status { get; set; } = "Open";

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

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

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

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

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

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

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