using GraphQL.Types;

namespace Books.Api.GraphQL.Types;

public class JournalEntryResultType : ObjectGraphType<JournalEntryResult>
{
    public JournalEntryResultType()
    {
        Name = "JournalEntryResult";
        Description = "Result of creating a journal entry";

        Field(x => x.TransactionId).Description("The Ledger transaction ID");
        Field(x => x.End2EndId).Description("End-to-end tracking ID");
        Field(x => x.IdempotencyKey).Description("Idempotency key used");
    }
}

public class JournalEntryResult
{
    public Guid TransactionId { get; set; }
    public string End2EndId { get; set; } = string.Empty;
    public string IdempotencyKey { get; set; } = string.Empty;
}
