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

namespace Books.Api.GraphQL.Types;

public class AccountGraphType : ObjectGraphType<AccountReadModelDto>
{
    public AccountGraphType()
    {
        Name = "Account";
        Description = "An account in the chart of accounts (kontoplan)";

        Field(x => x.Id).Description("Unique identifier");
        Field(x => x.CompanyId).Description("Company this account belongs to");
        Field(x => x.AccountNumber).Description("Account number (4-10 digits)");
        Field(x => x.Name).Description("Account name");
        Field(x => x.AccountType).Description("Type of account (asset, liability, equity, revenue, etc.)");
        Field(x => x.ParentId, nullable: true).Description("Parent account ID for hierarchical structure");
        Field(x => x.Description, nullable: true).Description("Account description");
        Field(x => x.VatCodeId, nullable: true).Description("Default VAT code for this account");
        Field(x => x.IsActive).Description("Whether the account is active");
        Field(x => x.IsSystemAccount).Description("Whether this is a system account (cannot be modified)");
        Field(x => x.StandardAccountNumber, nullable: true).Description("Erhvervsstyrelsens standardkontonummer for SAF-T rapportering");
        Field(x => x.CreatedAt).Description("When the account was created");
        Field(x => x.UpdatedAt).Description("When the account was last updated");
    }
}
