using GraphQL.Types;

namespace Books.Api.GraphQL.InputTypes;

public class ConfirmPaymentMatchInputType : InputObjectGraphType<ConfirmPaymentMatchInput>
{
    public ConfirmPaymentMatchInputType()
    {
        Name = "ConfirmPaymentMatchInput";
        Description = "Input for confirming a payment match";

        Field(x => x.BankTransactionId).Description("Bank transaction ID (required)");
        Field(x => x.InvoiceId).Description("Invoice ID (required)");
        Field(x => x.Amount).Description("Payment amount (required)");
        Field(x => x.MatchMethod, nullable: true).Description("Match method: manual, auto_amount, auto_reference, auto_name (default: manual)");
    }
}

public class ConfirmPaymentMatchInput
{
    public string BankTransactionId { get; set; } = string.Empty;
    public string InvoiceId { get; set; } = string.Empty;
    public decimal Amount { get; set; }
    public string? MatchMethod { get; set; }
}
