using GraphQL.Types;

namespace Books.Api.GraphQL.InputTypes;

public class UpdateCompanyInputType : InputObjectGraphType<UpdateCompanyInput>
{
    public UpdateCompanyInputType()
    {
        Name = "UpdateCompanyInput";
        Description = "Input for updating an existing company";

        Field(x => x.Name).Description("Company name (required)");
        Field(x => x.Cvr, nullable: true).Description("Danish CVR number");
        Field(x => x.Address, nullable: true).Description("Street address");
        Field(x => x.PostalCode, nullable: true).Description("Postal code");
        Field(x => x.City, nullable: true).Description("City");
        Field(x => x.Country, nullable: true).Description("Country code");
        Field(x => x.FiscalYearStartMonth, nullable: true).Description("Month when fiscal year starts");
        Field(x => x.Currency, nullable: true).Description("Default currency");
        Field(x => x.VatRegistered, nullable: true).Description("Whether VAT registered");
        Field(x => x.VatPeriodFrequency, nullable: true).Description("VAT reporting frequency");
    }
}

public class UpdateCompanyInput
{
    public string Name { get; set; } = string.Empty;
    public string? Cvr { get; set; }
    public string? Address { get; set; }
    public string? PostalCode { get; set; }
    public string? City { get; set; }
    public string? Country { get; set; }
    public int? FiscalYearStartMonth { get; set; }
    public string? Currency { get; set; }
    public bool? VatRegistered { get; set; }
    public string? VatPeriodFrequency { get; set; }
}
