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

namespace Books.Api.GraphQL.Types;

public class CompanyType : ObjectGraphType<CompanyReadModelDto>
{
    public CompanyType()
    {
        Name = "Company";
        Description = "A company/organization for bookkeeping";

        Field(x => x.Id).Description("Unique identifier");
        Field(x => x.Name).Description("Company name");
        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).Description("Country code (e.g., DK)");
        Field(x => x.FiscalYearStartMonth).Description("Month when fiscal year starts (1-12)");
        Field(x => x.Currency).Description("Default currency (e.g., DKK)");
        Field(x => x.VatRegistered).Description("Whether the company is VAT registered");
        Field(x => x.VatPeriodFrequency, nullable: true).Description("VAT reporting frequency");
        Field(x => x.CreatedAt).Description("When the company was created");
        Field(x => x.UpdatedAt).Description("When the company was last updated");

        // Nested fields will be added later:
        // - fiscalYears: [FiscalYearType] via DataLoader
        // - accounts: [AccountType] via DataLoader
    }
}
