using Books.Api.Saft.Models;
using GraphQL.Types;

namespace Books.Api.GraphQL.Types;

/// <summary>
/// GraphQL type for SAF-T export result.
/// </summary>
public class SaftExportResultType : ObjectGraphType<SaftExportResult>
{
    public SaftExportResultType()
    {
        Name = "SaftExportResult";
        Description = "Result of SAF-T XML export generation";

        Field(x => x.Success).Description("Whether the SAF-T file was generated successfully");
        Field(x => x.XmlContent, nullable: true).Description("The SAF-T XML content (null if failed)");
        Field(x => x.FileName, nullable: true).Description("Suggested filename for the SAF-T file");
        Field(x => x.ErrorCode, nullable: true).Description("Error code if generation failed");
        Field(x => x.ErrorMessage, nullable: true).Description("Error message if generation failed");
    }
}
