using CsvHelper.Configuration.Attributes;

namespace PowderCoating.Application.DTOs.Import;

/// <summary>
/// DTO for importing customer deposits from CSV. Column names match the native deposits export
/// (ExportDepositsCsv). The customer is resolved by name, the bank account by number
/// (DepositAccountNumber), and the optional applied invoice by number so the deposit's linkages
/// survive an export/import round-trip.
/// </summary>
public class DepositImportDto
{
    [Name("ReceiptNumber")]
    public string? ReceiptNumber { get; set; }

    /// <summary>Customer name (company name, or contact full name), matched against the customer record.</summary>
    [Name("CustomerName")]
    public string? CustomerName { get; set; }

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

    /// <summary>Valid values: Cash, Check, CreditDebitCard, BankTransferACH, DigitalPayment</summary>
    [Name("PaymentMethod")]
    public string PaymentMethod { get; set; } = "Cash";

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

    /// <summary>Bank/cash account number (Chart of Accounts) the deposit landed in. Optional.</summary>
    [Name("DepositAccountNumber")]
    public string? DepositAccountNumber { get; set; }

    /// <summary>Invoice number this deposit has been applied to, if any. Optional.</summary>
    [Name("AppliedToInvoiceNumber")]
    public string? AppliedToInvoiceNumber { get; set; }

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

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

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