using Books.Api.EventFlow.ReadModels;
using GraphQL.Types;

namespace Books.Api.GraphQL.Types;

public class ProductGraphType : ObjectGraphType<ProductReadModelDto>
{
    public ProductGraphType()
    {
        Name = "Product";
        Description = "A product in the product catalog for invoicing";

        Field(x => x.Id).Description("Unique identifier");
        Field(x => x.CompanyId).Description("Company this product belongs to");
        Field(x => x.ProductNumber, nullable: true).Description("Product number/SKU (optional)");
        Field(x => x.Name).Description("Product name");
        Field(x => x.Description, nullable: true).Description("Product description");
        Field(x => x.UnitPrice).Description("Unit price excl. VAT");
        Field(x => x.VatCode).Description("VAT code (e.g., U25, IEUV)");
        Field(x => x.Unit, nullable: true).Description("Unit of measure (e.g., stk, time, kg)");
        Field(x => x.DefaultAccountId, nullable: true).Description("Default revenue account for this product");
        Field(x => x.Ean, nullable: true).Description("EAN/barcode number");
        Field(x => x.Manufacturer, nullable: true).Description("Manufacturer/brand name");
        Field(x => x.IsActive).Description("Whether the product is active");
        Field(x => x.CreatedAt).Description("When the product was created");
        Field(x => x.UpdatedAt).Description("When the product was last updated");
    }
}
