using GraphQL.Types;

namespace Books.Api.GraphQL.InputTypes;

public class CreateCompanyInputType : InputObjectGraphType<CreateCompanyInput>
{
    public CreateCompanyInputType()
    {
        Name = "CreateCompanyInput";
        Description = "Input for creating a new 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 (default: DK)");
        Field(x => x.FiscalYearStartMonth, nullable: true).Description("Month when fiscal year starts (default: 1)");
        Field(x => x.Currency, nullable: true).Description("Default currency (default: DKK)");
        Field(x => x.VatRegistered, nullable: true).Description("Whether VAT registered (default: false)");
        Field(x => x.VatPeriodFrequency, nullable: true).Description("VAT reporting frequency");
    }
}

public class CreateCompanyInput
{
    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; }
}
